diff --git a/generate_all_sample_clients.sh b/generate_all_sample_clients.sh new file mode 100644 index 000000000000..1d5b06ec072e --- /dev/null +++ b/generate_all_sample_clients.sh @@ -0,0 +1,7 @@ +for f in bin/*.sh; do + bash "$f" || break +done + +for f in bin/openapi3/*.sh; do + bash "$f" || break +done diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index 661a7ab7f090..4a0e76a7075c 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -355,6 +355,9 @@ public Map postProcessModelsEnum(Map objs) { List> enumVars = new ArrayList>(); String commonPrefix = findCommonPrefixOfVars(values); int truncateIdx = commonPrefix.length(); + // https://www.regular-expressions.info/floatingpoint.html + Pattern numberPattern = Pattern.compile("^[-+]?[0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?$"); + for (Object value : values) { Map enumVar = new HashMap(); String enumName; @@ -366,7 +369,15 @@ public Map postProcessModelsEnum(Map objs) { enumName = value.toString(); } } - enumVar.put("name", toEnumVarName(enumName, cm.dataType)); + + String enumVarName = toEnumVarName(enumName, cm.dataType); + Matcher numberIsMatch = numberPattern.matcher(enumVarName); + if (numberIsMatch.find()) { + enumVar.put("name", "NUMBER_" + enumVarName); + } else { + enumVar.put("name", enumVarName); + } + enumVar.put("value", toEnumValue(value.toString(), cm.dataType)); enumVar.put("isString", isDataTypeString(cm.dataType)); enumVars.add(enumVar); diff --git a/samples/client/petstore/R/NAMESPACE b/samples/client/petstore/R/NAMESPACE index 42af616b9758..c38dd450a165 100644 --- a/samples/client/petstore/R/NAMESPACE +++ b/samples/client/petstore/R/NAMESPACE @@ -7,6 +7,8 @@ export(ApiResponse) # Models export(Category) +export(InlineObject) +export(InlineObject1) export(ModelApiResponse) export(Order) export(Pet) diff --git a/samples/client/petstore/R/R/inline_object.R b/samples/client/petstore/R/R/inline_object.R new file mode 100644 index 000000000000..8575ff8be396 --- /dev/null +++ b/samples/client/petstore/R/R/inline_object.R @@ -0,0 +1,86 @@ +# OpenAPI Petstore +# +# This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +#' @docType class +#' @title InlineObject +#' @description InlineObject Class +#' @format An \code{R6Class} generator object +#' @field name character [optional] +#' +#' @field status character [optional] +#' +#' +#' @importFrom R6 R6Class +#' @importFrom jsonlite fromJSON toJSON +#' @export +InlineObject <- R6::R6Class( + 'InlineObject', + public = list( + `name` = NULL, + `status` = NULL, + initialize = function(`name`=NULL, `status`=NULL, ...){ + local.optional.var <- list(...) + if (!is.null(`name`)) { + stopifnot(is.character(`name`), length(`name`) == 1) + self$`name` <- `name` + } + if (!is.null(`status`)) { + stopifnot(is.character(`status`), length(`status`) == 1) + self$`status` <- `status` + } + }, + toJSON = function() { + InlineObjectObject <- list() + if (!is.null(self$`name`)) { + InlineObjectObject[['name']] <- + self$`name` + } + if (!is.null(self$`status`)) { + InlineObjectObject[['status']] <- + self$`status` + } + + InlineObjectObject + }, + fromJSON = function(InlineObjectJson) { + InlineObjectObject <- jsonlite::fromJSON(InlineObjectJson) + if (!is.null(InlineObjectObject$`name`)) { + self$`name` <- InlineObjectObject$`name` + } + if (!is.null(InlineObjectObject$`status`)) { + self$`status` <- InlineObjectObject$`status` + } + }, + toJSONString = function() { + jsoncontent <- c( + if (!is.null(self$`name`)) { + sprintf( + '"name": + "%s" + ', + self$`name` + )}, + if (!is.null(self$`status`)) { + sprintf( + '"status": + "%s" + ', + self$`status` + )} + ) + jsoncontent <- paste(jsoncontent, collapse = ",") + paste('{', jsoncontent, '}', sep = "") + }, + fromJSONString = function(InlineObjectJson) { + InlineObjectObject <- jsonlite::fromJSON(InlineObjectJson) + self$`name` <- InlineObjectObject$`name` + self$`status` <- InlineObjectObject$`status` + self + } + ) +) diff --git a/samples/client/petstore/R/R/inline_object1.R b/samples/client/petstore/R/R/inline_object1.R new file mode 100644 index 000000000000..2552f44a253c --- /dev/null +++ b/samples/client/petstore/R/R/inline_object1.R @@ -0,0 +1,85 @@ +# OpenAPI Petstore +# +# This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +#' @docType class +#' @title InlineObject1 +#' @description InlineObject1 Class +#' @format An \code{R6Class} generator object +#' @field additionalMetadata character [optional] +#' +#' @field file data.frame [optional] +#' +#' +#' @importFrom R6 R6Class +#' @importFrom jsonlite fromJSON toJSON +#' @export +InlineObject1 <- R6::R6Class( + 'InlineObject1', + public = list( + `additionalMetadata` = NULL, + `file` = NULL, + initialize = function(`additionalMetadata`=NULL, `file`=NULL, ...){ + local.optional.var <- list(...) + if (!is.null(`additionalMetadata`)) { + stopifnot(is.character(`additionalMetadata`), length(`additionalMetadata`) == 1) + self$`additionalMetadata` <- `additionalMetadata` + } + if (!is.null(`file`)) { + self$`file` <- `file` + } + }, + toJSON = function() { + InlineObject1Object <- list() + if (!is.null(self$`additionalMetadata`)) { + InlineObject1Object[['additionalMetadata']] <- + self$`additionalMetadata` + } + if (!is.null(self$`file`)) { + InlineObject1Object[['file']] <- + self$`file` + } + + InlineObject1Object + }, + fromJSON = function(InlineObject1Json) { + InlineObject1Object <- jsonlite::fromJSON(InlineObject1Json) + if (!is.null(InlineObject1Object$`additionalMetadata`)) { + self$`additionalMetadata` <- InlineObject1Object$`additionalMetadata` + } + if (!is.null(InlineObject1Object$`file`)) { + self$`file` <- InlineObject1Object$`file` + } + }, + toJSONString = function() { + jsoncontent <- c( + if (!is.null(self$`additionalMetadata`)) { + sprintf( + '"additionalMetadata": + "%s" + ', + self$`additionalMetadata` + )}, + if (!is.null(self$`file`)) { + sprintf( + '"file": + "%s" + ', + self$`file` + )} + ) + jsoncontent <- paste(jsoncontent, collapse = ",") + paste('{', jsoncontent, '}', sep = "") + }, + fromJSONString = function(InlineObject1Json) { + InlineObject1Object <- jsonlite::fromJSON(InlineObject1Json) + self$`additionalMetadata` <- InlineObject1Object$`additionalMetadata` + self$`file` <- InlineObject1Object$`file` + self + } + ) +) diff --git a/samples/client/petstore/R/R/pet_api.R b/samples/client/petstore/R/R/pet_api.R index 3bc7bfafb390..0e1d6d8f9653 100644 --- a/samples/client/petstore/R/R/pet_api.R +++ b/samples/client/petstore/R/R/pet_api.R @@ -18,7 +18,7 @@ #' #' #' \itemize{ -#' \item \emph{ @param } body \link[petstore:Pet]{ Pet } +#' \item \emph{ @param } pet \link[petstore:Pet]{ Pet } #' #' #' \item status code : 405 | Invalid input @@ -76,6 +76,7 @@ #' #' \itemize{ #' \item \emph{ @param } tags list( character ) +#' \item \emph{ @param } max.count integer #' \item \emph{ @returnType } \link[petstore:Pet]{ list(Pet) } \cr #' #' @@ -130,7 +131,7 @@ #' #' #' \itemize{ -#' \item \emph{ @param } body \link[petstore:Pet]{ Pet } +#' \item \emph{ @param } pet \link[petstore:Pet]{ Pet } #' #' #' \item status code : 400 | Invalid ID supplied @@ -201,7 +202,7 @@ #' #################### AddPet #################### #' #' library(petstore) -#' var.body <- Pet$new() # Pet | Pet object that needs to be added to the store +#' var.pet <- Pet$new() # Pet | Pet object that needs to be added to the store #' #' #Add a new pet to the store #' api.instance <- PetApi$new() @@ -209,7 +210,7 @@ #' # Configure OAuth2 access token for authorization: petstore_auth #' api.instance$apiClient$accessToken <- 'TODO_YOUR_ACCESS_TOKEN'; #' -#' result <- api.instance$AddPet(var.body) +#' result <- api.instance$AddPet(var.pet) #' #' #' #################### DeletePet #################### @@ -245,6 +246,7 @@ #' #' library(petstore) #' var.tags <- ['tags_example'] # array[character] | Tags to filter by +#' var.max.count <- 56 # integer | Maximum number of items to return #' #' #Finds Pets by tags #' api.instance <- PetApi$new() @@ -252,7 +254,7 @@ #' # Configure OAuth2 access token for authorization: petstore_auth #' api.instance$apiClient$accessToken <- 'TODO_YOUR_ACCESS_TOKEN'; #' -#' result <- api.instance$FindPetsByTags(var.tags) +#' result <- api.instance$FindPetsByTags(var.tags, max.count=var.max.count) #' #' #' #################### GetPetById #################### @@ -272,7 +274,7 @@ #' #################### UpdatePet #################### #' #' library(petstore) -#' var.body <- Pet$new() # Pet | Pet object that needs to be added to the store +#' var.pet <- Pet$new() # Pet | Pet object that needs to be added to the store #' #' #Update an existing pet #' api.instance <- PetApi$new() @@ -280,7 +282,7 @@ #' # Configure OAuth2 access token for authorization: petstore_auth #' api.instance$apiClient$accessToken <- 'TODO_YOUR_ACCESS_TOKEN'; #' -#' result <- api.instance$UpdatePet(var.body) +#' result <- api.instance$UpdatePet(var.pet) #' #' #' #################### UpdatePetWithForm #################### @@ -331,8 +333,8 @@ PetApi <- R6::R6Class( self$apiClient <- ApiClient$new() } }, - AddPet = function(body, ...){ - apiResponse <- self$AddPetWithHttpInfo(body, ...) + AddPet = function(pet, ...){ + apiResponse <- self$AddPetWithHttpInfo(pet, ...) resp <- apiResponse$response if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { apiResponse$content @@ -343,17 +345,17 @@ PetApi <- R6::R6Class( } }, - AddPetWithHttpInfo = function(body, ...){ + AddPetWithHttpInfo = function(pet, ...){ args <- list(...) queryParams <- list() headerParams <- c() - if (missing(`body`)) { - stop("Missing required parameter `body`.") + if (missing(`pet`)) { + stop("Missing required parameter `pet`.") } - if (!missing(`body`)) { - body <- `body`$toJSONString() + if (!missing(`pet`)) { + body <- `pet`$toJSONString() } else { body <- NULL } @@ -471,8 +473,8 @@ PetApi <- R6::R6Class( ApiResponse$new("API server error", resp) } }, - FindPetsByTags = function(tags, ...){ - apiResponse <- self$FindPetsByTagsWithHttpInfo(tags, ...) + FindPetsByTags = function(tags, max.count=NULL, ...){ + apiResponse <- self$FindPetsByTagsWithHttpInfo(tags, max.count, ...) resp <- apiResponse$response if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { apiResponse$content @@ -483,7 +485,7 @@ PetApi <- R6::R6Class( } }, - FindPetsByTagsWithHttpInfo = function(tags, ...){ + FindPetsByTagsWithHttpInfo = function(tags, max.count=NULL, ...){ args <- list(...) queryParams <- list() headerParams <- c() @@ -494,6 +496,8 @@ PetApi <- R6::R6Class( queryParams['tags'] <- tags + queryParams['maxCount'] <- max.count + urlPath <- "/pet/findByTags" # OAuth token headerParams['Authorization'] <- paste("Bearer", self$apiClient$accessToken, sep=" ") @@ -571,8 +575,8 @@ PetApi <- R6::R6Class( ApiResponse$new("API server error", resp) } }, - UpdatePet = function(body, ...){ - apiResponse <- self$UpdatePetWithHttpInfo(body, ...) + UpdatePet = function(pet, ...){ + apiResponse <- self$UpdatePetWithHttpInfo(pet, ...) resp <- apiResponse$response if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { apiResponse$content @@ -583,17 +587,17 @@ PetApi <- R6::R6Class( } }, - UpdatePetWithHttpInfo = function(body, ...){ + UpdatePetWithHttpInfo = function(pet, ...){ args <- list(...) queryParams <- list() headerParams <- c() - if (missing(`body`)) { - stop("Missing required parameter `body`.") + if (missing(`pet`)) { + stop("Missing required parameter `pet`.") } - if (!missing(`body`)) { - body <- `body`$toJSONString() + if (!missing(`pet`)) { + body <- `pet`$toJSONString() } else { body <- NULL } diff --git a/samples/client/petstore/R/R/store_api.R b/samples/client/petstore/R/R/store_api.R index 7e066a32e948..b82a7b0330e7 100644 --- a/samples/client/petstore/R/R/store_api.R +++ b/samples/client/petstore/R/R/store_api.R @@ -87,7 +87,7 @@ #' #' #' \itemize{ -#' \item \emph{ @param } body \link[petstore:Order]{ Order } +#' \item \emph{ @param } order \link[petstore:Order]{ Order } #' \item \emph{ @returnType } \link[petstore:Order]{ Order } \cr #' #' @@ -150,12 +150,12 @@ #' #################### PlaceOrder #################### #' #' library(petstore) -#' var.body <- Order$new() # Order | order placed for purchasing the pet +#' var.order <- Order$new() # Order | order placed for purchasing the pet #' #' #Place an order for a pet #' api.instance <- StoreApi$new() #' -#' result <- api.instance$PlaceOrder(var.body) +#' result <- api.instance$PlaceOrder(var.order) #' #' #' } @@ -308,8 +308,8 @@ StoreApi <- R6::R6Class( ApiResponse$new("API server error", resp) } }, - PlaceOrder = function(body, ...){ - apiResponse <- self$PlaceOrderWithHttpInfo(body, ...) + PlaceOrder = function(order, ...){ + apiResponse <- self$PlaceOrderWithHttpInfo(order, ...) resp <- apiResponse$response if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { apiResponse$content @@ -320,17 +320,17 @@ StoreApi <- R6::R6Class( } }, - PlaceOrderWithHttpInfo = function(body, ...){ + PlaceOrderWithHttpInfo = function(order, ...){ args <- list(...) queryParams <- list() headerParams <- c() - if (missing(`body`)) { - stop("Missing required parameter `body`.") + if (missing(`order`)) { + stop("Missing required parameter `order`.") } - if (!missing(`body`)) { - body <- `body`$toJSONString() + if (!missing(`order`)) { + body <- `order`$toJSONString() } else { body <- NULL } diff --git a/samples/client/petstore/R/R/user_api.R b/samples/client/petstore/R/R/user_api.R index b130324b3469..78d13847cdf9 100644 --- a/samples/client/petstore/R/R/user_api.R +++ b/samples/client/petstore/R/R/user_api.R @@ -18,7 +18,7 @@ #' This can only be done by the logged in user. #' #' \itemize{ -#' \item \emph{ @param } body \link[petstore:User]{ User } +#' \item \emph{ @param } user \link[petstore:User]{ User } #' #' #' \item status code : 0 | successful operation @@ -34,7 +34,7 @@ #' #' #' \itemize{ -#' \item \emph{ @param } body list( \link[petstore:User]{ User } ) +#' \item \emph{ @param } user list( \link[petstore:User]{ User } ) #' #' #' \item status code : 0 | successful operation @@ -50,7 +50,7 @@ #' #' #' \itemize{ -#' \item \emph{ @param } body list( \link[petstore:User]{ User } ) +#' \item \emph{ @param } user list( \link[petstore:User]{ User } ) #' #' #' \item status code : 0 | successful operation @@ -130,6 +130,7 @@ #' \item response headers : #' #' \tabular{ll}{ +#' Set-Cookie \tab Cookie authentication key for use with the `auth_cookie` apiKey authentication. \cr #' X-Rate-Limit \tab calls per hour allowed by the user \cr #' X-Expires-After \tab date in UTC when toekn expires \cr #' } @@ -162,7 +163,7 @@ #' #' \itemize{ #' \item \emph{ @param } username character -#' \item \emph{ @param } body \link[petstore:User]{ User } +#' \item \emph{ @param } user \link[petstore:User]{ User } #' #' #' \item status code : 400 | Invalid user supplied @@ -189,34 +190,43 @@ #' #################### CreateUser #################### #' #' library(petstore) -#' var.body <- User$new() # User | Created user object +#' var.user <- User$new() # User | Created user object #' #' #Create user #' api.instance <- UserApi$new() #' -#' result <- api.instance$CreateUser(var.body) +#' #Configure API key authorization: auth_cookie +#' api.instance$apiClient$apiKeys['AUTH_KEY'] <- 'TODO_YOUR_API_KEY'; +#' +#' result <- api.instance$CreateUser(var.user) #' #' #' #################### CreateUsersWithArrayInput #################### #' #' library(petstore) -#' var.body <- [User$new()] # array[User] | List of user object +#' var.user <- [User$new()] # array[User] | List of user object #' #' #Creates list of users with given input array #' api.instance <- UserApi$new() #' -#' result <- api.instance$CreateUsersWithArrayInput(var.body) +#' #Configure API key authorization: auth_cookie +#' api.instance$apiClient$apiKeys['AUTH_KEY'] <- 'TODO_YOUR_API_KEY'; +#' +#' result <- api.instance$CreateUsersWithArrayInput(var.user) #' #' #' #################### CreateUsersWithListInput #################### #' #' library(petstore) -#' var.body <- [User$new()] # array[User] | List of user object +#' var.user <- [User$new()] # array[User] | List of user object #' #' #Creates list of users with given input array #' api.instance <- UserApi$new() #' -#' result <- api.instance$CreateUsersWithListInput(var.body) +#' #Configure API key authorization: auth_cookie +#' api.instance$apiClient$apiKeys['AUTH_KEY'] <- 'TODO_YOUR_API_KEY'; +#' +#' result <- api.instance$CreateUsersWithListInput(var.user) #' #' #' #################### DeleteUser #################### @@ -227,6 +237,9 @@ #' #Delete user #' api.instance <- UserApi$new() #' +#' #Configure API key authorization: auth_cookie +#' api.instance$apiClient$apiKeys['AUTH_KEY'] <- 'TODO_YOUR_API_KEY'; +#' #' result <- api.instance$DeleteUser(var.username) #' #' @@ -260,6 +273,9 @@ #' #Logs out current logged in user session #' api.instance <- UserApi$new() #' +#' #Configure API key authorization: auth_cookie +#' api.instance$apiClient$apiKeys['AUTH_KEY'] <- 'TODO_YOUR_API_KEY'; +#' #' result <- api.instance$LogoutUser() #' #' @@ -267,12 +283,15 @@ #' #' library(petstore) #' var.username <- 'username_example' # character | name that need to be deleted -#' var.body <- User$new() # User | Updated user object +#' var.user <- User$new() # User | Updated user object #' #' #Updated user #' api.instance <- UserApi$new() #' -#' result <- api.instance$UpdateUser(var.username, var.body) +#' #Configure API key authorization: auth_cookie +#' api.instance$apiClient$apiKeys['AUTH_KEY'] <- 'TODO_YOUR_API_KEY'; +#' +#' result <- api.instance$UpdateUser(var.username, var.user) #' #' #' } @@ -291,8 +310,8 @@ UserApi <- R6::R6Class( self$apiClient <- ApiClient$new() } }, - CreateUser = function(body, ...){ - apiResponse <- self$CreateUserWithHttpInfo(body, ...) + CreateUser = function(user, ...){ + apiResponse <- self$CreateUserWithHttpInfo(user, ...) resp <- apiResponse$response if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { apiResponse$content @@ -303,22 +322,23 @@ UserApi <- R6::R6Class( } }, - CreateUserWithHttpInfo = function(body, ...){ + CreateUserWithHttpInfo = function(user, ...){ args <- list(...) queryParams <- list() headerParams <- c() - if (missing(`body`)) { - stop("Missing required parameter `body`.") + if (missing(`user`)) { + stop("Missing required parameter `user`.") } - if (!missing(`body`)) { - body <- `body`$toJSONString() + if (!missing(`user`)) { + body <- `user`$toJSONString() } else { body <- NULL } urlPath <- "/user" + # API key authentication resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath), method = "POST", @@ -335,8 +355,8 @@ UserApi <- R6::R6Class( ApiResponse$new("API server error", resp) } }, - CreateUsersWithArrayInput = function(body, ...){ - apiResponse <- self$CreateUsersWithArrayInputWithHttpInfo(body, ...) + CreateUsersWithArrayInput = function(user, ...){ + apiResponse <- self$CreateUsersWithArrayInputWithHttpInfo(user, ...) resp <- apiResponse$response if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { apiResponse$content @@ -347,23 +367,24 @@ UserApi <- R6::R6Class( } }, - CreateUsersWithArrayInputWithHttpInfo = function(body, ...){ + CreateUsersWithArrayInputWithHttpInfo = function(user, ...){ args <- list(...) queryParams <- list() headerParams <- c() - if (missing(`body`)) { - stop("Missing required parameter `body`.") + if (missing(`user`)) { + stop("Missing required parameter `user`.") } - if (!missing(`body`)) { - body.items = paste(unlist(lapply(body, function(param){param$toJSONString()})), collapse = ",") + if (!missing(`user`)) { + body.items = paste(unlist(lapply(user, function(param){param$toJSONString()})), collapse = ",") body <- paste0('[', body.items, ']') } else { body <- NULL } urlPath <- "/user/createWithArray" + # API key authentication resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath), method = "POST", @@ -380,8 +401,8 @@ UserApi <- R6::R6Class( ApiResponse$new("API server error", resp) } }, - CreateUsersWithListInput = function(body, ...){ - apiResponse <- self$CreateUsersWithListInputWithHttpInfo(body, ...) + CreateUsersWithListInput = function(user, ...){ + apiResponse <- self$CreateUsersWithListInputWithHttpInfo(user, ...) resp <- apiResponse$response if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { apiResponse$content @@ -392,23 +413,24 @@ UserApi <- R6::R6Class( } }, - CreateUsersWithListInputWithHttpInfo = function(body, ...){ + CreateUsersWithListInputWithHttpInfo = function(user, ...){ args <- list(...) queryParams <- list() headerParams <- c() - if (missing(`body`)) { - stop("Missing required parameter `body`.") + if (missing(`user`)) { + stop("Missing required parameter `user`.") } - if (!missing(`body`)) { - body.items = paste(unlist(lapply(body, function(param){param$toJSONString()})), collapse = ",") + if (!missing(`user`)) { + body.items = paste(unlist(lapply(user, function(param){param$toJSONString()})), collapse = ",") body <- paste0('[', body.items, ']') } else { body <- NULL } urlPath <- "/user/createWithList" + # API key authentication resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath), method = "POST", @@ -451,6 +473,7 @@ UserApi <- R6::R6Class( urlPath <- gsub(paste0("\\{", "username", "\\}"), URLencode(as.character(`username`), reserved = TRUE), urlPath) } + # API key authentication resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath), method = "DELETE", @@ -585,6 +608,7 @@ UserApi <- R6::R6Class( headerParams <- c() urlPath <- "/user/logout" + # API key authentication resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath), method = "GET", @@ -601,8 +625,8 @@ UserApi <- R6::R6Class( ApiResponse$new("API server error", resp) } }, - UpdateUser = function(username, body, ...){ - apiResponse <- self$UpdateUserWithHttpInfo(username, body, ...) + UpdateUser = function(username, user, ...){ + apiResponse <- self$UpdateUserWithHttpInfo(username, user, ...) resp <- apiResponse$response if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { apiResponse$content @@ -613,7 +637,7 @@ UserApi <- R6::R6Class( } }, - UpdateUserWithHttpInfo = function(username, body, ...){ + UpdateUserWithHttpInfo = function(username, user, ...){ args <- list(...) queryParams <- list() headerParams <- c() @@ -622,12 +646,12 @@ UserApi <- R6::R6Class( stop("Missing required parameter `username`.") } - if (missing(`body`)) { - stop("Missing required parameter `body`.") + if (missing(`user`)) { + stop("Missing required parameter `user`.") } - if (!missing(`body`)) { - body <- `body`$toJSONString() + if (!missing(`user`)) { + body <- `user`$toJSONString() } else { body <- NULL } @@ -637,6 +661,7 @@ UserApi <- R6::R6Class( urlPath <- gsub(paste0("\\{", "username", "\\}"), URLencode(as.character(`username`), reserved = TRUE), urlPath) } + # API key authentication resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath), method = "PUT", diff --git a/samples/client/petstore/R/README.md b/samples/client/petstore/R/README.md index bdff66e39bc9..82c61e79109a 100644 --- a/samples/client/petstore/R/README.md +++ b/samples/client/petstore/R/README.md @@ -81,6 +81,8 @@ Class | Method | HTTP request | Description ## Documentation for Models - [Category](docs/Category.md) + - [InlineObject](docs/InlineObject.md) + - [InlineObject1](docs/InlineObject1.md) - [ModelApiResponse](docs/ModelApiResponse.md) - [Order](docs/Order.md) - [Pet](docs/Pet.md) @@ -97,6 +99,12 @@ Class | Method | HTTP request | Description - **API key parameter name**: api_key - **Location**: HTTP header +### auth_cookie + +- **Type**: API key +- **API key parameter name**: AUTH_KEY +- **Location**: + ### petstore_auth - **Type**: OAuth diff --git a/samples/client/petstore/R/docs/InlineObject.md b/samples/client/petstore/R/docs/InlineObject.md new file mode 100644 index 000000000000..04a7cebca3ad --- /dev/null +++ b/samples/client/petstore/R/docs/InlineObject.md @@ -0,0 +1,9 @@ +# petstore::InlineObject + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **character** | Updated name of the pet | [optional] +**status** | **character** | Updated status of the pet | [optional] + + diff --git a/samples/client/petstore/R/docs/InlineObject1.md b/samples/client/petstore/R/docs/InlineObject1.md new file mode 100644 index 000000000000..12e96153d94e --- /dev/null +++ b/samples/client/petstore/R/docs/InlineObject1.md @@ -0,0 +1,9 @@ +# petstore::InlineObject1 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**additionalMetadata** | **character** | Additional data to pass to server | [optional] +**file** | **data.frame** | file to upload | [optional] + + diff --git a/samples/client/petstore/R/docs/PetApi.md b/samples/client/petstore/R/docs/PetApi.md index 1e782619f410..d018b5cc24d0 100644 --- a/samples/client/petstore/R/docs/PetApi.md +++ b/samples/client/petstore/R/docs/PetApi.md @@ -15,7 +15,7 @@ Method | HTTP request | Description # **AddPet** -> AddPet(body) +> AddPet(pet) Add a new pet to the store @@ -23,20 +23,20 @@ Add a new pet to the store ```R library(petstore) -var.body <- Pet$new(123, Category$new(123, "name_example"), "name_example", list("photoUrls_example"), list(Tag$new(123, "name_example")), "status_example") # Pet | Pet object that needs to be added to the store +var.pet <- Pet$new(123, Category$new(123, "name_example"), "name_example", list("photoUrls_example"), list(Tag$new(123, "name_example")), "status_example") # Pet | Pet object that needs to be added to the store #Add a new pet to the store api.instance <- PetApi$new() # Configure OAuth2 access token for authorization: petstore_auth api.instance$apiClient$accessToken <- 'TODO_YOUR_ACCESS_TOKEN'; -api.instance$AddPet(var.body) +api.instance$AddPet(var.pet) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -137,7 +137,7 @@ Name | Type | Description | Notes # **FindPetsByTags** -> array[Pet] FindPetsByTags(tags) +> array[Pet] FindPetsByTags(tags, max.count=var.max.count) Finds Pets by tags @@ -148,12 +148,13 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 library(petstore) var.tags <- list("inner_example") # array[character] | Tags to filter by +var.max.count <- 56 # integer | Maximum number of items to return #Finds Pets by tags api.instance <- PetApi$new() # Configure OAuth2 access token for authorization: petstore_auth api.instance$apiClient$accessToken <- 'TODO_YOUR_ACCESS_TOKEN'; -result <- api.instance$FindPetsByTags(var.tags) +result <- api.instance$FindPetsByTags(var.tags, max.count=var.max.count) dput(result) ``` @@ -162,6 +163,7 @@ dput(result) Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **tags** | list( **character** )| Tags to filter by | + **max.count** | **integer**| Maximum number of items to return | [optional] ### Return type @@ -221,7 +223,7 @@ Name | Type | Description | Notes # **UpdatePet** -> UpdatePet(body) +> UpdatePet(pet) Update an existing pet @@ -229,20 +231,20 @@ Update an existing pet ```R library(petstore) -var.body <- Pet$new(123, Category$new(123, "name_example"), "name_example", list("photoUrls_example"), list(Tag$new(123, "name_example")), "status_example") # Pet | Pet object that needs to be added to the store +var.pet <- Pet$new(123, Category$new(123, "name_example"), "name_example", list("photoUrls_example"), list(Tag$new(123, "name_example")), "status_example") # Pet | Pet object that needs to be added to the store #Update an existing pet api.instance <- PetApi$new() # Configure OAuth2 access token for authorization: petstore_auth api.instance$apiClient$accessToken <- 'TODO_YOUR_ACCESS_TOKEN'; -api.instance$UpdatePet(var.body) +api.instance$UpdatePet(var.pet) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type diff --git a/samples/client/petstore/R/docs/StoreApi.md b/samples/client/petstore/R/docs/StoreApi.md index 81970724c12f..ee300a1c8343 100644 --- a/samples/client/petstore/R/docs/StoreApi.md +++ b/samples/client/petstore/R/docs/StoreApi.md @@ -128,7 +128,7 @@ No authorization required # **PlaceOrder** -> Order PlaceOrder(body) +> Order PlaceOrder(order) Place an order for a pet @@ -136,11 +136,11 @@ Place an order for a pet ```R library(petstore) -var.body <- Order$new(123, 123, 123, "shipDate_example", "status_example", "complete_example") # Order | order placed for purchasing the pet +var.order <- Order$new(123, 123, 123, "shipDate_example", "status_example", "complete_example") # Order | order placed for purchasing the pet #Place an order for a pet api.instance <- StoreApi$new() -result <- api.instance$PlaceOrder(var.body) +result <- api.instance$PlaceOrder(var.order) dput(result) ``` @@ -148,7 +148,7 @@ dput(result) Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | + **order** | [**Order**](Order.md)| order placed for purchasing the pet | ### Return type @@ -160,7 +160,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/xml, application/json diff --git a/samples/client/petstore/R/docs/UserApi.md b/samples/client/petstore/R/docs/UserApi.md index a0fe81e5fec9..9129c5a74b2b 100644 --- a/samples/client/petstore/R/docs/UserApi.md +++ b/samples/client/petstore/R/docs/UserApi.md @@ -15,7 +15,7 @@ Method | HTTP request | Description # **CreateUser** -> CreateUser(body) +> CreateUser(user) Create user @@ -25,18 +25,20 @@ This can only be done by the logged in user. ```R library(petstore) -var.body <- User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123) # 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() -api.instance$CreateUser(var.body) +# Configure API key authorization: auth_cookie +api.instance$apiClient$apiKeys['AUTH_KEY'] <- 'TODO_YOUR_API_KEY'; +api.instance$CreateUser(var.user) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | + **user** | [**User**](User.md)| Created user object | ### Return type @@ -44,17 +46,17 @@ void (empty response body) ### Authorization -No authorization required +[auth_cookie](../README.md#auth_cookie) ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: Not defined # **CreateUsersWithArrayInput** -> CreateUsersWithArrayInput(body) +> CreateUsersWithArrayInput(user) Creates list of users with given input array @@ -62,18 +64,20 @@ Creates list of users with given input array ```R library(petstore) -var.body <- 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 <- list(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() -api.instance$CreateUsersWithArrayInput(var.body) +# Configure API key authorization: auth_cookie +api.instance$apiClient$apiKeys['AUTH_KEY'] <- 'TODO_YOUR_API_KEY'; +api.instance$CreateUsersWithArrayInput(var.user) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | list( [**User**](User.md) )| List of user object | + **user** | list( [**User**](User.md) )| List of user object | ### Return type @@ -81,17 +85,17 @@ void (empty response body) ### Authorization -No authorization required +[auth_cookie](../README.md#auth_cookie) ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: Not defined # **CreateUsersWithListInput** -> CreateUsersWithListInput(body) +> CreateUsersWithListInput(user) Creates list of users with given input array @@ -99,18 +103,20 @@ Creates list of users with given input array ```R library(petstore) -var.body <- 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 <- list(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() -api.instance$CreateUsersWithListInput(var.body) +# Configure API key authorization: auth_cookie +api.instance$apiClient$apiKeys['AUTH_KEY'] <- 'TODO_YOUR_API_KEY'; +api.instance$CreateUsersWithListInput(var.user) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | list( [**User**](User.md) )| List of user object | + **user** | list( [**User**](User.md) )| List of user object | ### Return type @@ -118,11 +124,11 @@ void (empty response body) ### Authorization -No authorization required +[auth_cookie](../README.md#auth_cookie) ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: Not defined @@ -142,6 +148,8 @@ var.username <- 'username_example' # character | The name that needs to be delet #Delete user api.instance <- UserApi$new() +# Configure API key authorization: auth_cookie +api.instance$apiClient$apiKeys['AUTH_KEY'] <- 'TODO_YOUR_API_KEY'; api.instance$DeleteUser(var.username) ``` @@ -157,7 +165,7 @@ void (empty response body) ### Authorization -No authorization required +[auth_cookie](../README.md#auth_cookie) ### HTTP request headers @@ -256,6 +264,8 @@ library(petstore) #Logs out current logged in user session api.instance <- UserApi$new() +# Configure API key authorization: auth_cookie +api.instance$apiClient$apiKeys['AUTH_KEY'] <- 'TODO_YOUR_API_KEY'; api.instance$LogoutUser() ``` @@ -268,7 +278,7 @@ void (empty response body) ### Authorization -No authorization required +[auth_cookie](../README.md#auth_cookie) ### HTTP request headers @@ -278,7 +288,7 @@ No authorization required # **UpdateUser** -> UpdateUser(username, body) +> UpdateUser(username, user) Updated user @@ -289,11 +299,13 @@ This can only be done by the logged in user. library(petstore) var.username <- 'username_example' # character | name that need to be deleted -var.body <- User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123) # 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() -api.instance$UpdateUser(var.username, var.body) +# Configure API key authorization: auth_cookie +api.instance$apiClient$apiKeys['AUTH_KEY'] <- 'TODO_YOUR_API_KEY'; +api.instance$UpdateUser(var.username, var.user) ``` ### Parameters @@ -301,7 +313,7 @@ api.instance$UpdateUser(var.username, var.body) Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **character**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | + **user** | [**User**](User.md)| Updated user object | ### Return type @@ -309,11 +321,11 @@ void (empty response body) ### Authorization -No authorization required +[auth_cookie](../README.md#auth_cookie) ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: Not defined diff --git a/samples/client/petstore/R/tests/testthat/test_inline_object.R b/samples/client/petstore/R/tests/testthat/test_inline_object.R new file mode 100644 index 000000000000..1bd67ae59295 --- /dev/null +++ b/samples/client/petstore/R/tests/testthat/test_inline_object.R @@ -0,0 +1,23 @@ +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate + +context("Test InlineObject") + +model.instance <- InlineObject$new() + +test_that("name", { + # tests for the property `name` (character) + # Updated name of the pet + + # uncomment below to test the property + #expect_equal(model.instance$`name`, "EXPECTED_RESULT") +}) + +test_that("status", { + # tests for the property `status` (character) + # Updated status of the pet + + # uncomment below to test the property + #expect_equal(model.instance$`status`, "EXPECTED_RESULT") +}) + diff --git a/samples/client/petstore/R/tests/testthat/test_inline_object1.R b/samples/client/petstore/R/tests/testthat/test_inline_object1.R new file mode 100644 index 000000000000..8c5df97db88e --- /dev/null +++ b/samples/client/petstore/R/tests/testthat/test_inline_object1.R @@ -0,0 +1,23 @@ +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate + +context("Test InlineObject1") + +model.instance <- InlineObject1$new() + +test_that("additionalMetadata", { + # tests for the property `additionalMetadata` (character) + # Additional data to pass to server + + # uncomment below to test the property + #expect_equal(model.instance$`additionalMetadata`, "EXPECTED_RESULT") +}) + +test_that("file", { + # tests for the property `file` (data.frame) + # file to upload + + # uncomment below to test the property + #expect_equal(model.instance$`file`, "EXPECTED_RESULT") +}) + diff --git a/samples/client/petstore/ada/.openapi-generator/VERSION b/samples/client/petstore/ada/.openapi-generator/VERSION index afa636560641..83a328a9227e 100644 --- a/samples/client/petstore/ada/.openapi-generator/VERSION +++ b/samples/client/petstore/ada/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/ada/src/client/samples-petstore-clients.adb b/samples/client/petstore/ada/src/client/samples-petstore-clients.adb index e479690cf443..31b804f5bae7 100644 --- a/samples/client/petstore/ada/src/client/samples-petstore-clients.adb +++ b/samples/client/petstore/ada/src/client/samples-petstore-clients.adb @@ -1,10 +1,10 @@ -- OpenAPI Petstore -- This is a sample server Petstore server. For this sample, you can use the api key `special_key` to test the authorization filters. -- --- OpenAPI spec version: 1.0.0 +-- The version of the OpenAPI document: 1.0.0 -- -- --- NOTE: This package is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT. +-- NOTE: This package is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. -- https://openapi-generator.tech -- Do not edit the class manually. diff --git a/samples/client/petstore/ada/src/client/samples-petstore-clients.ads b/samples/client/petstore/ada/src/client/samples-petstore-clients.ads index 581760b24047..e47c1e6b3905 100644 --- a/samples/client/petstore/ada/src/client/samples-petstore-clients.ads +++ b/samples/client/petstore/ada/src/client/samples-petstore-clients.ads @@ -1,10 +1,10 @@ -- OpenAPI Petstore -- This is a sample server Petstore server. For this sample, you can use the api key `special_key` to test the authorization filters. -- --- OpenAPI spec version: 1.0.0 +-- The version of the OpenAPI document: 1.0.0 -- -- --- NOTE: This package is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT. +-- NOTE: This package is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. -- https://openapi-generator.tech -- Do not edit the class manually. diff --git a/samples/client/petstore/ada/src/model/samples-petstore-models.adb b/samples/client/petstore/ada/src/model/samples-petstore-models.adb index d03b9401c378..894e4d4a5df1 100644 --- a/samples/client/petstore/ada/src/model/samples-petstore-models.adb +++ b/samples/client/petstore/ada/src/model/samples-petstore-models.adb @@ -1,10 +1,10 @@ -- OpenAPI Petstore -- This is a sample server Petstore server. For this sample, you can use the api key `special_key` to test the authorization filters. -- --- OpenAPI spec version: 1.0.0 +-- The version of the OpenAPI document: 1.0.0 -- -- --- NOTE: This package is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT. +-- NOTE: This package is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. -- https://openapi-generator.tech -- Do not edit the class manually. diff --git a/samples/client/petstore/ada/src/model/samples-petstore-models.ads b/samples/client/petstore/ada/src/model/samples-petstore-models.ads index f52cb0676fc4..988288457fca 100644 --- a/samples/client/petstore/ada/src/model/samples-petstore-models.ads +++ b/samples/client/petstore/ada/src/model/samples-petstore-models.ads @@ -1,10 +1,10 @@ -- OpenAPI Petstore -- This is a sample server Petstore server. For this sample, you can use the api key `special_key` to test the authorization filters. -- --- OpenAPI spec version: 1.0.0 +-- The version of the OpenAPI document: 1.0.0 -- -- --- NOTE: This package is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT. +-- NOTE: This package is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. -- https://openapi-generator.tech -- Do not edit the class manually. diff --git a/samples/client/petstore/android/httpclient/.openapi-generator/VERSION b/samples/client/petstore/android/httpclient/.openapi-generator/VERSION index afa636560641..83a328a9227e 100644 --- a/samples/client/petstore/android/httpclient/.openapi-generator/VERSION +++ b/samples/client/petstore/android/httpclient/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/android/httpclient/README.md b/samples/client/petstore/android/httpclient/README.md index 309ba5d78118..7ffa3d2e9f48 100644 --- a/samples/client/petstore/android/httpclient/README.md +++ b/samples/client/petstore/android/httpclient/README.md @@ -49,8 +49,8 @@ At first generate the JAR by executing: Then manually install the following JARs: -* target/openapi-android-client-1.0.0.jar -* target/lib/*.jar +- target/openapi-android-client-1.0.0.jar +- target/lib/*.jar ## Getting Started @@ -108,6 +108,8 @@ Class | Method | HTTP request | Description - [ApiResponse](docs/ApiResponse.md) - [Category](docs/Category.md) + - [InlineObject](docs/InlineObject.md) + - [InlineObject1](docs/InlineObject1.md) - [Order](docs/Order.md) - [Pet](docs/Pet.md) - [Tag](docs/Tag.md) @@ -120,11 +122,20 @@ Authentication schemes defined for the API: ### api_key - **Type**: API key + - **API key parameter name**: api_key - **Location**: HTTP header +### auth_cookie + +- **Type**: API key + +- **API key parameter name**: AUTH_KEY +- **Location**: + ### petstore_auth + - **Type**: OAuth - **Flow**: implicit - **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog diff --git a/samples/client/petstore/android/httpclient/docs/ApiResponse.md b/samples/client/petstore/android/httpclient/docs/ApiResponse.md index 1c17767c2b72..a169bf232e15 100644 --- a/samples/client/petstore/android/httpclient/docs/ApiResponse.md +++ b/samples/client/petstore/android/httpclient/docs/ApiResponse.md @@ -1,7 +1,9 @@ + # ApiResponse ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **code** | **Integer** | | [optional] @@ -10,3 +12,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/android/httpclient/docs/Category.md b/samples/client/petstore/android/httpclient/docs/Category.md index e2df08032787..53c9fedc8bc4 100644 --- a/samples/client/petstore/android/httpclient/docs/Category.md +++ b/samples/client/petstore/android/httpclient/docs/Category.md @@ -1,7 +1,9 @@ + # Category ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Long** | | [optional] @@ -9,3 +11,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/android/httpclient/docs/InlineObject.md b/samples/client/petstore/android/httpclient/docs/InlineObject.md new file mode 100644 index 000000000000..9b4b33d1eeb0 --- /dev/null +++ b/samples/client/petstore/android/httpclient/docs/InlineObject.md @@ -0,0 +1,14 @@ + + +# InlineObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Updated name of the pet | [optional] +**status** | **String** | Updated status of the pet | [optional] + + + + diff --git a/samples/client/petstore/android/httpclient/docs/InlineObject1.md b/samples/client/petstore/android/httpclient/docs/InlineObject1.md new file mode 100644 index 000000000000..2dcb8fb8f57b --- /dev/null +++ b/samples/client/petstore/android/httpclient/docs/InlineObject1.md @@ -0,0 +1,14 @@ + + +# InlineObject1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**additionalMetadata** | **String** | Additional data to pass to server | [optional] +**file** | [**File**](File.md) | file to upload | [optional] + + + + diff --git a/samples/client/petstore/android/httpclient/docs/Order.md b/samples/client/petstore/android/httpclient/docs/Order.md index 5746ce97fad3..f49e8704e088 100644 --- a/samples/client/petstore/android/httpclient/docs/Order.md +++ b/samples/client/petstore/android/httpclient/docs/Order.md @@ -1,7 +1,9 @@ + # Order ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Long** | | [optional] @@ -12,10 +14,11 @@ Name | Type | Description | Notes **complete** | **Boolean** | | [optional] - ## Enum: StatusEnum + Name | Value ---- | ----- + diff --git a/samples/client/petstore/android/httpclient/docs/Pet.md b/samples/client/petstore/android/httpclient/docs/Pet.md index a4daa24feb60..72e3338dfb83 100644 --- a/samples/client/petstore/android/httpclient/docs/Pet.md +++ b/samples/client/petstore/android/httpclient/docs/Pet.md @@ -1,7 +1,9 @@ + # Pet ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Long** | | [optional] @@ -12,10 +14,11 @@ Name | Type | Description | Notes **status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] - ## Enum: StatusEnum + Name | Value ---- | ----- + diff --git a/samples/client/petstore/android/httpclient/docs/PetApi.md b/samples/client/petstore/android/httpclient/docs/PetApi.md index 7cf076f29c58..a7d70f33b16a 100644 --- a/samples/client/petstore/android/httpclient/docs/PetApi.md +++ b/samples/client/petstore/android/httpclient/docs/PetApi.md @@ -14,13 +14,15 @@ Method | HTTP request | Description [**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image - -# **addPet** + +## addPet + > addPet(pet) Add a new pet to the store ### Example + ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -37,6 +39,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | @@ -51,16 +54,18 @@ null (empty response body) ### HTTP request headers - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + + +## deletePet - -# **deletePet** > deletePet(petId, apiKey) Deletes a pet ### Example + ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -78,6 +83,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| Pet id to delete | [default to null] @@ -93,11 +99,12 @@ null (empty response body) ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined + + +## findPetsByStatus - -# **findPetsByStatus** > List<Pet> findPetsByStatus(status) Finds Pets by status @@ -105,6 +112,7 @@ Finds Pets by status Multiple status values can be provided with comma separated strings ### Example + ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -122,6 +130,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [default to null] [enum: available, pending, sold] @@ -136,26 +145,29 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json - -# **findPetsByTags** -> List<Pet> findPetsByTags(tags) + +## findPetsByTags + +> List<Pet> findPetsByTags(tags, maxCount) Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. ### Example + ```java // Import classes: //import org.openapitools.client.api.PetApi; PetApi apiInstance = new PetApi(); List tags = null; // List | Tags to filter by +Integer maxCount = null; // Integer | Maximum number of items to return try { - List result = apiInstance.findPetsByTags(tags); + List result = apiInstance.findPetsByTags(tags, maxCount); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#findPetsByTags"); @@ -165,9 +177,11 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **tags** | [**List<String>**](String.md)| Tags to filter by | [default to null] + **maxCount** | **Integer**| Maximum number of items to return | [optional] [default to null] ### Return type @@ -179,11 +193,12 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +## getPetById - -# **getPetById** > Pet getPetById(petId) Find pet by ID @@ -191,6 +206,7 @@ Find pet by ID Returns a single pet ### Example + ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -208,6 +224,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| ID of pet to return | [default to null] @@ -222,16 +239,18 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +## updatePet - -# **updatePet** > updatePet(pet) Update an existing pet ### Example + ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -248,6 +267,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | @@ -262,16 +282,18 @@ null (empty response body) ### HTTP request headers - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + + +## updatePetWithForm - -# **updatePetWithForm** > updatePetWithForm(petId, name, status) Updates a pet in the store with form data ### Example + ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -290,6 +312,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| ID of pet that needs to be updated | [default to null] @@ -306,16 +329,18 @@ null (empty response body) ### HTTP request headers - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + + +## uploadFile - -# **uploadFile** > ApiResponse uploadFile(petId, additionalMetadata, file) uploads an image ### Example + ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -335,6 +360,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| ID of pet to update | [default to null] @@ -351,6 +377,6 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: multipart/form-data - - **Accept**: application/json +- **Content-Type**: multipart/form-data +- **Accept**: application/json diff --git a/samples/client/petstore/android/httpclient/docs/StoreApi.md b/samples/client/petstore/android/httpclient/docs/StoreApi.md index b768ad5ba986..528ea3acd03c 100644 --- a/samples/client/petstore/android/httpclient/docs/StoreApi.md +++ b/samples/client/petstore/android/httpclient/docs/StoreApi.md @@ -10,8 +10,9 @@ Method | HTTP request | Description [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet - -# **deleteOrder** + +## deleteOrder + > deleteOrder(orderId) Delete purchase order by ID @@ -19,6 +20,7 @@ Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors ### Example + ```java // Import classes: //import org.openapitools.client.api.StoreApi; @@ -35,6 +37,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **orderId** | **String**| ID of the order that needs to be deleted | [default to null] @@ -49,11 +52,12 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined + + +## getInventory - -# **getInventory** > Map<String, Integer> getInventory() Returns pet inventories by status @@ -61,6 +65,7 @@ Returns pet inventories by status Returns a map of status codes to quantities ### Example + ```java // Import classes: //import org.openapitools.client.api.StoreApi; @@ -76,6 +81,7 @@ try { ``` ### Parameters + This endpoint does not need any parameter. ### Return type @@ -88,11 +94,12 @@ This endpoint does not need any parameter. ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json + + +## getOrderById - -# **getOrderById** > Order getOrderById(orderId) Find purchase order by ID @@ -100,6 +107,7 @@ Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions ### Example + ```java // Import classes: //import org.openapitools.client.api.StoreApi; @@ -117,6 +125,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **orderId** | **Long**| ID of pet that needs to be fetched | [default to null] @@ -131,16 +140,18 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +## placeOrder - -# **placeOrder** > Order placeOrder(order) Place an order for a pet ### Example + ```java // Import classes: //import org.openapitools.client.api.StoreApi; @@ -158,6 +169,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **order** | [**Order**](Order.md)| order placed for purchasing the pet | @@ -172,6 +184,6 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: application/json +- **Accept**: application/xml, application/json diff --git a/samples/client/petstore/android/httpclient/docs/Tag.md b/samples/client/petstore/android/httpclient/docs/Tag.md index de6814b55d57..b540cab453f0 100644 --- a/samples/client/petstore/android/httpclient/docs/Tag.md +++ b/samples/client/petstore/android/httpclient/docs/Tag.md @@ -1,7 +1,9 @@ + # Tag ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Long** | | [optional] @@ -9,3 +11,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/android/httpclient/docs/User.md b/samples/client/petstore/android/httpclient/docs/User.md index 8b6753dd284a..5e51c05150c8 100644 --- a/samples/client/petstore/android/httpclient/docs/User.md +++ b/samples/client/petstore/android/httpclient/docs/User.md @@ -1,7 +1,9 @@ + # User ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Long** | | [optional] @@ -15,3 +17,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/android/httpclient/docs/UserApi.md b/samples/client/petstore/android/httpclient/docs/UserApi.md index e5a16428112e..48e64b1ec223 100644 --- a/samples/client/petstore/android/httpclient/docs/UserApi.md +++ b/samples/client/petstore/android/httpclient/docs/UserApi.md @@ -14,8 +14,9 @@ Method | HTTP request | Description [**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user - -# **createUser** + +## createUser + > createUser(user) Create user @@ -23,6 +24,7 @@ Create user This can only be done by the logged in user. ### Example + ```java // Import classes: //import org.openapitools.client.api.UserApi; @@ -39,6 +41,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **user** | [**User**](User.md)| Created user object | @@ -49,26 +52,28 @@ null (empty response body) ### Authorization -No authorization required +[auth_cookie](../README.md#auth_cookie) ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: application/json +- **Accept**: Not defined + + +## createUsersWithArrayInput - -# **createUsersWithArrayInput** > createUsersWithArrayInput(user) Creates list of users with given input array ### Example + ```java // Import classes: //import org.openapitools.client.api.UserApi; UserApi apiInstance = new UserApi(); -List user = Arrays.asList(new List()); // List | List of user object +List user = Arrays.asList(new User()); // List | List of user object try { apiInstance.createUsersWithArrayInput(user); } catch (ApiException e) { @@ -79,9 +84,10 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**List<User>**](List.md)| List of user object | + **user** | [**List<User>**](User.md)| List of user object | ### Return type @@ -89,26 +95,28 @@ null (empty response body) ### Authorization -No authorization required +[auth_cookie](../README.md#auth_cookie) ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: application/json +- **Accept**: Not defined + + +## createUsersWithListInput - -# **createUsersWithListInput** > createUsersWithListInput(user) Creates list of users with given input array ### Example + ```java // Import classes: //import org.openapitools.client.api.UserApi; UserApi apiInstance = new UserApi(); -List user = Arrays.asList(new List()); // List | List of user object +List user = Arrays.asList(new User()); // List | List of user object try { apiInstance.createUsersWithListInput(user); } catch (ApiException e) { @@ -119,9 +127,10 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**List<User>**](List.md)| List of user object | + **user** | [**List<User>**](User.md)| List of user object | ### Return type @@ -129,15 +138,16 @@ null (empty response body) ### Authorization -No authorization required +[auth_cookie](../README.md#auth_cookie) ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: application/json +- **Accept**: Not defined + + +## deleteUser - -# **deleteUser** > deleteUser(username) Delete user @@ -145,6 +155,7 @@ Delete user This can only be done by the logged in user. ### Example + ```java // Import classes: //import org.openapitools.client.api.UserApi; @@ -161,6 +172,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| The name that needs to be deleted | [default to null] @@ -171,20 +183,22 @@ null (empty response body) ### Authorization -No authorization required +[auth_cookie](../README.md#auth_cookie) ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined + + +## getUserByName - -# **getUserByName** > User getUserByName(username) Get user by user name ### Example + ```java // Import classes: //import org.openapitools.client.api.UserApi; @@ -202,6 +216,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| The name that needs to be fetched. Use user1 for testing. | [default to null] @@ -216,16 +231,18 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +## loginUser - -# **loginUser** > String loginUser(username, password) Logs user into the system ### Example + ```java // Import classes: //import org.openapitools.client.api.UserApi; @@ -244,6 +261,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| The user name for login | [default to null] @@ -259,16 +277,18 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +## logoutUser - -# **logoutUser** > logoutUser() Logs out current logged in user session ### Example + ```java // Import classes: //import org.openapitools.client.api.UserApi; @@ -283,6 +303,7 @@ try { ``` ### Parameters + This endpoint does not need any parameter. ### Return type @@ -291,15 +312,16 @@ null (empty response body) ### Authorization -No authorization required +[auth_cookie](../README.md#auth_cookie) ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined + + +## updateUser - -# **updateUser** > updateUser(username, user) Updated user @@ -307,6 +329,7 @@ Updated user This can only be done by the logged in user. ### Example + ```java // Import classes: //import org.openapitools.client.api.UserApi; @@ -324,6 +347,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| name that need to be deleted | [default to null] @@ -335,10 +359,10 @@ null (empty response body) ### Authorization -No authorization required +[auth_cookie](../README.md#auth_cookie) ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: application/json +- **Accept**: Not defined diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/ApiException.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/ApiException.java index 7e9a6ef4d562..2e0db8b1bf70 100644 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/ApiException.java +++ b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/ApiException.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/ApiInvoker.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/ApiInvoker.java index 18403b1972c6..fd1eba49be83 100644 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/ApiInvoker.java +++ b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/ApiInvoker.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/HttpPatch.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/HttpPatch.java index 33fd7b63bd2a..5f6c62e79d8a 100644 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/HttpPatch.java +++ b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/HttpPatch.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/JsonUtil.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/JsonUtil.java index 624c820ebce9..e6c7f3ea1233 100644 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/JsonUtil.java +++ b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/JsonUtil.java @@ -42,6 +42,14 @@ public static Type getListTypeForDeserialization(Class cls) { return new TypeToken>(){}.getType(); } + if ("InlineObject".equalsIgnoreCase(className)) { + return new TypeToken>(){}.getType(); + } + + if ("InlineObject1".equalsIgnoreCase(className)) { + return new TypeToken>(){}.getType(); + } + if ("Order".equalsIgnoreCase(className)) { return new TypeToken>(){}.getType(); } @@ -72,6 +80,14 @@ public static Type getTypeForDeserialization(Class cls) { return new TypeToken(){}.getType(); } + if ("InlineObject".equalsIgnoreCase(className)) { + return new TypeToken(){}.getType(); + } + + if ("InlineObject1".equalsIgnoreCase(className)) { + return new TypeToken(){}.getType(); + } + if ("Order".equalsIgnoreCase(className)) { return new TypeToken(){}.getType(); } diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/Pair.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/Pair.java index 21a436455a1d..062883523107 100644 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/Pair.java +++ b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/Pair.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/PetApi.java index 10e4466ae0b2..932a2f46fc69 100644 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/PetApi.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -213,9 +213,10 @@ public List findPetsByStatus (List status) throws ApiException { * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by + * @param maxCount Maximum number of items to return * @return List */ - public List findPetsByTags (List tags) throws ApiException { + public List findPetsByTags (List tags, Integer maxCount) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'tags' is set if (tags == null) { @@ -233,6 +234,7 @@ public List findPetsByTags (List tags) throws ApiException { Map localVarFormParams = new HashMap(); localVarQueryParams.addAll(ApiInvoker.parameterToPairs("csv", "tags", tags)); + localVarQueryParams.addAll(ApiInvoker.parameterToPairs("", "maxCount", maxCount)); String[] localVarContentTypes = { diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/StoreApi.java index 91dadd5646da..f178afc87b51 100644 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/StoreApi.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -226,7 +226,7 @@ public Order placeOrder (Order order) throws ApiException { String[] localVarContentTypes = { - + "application/json" }; String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/UserApi.java index 6189aff41a38..890d22ed71f1 100644 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/UserApi.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -75,7 +75,7 @@ public void createUser (User user) throws ApiException { String[] localVarContentTypes = { - + "application/json" }; String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; @@ -127,7 +127,7 @@ public void createUsersWithArrayInput (List user) throws ApiException { String[] localVarContentTypes = { - + "application/json" }; String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; @@ -179,7 +179,7 @@ public void createUsersWithListInput (List user) throws ApiException { String[] localVarContentTypes = { - + "application/json" }; String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; @@ -446,7 +446,7 @@ public void updateUser (String username, User user) throws ApiException { String[] localVarContentTypes = { - + "application/json" }; String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/InlineObject.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/InlineObject.java new file mode 100644 index 000000000000..05432599373b --- /dev/null +++ b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/InlineObject.java @@ -0,0 +1,70 @@ +package org.openapitools.client.model; + + +import io.swagger.annotations.*; +import com.google.gson.annotations.SerializedName; + + +@ApiModel(description = "") +public class InlineObject { + + @SerializedName("name") + private String name = null; + @SerializedName("status") + private String status = null; + + /** + * Updated name of the pet + **/ + @ApiModelProperty(value = "Updated name of the pet") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + /** + * Updated status of the pet + **/ + @ApiModelProperty(value = "Updated status of the pet") + public String getStatus() { + return status; + } + public void setStatus(String status) { + this.status = status; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InlineObject inlineObject = (InlineObject) o; + return (this.name == null ? inlineObject.name == null : this.name.equals(inlineObject.name)) && + (this.status == null ? inlineObject.status == null : this.status.equals(inlineObject.status)); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (this.name == null ? 0: this.name.hashCode()); + result = 31 * result + (this.status == null ? 0: this.status.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InlineObject {\n"); + + sb.append(" name: ").append(name).append("\n"); + sb.append(" status: ").append(status).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/InlineObject1.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/InlineObject1.java new file mode 100644 index 000000000000..083f462d141b --- /dev/null +++ b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/InlineObject1.java @@ -0,0 +1,71 @@ +package org.openapitools.client.model; + +import java.io.File; + +import io.swagger.annotations.*; +import com.google.gson.annotations.SerializedName; + + +@ApiModel(description = "") +public class InlineObject1 { + + @SerializedName("additionalMetadata") + private String additionalMetadata = null; + @SerializedName("file") + private File file = null; + + /** + * Additional data to pass to server + **/ + @ApiModelProperty(value = "Additional data to pass to server") + public String getAdditionalMetadata() { + return additionalMetadata; + } + public void setAdditionalMetadata(String additionalMetadata) { + this.additionalMetadata = additionalMetadata; + } + + /** + * file to upload + **/ + @ApiModelProperty(value = "file to upload") + public File getFile() { + return file; + } + public void setFile(File file) { + this.file = file; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InlineObject1 inlineObject1 = (InlineObject1) o; + return (this.additionalMetadata == null ? inlineObject1.additionalMetadata == null : this.additionalMetadata.equals(inlineObject1.additionalMetadata)) && + (this.file == null ? inlineObject1.file == null : this.file.equals(inlineObject1.file)); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + (this.additionalMetadata == null ? 0: this.additionalMetadata.hashCode()); + result = 31 * result + (this.file == null ? 0: this.file.hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InlineObject1 {\n"); + + sb.append(" additionalMetadata: ").append(additionalMetadata).append("\n"); + sb.append(" file: ").append(file).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/samples/client/petstore/android/volley/.openapi-generator/VERSION b/samples/client/petstore/android/volley/.openapi-generator/VERSION index afa636560641..83a328a9227e 100644 --- a/samples/client/petstore/android/volley/.openapi-generator/VERSION +++ b/samples/client/petstore/android/volley/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/android/volley/README.md b/samples/client/petstore/android/volley/README.md index c2fca9e2b9eb..996f213b2caf 100644 --- a/samples/client/petstore/android/volley/README.md +++ b/samples/client/petstore/android/volley/README.md @@ -49,8 +49,8 @@ At first generate the JAR by executing: Then manually install the following JARs: -* target/petstore-android-volley-1.0.0.jar -* target/lib/*.jar +- target/petstore-android-volley-1.0.0.jar +- target/lib/*.jar ## Getting Started @@ -108,6 +108,8 @@ Class | Method | HTTP request | Description - [ApiResponse](docs/ApiResponse.md) - [Category](docs/Category.md) + - [InlineObject](docs/InlineObject.md) + - [InlineObject1](docs/InlineObject1.md) - [Order](docs/Order.md) - [Pet](docs/Pet.md) - [Tag](docs/Tag.md) @@ -120,11 +122,20 @@ Authentication schemes defined for the API: ### api_key - **Type**: API key + - **API key parameter name**: api_key - **Location**: HTTP header +### auth_cookie + +- **Type**: API key + +- **API key parameter name**: AUTH_KEY +- **Location**: + ### petstore_auth + - **Type**: OAuth - **Flow**: implicit - **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog diff --git a/samples/client/petstore/android/volley/docs/ApiResponse.md b/samples/client/petstore/android/volley/docs/ApiResponse.md index 1c17767c2b72..a169bf232e15 100644 --- a/samples/client/petstore/android/volley/docs/ApiResponse.md +++ b/samples/client/petstore/android/volley/docs/ApiResponse.md @@ -1,7 +1,9 @@ + # ApiResponse ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **code** | **Integer** | | [optional] @@ -10,3 +12,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/android/volley/docs/Category.md b/samples/client/petstore/android/volley/docs/Category.md index e2df08032787..53c9fedc8bc4 100644 --- a/samples/client/petstore/android/volley/docs/Category.md +++ b/samples/client/petstore/android/volley/docs/Category.md @@ -1,7 +1,9 @@ + # Category ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Long** | | [optional] @@ -9,3 +11,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/android/volley/docs/InlineObject.md b/samples/client/petstore/android/volley/docs/InlineObject.md new file mode 100644 index 000000000000..9b4b33d1eeb0 --- /dev/null +++ b/samples/client/petstore/android/volley/docs/InlineObject.md @@ -0,0 +1,14 @@ + + +# InlineObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Updated name of the pet | [optional] +**status** | **String** | Updated status of the pet | [optional] + + + + diff --git a/samples/client/petstore/android/volley/docs/InlineObject1.md b/samples/client/petstore/android/volley/docs/InlineObject1.md new file mode 100644 index 000000000000..2dcb8fb8f57b --- /dev/null +++ b/samples/client/petstore/android/volley/docs/InlineObject1.md @@ -0,0 +1,14 @@ + + +# InlineObject1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**additionalMetadata** | **String** | Additional data to pass to server | [optional] +**file** | [**File**](File.md) | file to upload | [optional] + + + + diff --git a/samples/client/petstore/android/volley/docs/Order.md b/samples/client/petstore/android/volley/docs/Order.md index 5746ce97fad3..f49e8704e088 100644 --- a/samples/client/petstore/android/volley/docs/Order.md +++ b/samples/client/petstore/android/volley/docs/Order.md @@ -1,7 +1,9 @@ + # Order ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Long** | | [optional] @@ -12,10 +14,11 @@ Name | Type | Description | Notes **complete** | **Boolean** | | [optional] - ## Enum: StatusEnum + Name | Value ---- | ----- + diff --git a/samples/client/petstore/android/volley/docs/Pet.md b/samples/client/petstore/android/volley/docs/Pet.md index a4daa24feb60..72e3338dfb83 100644 --- a/samples/client/petstore/android/volley/docs/Pet.md +++ b/samples/client/petstore/android/volley/docs/Pet.md @@ -1,7 +1,9 @@ + # Pet ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Long** | | [optional] @@ -12,10 +14,11 @@ Name | Type | Description | Notes **status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] - ## Enum: StatusEnum + Name | Value ---- | ----- + diff --git a/samples/client/petstore/android/volley/docs/PetApi.md b/samples/client/petstore/android/volley/docs/PetApi.md index 7cf076f29c58..a7d70f33b16a 100644 --- a/samples/client/petstore/android/volley/docs/PetApi.md +++ b/samples/client/petstore/android/volley/docs/PetApi.md @@ -14,13 +14,15 @@ Method | HTTP request | Description [**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image - -# **addPet** + +## addPet + > addPet(pet) Add a new pet to the store ### Example + ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -37,6 +39,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | @@ -51,16 +54,18 @@ null (empty response body) ### HTTP request headers - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + + +## deletePet - -# **deletePet** > deletePet(petId, apiKey) Deletes a pet ### Example + ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -78,6 +83,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| Pet id to delete | [default to null] @@ -93,11 +99,12 @@ null (empty response body) ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined + + +## findPetsByStatus - -# **findPetsByStatus** > List<Pet> findPetsByStatus(status) Finds Pets by status @@ -105,6 +112,7 @@ Finds Pets by status Multiple status values can be provided with comma separated strings ### Example + ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -122,6 +130,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [default to null] [enum: available, pending, sold] @@ -136,26 +145,29 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json - -# **findPetsByTags** -> List<Pet> findPetsByTags(tags) + +## findPetsByTags + +> List<Pet> findPetsByTags(tags, maxCount) Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. ### Example + ```java // Import classes: //import org.openapitools.client.api.PetApi; PetApi apiInstance = new PetApi(); List tags = null; // List | Tags to filter by +Integer maxCount = null; // Integer | Maximum number of items to return try { - List result = apiInstance.findPetsByTags(tags); + List result = apiInstance.findPetsByTags(tags, maxCount); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#findPetsByTags"); @@ -165,9 +177,11 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **tags** | [**List<String>**](String.md)| Tags to filter by | [default to null] + **maxCount** | **Integer**| Maximum number of items to return | [optional] [default to null] ### Return type @@ -179,11 +193,12 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +## getPetById - -# **getPetById** > Pet getPetById(petId) Find pet by ID @@ -191,6 +206,7 @@ Find pet by ID Returns a single pet ### Example + ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -208,6 +224,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| ID of pet to return | [default to null] @@ -222,16 +239,18 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +## updatePet - -# **updatePet** > updatePet(pet) Update an existing pet ### Example + ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -248,6 +267,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | @@ -262,16 +282,18 @@ null (empty response body) ### HTTP request headers - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + + +## updatePetWithForm - -# **updatePetWithForm** > updatePetWithForm(petId, name, status) Updates a pet in the store with form data ### Example + ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -290,6 +312,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| ID of pet that needs to be updated | [default to null] @@ -306,16 +329,18 @@ null (empty response body) ### HTTP request headers - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + + +## uploadFile - -# **uploadFile** > ApiResponse uploadFile(petId, additionalMetadata, file) uploads an image ### Example + ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -335,6 +360,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| ID of pet to update | [default to null] @@ -351,6 +377,6 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: multipart/form-data - - **Accept**: application/json +- **Content-Type**: multipart/form-data +- **Accept**: application/json diff --git a/samples/client/petstore/android/volley/docs/StoreApi.md b/samples/client/petstore/android/volley/docs/StoreApi.md index b768ad5ba986..528ea3acd03c 100644 --- a/samples/client/petstore/android/volley/docs/StoreApi.md +++ b/samples/client/petstore/android/volley/docs/StoreApi.md @@ -10,8 +10,9 @@ Method | HTTP request | Description [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet - -# **deleteOrder** + +## deleteOrder + > deleteOrder(orderId) Delete purchase order by ID @@ -19,6 +20,7 @@ Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors ### Example + ```java // Import classes: //import org.openapitools.client.api.StoreApi; @@ -35,6 +37,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **orderId** | **String**| ID of the order that needs to be deleted | [default to null] @@ -49,11 +52,12 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined + + +## getInventory - -# **getInventory** > Map<String, Integer> getInventory() Returns pet inventories by status @@ -61,6 +65,7 @@ Returns pet inventories by status Returns a map of status codes to quantities ### Example + ```java // Import classes: //import org.openapitools.client.api.StoreApi; @@ -76,6 +81,7 @@ try { ``` ### Parameters + This endpoint does not need any parameter. ### Return type @@ -88,11 +94,12 @@ This endpoint does not need any parameter. ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json + + +## getOrderById - -# **getOrderById** > Order getOrderById(orderId) Find purchase order by ID @@ -100,6 +107,7 @@ Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions ### Example + ```java // Import classes: //import org.openapitools.client.api.StoreApi; @@ -117,6 +125,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **orderId** | **Long**| ID of pet that needs to be fetched | [default to null] @@ -131,16 +140,18 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +## placeOrder - -# **placeOrder** > Order placeOrder(order) Place an order for a pet ### Example + ```java // Import classes: //import org.openapitools.client.api.StoreApi; @@ -158,6 +169,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **order** | [**Order**](Order.md)| order placed for purchasing the pet | @@ -172,6 +184,6 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: application/json +- **Accept**: application/xml, application/json diff --git a/samples/client/petstore/android/volley/docs/Tag.md b/samples/client/petstore/android/volley/docs/Tag.md index de6814b55d57..b540cab453f0 100644 --- a/samples/client/petstore/android/volley/docs/Tag.md +++ b/samples/client/petstore/android/volley/docs/Tag.md @@ -1,7 +1,9 @@ + # Tag ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Long** | | [optional] @@ -9,3 +11,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/android/volley/docs/User.md b/samples/client/petstore/android/volley/docs/User.md index 8b6753dd284a..5e51c05150c8 100644 --- a/samples/client/petstore/android/volley/docs/User.md +++ b/samples/client/petstore/android/volley/docs/User.md @@ -1,7 +1,9 @@ + # User ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Long** | | [optional] @@ -15,3 +17,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/android/volley/docs/UserApi.md b/samples/client/petstore/android/volley/docs/UserApi.md index e5a16428112e..48e64b1ec223 100644 --- a/samples/client/petstore/android/volley/docs/UserApi.md +++ b/samples/client/petstore/android/volley/docs/UserApi.md @@ -14,8 +14,9 @@ Method | HTTP request | Description [**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user - -# **createUser** + +## createUser + > createUser(user) Create user @@ -23,6 +24,7 @@ Create user This can only be done by the logged in user. ### Example + ```java // Import classes: //import org.openapitools.client.api.UserApi; @@ -39,6 +41,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **user** | [**User**](User.md)| Created user object | @@ -49,26 +52,28 @@ null (empty response body) ### Authorization -No authorization required +[auth_cookie](../README.md#auth_cookie) ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: application/json +- **Accept**: Not defined + + +## createUsersWithArrayInput - -# **createUsersWithArrayInput** > createUsersWithArrayInput(user) Creates list of users with given input array ### Example + ```java // Import classes: //import org.openapitools.client.api.UserApi; UserApi apiInstance = new UserApi(); -List user = Arrays.asList(new List()); // List | List of user object +List user = Arrays.asList(new User()); // List | List of user object try { apiInstance.createUsersWithArrayInput(user); } catch (ApiException e) { @@ -79,9 +84,10 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**List<User>**](List.md)| List of user object | + **user** | [**List<User>**](User.md)| List of user object | ### Return type @@ -89,26 +95,28 @@ null (empty response body) ### Authorization -No authorization required +[auth_cookie](../README.md#auth_cookie) ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: application/json +- **Accept**: Not defined + + +## createUsersWithListInput - -# **createUsersWithListInput** > createUsersWithListInput(user) Creates list of users with given input array ### Example + ```java // Import classes: //import org.openapitools.client.api.UserApi; UserApi apiInstance = new UserApi(); -List user = Arrays.asList(new List()); // List | List of user object +List user = Arrays.asList(new User()); // List | List of user object try { apiInstance.createUsersWithListInput(user); } catch (ApiException e) { @@ -119,9 +127,10 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**List<User>**](List.md)| List of user object | + **user** | [**List<User>**](User.md)| List of user object | ### Return type @@ -129,15 +138,16 @@ null (empty response body) ### Authorization -No authorization required +[auth_cookie](../README.md#auth_cookie) ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: application/json +- **Accept**: Not defined + + +## deleteUser - -# **deleteUser** > deleteUser(username) Delete user @@ -145,6 +155,7 @@ Delete user This can only be done by the logged in user. ### Example + ```java // Import classes: //import org.openapitools.client.api.UserApi; @@ -161,6 +172,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| The name that needs to be deleted | [default to null] @@ -171,20 +183,22 @@ null (empty response body) ### Authorization -No authorization required +[auth_cookie](../README.md#auth_cookie) ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined + + +## getUserByName - -# **getUserByName** > User getUserByName(username) Get user by user name ### Example + ```java // Import classes: //import org.openapitools.client.api.UserApi; @@ -202,6 +216,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| The name that needs to be fetched. Use user1 for testing. | [default to null] @@ -216,16 +231,18 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +## loginUser - -# **loginUser** > String loginUser(username, password) Logs user into the system ### Example + ```java // Import classes: //import org.openapitools.client.api.UserApi; @@ -244,6 +261,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| The user name for login | [default to null] @@ -259,16 +277,18 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +## logoutUser - -# **logoutUser** > logoutUser() Logs out current logged in user session ### Example + ```java // Import classes: //import org.openapitools.client.api.UserApi; @@ -283,6 +303,7 @@ try { ``` ### Parameters + This endpoint does not need any parameter. ### Return type @@ -291,15 +312,16 @@ null (empty response body) ### Authorization -No authorization required +[auth_cookie](../README.md#auth_cookie) ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined + + +## updateUser - -# **updateUser** > updateUser(username, user) Updated user @@ -307,6 +329,7 @@ Updated user This can only be done by the logged in user. ### Example + ```java // Import classes: //import org.openapitools.client.api.UserApi; @@ -324,6 +347,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| name that need to be deleted | [default to null] @@ -335,10 +359,10 @@ null (empty response body) ### Authorization -No authorization required +[auth_cookie](../README.md#auth_cookie) ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: application/json +- **Accept**: Not defined diff --git a/samples/client/petstore/android/volley/pom.xml b/samples/client/petstore/android/volley/pom.xml index 5c66c4ea568d..ea86c5243942 100644 --- a/samples/client/petstore/android/volley/pom.xml +++ b/samples/client/petstore/android/volley/pom.xml @@ -11,6 +11,12 @@ swagger-annotations ${swagger-annotations-version} + + + com.google.code.findbugs + jsr305 + 3.0.2 + org.apache.httpcomponents httpcore diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/ApiException.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/ApiException.java index 70f3b77ceead..2f57c83eeb73 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/ApiException.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/ApiException.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/ApiInvoker.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/ApiInvoker.java index 2e7ab447cf3d..14dd6ec752c9 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/ApiInvoker.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/ApiInvoker.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -204,6 +204,7 @@ public static void initializeInstance(Cache cache, Network network, int threadPo // Setup authentications (key: authentication name, value: authentication). INSTANCE.authentications = new HashMap(); INSTANCE.authentications.put("api_key", new ApiKeyAuth("header", "api_key")); + INSTANCE.authentications.put("auth_cookie", new ApiKeyAuth("query", "AUTH_KEY")); // TODO: comment out below as OAuth does not exist //INSTANCE.authentications.put("petstore_auth", new OAuth()); // Prevent the authentications from being modified. diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/JsonUtil.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/JsonUtil.java index 3cdc69558e3d..4767d1facde4 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/JsonUtil.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/JsonUtil.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -65,6 +65,14 @@ public static Type getListTypeForDeserialization(Class cls) { return new TypeToken>(){}.getType(); } + if ("InlineObject".equalsIgnoreCase(className)) { + return new TypeToken>(){}.getType(); + } + + if ("InlineObject1".equalsIgnoreCase(className)) { + return new TypeToken>(){}.getType(); + } + if ("Order".equalsIgnoreCase(className)) { return new TypeToken>(){}.getType(); } @@ -95,6 +103,14 @@ public static Type getTypeForDeserialization(Class cls) { return new TypeToken(){}.getType(); } + if ("InlineObject".equalsIgnoreCase(className)) { + return new TypeToken(){}.getType(); + } + + if ("InlineObject1".equalsIgnoreCase(className)) { + return new TypeToken(){}.getType(); + } + if ("Order".equalsIgnoreCase(className)) { return new TypeToken(){}.getType(); } diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/Pair.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/Pair.java index e8f34f395f89..d358fcf66b45 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/Pair.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/Pair.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/PetApi.java index f90cf9d21e36..314d05f83d9f 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/PetApi.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -441,9 +441,10 @@ public void onErrorResponse(VolleyError error) { * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by + * @param maxCount Maximum number of items to return * @return List */ - public List findPetsByTags (List tags) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + public List findPetsByTags (List tags, Integer maxCount) throws TimeoutException, ExecutionException, InterruptedException, ApiException { Object postBody = null; // verify the required parameter 'tags' is set if (tags == null) { @@ -461,6 +462,7 @@ public List findPetsByTags (List tags) throws TimeoutException, Exe // form params Map formParams = new HashMap(); queryParams.addAll(ApiInvoker.parameterToPairs("csv", "tags", tags)); + queryParams.addAll(ApiInvoker.parameterToPairs("", "maxCount", maxCount)); String[] contentTypes = { }; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; @@ -503,9 +505,9 @@ public List findPetsByTags (List tags) throws TimeoutException, Exe /** * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @param tags Tags to filter by + * @param tags Tags to filter by * @param maxCount Maximum number of items to return */ - public void findPetsByTags (List tags, final Response.Listener> responseListener, final Response.ErrorListener errorListener) { + public void findPetsByTags (List tags, Integer maxCount, final Response.Listener> responseListener, final Response.ErrorListener errorListener) { Object postBody = null; // verify the required parameter 'tags' is set @@ -525,6 +527,7 @@ public void findPetsByTags (List tags, final Response.Listener Map formParams = new HashMap(); queryParams.addAll(ApiInvoker.parameterToPairs("csv", "tags", tags)); + queryParams.addAll(ApiInvoker.parameterToPairs("", "maxCount", maxCount)); String[] contentTypes = { diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/StoreApi.java index 3da1f3f76896..98f51ad6cbd3 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/StoreApi.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -446,6 +446,7 @@ public Order placeOrder (Order order) throws TimeoutException, ExecutionExceptio // form params Map formParams = new HashMap(); String[] contentTypes = { + "application/json" }; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; @@ -511,7 +512,7 @@ public void placeOrder (Order order, final Response.Listener responseList String[] contentTypes = { - + "application/json" }; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/UserApi.java index ce88777ae1ca..92bca6f0a2ea 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/UserApi.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -80,6 +80,7 @@ public void createUser (User user) throws TimeoutException, ExecutionException, // form params Map formParams = new HashMap(); String[] contentTypes = { + "application/json" }; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; @@ -92,7 +93,7 @@ public void createUser (User user) throws TimeoutException, ExecutionException, // normal form params } - String[] authNames = new String[] { }; + String[] authNames = new String[] { "auth_cookie" }; try { String localVarResponse = apiInvoker.invokeAPI (basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames); @@ -145,7 +146,7 @@ public void createUser (User user, final Response.Listener responseListe String[] contentTypes = { - + "application/json" }; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; @@ -160,7 +161,7 @@ public void createUser (User user, final Response.Listener responseListe // normal form params } - String[] authNames = new String[] { }; + String[] authNames = new String[] { "auth_cookie" }; try { apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames, @@ -203,6 +204,7 @@ public void createUsersWithArrayInput (List user) throws TimeoutException, // form params Map formParams = new HashMap(); String[] contentTypes = { + "application/json" }; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; @@ -215,7 +217,7 @@ public void createUsersWithArrayInput (List user) throws TimeoutException, // normal form params } - String[] authNames = new String[] { }; + String[] authNames = new String[] { "auth_cookie" }; try { String localVarResponse = apiInvoker.invokeAPI (basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames); @@ -268,7 +270,7 @@ public void createUsersWithArrayInput (List user, final Response.Listener< String[] contentTypes = { - + "application/json" }; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; @@ -283,7 +285,7 @@ public void createUsersWithArrayInput (List user, final Response.Listener< // normal form params } - String[] authNames = new String[] { }; + String[] authNames = new String[] { "auth_cookie" }; try { apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames, @@ -326,6 +328,7 @@ public void createUsersWithListInput (List user) throws TimeoutException, // form params Map formParams = new HashMap(); String[] contentTypes = { + "application/json" }; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; @@ -338,7 +341,7 @@ public void createUsersWithListInput (List user) throws TimeoutException, // normal form params } - String[] authNames = new String[] { }; + String[] authNames = new String[] { "auth_cookie" }; try { String localVarResponse = apiInvoker.invokeAPI (basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames); @@ -391,7 +394,7 @@ public void createUsersWithListInput (List user, final Response.Listener 0 ? contentTypes[0] : "application/json"; @@ -406,7 +409,7 @@ public void createUsersWithListInput (List user, final Response.Listener respons // normal form params } - String[] authNames = new String[] { }; + String[] authNames = new String[] { "auth_cookie" }; try { apiInvoker.invokeAPI(basePath, path, "DELETE", queryParams, postBody, headerParams, formParams, contentType, authNames, @@ -847,7 +850,7 @@ public void logoutUser () throws TimeoutException, ExecutionException, Interrupt // normal form params } - String[] authNames = new String[] { }; + String[] authNames = new String[] { "auth_cookie" }; try { String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames); @@ -910,7 +913,7 @@ public void logoutUser (final Response.Listener responseListener, final // normal form params } - String[] authNames = new String[] { }; + String[] authNames = new String[] { "auth_cookie" }; try { apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, @@ -959,6 +962,7 @@ public void updateUser (String username, User user) throws TimeoutException, Exe // form params Map formParams = new HashMap(); String[] contentTypes = { + "application/json" }; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; @@ -971,7 +975,7 @@ public void updateUser (String username, User user) throws TimeoutException, Exe // normal form params } - String[] authNames = new String[] { }; + String[] authNames = new String[] { "auth_cookie" }; try { String localVarResponse = apiInvoker.invokeAPI (basePath, path, "PUT", queryParams, postBody, headerParams, formParams, contentType, authNames); @@ -1029,7 +1033,7 @@ public void updateUser (String username, User user, final Response.Listener 0 ? contentTypes[0] : "application/json"; @@ -1044,7 +1048,7 @@ public void updateUser (String username, User user, final Response.Listener> ~/.bashrc # @@ -37,21 +37,22 @@ line REST client for $(tput setaf 6)OpenAPI Petstore$(tput sgr0).\n\ \n\ For convenience, you can export the following environment variables:\n\ \n\ -$(tput setaf 3)PETSTORE_HOST$(tput sgr0) - server URL, e.g. https://example.com:8080\n\ -$(tput setaf 3)PETSTORE_API_KEY$(tput sgr0) - access token, e.g. "ASDASHJDG63456asdASSD"\n\ -$(tput setaf 3)PETSTORE_API_KEY$(tput sgr0) - access token, e.g. "ASDASHJDG63456asdASSD"\n\ -$(tput setaf 3)PETSTORE_BASIC_AUTH$(tput sgr0) - basic authentication credentials, e.g.: "username:password"\n\ + + + + + \n\ $(tput setaf 7)Basic usage:$(tput sgr0)\n\ \n\ $(tput setaf 3)Print the list of operations available on the service$(tput sgr0)\n\ -$ petstore-cli -h\n\ +$ -h\n\ \n\ $(tput setaf 3)Print the service description$(tput sgr0)\n\ -$ petstore-cli --about\n\ +$ --about\n\ \n\ $(tput setaf 3)Print detailed information about specific operation$(tput sgr0)\n\ -$ petstore-cli -h\n\ +$ -h\n\ \n\ By default you are logged into Zsh with full autocompletion for your REST API,\n\ but you can switch to Bash, where basic autocompletion is also supported.\n\ diff --git a/samples/client/petstore/bash/README.md b/samples/client/petstore/bash/README.md index 9e6a8c0dac3a..62ed3d8086f9 100644 --- a/samples/client/petstore/bash/README.md +++ b/samples/client/petstore/bash/README.md @@ -10,25 +10,25 @@ The script uses cURL underneath for making all REST calls. ```shell # Make sure the script has executable rights -$ chmod u+x petstore-cli +$ chmod u+x # Print the list of operations available on the service -$ ./petstore-cli -h +$ ./ -h # Print the service description -$ ./petstore-cli --about +$ ./ --about # Print detailed information about specific operation -$ ./petstore-cli -h +$ ./ -h # Make GET request -./petstore-cli --host http://: --accept xml = : +./ --host http://: --accept xml = : # Make GET request using arbitrary curl options (must be passed before ) to an SSL service using username:password -petstore-cli -k -sS --tlsv1.2 --host https:// -u : --accept xml = : + -k -sS --tlsv1.2 --host https:// -u : --accept xml = : # Make POST request -$ echo '' | petstore-cli --host --content-type json - +$ echo '' | --host --content-type json - # Make POST request with simple JSON content, e.g.: # { @@ -36,10 +36,10 @@ $ echo '' | petstore-cli --host --content-type json ' | petstore-cli --host --content-type json key1==value1 key2=value2 key3:=23 - +$ echo '' | --host --content-type json key1==value1 key2=value2 key3:=23 - # Preview the cURL command without actually executing it -$ petstore-cli --host http://: --dry-run +$ --host http://: --dry-run ``` @@ -65,13 +65,13 @@ is also available. The generated bash-completion script can be either directly loaded to the current Bash session using: ```shell -source petstore-cli.bash-completion +source .bash-completion ``` Alternatively, the script can be copied to the `/etc/bash-completion.d` (or on OSX with Homebrew to `/usr/local/etc/bash-completion.d`): ```shell -sudo cp petstore-cli.bash-completion /etc/bash-completion.d/petstore-cli +sudo cp .bash-completion /etc/bash-completion.d/ ``` #### OS X @@ -92,7 +92,7 @@ fi ### Zsh -In Zsh, the generated `_petstore-cli` Zsh completion file must be copied to one of the folders under `$FPATH` variable. +In Zsh, the generated `_` Zsh completion file must be copied to one of the folders under `$FPATH` variable. ## Documentation for API Endpoints @@ -101,7 +101,8 @@ All URIs are relative to */v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *AnotherFakeApi* | [**123Test@$%SpecialTags**](docs/AnotherFakeApi.md#123test@$%specialtags) | **PATCH** /another-fake/dummy | To test special tags -*FakeApi* | [**createXmlItem**](docs/FakeApi.md#createxmlitem) | **POST** /fake/create_xml_item | creates an XmlItem +*DefaultApi* | [**fooGet**](docs/DefaultApi.md#fooget) | **GET** /foo | +*FakeApi* | [**fakeHealthGet**](docs/FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint *FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | *FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | *FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | @@ -143,16 +144,8 @@ Class | Method | HTTP request | Description ## Documentation For Models - - [$special[modelName]](docs/$special[modelName].md) - [200Response](docs/200Response.md) - - [AdditionalPropertiesAnyType](docs/AdditionalPropertiesAnyType.md) - - [AdditionalPropertiesArray](docs/AdditionalPropertiesArray.md) - - [AdditionalPropertiesBoolean](docs/AdditionalPropertiesBoolean.md) - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) - - [AdditionalPropertiesInteger](docs/AdditionalPropertiesInteger.md) - - [AdditionalPropertiesNumber](docs/AdditionalPropertiesNumber.md) - - [AdditionalPropertiesObject](docs/AdditionalPropertiesObject.md) - - [AdditionalPropertiesString](docs/AdditionalPropertiesString.md) - [Animal](docs/Animal.md) - [ApiResponse](docs/ApiResponse.md) - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) @@ -170,23 +163,34 @@ Class | Method | HTTP request | Description - [EnumClass](docs/EnumClass.md) - [EnumTest](docs/EnumTest.md) - [FileSchemaTestClass](docs/FileSchemaTestClass.md) + - [Foo](docs/Foo.md) - [FormatTest](docs/FormatTest.md) - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [HealthCheckResult](docs/HealthCheckResult.md) + - [InlineObject](docs/InlineObject.md) + - [InlineObject1](docs/InlineObject1.md) + - [InlineObject2](docs/InlineObject2.md) + - [InlineObject3](docs/InlineObject3.md) + - [InlineObject4](docs/InlineObject4.md) + - [InlineObject5](docs/InlineObject5.md) + - [InlineResponseDefault](docs/InlineResponseDefault.md) - [MapTest](docs/MapTest.md) - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - [Name](docs/Name.md) + - [NullableClass](docs/NullableClass.md) - [NumberOnly](docs/NumberOnly.md) - [Order](docs/Order.md) - [OuterComposite](docs/OuterComposite.md) - [OuterEnum](docs/OuterEnum.md) + - [OuterEnumDefaultValue](docs/OuterEnumDefaultValue.md) + - [OuterEnumInteger](docs/OuterEnumInteger.md) + - [OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md) - [Pet](docs/Pet.md) - [ReadOnlyFirst](docs/ReadOnlyFirst.md) - [Return](docs/Return.md) + - [SpecialModelName](docs/SpecialModelName.md) - [Tag](docs/Tag.md) - - [TypeHolderDefault](docs/TypeHolderDefault.md) - - [TypeHolderExample](docs/TypeHolderExample.md) - [User](docs/User.md) - - [XmlItem](docs/XmlItem.md) ## Documentation For Authorization @@ -206,6 +210,10 @@ Class | Method | HTTP request | Description - **API key parameter name**: api_key_query - **Location**: URL query string +## bearer_test + +- **Type**: HTTP basic authentication + ## http_basic_test - **Type**: HTTP basic authentication diff --git a/samples/client/petstore/bash/docs/AdditionalPropertiesClass.md b/samples/client/petstore/bash/docs/AdditionalPropertiesClass.md index 5b1ed2dce633..0b452819e9e1 100644 --- a/samples/client/petstore/bash/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/bash/docs/AdditionalPropertiesClass.md @@ -3,17 +3,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**mapUnderscorestring** | **map[String, string]** | | [optional] [default to null] -**mapUnderscorenumber** | **map[String, integer]** | | [optional] [default to null] -**mapUnderscoreinteger** | **map[String, integer]** | | [optional] [default to null] -**mapUnderscoreboolean** | **map[String, boolean]** | | [optional] [default to null] -**mapUnderscorearrayUnderscoreinteger** | **map[String, array[integer]]** | | [optional] [default to null] -**mapUnderscorearrayUnderscoreanytype** | **map[String, array[map]]** | | [optional] [default to null] -**mapUnderscoremapUnderscorestring** | **map[String, map[String, string]]** | | [optional] [default to null] -**mapUnderscoremapUnderscoreanytype** | **map[String, map[String, map]]** | | [optional] [default to null] -**anytypeUnderscore1** | [**map**](.md) | | [optional] [default to null] -**anytypeUnderscore2** | [**map**](.md) | | [optional] [default to null] -**anytypeUnderscore3** | [**map**](.md) | | [optional] [default to null] +**mapUnderscoreproperty** | **map[String, string]** | | [optional] [default to null] +**mapUnderscoreofUnderscoremapUnderscoreproperty** | **map[String, map[String, string]]** | | [optional] [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/bash/docs/AnotherFakeApi.md b/samples/client/petstore/bash/docs/AnotherFakeApi.md index f93603717d2d..31bc56e999dc 100644 --- a/samples/client/petstore/bash/docs/AnotherFakeApi.md +++ b/samples/client/petstore/bash/docs/AnotherFakeApi.md @@ -17,7 +17,7 @@ To test special tags and operation ID starting with number ### Example ```bash -petstore-cli 123Test@$%SpecialTags + 123Test@$%SpecialTags ``` ### Parameters @@ -25,7 +25,7 @@ petstore-cli 123Test@$%SpecialTags Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md) | client model | + **client** | [**Client**](Client.md) | client model | ### Return type diff --git a/samples/client/petstore/bash/docs/EnumTest.md b/samples/client/petstore/bash/docs/EnumTest.md index 30b30efa7307..3f70a0a0667a 100644 --- a/samples/client/petstore/bash/docs/EnumTest.md +++ b/samples/client/petstore/bash/docs/EnumTest.md @@ -8,6 +8,9 @@ Name | Type | Description | Notes **enumUnderscoreinteger** | **integer** | | [optional] [default to null] **enumUnderscorenumber** | **float** | | [optional] [default to null] **outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] [default to null] +**outerEnumInteger** | [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional] [default to null] +**outerEnumDefaultValue** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] [default to null] +**outerEnumIntegerDefaultValue** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/bash/docs/FakeApi.md b/samples/client/petstore/bash/docs/FakeApi.md index 0f9bf109d342..0a8abebd18d7 100644 --- a/samples/client/petstore/bash/docs/FakeApi.md +++ b/samples/client/petstore/bash/docs/FakeApi.md @@ -4,7 +4,7 @@ All URIs are relative to */v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**createXmlItem**](FakeApi.md#createXmlItem) | **POST** /fake/create_xml_item | creates an XmlItem +[**fakeHealthGet**](FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint [**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | [**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | [**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | @@ -23,28 +23,23 @@ Method | HTTP request | Description -## createXmlItem +## fakeHealthGet -creates an XmlItem - -this route creates an XmlItem +Health check endpoint ### Example ```bash -petstore-cli createXmlItem + fakeHealthGet ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xmlItem** | [**XmlItem**](XmlItem.md) | XmlItem Body | +This endpoint does not need any parameter. ### Return type -(empty response body) +[**HealthCheckResult**](HealthCheckResult.md) ### Authorization @@ -52,8 +47,8 @@ No authorization required ### HTTP request headers -- **Content-Type**: application/xml, application/xml; charset=utf-8, application/xml; charset=utf-16, text/xml, text/xml; charset=utf-8, text/xml; charset=utf-16 -- **Accept**: Not Applicable +- **Content-Type**: Not Applicable +- **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -67,7 +62,7 @@ Test serialization of outer boolean types ### Example ```bash -petstore-cli fakeOuterBooleanSerialize + fakeOuterBooleanSerialize ``` ### Parameters @@ -87,7 +82,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not Applicable +- **Content-Type**: application/json - **Accept**: */* [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -102,7 +97,7 @@ Test serialization of object with outer number type ### Example ```bash -petstore-cli fakeOuterCompositeSerialize + fakeOuterCompositeSerialize ``` ### Parameters @@ -110,7 +105,7 @@ petstore-cli fakeOuterCompositeSerialize Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OuterComposite**](OuterComposite.md) | Input composite as post body | [optional] + **outerComposite** | [**OuterComposite**](OuterComposite.md) | Input composite as post body | [optional] ### Return type @@ -122,7 +117,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not Applicable +- **Content-Type**: application/json - **Accept**: */* [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -137,7 +132,7 @@ Test serialization of outer number types ### Example ```bash -petstore-cli fakeOuterNumberSerialize + fakeOuterNumberSerialize ``` ### Parameters @@ -157,7 +152,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not Applicable +- **Content-Type**: application/json - **Accept**: */* [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -172,7 +167,7 @@ Test serialization of outer string types ### Example ```bash -petstore-cli fakeOuterStringSerialize + fakeOuterStringSerialize ``` ### Parameters @@ -192,7 +187,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not Applicable +- **Content-Type**: application/json - **Accept**: */* [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -207,7 +202,7 @@ For this test, the body for this request much reference a schema named 'File'. ### Example ```bash -petstore-cli testBodyWithFileSchema + testBodyWithFileSchema ``` ### Parameters @@ -215,7 +210,7 @@ petstore-cli testBodyWithFileSchema Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**FileSchemaTestClass**](FileSchemaTestClass.md) | | + **fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md) | | ### Return type @@ -240,7 +235,7 @@ No authorization required ### Example ```bash -petstore-cli testBodyWithQueryParams query=value + testBodyWithQueryParams query=value ``` ### Parameters @@ -249,7 +244,7 @@ petstore-cli testBodyWithQueryParams query=value Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **query** | **string** | | [default to null] - **body** | [**User**](User.md) | | + **user** | [**User**](User.md) | | ### Return type @@ -276,7 +271,7 @@ To test \"client\" model ### Example ```bash -petstore-cli testClientModel + testClientModel ``` ### Parameters @@ -284,7 +279,7 @@ petstore-cli testClientModel Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md) | client model | + **client** | [**Client**](Client.md) | client model | ### Return type @@ -317,7 +312,7 @@ Fake endpoint for testing various parameters ### Example ```bash -petstore-cli testEndpointParameters + testEndpointParameters ``` ### Parameters @@ -365,7 +360,7 @@ To test enum parameters ### Example ```bash -petstore-cli testEnumParameters enum_header_string_array:value enum_header_string:value Specify as: enum_query_string_array="value1,value2,..." enum_query_string=value enum_query_integer=value enum_query_double=value + testEnumParameters enum_header_string_array:value enum_header_string:value Specify as: enum_query_string_array=value1 enum_query_string_array=value2 enum_query_string_array=... enum_query_string=value enum_query_integer=value enum_query_double=value ``` ### Parameters @@ -407,7 +402,7 @@ Fake endpoint to test group parameters (optional) ### Example ```bash -petstore-cli testGroupParameters required_string_group=value required_boolean_group:value required_int64_group=value string_group=value boolean_group:value int64_group=value + testGroupParameters required_string_group=value required_boolean_group:value required_int64_group=value string_group=value boolean_group:value int64_group=value ``` ### Parameters @@ -428,7 +423,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[bearer_test](../README.md#bearer_test) ### HTTP request headers @@ -445,7 +440,7 @@ test inline additionalProperties ### Example ```bash -petstore-cli testInlineAdditionalProperties + testInlineAdditionalProperties ``` ### Parameters @@ -453,7 +448,7 @@ petstore-cli testInlineAdditionalProperties Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **param** | [**map[String, string]**](string.md) | request body | + **requestBody** | [**map[String, string]**](string.md) | request body | ### Return type @@ -478,7 +473,7 @@ test json serialization of form data ### Example ```bash -petstore-cli testJsonFormData + testJsonFormData ``` ### Parameters diff --git a/samples/client/petstore/bash/docs/FakeClassnameTags123Api.md b/samples/client/petstore/bash/docs/FakeClassnameTags123Api.md index 19b3d386d383..c3a55cb3fd12 100644 --- a/samples/client/petstore/bash/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/bash/docs/FakeClassnameTags123Api.md @@ -17,7 +17,7 @@ To test class name in snake case ### Example ```bash -petstore-cli testClassname + testClassname ``` ### Parameters @@ -25,7 +25,7 @@ petstore-cli testClassname Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md) | client model | + **client** | [**Client**](Client.md) | client model | ### Return type diff --git a/samples/client/petstore/bash/docs/FormatTest.md b/samples/client/petstore/bash/docs/FormatTest.md index 8f73bb59bbcf..8fe26118a9dd 100644 --- a/samples/client/petstore/bash/docs/FormatTest.md +++ b/samples/client/petstore/bash/docs/FormatTest.md @@ -16,6 +16,8 @@ Name | Type | Description | Notes **dateTime** | **string** | | [optional] [default to null] **uuid** | **string** | | [optional] [default to null] **password** | **string** | | [default to null] +**patternUnderscorewithUnderscoredigits** | **string** | | [optional] [default to null] +**patternUnderscorewithUnderscoredigitsUnderscoreandUnderscoredelimiter** | **string** | | [optional] [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/bash/docs/PetApi.md b/samples/client/petstore/bash/docs/PetApi.md index 320863082061..5bc5fe3b8ae6 100644 --- a/samples/client/petstore/bash/docs/PetApi.md +++ b/samples/client/petstore/bash/docs/PetApi.md @@ -23,7 +23,7 @@ Add a new pet to the store ### Example ```bash -petstore-cli addPet + addPet ``` ### Parameters @@ -31,7 +31,7 @@ petstore-cli addPet Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | ### Return type @@ -56,7 +56,7 @@ Deletes a pet ### Example ```bash -petstore-cli deletePet petId=value api_key:value + deletePet petId=value api_key:value ``` ### Parameters @@ -92,7 +92,7 @@ Multiple status values can be provided with comma separated strings ### Example ```bash -petstore-cli findPetsByStatus Specify as: status="value1,value2,..." + findPetsByStatus Specify as: status="value1,value2,..." ``` ### Parameters @@ -127,7 +127,7 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 ### Example ```bash -petstore-cli findPetsByTags Specify as: tags="value1,value2,..." + findPetsByTags Specify as: tags="value1,value2,..." ``` ### Parameters @@ -162,7 +162,7 @@ Returns a single pet ### Example ```bash -petstore-cli getPetById petId=value + getPetById petId=value ``` ### Parameters @@ -195,7 +195,7 @@ Update an existing pet ### Example ```bash -petstore-cli updatePet + updatePet ``` ### Parameters @@ -203,7 +203,7 @@ petstore-cli updatePet Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | ### Return type @@ -228,7 +228,7 @@ Updates a pet in the store with form data ### Example ```bash -petstore-cli updatePetWithForm petId=value + updatePetWithForm petId=value ``` ### Parameters @@ -263,7 +263,7 @@ uploads an image ### Example ```bash -petstore-cli uploadFile petId=value + uploadFile petId=value ``` ### Parameters @@ -298,7 +298,7 @@ uploads an image (required) ### Example ```bash -petstore-cli uploadFileWithRequiredFile petId=value + uploadFileWithRequiredFile petId=value ``` ### Parameters diff --git a/samples/client/petstore/bash/docs/StoreApi.md b/samples/client/petstore/bash/docs/StoreApi.md index 56b2934562b5..3db55bc103c6 100644 --- a/samples/client/petstore/bash/docs/StoreApi.md +++ b/samples/client/petstore/bash/docs/StoreApi.md @@ -20,7 +20,7 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non ### Example ```bash -petstore-cli deleteOrder order_id=value + deleteOrder order_id=value ``` ### Parameters @@ -55,7 +55,7 @@ Returns a map of status codes to quantities ### Example ```bash -petstore-cli getInventory + getInventory ``` ### Parameters @@ -87,7 +87,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge ### Example ```bash -petstore-cli getOrderById order_id=value + getOrderById order_id=value ``` ### Parameters @@ -120,7 +120,7 @@ Place an order for a pet ### Example ```bash -petstore-cli placeOrder + placeOrder ``` ### Parameters @@ -128,7 +128,7 @@ petstore-cli placeOrder Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md) | order placed for purchasing the pet | + **order** | [**Order**](Order.md) | order placed for purchasing the pet | ### Return type @@ -140,7 +140,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not Applicable +- **Content-Type**: application/json - **Accept**: application/xml, application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/samples/client/petstore/bash/docs/UserApi.md b/samples/client/petstore/bash/docs/UserApi.md index 9663a425b732..34f38fbd4212 100644 --- a/samples/client/petstore/bash/docs/UserApi.md +++ b/samples/client/petstore/bash/docs/UserApi.md @@ -24,7 +24,7 @@ This can only be done by the logged in user. ### Example ```bash -petstore-cli createUser + createUser ``` ### Parameters @@ -32,7 +32,7 @@ petstore-cli createUser Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md) | Created user object | + **user** | [**User**](User.md) | Created user object | ### Return type @@ -44,7 +44,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not Applicable +- **Content-Type**: application/json - **Accept**: Not Applicable [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -57,7 +57,7 @@ Creates list of users with given input array ### Example ```bash -petstore-cli createUsersWithArrayInput + createUsersWithArrayInput ``` ### Parameters @@ -65,7 +65,7 @@ petstore-cli createUsersWithArrayInput Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**array[User]**](User.md) | List of user object | + **user** | [**array[User]**](User.md) | List of user object | ### Return type @@ -77,7 +77,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not Applicable +- **Content-Type**: application/json - **Accept**: Not Applicable [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -90,7 +90,7 @@ Creates list of users with given input array ### Example ```bash -petstore-cli createUsersWithListInput + createUsersWithListInput ``` ### Parameters @@ -98,7 +98,7 @@ petstore-cli createUsersWithListInput Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**array[User]**](User.md) | List of user object | + **user** | [**array[User]**](User.md) | List of user object | ### Return type @@ -110,7 +110,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not Applicable +- **Content-Type**: application/json - **Accept**: Not Applicable [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -125,7 +125,7 @@ This can only be done by the logged in user. ### Example ```bash -petstore-cli deleteUser username=value + deleteUser username=value ``` ### Parameters @@ -158,7 +158,7 @@ Get user by user name ### Example ```bash -petstore-cli getUserByName username=value + getUserByName username=value ``` ### Parameters @@ -191,7 +191,7 @@ Logs user into the system ### Example ```bash -petstore-cli loginUser username=value password=value + loginUser username=value password=value ``` ### Parameters @@ -225,7 +225,7 @@ Logs out current logged in user session ### Example ```bash -petstore-cli logoutUser + logoutUser ``` ### Parameters @@ -257,7 +257,7 @@ This can only be done by the logged in user. ### Example ```bash -petstore-cli updateUser username=value + updateUser username=value ``` ### Parameters @@ -266,7 +266,7 @@ petstore-cli updateUser username=value Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **string** | name that need to be deleted | [default to null] - **body** | [**User**](User.md) | Updated user object | + **user** | [**User**](User.md) | Updated user object | ### Return type @@ -278,7 +278,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not Applicable +- **Content-Type**: application/json - **Accept**: Not Applicable [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/samples/client/petstore/c/.openapi-generator/VERSION b/samples/client/petstore/c/.openapi-generator/VERSION index afa636560641..83a328a9227e 100644 --- a/samples/client/petstore/c/.openapi-generator/VERSION +++ b/samples/client/petstore/c/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/c/CMakeLists.txt b/samples/client/petstore/c/CMakeLists.txt index 404cf6f17f92..e685f785ddef 100644 --- a/samples/client/petstore/c/CMakeLists.txt +++ b/samples/client/petstore/c/CMakeLists.txt @@ -52,34 +52,39 @@ set(HDRS ) +# Add library with project file with projectname as library name add_library(${pkgName} SHARED ${SRCS} ${HDRS}) +# Link dependent libraries target_link_libraries(${pkgName} ${CURL_LIBRARIES} ) +#install library to destination install(TARGETS ${pkgName} DESTINATION ${CMAKE_INSTALL_PREFIX}) +# Setting file variables to null set(SRCS "") set(HDRS "") -# This section shows how to use the above compiled libary to compile the source files -# set source files -set(SRCS - unit-tests/manual-PetAPI.c - unit-tests/manual-StoreAPI.c - unit-tests/manual-UserAPI.c - unit-tests/manual-order.c - unit-tests/manual-user.c) -#set header files -set(HDRS -) +## This section shows how to use the above compiled libary to compile the source files +## set source files +#set(SRCS +# unit-tests/manual-PetAPI.c +# unit-tests/manual-StoreAPI.c +# unit-tests/manual-UserAPI.c +# unit-tests/manual-order.c +# unit-tests/manual-user.c) + +##set header files +#set(HDRS +#) -# loop over all files in SRCS variable -foreach(SOURCE_FILE ${SRCS}) - # Get only the file name from the file as add_executable doesnot support executable with slash("/") - get_filename_component(FILE_NAME_ONLY ${SOURCE_FILE} NAME_WE) - # Remove .c from the file name and set it as executable name - string( REPLACE ".c" "" EXECUTABLE_FILE ${FILE_NAME_ONLY}) - # Add executable for every source file in SRCS - add_executable(unit-${EXECUTABLE_FILE} ${SOURCE_FILE}) - # Link above created libary to executable and dependent libary curl - target_link_libraries(unit-${EXECUTABLE_FILE} ${CURL_LIBRARIES} ${pkgName} ) -endforeach(SOURCE_FILE ${SRCS}) +## loop over all files in SRCS variable +#foreach(SOURCE_FILE ${SRCS}) +# # Get only the file name from the file as add_executable doesnot support executable with slash("/") +# get_filename_component(FILE_NAME_ONLY ${SOURCE_FILE} NAME_WE) +# # Remove .c from the file name and set it as executable name +# string( REPLACE ".c" "" EXECUTABLE_FILE ${FILE_NAME_ONLY}) +# # Add executable for every source file in SRCS +# add_executable(unit-${EXECUTABLE_FILE} ${SOURCE_FILE}) +# # Link above created libary to executable and dependent libary curl +# target_link_libraries(unit-${EXECUTABLE_FILE} ${CURL_LIBRARIES} ${pkgName} ) +#endforeach(SOURCE_FILE ${SRCS}) diff --git a/samples/client/petstore/c/api/PetAPI.c b/samples/client/petstore/c/api/PetAPI.c index ad31d72f11e1..593839286420 100644 --- a/samples/client/petstore/c/api/PetAPI.c +++ b/samples/client/petstore/c/api/PetAPI.c @@ -6,630 +6,643 @@ #define MAX_BUFFER_LENGTH 4096 #define intToStr(dst, src) \ - do { \ - char dst[256]; \ - snprintf(dst, 256, "%ld", (long int) (src)); \ - } while(0) + do {\ + char dst[256];\ + snprintf(dst, 256, "%ld", (long int)(src));\ +}while(0) // Add a new pet to the store // -void PetAPI_addPet(apiClient_t *apiClient, pet_t *body) { - list_t *localVarQueryParameters = NULL; - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = NULL; - list_t *localVarContentType = list_create(); - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/pet") + 1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/pet"); - - - - - // Body Param - cJSON *localVarSingleItemJSON_body; - if(body != NULL) { - // string - localVarSingleItemJSON_body = pet_convertToJSON(body); - localVarBodyParameters = - cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarContentType, "application/json"); // consumes - list_addElement(localVarContentType, "application/xml"); // consumes - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "POST"); - - if(apiClient->response_code == 405) { - printf("%s\n", "Invalid input"); - } - // No return type +void +PetAPI_addPet(apiClient_t *apiClient ,pet_t * body) +{ + list_t *localVarQueryParameters = NULL; + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = NULL; + list_t *localVarContentType = list_create(); + char *localVarBodyParameters = NULL; + + // create the path + long sizeOfPath = strlen("/pet")+1; + char *localVarPath = malloc(sizeOfPath); + snprintf(localVarPath, sizeOfPath, "/pet"); + + + + + // Body Param + cJSON *localVarSingleItemJSON_body; + if (body != NULL) + { + //string + localVarSingleItemJSON_body = pet_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + } + list_addElement(localVarContentType,"application/json"); //consumes + list_addElement(localVarContentType,"application/xml"); //consumes + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + "POST"); + + if (apiClient->response_code == 405) { + printf("%s\n","Invalid input"); + } + //No return type end: - if(apiClient->dataReceived) { - free(apiClient->dataReceived); - } + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + } + + + + + list_free(localVarContentType); + free(localVarPath); + cJSON_Delete(localVarSingleItemJSON_body); + free(localVarBodyParameters); - - - - list_free(localVarContentType); - free(localVarPath); - cJSON_Delete(localVarSingleItemJSON_body); - free(localVarBodyParameters); } // Deletes a pet // -void PetAPI_deletePet(apiClient_t *apiClient, long petId, char *api_key) { - list_t *localVarQueryParameters = NULL; - list_t *localVarHeaderParameters = list_create(); - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = NULL; - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/pet/{petId}") + 1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/pet/{petId}"); - - - // Path Params - long sizeOfPathParams_petId = sizeof(petId) + 3 + strlen("{ petId }"); - if(petId == 0) { - goto end; - } - char *localVarToReplace_petId = malloc(sizeOfPathParams_petId); - snprintf(localVarToReplace_petId, sizeOfPathParams_petId, "{%s}", - "petId"); - - char localVarBuff_petId[256]; - intToStr(localVarBuff_petId, petId); - - localVarPath = strReplace(localVarPath, localVarToReplace_petId, - localVarBuff_petId); - - - - - // header parameters - char *keyHeader_api_key; - char *valueHeader_api_key; - keyValuePair_t *keyPairHeader_api_key = 0; - if(api_key) { - keyHeader_api_key = strdup("api_key"); - valueHeader_api_key = strdup((api_key)); - keyPairHeader_api_key = keyValuePair_create(keyHeader_api_key, - valueHeader_api_key); - list_addElement(localVarHeaderParameters, - keyPairHeader_api_key); - } - - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "DELETE"); - - if(apiClient->response_code == 400) { - printf("%s\n", "Invalid pet value"); - } - // No return type +void +PetAPI_deletePet(apiClient_t *apiClient ,long petId ,char * api_key) +{ + list_t *localVarQueryParameters = NULL; + list_t *localVarHeaderParameters = list_create(); + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = NULL; + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + + // create the path + long sizeOfPath = strlen("/pet/{petId}")+1; + char *localVarPath = malloc(sizeOfPath); + snprintf(localVarPath, sizeOfPath, "/pet/{petId}"); + + + // Path Params + long sizeOfPathParams_petId = sizeof(petId)+3 + strlen("{ petId }"); + if(petId == 0){ + goto end; + } + char* localVarToReplace_petId = malloc(sizeOfPathParams_petId); + snprintf(localVarToReplace_petId, sizeOfPathParams_petId, "{%s}", "petId"); + + char localVarBuff_petId[256]; + intToStr(localVarBuff_petId, petId); + + localVarPath = strReplace(localVarPath, localVarToReplace_petId, localVarBuff_petId); + + + + + // header parameters + char *keyHeader_api_key; + char * valueHeader_api_key; + keyValuePair_t *keyPairHeader_api_key = 0; + if (api_key) { + keyHeader_api_key = strdup("api_key"); + valueHeader_api_key = strdup((api_key)); + keyPairHeader_api_key = keyValuePair_create(keyHeader_api_key, valueHeader_api_key); + list_addElement(localVarHeaderParameters,keyPairHeader_api_key); + } + + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + "DELETE"); + + if (apiClient->response_code == 400) { + printf("%s\n","Invalid pet value"); + } + //No return type end: - if(apiClient->dataReceived) { - free(apiClient->dataReceived); - } - - list_free(localVarHeaderParameters); - + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + } + + list_free(localVarHeaderParameters); + + + + free(localVarPath); + free(localVarToReplace_petId); + free(keyHeader_api_key); + free(valueHeader_api_key); + free(keyPairHeader_api_key); - - free(localVarPath); - free(localVarToReplace_petId); - free(keyHeader_api_key); - free(valueHeader_api_key); - free(keyPairHeader_api_key); } // Finds Pets by status // // Multiple status values can be provided with comma separated strings // -list_t *PetAPI_findPetsByStatus(apiClient_t *apiClient, list_t *status) { - list_t *localVarQueryParameters = list_create(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_create(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/pet/findByStatus") + 1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/pet/findByStatus"); - - - - - // query parameters - if(status) { - list_addElement(localVarQueryParameters, status); - } - list_addElement(localVarHeaderType, "application/xml"); // produces - list_addElement(localVarHeaderType, "application/json"); // produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - - if(apiClient->response_code == 200) { - printf("%s\n", "successful operation"); - } - if(apiClient->response_code == 400) { - printf("%s\n", "Invalid status value"); - } - cJSON *PetAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - if(!cJSON_IsArray(PetAPIlocalVarJSON)) { - return 0; // nonprimitive container - } - list_t *elementToReturn = list_create(); - cJSON *VarJSON; - cJSON_ArrayForEach(VarJSON, PetAPIlocalVarJSON) - { - if(!cJSON_IsObject(VarJSON)) { - // return 0; - } - char *localVarJSONToChar = cJSON_Print(VarJSON); - list_addElement(elementToReturn, localVarJSONToChar); - } - - cJSON_Delete(PetAPIlocalVarJSON); - cJSON_Delete(VarJSON); - // return type - if(apiClient->dataReceived) { - free(apiClient->dataReceived); - } - list_free(localVarQueryParameters); - - - list_free(localVarHeaderType); - - free(localVarPath); - return elementToReturn; +list_t* +PetAPI_findPetsByStatus(apiClient_t *apiClient ,list_t * status) +{ + list_t *localVarQueryParameters = list_create(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_create(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + + // create the path + long sizeOfPath = strlen("/pet/findByStatus")+1; + char *localVarPath = malloc(sizeOfPath); + snprintf(localVarPath, sizeOfPath, "/pet/findByStatus"); + + + + + // query parameters + if (status) + { + list_addElement(localVarQueryParameters,status); + } + list_addElement(localVarHeaderType,"application/xml"); //produces + list_addElement(localVarHeaderType,"application/json"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + "GET"); + + if (apiClient->response_code == 200) { + printf("%s\n","successful operation"); + } + if (apiClient->response_code == 400) { + printf("%s\n","Invalid status value"); + } + cJSON *PetAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + if(!cJSON_IsArray(PetAPIlocalVarJSON)) { + return 0;//nonprimitive container + } + list_t *elementToReturn = list_create(); + cJSON *VarJSON; + cJSON_ArrayForEach(VarJSON, PetAPIlocalVarJSON) + { + if(!cJSON_IsObject(VarJSON)) + { + // return 0; + } + char *localVarJSONToChar = cJSON_Print(VarJSON); + list_addElement(elementToReturn , localVarJSONToChar); + } + + cJSON_Delete( PetAPIlocalVarJSON); + cJSON_Delete( VarJSON); + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + } + list_free(localVarQueryParameters); + + + list_free(localVarHeaderType); + + free(localVarPath); + return elementToReturn; end: - return NULL; + return NULL; + } // Finds Pets by tags // // Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. // -list_t *PetAPI_findPetsByTags(apiClient_t *apiClient, list_t *tags) { - list_t *localVarQueryParameters = list_create(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_create(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/pet/findByTags") + 1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/pet/findByTags"); - - - - - // query parameters - if(tags) { - list_addElement(localVarQueryParameters, tags); - } - list_addElement(localVarHeaderType, "application/xml"); // produces - list_addElement(localVarHeaderType, "application/json"); // produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - - if(apiClient->response_code == 200) { - printf("%s\n", "successful operation"); - } - if(apiClient->response_code == 400) { - printf("%s\n", "Invalid tag value"); - } - cJSON *PetAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - if(!cJSON_IsArray(PetAPIlocalVarJSON)) { - return 0; // nonprimitive container - } - list_t *elementToReturn = list_create(); - cJSON *VarJSON; - cJSON_ArrayForEach(VarJSON, PetAPIlocalVarJSON) - { - if(!cJSON_IsObject(VarJSON)) { - // return 0; - } - char *localVarJSONToChar = cJSON_Print(VarJSON); - list_addElement(elementToReturn, localVarJSONToChar); - } - - cJSON_Delete(PetAPIlocalVarJSON); - cJSON_Delete(VarJSON); - // return type - if(apiClient->dataReceived) { - free(apiClient->dataReceived); - } - list_free(localVarQueryParameters); - - - list_free(localVarHeaderType); - - free(localVarPath); - return elementToReturn; +list_t* +PetAPI_findPetsByTags(apiClient_t *apiClient ,list_t * tags) +{ + list_t *localVarQueryParameters = list_create(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_create(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + + // create the path + long sizeOfPath = strlen("/pet/findByTags")+1; + char *localVarPath = malloc(sizeOfPath); + snprintf(localVarPath, sizeOfPath, "/pet/findByTags"); + + + + + // query parameters + if (tags) + { + list_addElement(localVarQueryParameters,tags); + } + list_addElement(localVarHeaderType,"application/xml"); //produces + list_addElement(localVarHeaderType,"application/json"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + "GET"); + + if (apiClient->response_code == 200) { + printf("%s\n","successful operation"); + } + if (apiClient->response_code == 400) { + printf("%s\n","Invalid tag value"); + } + cJSON *PetAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + if(!cJSON_IsArray(PetAPIlocalVarJSON)) { + return 0;//nonprimitive container + } + list_t *elementToReturn = list_create(); + cJSON *VarJSON; + cJSON_ArrayForEach(VarJSON, PetAPIlocalVarJSON) + { + if(!cJSON_IsObject(VarJSON)) + { + // return 0; + } + char *localVarJSONToChar = cJSON_Print(VarJSON); + list_addElement(elementToReturn , localVarJSONToChar); + } + + cJSON_Delete( PetAPIlocalVarJSON); + cJSON_Delete( VarJSON); + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + } + list_free(localVarQueryParameters); + + + list_free(localVarHeaderType); + + free(localVarPath); + return elementToReturn; end: - return NULL; + return NULL; + } // Find pet by ID // // Returns a single pet // -pet_t *PetAPI_getPetById(apiClient_t *apiClient, long petId) { - list_t *localVarQueryParameters = NULL; - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_create(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/pet/{petId}") + 1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/pet/{petId}"); - - - // Path Params - long sizeOfPathParams_petId = sizeof(petId) + 3 + strlen("{ petId }"); - if(petId == 0) { - goto end; - } - char *localVarToReplace_petId = malloc(sizeOfPathParams_petId); - snprintf(localVarToReplace_petId, sizeOfPathParams_petId, "{%s}", - "petId"); - - char localVarBuff_petId[256]; - intToStr(localVarBuff_petId, petId); - - localVarPath = strReplace(localVarPath, localVarToReplace_petId, - localVarBuff_petId); - - - - list_addElement(localVarHeaderType, "application/xml"); // produces - list_addElement(localVarHeaderType, "application/json"); // produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - - if(apiClient->response_code == 200) { - printf("%s\n", "successful operation"); - } - if(apiClient->response_code == 400) { - printf("%s\n", "Invalid ID supplied"); - } - if(apiClient->response_code == 404) { - printf("%s\n", "Pet not found"); - } - // nonprimitive not container - cJSON *PetAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - pet_t *elementToReturn = pet_parseFromJSON(PetAPIlocalVarJSON); +pet_t* +PetAPI_getPetById(apiClient_t *apiClient ,long petId) +{ + list_t *localVarQueryParameters = NULL; + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_create(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + + // create the path + long sizeOfPath = strlen("/pet/{petId}")+1; + char *localVarPath = malloc(sizeOfPath); + snprintf(localVarPath, sizeOfPath, "/pet/{petId}"); + + + // Path Params + long sizeOfPathParams_petId = sizeof(petId)+3 + strlen("{ petId }"); + if(petId == 0){ + goto end; + } + char* localVarToReplace_petId = malloc(sizeOfPathParams_petId); + snprintf(localVarToReplace_petId, sizeOfPathParams_petId, "{%s}", "petId"); + + char localVarBuff_petId[256]; + intToStr(localVarBuff_petId, petId); + + localVarPath = strReplace(localVarPath, localVarToReplace_petId, localVarBuff_petId); + + + + list_addElement(localVarHeaderType,"application/xml"); //produces + list_addElement(localVarHeaderType,"application/json"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + "GET"); + + if (apiClient->response_code == 200) { + printf("%s\n","successful operation"); + } + if (apiClient->response_code == 400) { + printf("%s\n","Invalid ID supplied"); + } + if (apiClient->response_code == 404) { + printf("%s\n","Pet not found"); + } + //nonprimitive not container + cJSON *PetAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + pet_t *elementToReturn = pet_parseFromJSON(PetAPIlocalVarJSON); cJSON_Delete(PetAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - // return type - if(apiClient->dataReceived) { - free(apiClient->dataReceived); - } - - - - list_free(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace_petId); - return elementToReturn; + if(elementToReturn == NULL) { + // return 0; + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + } + + + + list_free(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_petId); + return elementToReturn; end: - return NULL; + return NULL; + } // Update an existing pet // -void PetAPI_updatePet(apiClient_t *apiClient, pet_t *body) { - list_t *localVarQueryParameters = NULL; - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = NULL; - list_t *localVarContentType = list_create(); - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/pet") + 1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/pet"); - - - - - // Body Param - cJSON *localVarSingleItemJSON_body; - if(body != NULL) { - // string - localVarSingleItemJSON_body = pet_convertToJSON(body); - localVarBodyParameters = - cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarContentType, "application/json"); // consumes - list_addElement(localVarContentType, "application/xml"); // consumes - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "PUT"); - - if(apiClient->response_code == 400) { - printf("%s\n", "Invalid ID supplied"); - } - if(apiClient->response_code == 404) { - printf("%s\n", "Pet not found"); - } - if(apiClient->response_code == 405) { - printf("%s\n", "Validation exception"); - } - // No return type +void +PetAPI_updatePet(apiClient_t *apiClient ,pet_t * body) +{ + list_t *localVarQueryParameters = NULL; + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = NULL; + list_t *localVarContentType = list_create(); + char *localVarBodyParameters = NULL; + + // create the path + long sizeOfPath = strlen("/pet")+1; + char *localVarPath = malloc(sizeOfPath); + snprintf(localVarPath, sizeOfPath, "/pet"); + + + + + // Body Param + cJSON *localVarSingleItemJSON_body; + if (body != NULL) + { + //string + localVarSingleItemJSON_body = pet_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + } + list_addElement(localVarContentType,"application/json"); //consumes + list_addElement(localVarContentType,"application/xml"); //consumes + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + "PUT"); + + if (apiClient->response_code == 400) { + printf("%s\n","Invalid ID supplied"); + } + if (apiClient->response_code == 404) { + printf("%s\n","Pet not found"); + } + if (apiClient->response_code == 405) { + printf("%s\n","Validation exception"); + } + //No return type end: - if(apiClient->dataReceived) { - free(apiClient->dataReceived); - } - + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + } + + + + + list_free(localVarContentType); + free(localVarPath); + cJSON_Delete(localVarSingleItemJSON_body); + free(localVarBodyParameters); - - - list_free(localVarContentType); - free(localVarPath); - cJSON_Delete(localVarSingleItemJSON_body); - free(localVarBodyParameters); } // Updates a pet in the store with form data // -void PetAPI_updatePetWithForm(apiClient_t *apiClient, long petId, char *name, - char *status) { - list_t *localVarQueryParameters = NULL; - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = list_create(); - list_t *localVarHeaderType = NULL; - list_t *localVarContentType = list_create(); - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/pet/{petId}") + 1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/pet/{petId}"); - - - // Path Params - long sizeOfPathParams_petId = sizeof(petId) + 3 + strlen("{ petId }"); - if(petId == 0) { - goto end; - } - char *localVarToReplace_petId = malloc(sizeOfPathParams_petId); - snprintf(localVarToReplace_petId, sizeOfPathParams_petId, "{%s}", - "petId"); - - char localVarBuff_petId[256]; - intToStr(localVarBuff_petId, petId); - - localVarPath = strReplace(localVarPath, localVarToReplace_petId, - localVarBuff_petId); - - - - - // form parameters - char *keyForm_name; - char *valueForm_name; - keyValuePair_t *keyPairForm_name = 0; - if(name != NULL) { - keyForm_name = strdup("name"); - valueForm_name = strdup((name)); - keyPairForm_name = keyValuePair_create(keyForm_name, - valueForm_name); - list_addElement(localVarFormParameters, keyPairForm_name); - } - - // form parameters - char *keyForm_status; - char *valueForm_status; - keyValuePair_t *keyPairForm_status = 0; - if(status != NULL) { - keyForm_status = strdup("status"); - valueForm_status = strdup((status)); - keyPairForm_status = keyValuePair_create(keyForm_status, - valueForm_status); - list_addElement(localVarFormParameters, keyPairForm_status); - } - list_addElement(localVarContentType, - "application/x-www-form-urlencoded"); // consumes - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "POST"); - - if(apiClient->response_code == 405) { - printf("%s\n", "Invalid input"); - } - // No return type +void +PetAPI_updatePetWithForm(apiClient_t *apiClient ,long petId ,char * name ,char * status) +{ + list_t *localVarQueryParameters = NULL; + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = list_create(); + list_t *localVarHeaderType = NULL; + list_t *localVarContentType = list_create(); + char *localVarBodyParameters = NULL; + + // create the path + long sizeOfPath = strlen("/pet/{petId}")+1; + char *localVarPath = malloc(sizeOfPath); + snprintf(localVarPath, sizeOfPath, "/pet/{petId}"); + + + // Path Params + long sizeOfPathParams_petId = sizeof(petId)+3 + strlen("{ petId }"); + if(petId == 0){ + goto end; + } + char* localVarToReplace_petId = malloc(sizeOfPathParams_petId); + snprintf(localVarToReplace_petId, sizeOfPathParams_petId, "{%s}", "petId"); + + char localVarBuff_petId[256]; + intToStr(localVarBuff_petId, petId); + + localVarPath = strReplace(localVarPath, localVarToReplace_petId, localVarBuff_petId); + + + + + // form parameters + char *keyForm_name; + char * valueForm_name; + keyValuePair_t *keyPairForm_name = 0; + if (name != NULL) + { + keyForm_name = strdup("name"); + valueForm_name = strdup((name)); + keyPairForm_name = keyValuePair_create(keyForm_name,valueForm_name); + list_addElement(localVarFormParameters,keyPairForm_name); + } + + // form parameters + char *keyForm_status; + char * valueForm_status; + keyValuePair_t *keyPairForm_status = 0; + if (status != NULL) + { + keyForm_status = strdup("status"); + valueForm_status = strdup((status)); + keyPairForm_status = keyValuePair_create(keyForm_status,valueForm_status); + list_addElement(localVarFormParameters,keyPairForm_status); + } + list_addElement(localVarContentType,"application/x-www-form-urlencoded"); //consumes + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + "POST"); + + if (apiClient->response_code == 405) { + printf("%s\n","Invalid input"); + } + //No return type end: - if(apiClient->dataReceived) { - free(apiClient->dataReceived); - } - - - list_free(localVarFormParameters); - - list_free(localVarContentType); - free(localVarPath); - free(localVarToReplace_petId); - free(keyForm_name); - free(valueForm_name); - keyValuePair_free(keyPairForm_name); - free(keyForm_status); - free(valueForm_status); - keyValuePair_free(keyPairForm_status); + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + } + + + list_free(localVarFormParameters); + + list_free(localVarContentType); + free(localVarPath); + free(localVarToReplace_petId); + free(keyForm_name); + free(valueForm_name); + keyValuePair_free(keyPairForm_name); + free(keyForm_status); + free(valueForm_status); + keyValuePair_free(keyPairForm_status); + } // uploads an image // -api_response_t *PetAPI_uploadFile(apiClient_t *apiClient, long petId, - char *additionalMetadata, binary_t *file) { - list_t *localVarQueryParameters = NULL; - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = list_create(); - list_t *localVarHeaderType = list_create(); - list_t *localVarContentType = list_create(); - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/pet/{petId}/uploadImage") + 1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/pet/{petId}/uploadImage"); - - - // Path Params - long sizeOfPathParams_petId = sizeof(petId) + 3 + strlen("{ petId }"); - if(petId == 0) { - goto end; - } - char *localVarToReplace_petId = malloc(sizeOfPathParams_petId); - snprintf(localVarToReplace_petId, sizeOfPathParams_petId, "{%s}", - "petId"); - - char localVarBuff_petId[256]; - intToStr(localVarBuff_petId, petId); - - localVarPath = strReplace(localVarPath, localVarToReplace_petId, - localVarBuff_petId); - - - - - // form parameters - char *keyForm_additionalMetadata; - char *valueForm_additionalMetadata; - keyValuePair_t *keyPairForm_additionalMetadata = 0; - if(additionalMetadata != NULL) { - keyForm_additionalMetadata = strdup("additionalMetadata"); - valueForm_additionalMetadata = strdup((additionalMetadata)); - keyPairForm_additionalMetadata = keyValuePair_create( - keyForm_additionalMetadata, - valueForm_additionalMetadata); - list_addElement(localVarFormParameters, - keyPairForm_additionalMetadata); - } - - // form parameters - char *keyForm_file; - binary_t *valueForm_file; - keyValuePair_t *keyPairForm_file = 0; - if(file != NULL) { - keyForm_file = strdup("file"); - valueForm_file = file; - keyPairForm_file = keyValuePair_create(keyForm_file, - &valueForm_file); - list_addElement(localVarFormParameters, keyPairForm_file); // file adding - } - list_addElement(localVarHeaderType, "application/json"); // produces - list_addElement(localVarContentType, "multipart/form-data"); // consumes - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "POST"); - - if(apiClient->response_code == 200) { - printf("%s\n", "successful operation"); - } - // nonprimitive not container - cJSON *PetAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - api_response_t *elementToReturn = api_response_parseFromJSON( - PetAPIlocalVarJSON); +api_response_t* +PetAPI_uploadFile(apiClient_t *apiClient ,long petId ,char * additionalMetadata ,binary_t* file) +{ + list_t *localVarQueryParameters = NULL; + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = list_create(); + list_t *localVarHeaderType = list_create(); + list_t *localVarContentType = list_create(); + char *localVarBodyParameters = NULL; + + // create the path + long sizeOfPath = strlen("/pet/{petId}/uploadImage")+1; + char *localVarPath = malloc(sizeOfPath); + snprintf(localVarPath, sizeOfPath, "/pet/{petId}/uploadImage"); + + + // Path Params + long sizeOfPathParams_petId = sizeof(petId)+3 + strlen("{ petId }"); + if(petId == 0){ + goto end; + } + char* localVarToReplace_petId = malloc(sizeOfPathParams_petId); + snprintf(localVarToReplace_petId, sizeOfPathParams_petId, "{%s}", "petId"); + + char localVarBuff_petId[256]; + intToStr(localVarBuff_petId, petId); + + localVarPath = strReplace(localVarPath, localVarToReplace_petId, localVarBuff_petId); + + + + + // form parameters + char *keyForm_additionalMetadata; + char * valueForm_additionalMetadata; + keyValuePair_t *keyPairForm_additionalMetadata = 0; + if (additionalMetadata != NULL) + { + keyForm_additionalMetadata = strdup("additionalMetadata"); + valueForm_additionalMetadata = strdup((additionalMetadata)); + keyPairForm_additionalMetadata = keyValuePair_create(keyForm_additionalMetadata,valueForm_additionalMetadata); + list_addElement(localVarFormParameters,keyPairForm_additionalMetadata); + } + + // form parameters + char *keyForm_file; + binary_t* valueForm_file; + keyValuePair_t *keyPairForm_file = 0; + if (file != NULL) + { + keyForm_file = strdup("file"); + valueForm_file = file; + keyPairForm_file = keyValuePair_create(keyForm_file, &valueForm_file); + list_addElement(localVarFormParameters,keyPairForm_file); //file adding + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarContentType,"multipart/form-data"); //consumes + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + "POST"); + + if (apiClient->response_code == 200) { + printf("%s\n","successful operation"); + } + //nonprimitive not container + cJSON *PetAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + api_response_t *elementToReturn = api_response_parseFromJSON(PetAPIlocalVarJSON); cJSON_Delete(PetAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - // return type - if(apiClient->dataReceived) { - free(apiClient->dataReceived); - } - - - list_free(localVarFormParameters); - list_free(localVarHeaderType); - list_free(localVarContentType); - free(localVarPath); - free(localVarToReplace_petId); - free(keyForm_additionalMetadata); - free(valueForm_additionalMetadata); - free(keyPairForm_additionalMetadata); - free(keyForm_file); -// free(fileVar_file->data); -// free(fileVar_file); - free(keyPairForm_file); - return elementToReturn; + if(elementToReturn == NULL) { + // return 0; + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + } + + + list_free(localVarFormParameters); + list_free(localVarHeaderType); + list_free(localVarContentType); + free(localVarPath); + free(localVarToReplace_petId); + free(keyForm_additionalMetadata); + free(valueForm_additionalMetadata); + free(keyPairForm_additionalMetadata); + free(keyForm_file); +// free(fileVar_file->data); +// free(fileVar_file); + free(keyPairForm_file); + return elementToReturn; end: - return NULL; + return NULL; + } + diff --git a/samples/client/petstore/c/api/PetAPI.h b/samples/client/petstore/c/api/PetAPI.h index be1693168a19..5cb6c9de2c65 100644 --- a/samples/client/petstore/c/api/PetAPI.h +++ b/samples/client/petstore/c/api/PetAPI.h @@ -10,47 +10,55 @@ // Add a new pet to the store // -void PetAPI_addPet(apiClient_t *apiClient, pet_t *body); +void +PetAPI_addPet(apiClient_t *apiClient ,pet_t * body); // Deletes a pet // -void PetAPI_deletePet(apiClient_t *apiClient, long petId, char *api_key); +void +PetAPI_deletePet(apiClient_t *apiClient ,long petId ,char * api_key); // Finds Pets by status // // Multiple status values can be provided with comma separated strings // -list_t *PetAPI_findPetsByStatus(apiClient_t *apiClient, list_t *status); +list_t* +PetAPI_findPetsByStatus(apiClient_t *apiClient ,list_t * status); // Finds Pets by tags // // Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. // -list_t *PetAPI_findPetsByTags(apiClient_t *apiClient, list_t *tags); +list_t* +PetAPI_findPetsByTags(apiClient_t *apiClient ,list_t * tags); // Find pet by ID // // Returns a single pet // -pet_t *PetAPI_getPetById(apiClient_t *apiClient, long petId); +pet_t* +PetAPI_getPetById(apiClient_t *apiClient ,long petId); // Update an existing pet // -void PetAPI_updatePet(apiClient_t *apiClient, pet_t *body); +void +PetAPI_updatePet(apiClient_t *apiClient ,pet_t * body); // Updates a pet in the store with form data // -void PetAPI_updatePetWithForm(apiClient_t *apiClient, long petId, char *name, - char *status); +void +PetAPI_updatePetWithForm(apiClient_t *apiClient ,long petId ,char * name ,char * status); // uploads an image // -api_response_t *PetAPI_uploadFile(apiClient_t *apiClient, long petId, - char *additionalMetadata, binary_t *file); +api_response_t* +PetAPI_uploadFile(apiClient_t *apiClient ,long petId ,char * additionalMetadata ,binary_t* file); + + diff --git a/samples/client/petstore/c/api/StoreAPI.c b/samples/client/petstore/c/api/StoreAPI.c index d1269274a845..0a4a3a37fedb 100644 --- a/samples/client/petstore/c/api/StoreAPI.c +++ b/samples/client/petstore/c/api/StoreAPI.c @@ -6,277 +6,283 @@ #define MAX_BUFFER_LENGTH 4096 #define intToStr(dst, src) \ - do { \ - char dst[256]; \ - snprintf(dst, 256, "%ld", (long int) (src)); \ - } while(0) + do {\ + char dst[256];\ + snprintf(dst, 256, "%ld", (long int)(src));\ +}while(0) // Delete purchase order by ID // // For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors // -void StoreAPI_deleteOrder(apiClient_t *apiClient, char *orderId) { - list_t *localVarQueryParameters = NULL; - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = NULL; - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/store/order/{orderId}") + 1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/store/order/{orderId}"); - - - // Path Params - long sizeOfPathParams_orderId = strlen(orderId) + 3 + strlen( - "{ orderId }"); - if(orderId == NULL) { - goto end; - } - char *localVarToReplace_orderId = malloc(sizeOfPathParams_orderId); - sprintf(localVarToReplace_orderId, "{%s}", "orderId"); - - localVarPath = strReplace(localVarPath, localVarToReplace_orderId, - orderId); - - - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "DELETE"); - - if(apiClient->response_code == 400) { - printf("%s\n", "Invalid ID supplied"); - } - if(apiClient->response_code == 404) { - printf("%s\n", "Order not found"); - } - // No return type +void +StoreAPI_deleteOrder(apiClient_t *apiClient ,char * orderId) +{ + list_t *localVarQueryParameters = NULL; + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = NULL; + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + + // create the path + long sizeOfPath = strlen("/store/order/{orderId}")+1; + char *localVarPath = malloc(sizeOfPath); + snprintf(localVarPath, sizeOfPath, "/store/order/{orderId}"); + + + // Path Params + long sizeOfPathParams_orderId = strlen(orderId)+3 + strlen("{ orderId }"); + if(orderId == NULL) { + goto end; + } + char* localVarToReplace_orderId = malloc(sizeOfPathParams_orderId); + sprintf(localVarToReplace_orderId, "{%s}", "orderId"); + + localVarPath = strReplace(localVarPath, localVarToReplace_orderId, orderId); + + + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + "DELETE"); + + if (apiClient->response_code == 400) { + printf("%s\n","Invalid ID supplied"); + } + if (apiClient->response_code == 404) { + printf("%s\n","Order not found"); + } + //No return type end: - if(apiClient->dataReceived) { - free(apiClient->dataReceived); - } + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + } + + + + + + free(localVarPath); + free(localVarToReplace_orderId); - - - - - free(localVarPath); - free(localVarToReplace_orderId); } // Returns pet inventories by status // // Returns a map of status codes to quantities // -list_t *StoreAPI_getInventory(apiClient_t *apiClient) { - list_t *localVarQueryParameters = NULL; - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_create(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/store/inventory") + 1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/store/inventory"); - - - - list_addElement(localVarHeaderType, "application/json"); // produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - - if(apiClient->response_code == 200) { - printf("%s\n", "successful operation"); - } - // primitive reutrn type not simple - cJSON *localVarJSON = cJSON_Parse(apiClient->dataReceived); - cJSON *VarJSON; - list_t *elementToReturn = list_create(); - cJSON_ArrayForEach(VarJSON, localVarJSON) { - keyValuePair_t *keyPair = - keyValuePair_create(strdup(VarJSON->string), cJSON_Print( - VarJSON)); - list_addElement(elementToReturn, keyPair); - } - cJSON_Delete(localVarJSON); - - if(apiClient->dataReceived) { - free(apiClient->dataReceived); - } - - - - list_free(localVarHeaderType); - - free(localVarPath); - return elementToReturn; +list_t* +StoreAPI_getInventory(apiClient_t *apiClient) +{ + list_t *localVarQueryParameters = NULL; + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_create(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + + // create the path + long sizeOfPath = strlen("/store/inventory")+1; + char *localVarPath = malloc(sizeOfPath); + snprintf(localVarPath, sizeOfPath, "/store/inventory"); + + + + list_addElement(localVarHeaderType,"application/json"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + "GET"); + + if (apiClient->response_code == 200) { + printf("%s\n","successful operation"); + } + //primitive reutrn type not simple + cJSON *localVarJSON = cJSON_Parse(apiClient->dataReceived); + cJSON *VarJSON; + list_t *elementToReturn = list_create(); + cJSON_ArrayForEach(VarJSON, localVarJSON){ + keyValuePair_t *keyPair = keyValuePair_create(strdup(VarJSON->string), cJSON_Print(VarJSON)); + list_addElement(elementToReturn, keyPair); + } + cJSON_Delete(localVarJSON); + + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + } + + + + list_free(localVarHeaderType); + + free(localVarPath); + return elementToReturn; end: - return NULL; + return NULL; + } // Find purchase order by ID // // For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions // -order_t *StoreAPI_getOrderById(apiClient_t *apiClient, long orderId) { - list_t *localVarQueryParameters = NULL; - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_create(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/store/order/{orderId}") + 1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/store/order/{orderId}"); - - - // Path Params - long sizeOfPathParams_orderId = sizeof(orderId) + 3 + strlen( - "{ orderId }"); - if(orderId == 0) { - goto end; - } - char *localVarToReplace_orderId = malloc(sizeOfPathParams_orderId); - snprintf(localVarToReplace_orderId, sizeOfPathParams_orderId, "{%s}", - "orderId"); - - char localVarBuff_orderId[256]; - intToStr(localVarBuff_orderId, orderId); - - localVarPath = strReplace(localVarPath, localVarToReplace_orderId, - localVarBuff_orderId); - - - - list_addElement(localVarHeaderType, "application/xml"); // produces - list_addElement(localVarHeaderType, "application/json"); // produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - - if(apiClient->response_code == 200) { - printf("%s\n", "successful operation"); - } - if(apiClient->response_code == 400) { - printf("%s\n", "Invalid ID supplied"); - } - if(apiClient->response_code == 404) { - printf("%s\n", "Order not found"); - } - // nonprimitive not container - cJSON *StoreAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - order_t *elementToReturn = order_parseFromJSON(StoreAPIlocalVarJSON); +order_t* +StoreAPI_getOrderById(apiClient_t *apiClient ,long orderId) +{ + list_t *localVarQueryParameters = NULL; + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_create(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + + // create the path + long sizeOfPath = strlen("/store/order/{orderId}")+1; + char *localVarPath = malloc(sizeOfPath); + snprintf(localVarPath, sizeOfPath, "/store/order/{orderId}"); + + + // Path Params + long sizeOfPathParams_orderId = sizeof(orderId)+3 + strlen("{ orderId }"); + if(orderId == 0){ + goto end; + } + char* localVarToReplace_orderId = malloc(sizeOfPathParams_orderId); + snprintf(localVarToReplace_orderId, sizeOfPathParams_orderId, "{%s}", "orderId"); + + char localVarBuff_orderId[256]; + intToStr(localVarBuff_orderId, orderId); + + localVarPath = strReplace(localVarPath, localVarToReplace_orderId, localVarBuff_orderId); + + + + list_addElement(localVarHeaderType,"application/xml"); //produces + list_addElement(localVarHeaderType,"application/json"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + "GET"); + + if (apiClient->response_code == 200) { + printf("%s\n","successful operation"); + } + if (apiClient->response_code == 400) { + printf("%s\n","Invalid ID supplied"); + } + if (apiClient->response_code == 404) { + printf("%s\n","Order not found"); + } + //nonprimitive not container + cJSON *StoreAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + order_t *elementToReturn = order_parseFromJSON(StoreAPIlocalVarJSON); cJSON_Delete(StoreAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - // return type - if(apiClient->dataReceived) { - free(apiClient->dataReceived); - } - - - - list_free(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace_orderId); - return elementToReturn; + if(elementToReturn == NULL) { + // return 0; + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + } + + + + list_free(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_orderId); + return elementToReturn; end: - return NULL; + return NULL; + } // Place an order for a pet // -order_t *StoreAPI_placeOrder(apiClient_t *apiClient, order_t *body) { - list_t *localVarQueryParameters = NULL; - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_create(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/store/order") + 1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/store/order"); - - - - - // Body Param - cJSON *localVarSingleItemJSON_body; - if(body != NULL) { - // string - localVarSingleItemJSON_body = order_convertToJSON(body); - localVarBodyParameters = - cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType, "application/xml"); // produces - list_addElement(localVarHeaderType, "application/json"); // produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "POST"); - - if(apiClient->response_code == 200) { - printf("%s\n", "successful operation"); - } - if(apiClient->response_code == 400) { - printf("%s\n", "Invalid Order"); - } - // nonprimitive not container - cJSON *StoreAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - order_t *elementToReturn = order_parseFromJSON(StoreAPIlocalVarJSON); +order_t* +StoreAPI_placeOrder(apiClient_t *apiClient ,order_t * body) +{ + list_t *localVarQueryParameters = NULL; + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_create(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + + // create the path + long sizeOfPath = strlen("/store/order")+1; + char *localVarPath = malloc(sizeOfPath); + snprintf(localVarPath, sizeOfPath, "/store/order"); + + + + + // Body Param + cJSON *localVarSingleItemJSON_body; + if (body != NULL) + { + //string + localVarSingleItemJSON_body = order_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + } + list_addElement(localVarHeaderType,"application/xml"); //produces + list_addElement(localVarHeaderType,"application/json"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + "POST"); + + if (apiClient->response_code == 200) { + printf("%s\n","successful operation"); + } + if (apiClient->response_code == 400) { + printf("%s\n","Invalid Order"); + } + //nonprimitive not container + cJSON *StoreAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + order_t *elementToReturn = order_parseFromJSON(StoreAPIlocalVarJSON); cJSON_Delete(StoreAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - // return type - if(apiClient->dataReceived) { - free(apiClient->dataReceived); - } - - - - list_free(localVarHeaderType); - - free(localVarPath); - cJSON_Delete(localVarSingleItemJSON_body); - free(localVarBodyParameters); - return elementToReturn; + if(elementToReturn == NULL) { + // return 0; + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + } + + + + list_free(localVarHeaderType); + + free(localVarPath); + cJSON_Delete(localVarSingleItemJSON_body); + free(localVarBodyParameters); + return elementToReturn; end: - return NULL; + return NULL; + } + diff --git a/samples/client/petstore/c/api/StoreAPI.h b/samples/client/petstore/c/api/StoreAPI.h index 81d68528f1f0..cba13a977d55 100644 --- a/samples/client/petstore/c/api/StoreAPI.h +++ b/samples/client/petstore/c/api/StoreAPI.h @@ -11,23 +11,29 @@ // // For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors // -void StoreAPI_deleteOrder(apiClient_t *apiClient, char *orderId); +void +StoreAPI_deleteOrder(apiClient_t *apiClient ,char * orderId); // Returns pet inventories by status // // Returns a map of status codes to quantities // -list_t *StoreAPI_getInventory(apiClient_t *apiClient); +list_t* +StoreAPI_getInventory(apiClient_t *apiClient); // Find purchase order by ID // // For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions // -order_t *StoreAPI_getOrderById(apiClient_t *apiClient, long orderId); +order_t* +StoreAPI_getOrderById(apiClient_t *apiClient ,long orderId); // Place an order for a pet // -order_t *StoreAPI_placeOrder(apiClient_t *apiClient, order_t *body); +order_t* +StoreAPI_placeOrder(apiClient_t *apiClient ,order_t * body); + + diff --git a/samples/client/petstore/c/api/UserAPI.c b/samples/client/petstore/c/api/UserAPI.c index ae618b886961..1656b4472bcd 100644 --- a/samples/client/petstore/c/api/UserAPI.c +++ b/samples/client/petstore/c/api/UserAPI.c @@ -6,546 +6,566 @@ #define MAX_BUFFER_LENGTH 4096 #define intToStr(dst, src) \ - do { \ - char dst[256]; \ - snprintf(dst, 256, "%ld", (long int) (src)); \ - } while(0) + do {\ + char dst[256];\ + snprintf(dst, 256, "%ld", (long int)(src));\ +}while(0) // Create user // // This can only be done by the logged in user. // -void UserAPI_createUser(apiClient_t *apiClient, user_t *body) { - list_t *localVarQueryParameters = NULL; - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = NULL; - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/user") + 1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/user"); - - - - - // Body Param - cJSON *localVarSingleItemJSON_body; - if(body != NULL) { - // string - localVarSingleItemJSON_body = user_convertToJSON(body); - localVarBodyParameters = - cJSON_Print(localVarSingleItemJSON_body); - } - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "POST"); - - if(apiClient->response_code == 0) { - printf("%s\n", "successful operation"); - } - // No return type +void +UserAPI_createUser(apiClient_t *apiClient ,user_t * body) +{ + list_t *localVarQueryParameters = NULL; + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = NULL; + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + + // create the path + long sizeOfPath = strlen("/user")+1; + char *localVarPath = malloc(sizeOfPath); + snprintf(localVarPath, sizeOfPath, "/user"); + + + + + // Body Param + cJSON *localVarSingleItemJSON_body; + if (body != NULL) + { + //string + localVarSingleItemJSON_body = user_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + } + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + "POST"); + + if (apiClient->response_code == 0) { + printf("%s\n","successful operation"); + } + //No return type end: - if(apiClient->dataReceived) { - free(apiClient->dataReceived); - } + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + } + + + + + + free(localVarPath); + cJSON_Delete(localVarSingleItemJSON_body); + free(localVarBodyParameters); - - - - - free(localVarPath); - cJSON_Delete(localVarSingleItemJSON_body); - free(localVarBodyParameters); } // Creates list of users with given input array // -void UserAPI_createUsersWithArrayInput(apiClient_t *apiClient, list_t *body) { - list_t *localVarQueryParameters = NULL; - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = NULL; - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/user/createWithArray") + 1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/user/createWithArray"); - - - - - // Body Param - // notstring - cJSON *localVar_body; - cJSON *localVarItemJSON_body; - cJSON *localVarSingleItemJSON_body; - if(body != NULL) { - localVarItemJSON_body = cJSON_CreateObject(); - localVarSingleItemJSON_body = cJSON_AddArrayToObject( - localVarItemJSON_body, "body"); - if(localVarSingleItemJSON_body == NULL) { - // nonprimitive container - - goto end; - } - } - - listEntry_t *bodyBodyListEntry; - list_ForEach(bodyBodyListEntry, body) - { - localVar_body = user_convertToJSON(bodyBodyListEntry->data); - if(localVar_body == NULL) { - goto end; - } - cJSON_AddItemToArray(localVarSingleItemJSON_body, - localVar_body); - localVarBodyParameters = cJSON_Print(localVarItemJSON_body); - } - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "POST"); - - if(apiClient->response_code == 0) { - printf("%s\n", "successful operation"); - } - // No return type +void +UserAPI_createUsersWithArrayInput(apiClient_t *apiClient ,list_t * body) +{ + list_t *localVarQueryParameters = NULL; + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = NULL; + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + + // create the path + long sizeOfPath = strlen("/user/createWithArray")+1; + char *localVarPath = malloc(sizeOfPath); + snprintf(localVarPath, sizeOfPath, "/user/createWithArray"); + + + + + // Body Param + //notstring + cJSON *localVar_body; + cJSON *localVarItemJSON_body; + cJSON *localVarSingleItemJSON_body; + if (body != NULL) + { + localVarItemJSON_body = cJSON_CreateObject(); + localVarSingleItemJSON_body = cJSON_AddArrayToObject(localVarItemJSON_body, "body"); + if (localVarSingleItemJSON_body == NULL) + { + // nonprimitive container + + goto end; + } + } + + listEntry_t *bodyBodyListEntry; + list_ForEach(bodyBodyListEntry, body) + { + localVar_body = user_convertToJSON(bodyBodyListEntry->data); + if(localVar_body == NULL) + { + goto end; + } + cJSON_AddItemToArray(localVarSingleItemJSON_body, localVar_body); + localVarBodyParameters = cJSON_Print(localVarItemJSON_body); + } + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + "POST"); + + if (apiClient->response_code == 0) { + printf("%s\n","successful operation"); + } + //No return type end: - if(apiClient->dataReceived) { - free(apiClient->dataReceived); - } - - - - + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + } + + + + + + free(localVarPath); + cJSON_Delete(localVarItemJSON_body); + cJSON_Delete(localVarSingleItemJSON_body); + cJSON_Delete(localVar_body); + free(localVarBodyParameters); - free(localVarPath); - cJSON_Delete(localVarItemJSON_body); - cJSON_Delete(localVarSingleItemJSON_body); - cJSON_Delete(localVar_body); - free(localVarBodyParameters); } // Creates list of users with given input array // -void UserAPI_createUsersWithListInput(apiClient_t *apiClient, list_t *body) { - list_t *localVarQueryParameters = NULL; - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = NULL; - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/user/createWithList") + 1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/user/createWithList"); - - - - - // Body Param - // notstring - cJSON *localVar_body; - cJSON *localVarItemJSON_body; - cJSON *localVarSingleItemJSON_body; - if(body != NULL) { - localVarItemJSON_body = cJSON_CreateObject(); - localVarSingleItemJSON_body = cJSON_AddArrayToObject( - localVarItemJSON_body, "body"); - if(localVarSingleItemJSON_body == NULL) { - // nonprimitive container - - goto end; - } - } - - listEntry_t *bodyBodyListEntry; - list_ForEach(bodyBodyListEntry, body) - { - localVar_body = user_convertToJSON(bodyBodyListEntry->data); - if(localVar_body == NULL) { - goto end; - } - cJSON_AddItemToArray(localVarSingleItemJSON_body, - localVar_body); - localVarBodyParameters = cJSON_Print(localVarItemJSON_body); - } - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "POST"); - - if(apiClient->response_code == 0) { - printf("%s\n", "successful operation"); - } - // No return type +void +UserAPI_createUsersWithListInput(apiClient_t *apiClient ,list_t * body) +{ + list_t *localVarQueryParameters = NULL; + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = NULL; + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + + // create the path + long sizeOfPath = strlen("/user/createWithList")+1; + char *localVarPath = malloc(sizeOfPath); + snprintf(localVarPath, sizeOfPath, "/user/createWithList"); + + + + + // Body Param + //notstring + cJSON *localVar_body; + cJSON *localVarItemJSON_body; + cJSON *localVarSingleItemJSON_body; + if (body != NULL) + { + localVarItemJSON_body = cJSON_CreateObject(); + localVarSingleItemJSON_body = cJSON_AddArrayToObject(localVarItemJSON_body, "body"); + if (localVarSingleItemJSON_body == NULL) + { + // nonprimitive container + + goto end; + } + } + + listEntry_t *bodyBodyListEntry; + list_ForEach(bodyBodyListEntry, body) + { + localVar_body = user_convertToJSON(bodyBodyListEntry->data); + if(localVar_body == NULL) + { + goto end; + } + cJSON_AddItemToArray(localVarSingleItemJSON_body, localVar_body); + localVarBodyParameters = cJSON_Print(localVarItemJSON_body); + } + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + "POST"); + + if (apiClient->response_code == 0) { + printf("%s\n","successful operation"); + } + //No return type end: - if(apiClient->dataReceived) { - free(apiClient->dataReceived); - } + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + } + + + + + + free(localVarPath); + cJSON_Delete(localVarItemJSON_body); + cJSON_Delete(localVarSingleItemJSON_body); + cJSON_Delete(localVar_body); + free(localVarBodyParameters); - - - - - free(localVarPath); - cJSON_Delete(localVarItemJSON_body); - cJSON_Delete(localVarSingleItemJSON_body); - cJSON_Delete(localVar_body); - free(localVarBodyParameters); } // Delete user // // This can only be done by the logged in user. // -void UserAPI_deleteUser(apiClient_t *apiClient, char *username) { - list_t *localVarQueryParameters = NULL; - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = NULL; - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/user/{username}") + 1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/user/{username}"); - - - // Path Params - long sizeOfPathParams_username = strlen(username) + 3 + strlen( - "{ username }"); - if(username == NULL) { - goto end; - } - char *localVarToReplace_username = malloc(sizeOfPathParams_username); - sprintf(localVarToReplace_username, "{%s}", "username"); - - localVarPath = strReplace(localVarPath, localVarToReplace_username, - username); - - - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "DELETE"); - - if(apiClient->response_code == 400) { - printf("%s\n", "Invalid username supplied"); - } - if(apiClient->response_code == 404) { - printf("%s\n", "User not found"); - } - // No return type +void +UserAPI_deleteUser(apiClient_t *apiClient ,char * username) +{ + list_t *localVarQueryParameters = NULL; + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = NULL; + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + + // create the path + long sizeOfPath = strlen("/user/{username}")+1; + char *localVarPath = malloc(sizeOfPath); + snprintf(localVarPath, sizeOfPath, "/user/{username}"); + + + // Path Params + long sizeOfPathParams_username = strlen(username)+3 + strlen("{ username }"); + if(username == NULL) { + goto end; + } + char* localVarToReplace_username = malloc(sizeOfPathParams_username); + sprintf(localVarToReplace_username, "{%s}", "username"); + + localVarPath = strReplace(localVarPath, localVarToReplace_username, username); + + + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + "DELETE"); + + if (apiClient->response_code == 400) { + printf("%s\n","Invalid username supplied"); + } + if (apiClient->response_code == 404) { + printf("%s\n","User not found"); + } + //No return type end: - if(apiClient->dataReceived) { - free(apiClient->dataReceived); - } - - - - + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + } + + + + + + free(localVarPath); + free(localVarToReplace_username); - free(localVarPath); - free(localVarToReplace_username); } // Get user by user name // -user_t *UserAPI_getUserByName(apiClient_t *apiClient, char *username) { - list_t *localVarQueryParameters = NULL; - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_create(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/user/{username}") + 1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/user/{username}"); - - - // Path Params - long sizeOfPathParams_username = strlen(username) + 3 + strlen( - "{ username }"); - if(username == NULL) { - goto end; - } - char *localVarToReplace_username = malloc(sizeOfPathParams_username); - sprintf(localVarToReplace_username, "{%s}", "username"); - - localVarPath = strReplace(localVarPath, localVarToReplace_username, - username); - - - list_addElement(localVarHeaderType, "application/xml"); // produces - list_addElement(localVarHeaderType, "application/json"); // produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - - if(apiClient->response_code == 200) { - printf("%s\n", "successful operation"); - } - if(apiClient->response_code == 400) { - printf("%s\n", "Invalid username supplied"); - } - if(apiClient->response_code == 404) { - printf("%s\n", "User not found"); - } - // nonprimitive not container - cJSON *UserAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - user_t *elementToReturn = user_parseFromJSON(UserAPIlocalVarJSON); +user_t* +UserAPI_getUserByName(apiClient_t *apiClient ,char * username) +{ + list_t *localVarQueryParameters = NULL; + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_create(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + + // create the path + long sizeOfPath = strlen("/user/{username}")+1; + char *localVarPath = malloc(sizeOfPath); + snprintf(localVarPath, sizeOfPath, "/user/{username}"); + + + // Path Params + long sizeOfPathParams_username = strlen(username)+3 + strlen("{ username }"); + if(username == NULL) { + goto end; + } + char* localVarToReplace_username = malloc(sizeOfPathParams_username); + sprintf(localVarToReplace_username, "{%s}", "username"); + + localVarPath = strReplace(localVarPath, localVarToReplace_username, username); + + + list_addElement(localVarHeaderType,"application/xml"); //produces + list_addElement(localVarHeaderType,"application/json"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + "GET"); + + if (apiClient->response_code == 200) { + printf("%s\n","successful operation"); + } + if (apiClient->response_code == 400) { + printf("%s\n","Invalid username supplied"); + } + if (apiClient->response_code == 404) { + printf("%s\n","User not found"); + } + //nonprimitive not container + cJSON *UserAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + user_t *elementToReturn = user_parseFromJSON(UserAPIlocalVarJSON); cJSON_Delete(UserAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - // return type - if(apiClient->dataReceived) { - free(apiClient->dataReceived); - } - - - - list_free(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace_username); - return elementToReturn; + if(elementToReturn == NULL) { + // return 0; + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + } + + + + list_free(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_username); + return elementToReturn; end: - return NULL; + return NULL; + } // Logs user into the system // -char *UserAPI_loginUser(apiClient_t *apiClient, char *username, - char *password) { - list_t *localVarQueryParameters = list_create(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_create(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/user/login") + 1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/user/login"); - - - - - // query parameters - char *keyQuery_username; - char *valueQuery_username; - keyValuePair_t *keyPairQuery_username = 0; - if(username) { - keyQuery_username = strdup("username"); - valueQuery_username = strdup((username)); - keyPairQuery_username = keyValuePair_create(keyQuery_username, - valueQuery_username); - list_addElement(localVarQueryParameters, keyPairQuery_username); - } - - // query parameters - char *keyQuery_password; - char *valueQuery_password; - keyValuePair_t *keyPairQuery_password = 0; - if(password) { - keyQuery_password = strdup("password"); - valueQuery_password = strdup((password)); - keyPairQuery_password = keyValuePair_create(keyQuery_password, - valueQuery_password); - list_addElement(localVarQueryParameters, keyPairQuery_password); - } - list_addElement(localVarHeaderType, "application/xml"); // produces - list_addElement(localVarHeaderType, "application/json"); // produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - - if(apiClient->response_code == 200) { - printf("%s\n", "successful operation"); - } - if(apiClient->response_code == 400) { - printf("%s\n", "Invalid username/password supplied"); - } - // primitive reutrn type simple - char *elementToReturn = strdup((char *) apiClient->dataReceived); - - if(apiClient->dataReceived) { - free(apiClient->dataReceived); - } - list_free(localVarQueryParameters); - - - list_free(localVarHeaderType); - - free(localVarPath); - free(keyQuery_username); - free(valueQuery_username); - keyValuePair_free(keyPairQuery_username); - free(keyQuery_password); - free(valueQuery_password); - keyValuePair_free(keyPairQuery_password); - return elementToReturn; +char* +UserAPI_loginUser(apiClient_t *apiClient ,char * username ,char * password) +{ + list_t *localVarQueryParameters = list_create(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_create(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + + // create the path + long sizeOfPath = strlen("/user/login")+1; + char *localVarPath = malloc(sizeOfPath); + snprintf(localVarPath, sizeOfPath, "/user/login"); + + + + + // query parameters + char *keyQuery_username; + char * valueQuery_username; + keyValuePair_t *keyPairQuery_username = 0; + if (username) + { + keyQuery_username = strdup("username"); + valueQuery_username = strdup((username)); + keyPairQuery_username = keyValuePair_create(keyQuery_username, valueQuery_username); + list_addElement(localVarQueryParameters,keyPairQuery_username); + } + + // query parameters + char *keyQuery_password; + char * valueQuery_password; + keyValuePair_t *keyPairQuery_password = 0; + if (password) + { + keyQuery_password = strdup("password"); + valueQuery_password = strdup((password)); + keyPairQuery_password = keyValuePair_create(keyQuery_password, valueQuery_password); + list_addElement(localVarQueryParameters,keyPairQuery_password); + } + list_addElement(localVarHeaderType,"application/xml"); //produces + list_addElement(localVarHeaderType,"application/json"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + "GET"); + + if (apiClient->response_code == 200) { + printf("%s\n","successful operation"); + } + if (apiClient->response_code == 400) { + printf("%s\n","Invalid username/password supplied"); + } + //primitive reutrn type simple + char* elementToReturn = strdup((char*)apiClient->dataReceived); + + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + } + list_free(localVarQueryParameters); + + + list_free(localVarHeaderType); + + free(localVarPath); + free(keyQuery_username); + free(valueQuery_username); + keyValuePair_free(keyPairQuery_username); + free(keyQuery_password); + free(valueQuery_password); + keyValuePair_free(keyPairQuery_password); + return elementToReturn; end: - return NULL; + return NULL; + } // Logs out current logged in user session // -void UserAPI_logoutUser(apiClient_t *apiClient) { - list_t *localVarQueryParameters = NULL; - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = NULL; - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/user/logout") + 1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/user/logout"); - - - - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - - if(apiClient->response_code == 0) { - printf("%s\n", "successful operation"); - } - // No return type +void +UserAPI_logoutUser(apiClient_t *apiClient) +{ + list_t *localVarQueryParameters = NULL; + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = NULL; + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + + // create the path + long sizeOfPath = strlen("/user/logout")+1; + char *localVarPath = malloc(sizeOfPath); + snprintf(localVarPath, sizeOfPath, "/user/logout"); + + + + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + "GET"); + + if (apiClient->response_code == 0) { + printf("%s\n","successful operation"); + } + //No return type end: - if(apiClient->dataReceived) { - free(apiClient->dataReceived); - } - + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + } + + + + + + free(localVarPath); - - - - free(localVarPath); } // Updated user // // This can only be done by the logged in user. // -void UserAPI_updateUser(apiClient_t *apiClient, char *username, user_t *body) { - list_t *localVarQueryParameters = NULL; - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = NULL; - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/user/{username}") + 1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/user/{username}"); - - - // Path Params - long sizeOfPathParams_username = strlen(username) + 3 + strlen( - "{ username }"); - if(username == NULL) { - goto end; - } - char *localVarToReplace_username = malloc(sizeOfPathParams_username); - sprintf(localVarToReplace_username, "{%s}", "username"); - - localVarPath = strReplace(localVarPath, localVarToReplace_username, - username); - - - - // Body Param - cJSON *localVarSingleItemJSON_body; - if(body != NULL) { - // string - localVarSingleItemJSON_body = user_convertToJSON(body); - localVarBodyParameters = - cJSON_Print(localVarSingleItemJSON_body); - } - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "PUT"); - - if(apiClient->response_code == 400) { - printf("%s\n", "Invalid user supplied"); - } - if(apiClient->response_code == 404) { - printf("%s\n", "User not found"); - } - // No return type +void +UserAPI_updateUser(apiClient_t *apiClient ,char * username ,user_t * body) +{ + list_t *localVarQueryParameters = NULL; + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = NULL; + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + + // create the path + long sizeOfPath = strlen("/user/{username}")+1; + char *localVarPath = malloc(sizeOfPath); + snprintf(localVarPath, sizeOfPath, "/user/{username}"); + + + // Path Params + long sizeOfPathParams_username = strlen(username)+3 + strlen("{ username }"); + if(username == NULL) { + goto end; + } + char* localVarToReplace_username = malloc(sizeOfPathParams_username); + sprintf(localVarToReplace_username, "{%s}", "username"); + + localVarPath = strReplace(localVarPath, localVarToReplace_username, username); + + + + // Body Param + cJSON *localVarSingleItemJSON_body; + if (body != NULL) + { + //string + localVarSingleItemJSON_body = user_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + } + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + "PUT"); + + if (apiClient->response_code == 400) { + printf("%s\n","Invalid user supplied"); + } + if (apiClient->response_code == 404) { + printf("%s\n","User not found"); + } + //No return type end: - if(apiClient->dataReceived) { - free(apiClient->dataReceived); - } - + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + } + + + + + + free(localVarPath); + free(localVarToReplace_username); + cJSON_Delete(localVarSingleItemJSON_body); + free(localVarBodyParameters); - - - - free(localVarPath); - free(localVarToReplace_username); - cJSON_Delete(localVarSingleItemJSON_body); - free(localVarBodyParameters); } + diff --git a/samples/client/petstore/c/api/UserAPI.h b/samples/client/petstore/c/api/UserAPI.h index c9475c2e55d3..57f04a721940 100644 --- a/samples/client/petstore/c/api/UserAPI.h +++ b/samples/client/petstore/c/api/UserAPI.h @@ -11,43 +11,53 @@ // // This can only be done by the logged in user. // -void UserAPI_createUser(apiClient_t *apiClient, user_t *body); +void +UserAPI_createUser(apiClient_t *apiClient ,user_t * body); // Creates list of users with given input array // -void UserAPI_createUsersWithArrayInput(apiClient_t *apiClient, list_t *body); +void +UserAPI_createUsersWithArrayInput(apiClient_t *apiClient ,list_t * body); // Creates list of users with given input array // -void UserAPI_createUsersWithListInput(apiClient_t *apiClient, list_t *body); +void +UserAPI_createUsersWithListInput(apiClient_t *apiClient ,list_t * body); // Delete user // // This can only be done by the logged in user. // -void UserAPI_deleteUser(apiClient_t *apiClient, char *username); +void +UserAPI_deleteUser(apiClient_t *apiClient ,char * username); // Get user by user name // -user_t *UserAPI_getUserByName(apiClient_t *apiClient, char *username); +user_t* +UserAPI_getUserByName(apiClient_t *apiClient ,char * username); // Logs user into the system // -char *UserAPI_loginUser(apiClient_t *apiClient, char *username, char *password); +char* +UserAPI_loginUser(apiClient_t *apiClient ,char * username ,char * password); // Logs out current logged in user session // -void UserAPI_logoutUser(apiClient_t *apiClient); +void +UserAPI_logoutUser(apiClient_t *apiClient); // Updated user // // This can only be done by the logged in user. // -void UserAPI_updateUser(apiClient_t *apiClient, char *username, user_t *body); +void +UserAPI_updateUser(apiClient_t *apiClient ,char * username ,user_t * body); + + diff --git a/samples/client/petstore/c/external/cJSON.c b/samples/client/petstore/c/external/cJSON.c index 78b3ecfec6f9..cbdec4132f10 100644 --- a/samples/client/petstore/c/external/cJSON.c +++ b/samples/client/petstore/c/external/cJSON.c @@ -1,31 +1,30 @@ /* - Copyright (c) 2009-2017 Dave Gamble and cJSON contributors - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - */ + Copyright (c) 2009-2017 Dave Gamble and cJSON contributors + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +*/ /* cJSON */ /* JSON parser in C. */ /* disable warnings about old C89 functions in MSVC */ -#if !defined(_CRT_SECURE_NO_DEPRECATE) && \ - defined(_MSC_VER) +#if !defined(_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) #define _CRT_SECURE_NO_DEPRECATE #endif @@ -59,85 +58,85 @@ #include "cJSON.h" /* define our own boolean type */ -#define true ((cJSON_bool) 1) -#define false ((cJSON_bool) 0) +#define true ((cJSON_bool)1) +#define false ((cJSON_bool)0) typedef struct { - const unsigned char *json; - size_t position; + const unsigned char *json; + size_t position; } error; static error global_error = { NULL, 0 }; CJSON_PUBLIC(const char *) cJSON_GetErrorPtr(void) { - return (const char *) (global_error.json + global_error.position); + return (const char*) (global_error.json + global_error.position); } -CJSON_PUBLIC(char *) cJSON_GetStringValue(cJSON * item) { - if(!cJSON_IsString(item)) { - return NULL; - } +CJSON_PUBLIC(char *) cJSON_GetStringValue(cJSON *item) { + if (!cJSON_IsString(item)) { + return NULL; + } - return item->valuestring; + return item->valuestring; } /* This is a safeguard to prevent copy-pasters from using incompatible C and header files */ -#if (CJSON_VERSION_MAJOR != 1) || \ - (CJSON_VERSION_MINOR != 7) || \ - (CJSON_VERSION_PATCH != 7) - #error \ - cJSON.h and cJSON.c have different versions. Make sure that both have the same. +#if (CJSON_VERSION_MAJOR != 1) || (CJSON_VERSION_MINOR != 7) || (CJSON_VERSION_PATCH != 7) + #error cJSON.h and cJSON.c have different versions. Make sure that both have the same. #endif -CJSON_PUBLIC(const char *) cJSON_Version(void) +CJSON_PUBLIC(const char*) cJSON_Version(void) { - static char version[15]; - sprintf(version, "%i.%i.%i", CJSON_VERSION_MAJOR, CJSON_VERSION_MINOR, - CJSON_VERSION_PATCH); + static char version[15]; + sprintf(version, "%i.%i.%i", CJSON_VERSION_MAJOR, CJSON_VERSION_MINOR, CJSON_VERSION_PATCH); - return version; + return version; } /* Case insensitive string comparison, doesn't consider two NULL pointers equal though */ -static int case_insensitive_strcmp(const unsigned char *string1, - const unsigned char *string2) { - if((string1 == NULL) || - (string2 == NULL)) - { - return 1; - } - - if(string1 == string2) { - return 0; - } - - for( ; tolower(*string1) == tolower(*string2); - (void) string1++, string2++) - { - if(*string1 == '\0') { - return 0; - } - } - - return tolower(*string1) - tolower(*string2); -} - -typedef struct internal_hooks { - void *(*allocate)(size_t size); - void (*deallocate)(void *pointer); - void *(*reallocate)(void *pointer, size_t size); +static int case_insensitive_strcmp(const unsigned char *string1, const unsigned char *string2) +{ + if ((string1 == NULL) || (string2 == NULL)) + { + return 1; + } + + if (string1 == string2) + { + return 0; + } + + for(; tolower(*string1) == tolower(*string2); (void)string1++, string2++) + { + if (*string1 == '\0') + { + return 0; + } + } + + return tolower(*string1) - tolower(*string2); +} + +typedef struct internal_hooks +{ + void *(*allocate)(size_t size); + void (*deallocate)(void *pointer); + void *(*reallocate)(void *pointer, size_t size); } internal_hooks; #if defined(_MSC_VER) /* work around MSVC error C2322: '...' address of dillimport '...' is not static */ -static void *internal_malloc(size_t size) { - return malloc(size); +static void *internal_malloc(size_t size) +{ + return malloc(size); } -static void internal_free(void *pointer) { - free(pointer); +static void internal_free(void *pointer) +{ + free(pointer); } -static void *internal_realloc(void *pointer, size_t size) { - return realloc(pointer, size); +static void *internal_realloc(void *pointer, size_t size) +{ + return realloc(pointer, size); } #else #define internal_malloc malloc @@ -145,2711 +144,2789 @@ static void *internal_realloc(void *pointer, size_t size) { #define internal_realloc realloc #endif -static internal_hooks global_hooks = -{ internal_malloc, internal_free, internal_realloc }; +static internal_hooks global_hooks = { internal_malloc, internal_free, internal_realloc }; -static unsigned char *cJSON_strdup(const unsigned char *string, - const internal_hooks *const hooks) { - size_t length = 0; - unsigned char *copy = NULL; +static unsigned char* cJSON_strdup(const unsigned char* string, const internal_hooks * const hooks) +{ + size_t length = 0; + unsigned char *copy = NULL; - if(string == NULL) { - return NULL; - } + if (string == NULL) + { + return NULL; + } - length = strlen((const char *) string) + sizeof(""); - copy = (unsigned char *) hooks->allocate(length); - if(copy == NULL) { - return NULL; - } - memcpy(copy, string, length); + length = strlen((const char*)string) + sizeof(""); + copy = (unsigned char*)hooks->allocate(length); + if (copy == NULL) + { + return NULL; + } + memcpy(copy, string, length); - return copy; + return copy; } -CJSON_PUBLIC(void) cJSON_InitHooks(cJSON_Hooks * hooks) +CJSON_PUBLIC(void) cJSON_InitHooks(cJSON_Hooks* hooks) { - if(hooks == NULL) { - /* Reset hooks */ - global_hooks.allocate = malloc; - global_hooks.deallocate = free; - global_hooks.reallocate = realloc; - return; - } + if (hooks == NULL) + { + /* Reset hooks */ + global_hooks.allocate = malloc; + global_hooks.deallocate = free; + global_hooks.reallocate = realloc; + return; + } - global_hooks.allocate = malloc; - if(hooks->malloc_fn != NULL) { - global_hooks.allocate = hooks->malloc_fn; - } + global_hooks.allocate = malloc; + if (hooks->malloc_fn != NULL) + { + global_hooks.allocate = hooks->malloc_fn; + } - global_hooks.deallocate = free; - if(hooks->free_fn != NULL) { - global_hooks.deallocate = hooks->free_fn; - } + global_hooks.deallocate = free; + if (hooks->free_fn != NULL) + { + global_hooks.deallocate = hooks->free_fn; + } - /* use realloc only if both free and malloc are used */ - global_hooks.reallocate = NULL; - if((global_hooks.allocate == malloc) && - (global_hooks.deallocate == free)) - { - global_hooks.reallocate = realloc; - } + /* use realloc only if both free and malloc are used */ + global_hooks.reallocate = NULL; + if ((global_hooks.allocate == malloc) && (global_hooks.deallocate == free)) + { + global_hooks.reallocate = realloc; + } } /* Internal constructor. */ -static cJSON *cJSON_New_Item(const internal_hooks *const hooks) { - cJSON *node = (cJSON *) hooks->allocate(sizeof(cJSON)); - if(node) { - memset(node, '\0', sizeof(cJSON)); - } +static cJSON *cJSON_New_Item(const internal_hooks * const hooks) +{ + cJSON* node = (cJSON*)hooks->allocate(sizeof(cJSON)); + if (node) + { + memset(node, '\0', sizeof(cJSON)); + } - return node; + return node; } /* Delete a cJSON structure. */ -CJSON_PUBLIC(void) cJSON_Delete(cJSON * item) -{ - cJSON *next = NULL; - while(item != NULL) { - next = item->next; - if(!(item->type & cJSON_IsReference) && - (item->child != NULL)) - { - cJSON_Delete(item->child); - } - if(!(item->type & cJSON_IsReference) && - (item->valuestring != NULL)) - { - global_hooks.deallocate(item->valuestring); - } - if(!(item->type & cJSON_StringIsConst) && - (item->string != NULL)) - { - global_hooks.deallocate(item->string); - } - global_hooks.deallocate(item); - item = next; - } +CJSON_PUBLIC(void) cJSON_Delete(cJSON *item) +{ + cJSON *next = NULL; + while (item != NULL) + { + next = item->next; + if (!(item->type & cJSON_IsReference) && (item->child != NULL)) + { + cJSON_Delete(item->child); + } + if (!(item->type & cJSON_IsReference) && (item->valuestring != NULL)) + { + global_hooks.deallocate(item->valuestring); + } + if (!(item->type & cJSON_StringIsConst) && (item->string != NULL)) + { + global_hooks.deallocate(item->string); + } + global_hooks.deallocate(item); + item = next; + } } /* get the decimal point character of the current locale */ -static unsigned char get_decimal_point(void) { +static unsigned char get_decimal_point(void) +{ #ifdef ENABLE_LOCALES - struct lconv *lconv = localeconv(); - return (unsigned char) lconv->decimal_point[0]; + struct lconv *lconv = localeconv(); + return (unsigned char) lconv->decimal_point[0]; #else - return '.'; + return '.'; #endif } -typedef struct { - const unsigned char *content; - size_t length; - size_t offset; - size_t depth; /* How deeply nested (in arrays/objects) is the input at the current offset. */ - internal_hooks hooks; +typedef struct +{ + const unsigned char *content; + size_t length; + size_t offset; + size_t depth; /* How deeply nested (in arrays/objects) is the input at the current offset. */ + internal_hooks hooks; } parse_buffer; /* check if the given size is left to read in a given parse buffer (starting with 1) */ -#define can_read(buffer, size) ((buffer != NULL) && \ - (((buffer)->offset + size) <= (buffer)->length)) +#define can_read(buffer, size) ((buffer != NULL) && (((buffer)->offset + size) <= (buffer)->length)) /* check if the buffer can be accessed at the given index (starting with 0) */ -#define can_access_at_index(buffer, index) ((buffer != NULL) && \ - (((buffer)->offset + index) < \ - (buffer)->length)) -#define cannot_access_at_index(buffer, \ - index) (!can_access_at_index(buffer, index)) +#define can_access_at_index(buffer, index) ((buffer != NULL) && (((buffer)->offset + index) < (buffer)->length)) +#define cannot_access_at_index(buffer, index) (!can_access_at_index(buffer, index)) /* get a pointer to the buffer at the position */ #define buffer_at_offset(buffer) ((buffer)->content + (buffer)->offset) /* Parse the input text to generate a number, and populate the result into item. */ -static cJSON_bool parse_number(cJSON *const item, - parse_buffer *const input_buffer) { - double number = 0; - unsigned char *after_end = NULL; - unsigned char number_c_string[64]; - unsigned char decimal_point = get_decimal_point(); - size_t i = 0; - - if((input_buffer == NULL) || - (input_buffer->content == NULL)) - { - return false; - } - - /* copy the number into a temporary buffer and replace '.' with the decimal point - * of the current locale (for strtod) - * This also takes care of '\0' not necessarily being available for marking the end of the input */ - for(i = 0; (i < (sizeof(number_c_string) - 1)) && - can_access_at_index(input_buffer, i); i++) - { - switch(buffer_at_offset(input_buffer)[i]) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case '+': - case '-': - case 'e': - case 'E': - number_c_string[i] = buffer_at_offset(input_buffer)[i]; - break; - - case '.': - number_c_string[i] = decimal_point; - break; - - default: - goto loop_end; - } - } +static cJSON_bool parse_number(cJSON * const item, parse_buffer * const input_buffer) +{ + double number = 0; + unsigned char *after_end = NULL; + unsigned char number_c_string[64]; + unsigned char decimal_point = get_decimal_point(); + size_t i = 0; + + if ((input_buffer == NULL) || (input_buffer->content == NULL)) + { + return false; + } + + /* copy the number into a temporary buffer and replace '.' with the decimal point + * of the current locale (for strtod) + * This also takes care of '\0' not necessarily being available for marking the end of the input */ + for (i = 0; (i < (sizeof(number_c_string) - 1)) && can_access_at_index(input_buffer, i); i++) + { + switch (buffer_at_offset(input_buffer)[i]) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case '+': + case '-': + case 'e': + case 'E': + number_c_string[i] = buffer_at_offset(input_buffer)[i]; + break; + + case '.': + number_c_string[i] = decimal_point; + break; + + default: + goto loop_end; + } + } loop_end: - number_c_string[i] = '\0'; + number_c_string[i] = '\0'; - number = strtod((const char *) number_c_string, (char **) &after_end); - if(number_c_string == after_end) { - return false; /* parse_error */ - } + number = strtod((const char*)number_c_string, (char**)&after_end); + if (number_c_string == after_end) + { + return false; /* parse_error */ + } - item->valuedouble = number; + item->valuedouble = number; - /* use saturation in case of overflow */ - if(number >= INT_MAX) { - item->valueint = INT_MAX; - } else if(number <= INT_MIN) { - item->valueint = INT_MIN; - } else { - item->valueint = (int) number; - } + /* use saturation in case of overflow */ + if (number >= INT_MAX) + { + item->valueint = INT_MAX; + } + else if (number <= INT_MIN) + { + item->valueint = INT_MIN; + } + else + { + item->valueint = (int)number; + } - item->type = cJSON_Number; + item->type = cJSON_Number; - input_buffer->offset += (size_t) (after_end - number_c_string); - return true; + input_buffer->offset += (size_t)(after_end - number_c_string); + return true; } /* don't ask me, but the original cJSON_SetNumberValue returns an integer or double */ -CJSON_PUBLIC(double) cJSON_SetNumberHelper(cJSON * object, double number) -{ - if(number >= INT_MAX) { - object->valueint = INT_MAX; - } else if(number <= INT_MIN) { - object->valueint = INT_MIN; - } else { - object->valueint = (int) number; - } - - return object->valuedouble = number; -} - -typedef struct { - unsigned char *buffer; - size_t length; - size_t offset; - size_t depth; /* current nesting depth (for formatted printing) */ - cJSON_bool noalloc; - cJSON_bool format; /* is this print a formatted print */ - internal_hooks hooks; +CJSON_PUBLIC(double) cJSON_SetNumberHelper(cJSON *object, double number) +{ + if (number >= INT_MAX) + { + object->valueint = INT_MAX; + } + else if (number <= INT_MIN) + { + object->valueint = INT_MIN; + } + else + { + object->valueint = (int)number; + } + + return object->valuedouble = number; +} + +typedef struct +{ + unsigned char *buffer; + size_t length; + size_t offset; + size_t depth; /* current nesting depth (for formatted printing) */ + cJSON_bool noalloc; + cJSON_bool format; /* is this print a formatted print */ + internal_hooks hooks; } printbuffer; /* realloc printbuffer if necessary to have at least "needed" bytes more */ -static unsigned char *ensure(printbuffer *const p, size_t needed) { - unsigned char *newbuffer = NULL; - size_t newsize = 0; - - if((p == NULL) || - (p->buffer == NULL)) - { - return NULL; - } - - if((p->length > 0) && - (p->offset >= p->length)) - { - /* make sure that offset is valid */ - return NULL; - } - - if(needed > INT_MAX) { - /* sizes bigger than INT_MAX are currently not supported */ - return NULL; - } - - needed += p->offset + 1; - if(needed <= p->length) { - return p->buffer + p->offset; - } - - if(p->noalloc) { - return NULL; - } - - /* calculate new buffer size */ - if(needed > (INT_MAX / 2)) { - /* overflow of int, use INT_MAX if possible */ - if(needed <= INT_MAX) { - newsize = INT_MAX; - } else { - return NULL; - } - } else { - newsize = needed * 2; - } - - if(p->hooks.reallocate != NULL) { - /* reallocate with realloc if available */ - newbuffer = (unsigned char *) p->hooks.reallocate(p->buffer, - newsize); - if(newbuffer == NULL) { - p->hooks.deallocate(p->buffer); - p->length = 0; - p->buffer = NULL; - - return NULL; - } - } else { - /* otherwise reallocate manually */ - newbuffer = (unsigned char *) p->hooks.allocate(newsize); - if(!newbuffer) { - p->hooks.deallocate(p->buffer); - p->length = 0; - p->buffer = NULL; - - return NULL; - } - if(newbuffer) { - memcpy(newbuffer, p->buffer, p->offset + 1); - } - p->hooks.deallocate(p->buffer); - } - p->length = newsize; - p->buffer = newbuffer; - - return newbuffer + p->offset; +static unsigned char* ensure(printbuffer * const p, size_t needed) +{ + unsigned char *newbuffer = NULL; + size_t newsize = 0; + + if ((p == NULL) || (p->buffer == NULL)) + { + return NULL; + } + + if ((p->length > 0) && (p->offset >= p->length)) + { + /* make sure that offset is valid */ + return NULL; + } + + if (needed > INT_MAX) + { + /* sizes bigger than INT_MAX are currently not supported */ + return NULL; + } + + needed += p->offset + 1; + if (needed <= p->length) + { + return p->buffer + p->offset; + } + + if (p->noalloc) { + return NULL; + } + + /* calculate new buffer size */ + if (needed > (INT_MAX / 2)) + { + /* overflow of int, use INT_MAX if possible */ + if (needed <= INT_MAX) + { + newsize = INT_MAX; + } + else + { + return NULL; + } + } + else + { + newsize = needed * 2; + } + + if (p->hooks.reallocate != NULL) + { + /* reallocate with realloc if available */ + newbuffer = (unsigned char*)p->hooks.reallocate(p->buffer, newsize); + if (newbuffer == NULL) + { + p->hooks.deallocate(p->buffer); + p->length = 0; + p->buffer = NULL; + + return NULL; + } + } + else + { + /* otherwise reallocate manually */ + newbuffer = (unsigned char*)p->hooks.allocate(newsize); + if (!newbuffer) + { + p->hooks.deallocate(p->buffer); + p->length = 0; + p->buffer = NULL; + + return NULL; + } + if (newbuffer) + { + memcpy(newbuffer, p->buffer, p->offset + 1); + } + p->hooks.deallocate(p->buffer); + } + p->length = newsize; + p->buffer = newbuffer; + + return newbuffer + p->offset; } /* calculate the new length of the string in a printbuffer and update the offset */ -static void update_offset(printbuffer *const buffer) { - const unsigned char *buffer_pointer = NULL; - if((buffer == NULL) || - (buffer->buffer == NULL)) - { - return; - } - buffer_pointer = buffer->buffer + buffer->offset; +static void update_offset(printbuffer * const buffer) +{ + const unsigned char *buffer_pointer = NULL; + if ((buffer == NULL) || (buffer->buffer == NULL)) + { + return; + } + buffer_pointer = buffer->buffer + buffer->offset; - buffer->offset += strlen((const char *) buffer_pointer); + buffer->offset += strlen((const char*)buffer_pointer); } /* Render the number nicely from the given item into a string. */ -static cJSON_bool print_number(const cJSON *const item, - printbuffer *const output_buffer) { - unsigned char *output_pointer = NULL; - double d = item->valuedouble; - int length = 0; - size_t i = 0; - unsigned char number_buffer[26]; /* temporary buffer to print the number into */ - unsigned char decimal_point = get_decimal_point(); - double test; - - if(output_buffer == NULL) { - return false; - } - - /* This checks for NaN and Infinity */ - if((d * 0) != 0) { - length = sprintf((char *) number_buffer, "null"); - } else { - /* Try 15 decimal places of precision to avoid nonsignificant nonzero digits */ - length = sprintf((char *) number_buffer, "%1.15g", d); - - /* Check whether the original double can be recovered */ - if((sscanf((char *) number_buffer, "%lg", &test) != 1) || - ((double) test != d)) - { - /* If not, print with 17 decimal places of precision */ - length = sprintf((char *) number_buffer, "%1.17g", d); - } - } - - /* sprintf failed or buffer overrun occured */ - if((length < 0) || - (length > (int) (sizeof(number_buffer) - 1))) - { - return false; - } - - /* reserve appropriate space in the output */ - output_pointer = ensure(output_buffer, (size_t) length + sizeof("")); - if(output_pointer == NULL) { - return false; - } - - /* copy the printed number to the output and replace locale - * dependent decimal point with '.' */ - for(i = 0; i < ((size_t) length); i++) { - if(number_buffer[i] == decimal_point) { - output_pointer[i] = '.'; - continue; - } - - output_pointer[i] = number_buffer[i]; - } - output_pointer[i] = '\0'; - - output_buffer->offset += (size_t) length; - - return true; +static cJSON_bool print_number(const cJSON * const item, printbuffer * const output_buffer) +{ + unsigned char *output_pointer = NULL; + double d = item->valuedouble; + int length = 0; + size_t i = 0; + unsigned char number_buffer[26]; /* temporary buffer to print the number into */ + unsigned char decimal_point = get_decimal_point(); + double test; + + if (output_buffer == NULL) + { + return false; + } + + /* This checks for NaN and Infinity */ + if ((d * 0) != 0) + { + length = sprintf((char*)number_buffer, "null"); + } + else + { + /* Try 15 decimal places of precision to avoid nonsignificant nonzero digits */ + length = sprintf((char*)number_buffer, "%1.15g", d); + + /* Check whether the original double can be recovered */ + if ((sscanf((char*)number_buffer, "%lg", &test) != 1) || ((double)test != d)) + { + /* If not, print with 17 decimal places of precision */ + length = sprintf((char*)number_buffer, "%1.17g", d); + } + } + + /* sprintf failed or buffer overrun occured */ + if ((length < 0) || (length > (int)(sizeof(number_buffer) - 1))) + { + return false; + } + + /* reserve appropriate space in the output */ + output_pointer = ensure(output_buffer, (size_t)length + sizeof("")); + if (output_pointer == NULL) + { + return false; + } + + /* copy the printed number to the output and replace locale + * dependent decimal point with '.' */ + for (i = 0; i < ((size_t)length); i++) + { + if (number_buffer[i] == decimal_point) + { + output_pointer[i] = '.'; + continue; + } + + output_pointer[i] = number_buffer[i]; + } + output_pointer[i] = '\0'; + + output_buffer->offset += (size_t)length; + + return true; } /* parse 4 digit hexadecimal number */ -static unsigned parse_hex4(const unsigned char *const input) { - unsigned int h = 0; - size_t i = 0; - - for(i = 0; i < 4; i++) { - /* parse digit */ - if((input[i] >= '0') && - (input[i] <= '9')) - { - h += (unsigned int) input[i] - '0'; - } else if((input[i] >= 'A') && - (input[i] <= 'F')) - { - h += (unsigned int) 10 + input[i] - 'A'; - } else if((input[i] >= 'a') && - (input[i] <= 'f')) - { - h += (unsigned int) 10 + input[i] - 'a'; - } else { /* invalid */ - return 0; - } - - if(i < 3) { - /* shift left to make place for the next nibble */ - h = h << 4; - } - } - - return h; +static unsigned parse_hex4(const unsigned char * const input) +{ + unsigned int h = 0; + size_t i = 0; + + for (i = 0; i < 4; i++) + { + /* parse digit */ + if ((input[i] >= '0') && (input[i] <= '9')) + { + h += (unsigned int) input[i] - '0'; + } + else if ((input[i] >= 'A') && (input[i] <= 'F')) + { + h += (unsigned int) 10 + input[i] - 'A'; + } + else if ((input[i] >= 'a') && (input[i] <= 'f')) + { + h += (unsigned int) 10 + input[i] - 'a'; + } + else /* invalid */ + { + return 0; + } + + if (i < 3) + { + /* shift left to make place for the next nibble */ + h = h << 4; + } + } + + return h; } /* converts a UTF-16 literal to UTF-8 * A literal can be one or two sequences of the form \uXXXX */ -static unsigned char utf16_literal_to_utf8( - const unsigned char *const input_pointer, - const unsigned char *const input_end, unsigned char **output_pointer) { - long unsigned int codepoint = 0; - unsigned int first_code = 0; - const unsigned char *first_sequence = input_pointer; - unsigned char utf8_length = 0; - unsigned char utf8_position = 0; - unsigned char sequence_length = 0; - unsigned char first_byte_mark = 0; - - if((input_end - first_sequence) < 6) { - /* input ends unexpectedly */ - goto fail; - } - - /* get the first utf16 sequence */ - first_code = parse_hex4(first_sequence + 2); - - /* check that the code is valid */ - if(((first_code >= 0xDC00) && - (first_code <= 0xDFFF))) - { - goto fail; - } - - /* UTF16 surrogate pair */ - if((first_code >= 0xD800) && - (first_code <= 0xDBFF)) - { - const unsigned char *second_sequence = first_sequence + 6; - unsigned int second_code = 0; - sequence_length = 12; /* \uXXXX\uXXXX */ - - if((input_end - second_sequence) < 6) { - /* input ends unexpectedly */ - goto fail; - } - - if((second_sequence[0] != '\\') || - (second_sequence[1] != 'u')) - { - /* missing second half of the surrogate pair */ - goto fail; - } - - /* get the second utf16 sequence */ - second_code = parse_hex4(second_sequence + 2); - /* check that the code is valid */ - if((second_code < 0xDC00) || - (second_code > 0xDFFF)) - { - /* invalid second half of the surrogate pair */ - goto fail; - } - - - /* calculate the unicode codepoint from the surrogate pair */ - codepoint = 0x10000 + - (((first_code & 0x3FF) << 10) | - (second_code & 0x3FF)); - } else { - sequence_length = 6; /* \uXXXX */ - codepoint = first_code; - } - - /* encode as UTF-8 - * takes at maximum 4 bytes to encode: - * 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx */ - if(codepoint < 0x80) { - /* normal ascii, encoding 0xxxxxxx */ - utf8_length = 1; - } else if(codepoint < 0x800) { - /* two bytes, encoding 110xxxxx 10xxxxxx */ - utf8_length = 2; - first_byte_mark = 0xC0; /* 11000000 */ - } else if(codepoint < 0x10000) { - /* three bytes, encoding 1110xxxx 10xxxxxx 10xxxxxx */ - utf8_length = 3; - first_byte_mark = 0xE0; /* 11100000 */ - } else if(codepoint <= 0x10FFFF) { - /* four bytes, encoding 1110xxxx 10xxxxxx 10xxxxxx 10xxxxxx */ - utf8_length = 4; - first_byte_mark = 0xF0; /* 11110000 */ - } else { - /* invalid unicode codepoint */ - goto fail; - } - - /* encode as utf8 */ - for(utf8_position = - (unsigned char) (utf8_length - 1); utf8_position > 0; - utf8_position--) { - /* 10xxxxxx */ - (*output_pointer)[utf8_position] = - (unsigned char) ((codepoint | 0x80) & 0xBF); - codepoint >>= 6; - } - /* encode first byte */ - if(utf8_length > 1) { - (*output_pointer)[0] = - (unsigned char) ((codepoint | first_byte_mark) & 0xFF); - } else { - (*output_pointer)[0] = (unsigned char) (codepoint & 0x7F); - } - - *output_pointer += utf8_length; - - return sequence_length; +static unsigned char utf16_literal_to_utf8(const unsigned char * const input_pointer, const unsigned char * const input_end, unsigned char **output_pointer) +{ + long unsigned int codepoint = 0; + unsigned int first_code = 0; + const unsigned char *first_sequence = input_pointer; + unsigned char utf8_length = 0; + unsigned char utf8_position = 0; + unsigned char sequence_length = 0; + unsigned char first_byte_mark = 0; + + if ((input_end - first_sequence) < 6) + { + /* input ends unexpectedly */ + goto fail; + } + + /* get the first utf16 sequence */ + first_code = parse_hex4(first_sequence + 2); + + /* check that the code is valid */ + if (((first_code >= 0xDC00) && (first_code <= 0xDFFF))) + { + goto fail; + } + + /* UTF16 surrogate pair */ + if ((first_code >= 0xD800) && (first_code <= 0xDBFF)) + { + const unsigned char *second_sequence = first_sequence + 6; + unsigned int second_code = 0; + sequence_length = 12; /* \uXXXX\uXXXX */ + + if ((input_end - second_sequence) < 6) + { + /* input ends unexpectedly */ + goto fail; + } + + if ((second_sequence[0] != '\\') || (second_sequence[1] != 'u')) + { + /* missing second half of the surrogate pair */ + goto fail; + } + + /* get the second utf16 sequence */ + second_code = parse_hex4(second_sequence + 2); + /* check that the code is valid */ + if ((second_code < 0xDC00) || (second_code > 0xDFFF)) + { + /* invalid second half of the surrogate pair */ + goto fail; + } + + + /* calculate the unicode codepoint from the surrogate pair */ + codepoint = 0x10000 + (((first_code & 0x3FF) << 10) | (second_code & 0x3FF)); + } + else + { + sequence_length = 6; /* \uXXXX */ + codepoint = first_code; + } + + /* encode as UTF-8 + * takes at maximum 4 bytes to encode: + * 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx */ + if (codepoint < 0x80) + { + /* normal ascii, encoding 0xxxxxxx */ + utf8_length = 1; + } + else if (codepoint < 0x800) + { + /* two bytes, encoding 110xxxxx 10xxxxxx */ + utf8_length = 2; + first_byte_mark = 0xC0; /* 11000000 */ + } + else if (codepoint < 0x10000) + { + /* three bytes, encoding 1110xxxx 10xxxxxx 10xxxxxx */ + utf8_length = 3; + first_byte_mark = 0xE0; /* 11100000 */ + } + else if (codepoint <= 0x10FFFF) + { + /* four bytes, encoding 1110xxxx 10xxxxxx 10xxxxxx 10xxxxxx */ + utf8_length = 4; + first_byte_mark = 0xF0; /* 11110000 */ + } + else + { + /* invalid unicode codepoint */ + goto fail; + } + + /* encode as utf8 */ + for (utf8_position = (unsigned char)(utf8_length - 1); utf8_position > 0; utf8_position--) + { + /* 10xxxxxx */ + (*output_pointer)[utf8_position] = (unsigned char)((codepoint | 0x80) & 0xBF); + codepoint >>= 6; + } + /* encode first byte */ + if (utf8_length > 1) + { + (*output_pointer)[0] = (unsigned char)((codepoint | first_byte_mark) & 0xFF); + } + else + { + (*output_pointer)[0] = (unsigned char)(codepoint & 0x7F); + } + + *output_pointer += utf8_length; + + return sequence_length; fail: - return 0; + return 0; } /* Parse the input text into an unescaped cinput, and populate item. */ -static cJSON_bool parse_string(cJSON *const item, - parse_buffer *const input_buffer) { - const unsigned char *input_pointer = buffer_at_offset(input_buffer) + 1; - const unsigned char *input_end = buffer_at_offset(input_buffer) + 1; - unsigned char *output_pointer = NULL; - unsigned char *output = NULL; - - /* not a string */ - if(buffer_at_offset(input_buffer)[0] != '\"') { - goto fail; - } - - { - /* calculate approximate size of the output (overestimate) */ - size_t allocation_length = 0; - size_t skipped_bytes = 0; - while(((size_t) (input_end - input_buffer->content) < - input_buffer->length) && - (*input_end != '\"')) - { - /* is escape sequence */ - if(input_end[0] == '\\') { - if((size_t) (input_end + 1 - - input_buffer->content) >= - input_buffer->length) { - /* prevent buffer overflow when last input character is a backslash */ - goto fail; - } - skipped_bytes++; - input_end++; - } - input_end++; - } - if(((size_t) (input_end - input_buffer->content) >= - input_buffer->length) || - (*input_end != '\"')) - { - goto fail; /* string ended unexpectedly */ - } - - /* This is at most how much we need for the output */ - allocation_length = - (size_t) (input_end - buffer_at_offset(input_buffer)) - - skipped_bytes; - output = (unsigned char *) input_buffer->hooks.allocate( - allocation_length + sizeof("")); - if(output == NULL) { - goto fail; /* allocation failure */ - } - } - - output_pointer = output; - /* loop through the string literal */ - while(input_pointer < input_end) { - if(*input_pointer != '\\') { - *output_pointer++ = *input_pointer++; - } - /* escape sequence */ - else { - unsigned char sequence_length = 2; - if((input_end - input_pointer) < 1) { - goto fail; - } - - switch(input_pointer[1]) { - case 'b': - *output_pointer++ = '\b'; - break; - - case 'f': - *output_pointer++ = '\f'; - break; - - case 'n': - *output_pointer++ = '\n'; - break; - - case 'r': - *output_pointer++ = '\r'; - break; - - case 't': - *output_pointer++ = '\t'; - break; - - case '\"': - case '\\': - case '/': - *output_pointer++ = input_pointer[1]; - break; - - /* UTF-16 literal */ - case 'u': - sequence_length = utf16_literal_to_utf8( - input_pointer, input_end, - &output_pointer); - if(sequence_length == 0) { - /* failed to convert UTF16-literal to UTF-8 */ - goto fail; - } - break; - - default: - goto fail; - } - input_pointer += sequence_length; - } - } - - /* zero terminate the output */ - *output_pointer = '\0'; - - item->type = cJSON_String; - item->valuestring = (char *) output; - - input_buffer->offset = (size_t) (input_end - input_buffer->content); - input_buffer->offset++; - - return true; +static cJSON_bool parse_string(cJSON * const item, parse_buffer * const input_buffer) +{ + const unsigned char *input_pointer = buffer_at_offset(input_buffer) + 1; + const unsigned char *input_end = buffer_at_offset(input_buffer) + 1; + unsigned char *output_pointer = NULL; + unsigned char *output = NULL; + + /* not a string */ + if (buffer_at_offset(input_buffer)[0] != '\"') + { + goto fail; + } + + { + /* calculate approximate size of the output (overestimate) */ + size_t allocation_length = 0; + size_t skipped_bytes = 0; + while (((size_t)(input_end - input_buffer->content) < input_buffer->length) && (*input_end != '\"')) + { + /* is escape sequence */ + if (input_end[0] == '\\') + { + if ((size_t)(input_end + 1 - input_buffer->content) >= input_buffer->length) + { + /* prevent buffer overflow when last input character is a backslash */ + goto fail; + } + skipped_bytes++; + input_end++; + } + input_end++; + } + if (((size_t)(input_end - input_buffer->content) >= input_buffer->length) || (*input_end != '\"')) + { + goto fail; /* string ended unexpectedly */ + } + + /* This is at most how much we need for the output */ + allocation_length = (size_t) (input_end - buffer_at_offset(input_buffer)) - skipped_bytes; + output = (unsigned char*)input_buffer->hooks.allocate(allocation_length + sizeof("")); + if (output == NULL) + { + goto fail; /* allocation failure */ + } + } + + output_pointer = output; + /* loop through the string literal */ + while (input_pointer < input_end) + { + if (*input_pointer != '\\') + { + *output_pointer++ = *input_pointer++; + } + /* escape sequence */ + else + { + unsigned char sequence_length = 2; + if ((input_end - input_pointer) < 1) + { + goto fail; + } + + switch (input_pointer[1]) + { + case 'b': + *output_pointer++ = '\b'; + break; + case 'f': + *output_pointer++ = '\f'; + break; + case 'n': + *output_pointer++ = '\n'; + break; + case 'r': + *output_pointer++ = '\r'; + break; + case 't': + *output_pointer++ = '\t'; + break; + case '\"': + case '\\': + case '/': + *output_pointer++ = input_pointer[1]; + break; + + /* UTF-16 literal */ + case 'u': + sequence_length = utf16_literal_to_utf8(input_pointer, input_end, &output_pointer); + if (sequence_length == 0) + { + /* failed to convert UTF16-literal to UTF-8 */ + goto fail; + } + break; + + default: + goto fail; + } + input_pointer += sequence_length; + } + } + + /* zero terminate the output */ + *output_pointer = '\0'; + + item->type = cJSON_String; + item->valuestring = (char*)output; + + input_buffer->offset = (size_t) (input_end - input_buffer->content); + input_buffer->offset++; + + return true; fail: - if(output != NULL) { - input_buffer->hooks.deallocate(output); - } + if (output != NULL) + { + input_buffer->hooks.deallocate(output); + } - if(input_pointer != NULL) { - input_buffer->offset = - (size_t) (input_pointer - input_buffer->content); - } + if (input_pointer != NULL) + { + input_buffer->offset = (size_t)(input_pointer - input_buffer->content); + } - return false; + return false; } /* Render the cstring provided to an escaped version that can be printed. */ -static cJSON_bool print_string_ptr(const unsigned char *const input, - printbuffer *const output_buffer) { - const unsigned char *input_pointer = NULL; - unsigned char *output = NULL; - unsigned char *output_pointer = NULL; - size_t output_length = 0; - /* numbers of additional characters needed for escaping */ - size_t escape_characters = 0; - - if(output_buffer == NULL) { - return false; - } - - /* empty string */ - if(input == NULL) { - output = ensure(output_buffer, sizeof("\"\"")); - if(output == NULL) { - return false; - } - strcpy((char *) output, "\"\""); - - return true; - } - - /* set "flag" to 1 if something needs to be escaped */ - for(input_pointer = input; *input_pointer; input_pointer++) { - switch(*input_pointer) { - case '\"': - case '\\': - case '\b': - case '\f': - case '\n': - case '\r': - case '\t': - /* one character escape sequence */ - escape_characters++; - break; - - default: - if(*input_pointer < 32) { - /* UTF-16 escape sequence uXXXX */ - escape_characters += 5; - } - break; - } - } - output_length = (size_t) (input_pointer - input) + escape_characters; - - output = ensure(output_buffer, output_length + sizeof("\"\"")); - if(output == NULL) { - return false; - } - - /* no characters have to be escaped */ - if(escape_characters == 0) { - output[0] = '\"'; - memcpy(output + 1, input, output_length); - output[output_length + 1] = '\"'; - output[output_length + 2] = '\0'; - - return true; - } - - output[0] = '\"'; - output_pointer = output + 1; - /* copy the string */ - for(input_pointer = input; *input_pointer != '\0'; - (void) input_pointer++, output_pointer++) { - if((*input_pointer > 31) && - (*input_pointer != '\"') && - (*input_pointer != '\\')) - { - /* normal character, copy */ - *output_pointer = *input_pointer; - } else { - /* character needs to be escaped */ - *output_pointer++ = '\\'; - switch(*input_pointer) { - case '\\': - *output_pointer = '\\'; - break; - - case '\"': - *output_pointer = '\"'; - break; - - case '\b': - *output_pointer = 'b'; - break; - - case '\f': - *output_pointer = 'f'; - break; - - case '\n': - *output_pointer = 'n'; - break; - - case '\r': - *output_pointer = 'r'; - break; - - case '\t': - *output_pointer = 't'; - break; - - default: - /* escape and print as unicode codepoint */ - sprintf((char *) output_pointer, "u%04x", - *input_pointer); - output_pointer += 4; - break; - } - } - } - output[output_length + 1] = '\"'; - output[output_length + 2] = '\0'; - - return true; +static cJSON_bool print_string_ptr(const unsigned char * const input, printbuffer * const output_buffer) +{ + const unsigned char *input_pointer = NULL; + unsigned char *output = NULL; + unsigned char *output_pointer = NULL; + size_t output_length = 0; + /* numbers of additional characters needed for escaping */ + size_t escape_characters = 0; + + if (output_buffer == NULL) + { + return false; + } + + /* empty string */ + if (input == NULL) + { + output = ensure(output_buffer, sizeof("\"\"")); + if (output == NULL) + { + return false; + } + strcpy((char*)output, "\"\""); + + return true; + } + + /* set "flag" to 1 if something needs to be escaped */ + for (input_pointer = input; *input_pointer; input_pointer++) + { + switch (*input_pointer) + { + case '\"': + case '\\': + case '\b': + case '\f': + case '\n': + case '\r': + case '\t': + /* one character escape sequence */ + escape_characters++; + break; + default: + if (*input_pointer < 32) + { + /* UTF-16 escape sequence uXXXX */ + escape_characters += 5; + } + break; + } + } + output_length = (size_t)(input_pointer - input) + escape_characters; + + output = ensure(output_buffer, output_length + sizeof("\"\"")); + if (output == NULL) + { + return false; + } + + /* no characters have to be escaped */ + if (escape_characters == 0) + { + output[0] = '\"'; + memcpy(output + 1, input, output_length); + output[output_length + 1] = '\"'; + output[output_length + 2] = '\0'; + + return true; + } + + output[0] = '\"'; + output_pointer = output + 1; + /* copy the string */ + for (input_pointer = input; *input_pointer != '\0'; (void)input_pointer++, output_pointer++) + { + if ((*input_pointer > 31) && (*input_pointer != '\"') && (*input_pointer != '\\')) + { + /* normal character, copy */ + *output_pointer = *input_pointer; + } + else + { + /* character needs to be escaped */ + *output_pointer++ = '\\'; + switch (*input_pointer) + { + case '\\': + *output_pointer = '\\'; + break; + case '\"': + *output_pointer = '\"'; + break; + case '\b': + *output_pointer = 'b'; + break; + case '\f': + *output_pointer = 'f'; + break; + case '\n': + *output_pointer = 'n'; + break; + case '\r': + *output_pointer = 'r'; + break; + case '\t': + *output_pointer = 't'; + break; + default: + /* escape and print as unicode codepoint */ + sprintf((char*)output_pointer, "u%04x", *input_pointer); + output_pointer += 4; + break; + } + } + } + output[output_length + 1] = '\"'; + output[output_length + 2] = '\0'; + + return true; } /* Invoke print_string_ptr (which is useful) on an item. */ -static cJSON_bool print_string(const cJSON *const item, printbuffer *const p) { - return print_string_ptr((unsigned char *) item->valuestring, p); +static cJSON_bool print_string(const cJSON * const item, printbuffer * const p) +{ + return print_string_ptr((unsigned char*)item->valuestring, p); } /* Predeclare these prototypes. */ -static cJSON_bool parse_value(cJSON *const item, - parse_buffer *const input_buffer); -static cJSON_bool print_value(const cJSON *const item, - printbuffer *const output_buffer); -static cJSON_bool parse_array(cJSON *const item, - parse_buffer *const input_buffer); -static cJSON_bool print_array(const cJSON *const item, - printbuffer *const output_buffer); -static cJSON_bool parse_object(cJSON *const item, - parse_buffer *const input_buffer); -static cJSON_bool print_object(const cJSON *const item, - printbuffer *const output_buffer); +static cJSON_bool parse_value(cJSON * const item, parse_buffer * const input_buffer); +static cJSON_bool print_value(const cJSON * const item, printbuffer * const output_buffer); +static cJSON_bool parse_array(cJSON * const item, parse_buffer * const input_buffer); +static cJSON_bool print_array(const cJSON * const item, printbuffer * const output_buffer); +static cJSON_bool parse_object(cJSON * const item, parse_buffer * const input_buffer); +static cJSON_bool print_object(const cJSON * const item, printbuffer * const output_buffer); /* Utility to jump whitespace and cr/lf */ -static parse_buffer *buffer_skip_whitespace(parse_buffer *const buffer) { - if((buffer == NULL) || - (buffer->content == NULL)) - { - return NULL; - } +static parse_buffer *buffer_skip_whitespace(parse_buffer * const buffer) +{ + if ((buffer == NULL) || (buffer->content == NULL)) + { + return NULL; + } - while(can_access_at_index(buffer, 0) && - (buffer_at_offset(buffer)[0] <= 32)) - { - buffer->offset++; - } + while (can_access_at_index(buffer, 0) && (buffer_at_offset(buffer)[0] <= 32)) + { + buffer->offset++; + } - if(buffer->offset == buffer->length) { - buffer->offset--; - } + if (buffer->offset == buffer->length) + { + buffer->offset--; + } - return buffer; + return buffer; } /* skip the UTF-8 BOM (byte order mark) if it is at the beginning of a buffer */ -static parse_buffer *skip_utf8_bom(parse_buffer *const buffer) { - if((buffer == NULL) || - (buffer->content == NULL) || - (buffer->offset != 0)) - { - return NULL; - } +static parse_buffer *skip_utf8_bom(parse_buffer * const buffer) +{ + if ((buffer == NULL) || (buffer->content == NULL) || (buffer->offset != 0)) + { + return NULL; + } - if(can_access_at_index(buffer, 4) && - (strncmp((const char *) buffer_at_offset(buffer), "\xEF\xBB\xBF", - 3) == 0)) - { - buffer->offset += 3; - } + if (can_access_at_index(buffer, 4) && (strncmp((const char*)buffer_at_offset(buffer), "\xEF\xBB\xBF", 3) == 0)) + { + buffer->offset += 3; + } - return buffer; + return buffer; } /* Parse an object - create a new root, and populate. */ -CJSON_PUBLIC(cJSON *) cJSON_ParseWithOpts(const char *value, - const char **return_parse_end, - cJSON_bool require_null_terminated) -{ - parse_buffer buffer = { 0, 0, 0, 0, { 0, 0, 0 } }; - cJSON *item = NULL; - - /* reset error position */ - global_error.json = NULL; - global_error.position = 0; - - if(value == NULL) { - goto fail; - } - - buffer.content = (const unsigned char *) value; - buffer.length = strlen((const char *) value) + sizeof(""); - buffer.offset = 0; - buffer.hooks = global_hooks; - - item = cJSON_New_Item(&global_hooks); - if(item == NULL) { /* memory fail */ - goto fail; - } - - if(!parse_value(item, buffer_skip_whitespace(skip_utf8_bom(&buffer)))) { - /* parse failure. ep is set. */ - goto fail; - } - - /* if we require null-terminated JSON without appended garbage, skip and then check for a null terminator */ - if(require_null_terminated) { - buffer_skip_whitespace(&buffer); - if((buffer.offset >= buffer.length) || - (buffer_at_offset(&buffer)[0] != '\0') ) - { - goto fail; - } - } - if(return_parse_end) { - *return_parse_end = (const char *) buffer_at_offset(&buffer); - } - - return item; +CJSON_PUBLIC(cJSON *) cJSON_ParseWithOpts(const char *value, const char **return_parse_end, cJSON_bool require_null_terminated) +{ + parse_buffer buffer = { 0, 0, 0, 0, { 0, 0, 0 } }; + cJSON *item = NULL; + + /* reset error position */ + global_error.json = NULL; + global_error.position = 0; + + if (value == NULL) + { + goto fail; + } + + buffer.content = (const unsigned char*)value; + buffer.length = strlen((const char*)value) + sizeof(""); + buffer.offset = 0; + buffer.hooks = global_hooks; + + item = cJSON_New_Item(&global_hooks); + if (item == NULL) /* memory fail */ + { + goto fail; + } + + if (!parse_value(item, buffer_skip_whitespace(skip_utf8_bom(&buffer)))) + { + /* parse failure. ep is set. */ + goto fail; + } + + /* if we require null-terminated JSON without appended garbage, skip and then check for a null terminator */ + if (require_null_terminated) + { + buffer_skip_whitespace(&buffer); + if ((buffer.offset >= buffer.length) || buffer_at_offset(&buffer)[0] != '\0') + { + goto fail; + } + } + if (return_parse_end) + { + *return_parse_end = (const char*)buffer_at_offset(&buffer); + } + + return item; fail: - if(item != NULL) { - cJSON_Delete(item); - } + if (item != NULL) + { + cJSON_Delete(item); + } - if(value != NULL) { - error local_error; - local_error.json = (const unsigned char *) value; - local_error.position = 0; + if (value != NULL) + { + error local_error; + local_error.json = (const unsigned char*)value; + local_error.position = 0; - if(buffer.offset < buffer.length) { - local_error.position = buffer.offset; - } else if(buffer.length > 0) { - local_error.position = buffer.length - 1; - } + if (buffer.offset < buffer.length) + { + local_error.position = buffer.offset; + } + else if (buffer.length > 0) + { + local_error.position = buffer.length - 1; + } - if(return_parse_end != NULL) { - *return_parse_end = (const char *) local_error.json + - local_error.position; - } + if (return_parse_end != NULL) + { + *return_parse_end = (const char*)local_error.json + local_error.position; + } - global_error = local_error; - } + global_error = local_error; + } - return NULL; + return NULL; } /* Default options for cJSON_Parse */ CJSON_PUBLIC(cJSON *) cJSON_Parse(const char *value) { - return cJSON_ParseWithOpts(value, 0, 0); + return cJSON_ParseWithOpts(value, 0, 0); } #define cjson_min(a, b) ((a < b) ? a : b) -static unsigned char *print(const cJSON *const item, cJSON_bool format, - const internal_hooks *const hooks) { - static const size_t default_buffer_size = 256; - printbuffer buffer[1]; - unsigned char *printed = NULL; - - memset(buffer, 0, sizeof(buffer)); - - /* create buffer */ - buffer->buffer = (unsigned char *) hooks->allocate(default_buffer_size); - buffer->length = default_buffer_size; - buffer->format = format; - buffer->hooks = *hooks; - if(buffer->buffer == NULL) { - goto fail; - } - - /* print the value */ - if(!print_value(item, buffer)) { - goto fail; - } - update_offset(buffer); - - /* check if reallocate is available */ - if(hooks->reallocate != NULL) { - printed = (unsigned char *) hooks->reallocate(buffer->buffer, - buffer->offset + - 1); - if(printed == NULL) { - goto fail; - } - buffer->buffer = NULL; - } else { /* otherwise copy the JSON over to a new buffer */ - printed = (unsigned char *) hooks->allocate(buffer->offset + 1); - if(printed == NULL) { - goto fail; - } - memcpy(printed, buffer->buffer, - cjson_min(buffer->length, buffer->offset + 1)); - printed[buffer->offset] = '\0'; /* just to be sure */ - - /* free the buffer */ - hooks->deallocate(buffer->buffer); - } - - return printed; +static unsigned char *print(const cJSON * const item, cJSON_bool format, const internal_hooks * const hooks) +{ + static const size_t default_buffer_size = 256; + printbuffer buffer[1]; + unsigned char *printed = NULL; + + memset(buffer, 0, sizeof(buffer)); + + /* create buffer */ + buffer->buffer = (unsigned char*) hooks->allocate(default_buffer_size); + buffer->length = default_buffer_size; + buffer->format = format; + buffer->hooks = *hooks; + if (buffer->buffer == NULL) + { + goto fail; + } + + /* print the value */ + if (!print_value(item, buffer)) + { + goto fail; + } + update_offset(buffer); + + /* check if reallocate is available */ + if (hooks->reallocate != NULL) + { + printed = (unsigned char*) hooks->reallocate(buffer->buffer, buffer->offset + 1); + if (printed == NULL) { + goto fail; + } + buffer->buffer = NULL; + } + else /* otherwise copy the JSON over to a new buffer */ + { + printed = (unsigned char*) hooks->allocate(buffer->offset + 1); + if (printed == NULL) + { + goto fail; + } + memcpy(printed, buffer->buffer, cjson_min(buffer->length, buffer->offset + 1)); + printed[buffer->offset] = '\0'; /* just to be sure */ + + /* free the buffer */ + hooks->deallocate(buffer->buffer); + } + + return printed; fail: - if(buffer->buffer != NULL) { - hooks->deallocate(buffer->buffer); - } + if (buffer->buffer != NULL) + { + hooks->deallocate(buffer->buffer); + } - if(printed != NULL) { - hooks->deallocate(printed); - } + if (printed != NULL) + { + hooks->deallocate(printed); + } - return NULL; + return NULL; } /* Render a cJSON item/entity/structure to text. */ -CJSON_PUBLIC(char *) cJSON_Print(const cJSON * item) +CJSON_PUBLIC(char *) cJSON_Print(const cJSON *item) { - return (char *) print(item, true, &global_hooks); + return (char*)print(item, true, &global_hooks); } -CJSON_PUBLIC(char *) cJSON_PrintUnformatted(const cJSON * item) +CJSON_PUBLIC(char *) cJSON_PrintUnformatted(const cJSON *item) { - return (char *) print(item, false, &global_hooks); + return (char*)print(item, false, &global_hooks); } -CJSON_PUBLIC(char *) cJSON_PrintBuffered(const cJSON * item, int prebuffer, - cJSON_bool fmt) +CJSON_PUBLIC(char *) cJSON_PrintBuffered(const cJSON *item, int prebuffer, cJSON_bool fmt) { - printbuffer p = { 0, 0, 0, 0, 0, 0, { 0, 0, 0 } }; + printbuffer p = { 0, 0, 0, 0, 0, 0, { 0, 0, 0 } }; - if(prebuffer < 0) { - return NULL; - } + if (prebuffer < 0) + { + return NULL; + } - p.buffer = (unsigned char *) global_hooks.allocate((size_t) prebuffer); - if(!p.buffer) { - return NULL; - } + p.buffer = (unsigned char*)global_hooks.allocate((size_t)prebuffer); + if (!p.buffer) + { + return NULL; + } - p.length = (size_t) prebuffer; - p.offset = 0; - p.noalloc = false; - p.format = fmt; - p.hooks = global_hooks; + p.length = (size_t)prebuffer; + p.offset = 0; + p.noalloc = false; + p.format = fmt; + p.hooks = global_hooks; - if(!print_value(item, &p)) { - global_hooks.deallocate(p.buffer); - return NULL; - } + if (!print_value(item, &p)) + { + global_hooks.deallocate(p.buffer); + return NULL; + } - return (char *) p.buffer; + return (char*)p.buffer; } -CJSON_PUBLIC(cJSON_bool) cJSON_PrintPreallocated(cJSON * item, char *buf, - const int len, - const cJSON_bool fmt) +CJSON_PUBLIC(cJSON_bool) cJSON_PrintPreallocated(cJSON *item, char *buf, const int len, const cJSON_bool fmt) { - printbuffer p = { 0, 0, 0, 0, 0, 0, { 0, 0, 0 } }; + printbuffer p = { 0, 0, 0, 0, 0, 0, { 0, 0, 0 } }; - if((len < 0) || - (buf == NULL)) - { - return false; - } + if ((len < 0) || (buf == NULL)) + { + return false; + } - p.buffer = (unsigned char *) buf; - p.length = (size_t) len; - p.offset = 0; - p.noalloc = true; - p.format = fmt; - p.hooks = global_hooks; + p.buffer = (unsigned char*)buf; + p.length = (size_t)len; + p.offset = 0; + p.noalloc = true; + p.format = fmt; + p.hooks = global_hooks; - return print_value(item, &p); + return print_value(item, &p); } /* Parser core - when encountering text, process appropriately. */ -static cJSON_bool parse_value(cJSON *const item, - parse_buffer *const input_buffer) { - if((input_buffer == NULL) || - (input_buffer->content == NULL)) - { - return false; /* no input */ - } - - /* parse the different types of values */ - /* null */ - if(can_read(input_buffer, 4) && - (strncmp((const char *) buffer_at_offset(input_buffer), "null", - 4) == 0)) - { - item->type = cJSON_NULL; - input_buffer->offset += 4; - return true; - } - /* false */ - if(can_read(input_buffer, 5) && - (strncmp((const char *) buffer_at_offset(input_buffer), "false", - 5) == 0)) - { - item->type = cJSON_False; - input_buffer->offset += 5; - return true; - } - /* true */ - if(can_read(input_buffer, 4) && - (strncmp((const char *) buffer_at_offset(input_buffer), "true", - 4) == 0)) - { - item->type = cJSON_True; - item->valueint = 1; - input_buffer->offset += 4; - return true; - } - /* string */ - if(can_access_at_index(input_buffer, 0) && - (buffer_at_offset(input_buffer)[0] == '\"')) - { - return parse_string(item, input_buffer); - } - /* number */ - if(can_access_at_index(input_buffer, 0) && - ((buffer_at_offset(input_buffer)[0] == '-') || - ((buffer_at_offset(input_buffer)[0] >= '0') && - (buffer_at_offset(input_buffer)[0] <= '9')))) - { - return parse_number(item, input_buffer); - } - /* array */ - if(can_access_at_index(input_buffer, 0) && - (buffer_at_offset(input_buffer)[0] == '[')) - { - return parse_array(item, input_buffer); - } - /* object */ - if(can_access_at_index(input_buffer, 0) && - (buffer_at_offset(input_buffer)[0] == '{')) - { - return parse_object(item, input_buffer); - } - - return false; +static cJSON_bool parse_value(cJSON * const item, parse_buffer * const input_buffer) +{ + if ((input_buffer == NULL) || (input_buffer->content == NULL)) + { + return false; /* no input */ + } + + /* parse the different types of values */ + /* null */ + if (can_read(input_buffer, 4) && (strncmp((const char*)buffer_at_offset(input_buffer), "null", 4) == 0)) + { + item->type = cJSON_NULL; + input_buffer->offset += 4; + return true; + } + /* false */ + if (can_read(input_buffer, 5) && (strncmp((const char*)buffer_at_offset(input_buffer), "false", 5) == 0)) + { + item->type = cJSON_False; + input_buffer->offset += 5; + return true; + } + /* true */ + if (can_read(input_buffer, 4) && (strncmp((const char*)buffer_at_offset(input_buffer), "true", 4) == 0)) + { + item->type = cJSON_True; + item->valueint = 1; + input_buffer->offset += 4; + return true; + } + /* string */ + if (can_access_at_index(input_buffer, 0) && (buffer_at_offset(input_buffer)[0] == '\"')) + { + return parse_string(item, input_buffer); + } + /* number */ + if (can_access_at_index(input_buffer, 0) && ((buffer_at_offset(input_buffer)[0] == '-') || ((buffer_at_offset(input_buffer)[0] >= '0') && (buffer_at_offset(input_buffer)[0] <= '9')))) + { + return parse_number(item, input_buffer); + } + /* array */ + if (can_access_at_index(input_buffer, 0) && (buffer_at_offset(input_buffer)[0] == '[')) + { + return parse_array(item, input_buffer); + } + /* object */ + if (can_access_at_index(input_buffer, 0) && (buffer_at_offset(input_buffer)[0] == '{')) + { + return parse_object(item, input_buffer); + } + + return false; } /* Render a value to text. */ -static cJSON_bool print_value(const cJSON *const item, - printbuffer *const output_buffer) { - unsigned char *output = NULL; - - if((item == NULL) || - (output_buffer == NULL)) - { - return false; - } - - switch((item->type) & 0xFF) { - case cJSON_NULL: - output = ensure(output_buffer, 5); - if(output == NULL) { - return false; - } - strcpy((char *) output, "null"); - return true; - - case cJSON_False: - output = ensure(output_buffer, 6); - if(output == NULL) { - return false; - } - strcpy((char *) output, "false"); - return true; - - case cJSON_True: - output = ensure(output_buffer, 5); - if(output == NULL) { - return false; - } - strcpy((char *) output, "true"); - return true; - - case cJSON_Number: - return print_number(item, output_buffer); - - case cJSON_Raw: - { - size_t raw_length = 0; - if(item->valuestring == NULL) { - return false; - } - - raw_length = strlen(item->valuestring) + sizeof(""); - output = ensure(output_buffer, raw_length); - if(output == NULL) { - return false; - } - memcpy(output, item->valuestring, raw_length); - return true; - } - - case cJSON_String: - return print_string(item, output_buffer); - - case cJSON_Array: - return print_array(item, output_buffer); - - case cJSON_Object: - return print_object(item, output_buffer); - - default: - return false; - } +static cJSON_bool print_value(const cJSON * const item, printbuffer * const output_buffer) +{ + unsigned char *output = NULL; + + if ((item == NULL) || (output_buffer == NULL)) + { + return false; + } + + switch ((item->type) & 0xFF) + { + case cJSON_NULL: + output = ensure(output_buffer, 5); + if (output == NULL) + { + return false; + } + strcpy((char*)output, "null"); + return true; + + case cJSON_False: + output = ensure(output_buffer, 6); + if (output == NULL) + { + return false; + } + strcpy((char*)output, "false"); + return true; + + case cJSON_True: + output = ensure(output_buffer, 5); + if (output == NULL) + { + return false; + } + strcpy((char*)output, "true"); + return true; + + case cJSON_Number: + return print_number(item, output_buffer); + + case cJSON_Raw: + { + size_t raw_length = 0; + if (item->valuestring == NULL) + { + return false; + } + + raw_length = strlen(item->valuestring) + sizeof(""); + output = ensure(output_buffer, raw_length); + if (output == NULL) + { + return false; + } + memcpy(output, item->valuestring, raw_length); + return true; + } + + case cJSON_String: + return print_string(item, output_buffer); + + case cJSON_Array: + return print_array(item, output_buffer); + + case cJSON_Object: + return print_object(item, output_buffer); + + default: + return false; + } } /* Build an array from input text. */ -static cJSON_bool parse_array(cJSON *const item, - parse_buffer *const input_buffer) { - cJSON *head = NULL; /* head of the linked list */ - cJSON *current_item = NULL; - - if(input_buffer->depth >= CJSON_NESTING_LIMIT) { - return false; /* to deeply nested */ - } - input_buffer->depth++; - - if(buffer_at_offset(input_buffer)[0] != '[') { - /* not an array */ - goto fail; - } - - input_buffer->offset++; - buffer_skip_whitespace(input_buffer); - if(can_access_at_index(input_buffer, 0) && - (buffer_at_offset(input_buffer)[0] == ']')) - { - /* empty array */ - goto success; - } - - /* check if we skipped to the end of the buffer */ - if(cannot_access_at_index(input_buffer, 0)) { - input_buffer->offset--; - goto fail; - } - - /* step back to character in front of the first element */ - input_buffer->offset--; - /* loop through the comma separated array elements */ - do { - /* allocate next item */ - cJSON *new_item = cJSON_New_Item(&(input_buffer->hooks)); - if(new_item == NULL) { - goto fail; /* allocation failure */ - } - - /* attach next item to list */ - if(head == NULL) { - /* start the linked list */ - current_item = head = new_item; - } else { - /* add to the end and advance */ - current_item->next = new_item; - new_item->prev = current_item; - current_item = new_item; - } - - /* parse next value */ - input_buffer->offset++; - buffer_skip_whitespace(input_buffer); - if(!parse_value(current_item, input_buffer)) { - goto fail; /* failed to parse value */ - } - buffer_skip_whitespace(input_buffer); - } while(can_access_at_index(input_buffer, 0) && - (buffer_at_offset(input_buffer)[0] == ',')); - - if(cannot_access_at_index(input_buffer, 0) || - (buffer_at_offset(input_buffer)[0] != ']') ) - { - goto fail; /* expected end of array */ - } +static cJSON_bool parse_array(cJSON * const item, parse_buffer * const input_buffer) +{ + cJSON *head = NULL; /* head of the linked list */ + cJSON *current_item = NULL; + + if (input_buffer->depth >= CJSON_NESTING_LIMIT) + { + return false; /* to deeply nested */ + } + input_buffer->depth++; + + if (buffer_at_offset(input_buffer)[0] != '[') + { + /* not an array */ + goto fail; + } + + input_buffer->offset++; + buffer_skip_whitespace(input_buffer); + if (can_access_at_index(input_buffer, 0) && (buffer_at_offset(input_buffer)[0] == ']')) + { + /* empty array */ + goto success; + } + + /* check if we skipped to the end of the buffer */ + if (cannot_access_at_index(input_buffer, 0)) + { + input_buffer->offset--; + goto fail; + } + + /* step back to character in front of the first element */ + input_buffer->offset--; + /* loop through the comma separated array elements */ + do + { + /* allocate next item */ + cJSON *new_item = cJSON_New_Item(&(input_buffer->hooks)); + if (new_item == NULL) + { + goto fail; /* allocation failure */ + } + + /* attach next item to list */ + if (head == NULL) + { + /* start the linked list */ + current_item = head = new_item; + } + else + { + /* add to the end and advance */ + current_item->next = new_item; + new_item->prev = current_item; + current_item = new_item; + } + + /* parse next value */ + input_buffer->offset++; + buffer_skip_whitespace(input_buffer); + if (!parse_value(current_item, input_buffer)) + { + goto fail; /* failed to parse value */ + } + buffer_skip_whitespace(input_buffer); + } + while (can_access_at_index(input_buffer, 0) && (buffer_at_offset(input_buffer)[0] == ',')); + + if (cannot_access_at_index(input_buffer, 0) || buffer_at_offset(input_buffer)[0] != ']') + { + goto fail; /* expected end of array */ + } success: - input_buffer->depth--; + input_buffer->depth--; - item->type = cJSON_Array; - item->child = head; + item->type = cJSON_Array; + item->child = head; - input_buffer->offset++; + input_buffer->offset++; - return true; + return true; fail: - if(head != NULL) { - cJSON_Delete(head); - } + if (head != NULL) + { + cJSON_Delete(head); + } - return false; + return false; } /* Render an array to text */ -static cJSON_bool print_array(const cJSON *const item, - printbuffer *const output_buffer) { - unsigned char *output_pointer = NULL; - size_t length = 0; - cJSON *current_element = item->child; - - if(output_buffer == NULL) { - return false; - } - - /* Compose the output array. */ - /* opening square bracket */ - output_pointer = ensure(output_buffer, 1); - if(output_pointer == NULL) { - return false; - } - - *output_pointer = '['; - output_buffer->offset++; - output_buffer->depth++; - - while(current_element != NULL) { - if(!print_value(current_element, output_buffer)) { - return false; - } - update_offset(output_buffer); - if(current_element->next) { - length = (size_t) (output_buffer->format ? 2 : 1); - output_pointer = ensure(output_buffer, length + 1); - if(output_pointer == NULL) { - return false; - } - *output_pointer++ = ','; - if(output_buffer->format) { - *output_pointer++ = ' '; - } - *output_pointer = '\0'; - output_buffer->offset += length; - } - current_element = current_element->next; - } - - output_pointer = ensure(output_buffer, 2); - if(output_pointer == NULL) { - return false; - } - *output_pointer++ = ']'; - *output_pointer = '\0'; - output_buffer->depth--; - - return true; +static cJSON_bool print_array(const cJSON * const item, printbuffer * const output_buffer) +{ + unsigned char *output_pointer = NULL; + size_t length = 0; + cJSON *current_element = item->child; + + if (output_buffer == NULL) + { + return false; + } + + /* Compose the output array. */ + /* opening square bracket */ + output_pointer = ensure(output_buffer, 1); + if (output_pointer == NULL) + { + return false; + } + + *output_pointer = '['; + output_buffer->offset++; + output_buffer->depth++; + + while (current_element != NULL) + { + if (!print_value(current_element, output_buffer)) + { + return false; + } + update_offset(output_buffer); + if (current_element->next) + { + length = (size_t) (output_buffer->format ? 2 : 1); + output_pointer = ensure(output_buffer, length + 1); + if (output_pointer == NULL) + { + return false; + } + *output_pointer++ = ','; + if(output_buffer->format) + { + *output_pointer++ = ' '; + } + *output_pointer = '\0'; + output_buffer->offset += length; + } + current_element = current_element->next; + } + + output_pointer = ensure(output_buffer, 2); + if (output_pointer == NULL) + { + return false; + } + *output_pointer++ = ']'; + *output_pointer = '\0'; + output_buffer->depth--; + + return true; } /* Build an object from the text. */ -static cJSON_bool parse_object(cJSON *const item, - parse_buffer *const input_buffer) { - cJSON *head = NULL; /* linked list head */ - cJSON *current_item = NULL; - - if(input_buffer->depth >= CJSON_NESTING_LIMIT) { - return false; /* to deeply nested */ - } - input_buffer->depth++; - - if(cannot_access_at_index(input_buffer, 0) || - (buffer_at_offset(input_buffer)[0] != '{')) - { - goto fail; /* not an object */ - } - - input_buffer->offset++; - buffer_skip_whitespace(input_buffer); - if(can_access_at_index(input_buffer, 0) && - (buffer_at_offset(input_buffer)[0] == '}')) - { - goto success; /* empty object */ - } - - /* check if we skipped to the end of the buffer */ - if(cannot_access_at_index(input_buffer, 0)) { - input_buffer->offset--; - goto fail; - } - - /* step back to character in front of the first element */ - input_buffer->offset--; - /* loop through the comma separated array elements */ - do { - /* allocate next item */ - cJSON *new_item = cJSON_New_Item(&(input_buffer->hooks)); - if(new_item == NULL) { - goto fail; /* allocation failure */ - } - - /* attach next item to list */ - if(head == NULL) { - /* start the linked list */ - current_item = head = new_item; - } else { - /* add to the end and advance */ - current_item->next = new_item; - new_item->prev = current_item; - current_item = new_item; - } - - /* parse the name of the child */ - input_buffer->offset++; - buffer_skip_whitespace(input_buffer); - if(!parse_string(current_item, input_buffer)) { - goto fail; /* faile to parse name */ - } - buffer_skip_whitespace(input_buffer); - - /* swap valuestring and string, because we parsed the name */ - current_item->string = current_item->valuestring; - current_item->valuestring = NULL; - - if(cannot_access_at_index(input_buffer, 0) || - (buffer_at_offset(input_buffer)[0] != ':')) - { - goto fail; /* invalid object */ - } - - /* parse the value */ - input_buffer->offset++; - buffer_skip_whitespace(input_buffer); - if(!parse_value(current_item, input_buffer)) { - goto fail; /* failed to parse value */ - } - buffer_skip_whitespace(input_buffer); - } while(can_access_at_index(input_buffer, 0) && - (buffer_at_offset(input_buffer)[0] == ',')); - - if(cannot_access_at_index(input_buffer, 0) || - (buffer_at_offset(input_buffer)[0] != '}')) - { - goto fail; /* expected end of object */ - } +static cJSON_bool parse_object(cJSON * const item, parse_buffer * const input_buffer) +{ + cJSON *head = NULL; /* linked list head */ + cJSON *current_item = NULL; + + if (input_buffer->depth >= CJSON_NESTING_LIMIT) + { + return false; /* to deeply nested */ + } + input_buffer->depth++; + + if (cannot_access_at_index(input_buffer, 0) || (buffer_at_offset(input_buffer)[0] != '{')) + { + goto fail; /* not an object */ + } + + input_buffer->offset++; + buffer_skip_whitespace(input_buffer); + if (can_access_at_index(input_buffer, 0) && (buffer_at_offset(input_buffer)[0] == '}')) + { + goto success; /* empty object */ + } + + /* check if we skipped to the end of the buffer */ + if (cannot_access_at_index(input_buffer, 0)) + { + input_buffer->offset--; + goto fail; + } + + /* step back to character in front of the first element */ + input_buffer->offset--; + /* loop through the comma separated array elements */ + do + { + /* allocate next item */ + cJSON *new_item = cJSON_New_Item(&(input_buffer->hooks)); + if (new_item == NULL) + { + goto fail; /* allocation failure */ + } + + /* attach next item to list */ + if (head == NULL) + { + /* start the linked list */ + current_item = head = new_item; + } + else + { + /* add to the end and advance */ + current_item->next = new_item; + new_item->prev = current_item; + current_item = new_item; + } + + /* parse the name of the child */ + input_buffer->offset++; + buffer_skip_whitespace(input_buffer); + if (!parse_string(current_item, input_buffer)) + { + goto fail; /* faile to parse name */ + } + buffer_skip_whitespace(input_buffer); + + /* swap valuestring and string, because we parsed the name */ + current_item->string = current_item->valuestring; + current_item->valuestring = NULL; + + if (cannot_access_at_index(input_buffer, 0) || (buffer_at_offset(input_buffer)[0] != ':')) + { + goto fail; /* invalid object */ + } + + /* parse the value */ + input_buffer->offset++; + buffer_skip_whitespace(input_buffer); + if (!parse_value(current_item, input_buffer)) + { + goto fail; /* failed to parse value */ + } + buffer_skip_whitespace(input_buffer); + } + while (can_access_at_index(input_buffer, 0) && (buffer_at_offset(input_buffer)[0] == ',')); + + if (cannot_access_at_index(input_buffer, 0) || (buffer_at_offset(input_buffer)[0] != '}')) + { + goto fail; /* expected end of object */ + } success: - input_buffer->depth--; + input_buffer->depth--; - item->type = cJSON_Object; - item->child = head; + item->type = cJSON_Object; + item->child = head; - input_buffer->offset++; - return true; + input_buffer->offset++; + return true; fail: - if(head != NULL) { - cJSON_Delete(head); - } + if (head != NULL) + { + cJSON_Delete(head); + } - return false; + return false; } /* Render an object to text. */ -static cJSON_bool print_object(const cJSON *const item, - printbuffer *const output_buffer) { - unsigned char *output_pointer = NULL; - size_t length = 0; - cJSON *current_item = item->child; - - if(output_buffer == NULL) { - return false; - } - - /* Compose the output: */ - length = (size_t) (output_buffer->format ? 2 : 1); /* fmt: {\n */ - output_pointer = ensure(output_buffer, length + 1); - if(output_pointer == NULL) { - return false; - } - - *output_pointer++ = '{'; - output_buffer->depth++; - if(output_buffer->format) { - *output_pointer++ = '\n'; - } - output_buffer->offset += length; - - while(current_item) { - if(output_buffer->format) { - size_t i; - output_pointer = ensure(output_buffer, - output_buffer->depth); - if(output_pointer == NULL) { - return false; - } - for(i = 0; i < output_buffer->depth; i++) { - *output_pointer++ = '\t'; - } - output_buffer->offset += output_buffer->depth; - } - - /* print key */ - if(!print_string_ptr((unsigned char *) current_item->string, - output_buffer)) { - return false; - } - update_offset(output_buffer); - - length = (size_t) (output_buffer->format ? 2 : 1); - output_pointer = ensure(output_buffer, length); - if(output_pointer == NULL) { - return false; - } - *output_pointer++ = ':'; - if(output_buffer->format) { - *output_pointer++ = '\t'; - } - output_buffer->offset += length; - - /* print value */ - if(!print_value(current_item, output_buffer)) { - return false; - } - update_offset(output_buffer); - - /* print comma if not last */ - length = - (size_t) ((output_buffer->format ? 1 : 0) + - (current_item->next ? 1 : 0)); - output_pointer = ensure(output_buffer, length + 1); - if(output_pointer == NULL) { - return false; - } - if(current_item->next) { - *output_pointer++ = ','; - } - - if(output_buffer->format) { - *output_pointer++ = '\n'; - } - *output_pointer = '\0'; - output_buffer->offset += length; - - current_item = current_item->next; - } - - output_pointer = - ensure(output_buffer, - output_buffer->format ? (output_buffer->depth + 1) : 2); - if(output_pointer == NULL) { - return false; - } - if(output_buffer->format) { - size_t i; - for(i = 0; i < (output_buffer->depth - 1); i++) { - *output_pointer++ = '\t'; - } - } - *output_pointer++ = '}'; - *output_pointer = '\0'; - output_buffer->depth--; - - return true; +static cJSON_bool print_object(const cJSON * const item, printbuffer * const output_buffer) +{ + unsigned char *output_pointer = NULL; + size_t length = 0; + cJSON *current_item = item->child; + + if (output_buffer == NULL) + { + return false; + } + + /* Compose the output: */ + length = (size_t) (output_buffer->format ? 2 : 1); /* fmt: {\n */ + output_pointer = ensure(output_buffer, length + 1); + if (output_pointer == NULL) + { + return false; + } + + *output_pointer++ = '{'; + output_buffer->depth++; + if (output_buffer->format) + { + *output_pointer++ = '\n'; + } + output_buffer->offset += length; + + while (current_item) + { + if (output_buffer->format) + { + size_t i; + output_pointer = ensure(output_buffer, output_buffer->depth); + if (output_pointer == NULL) + { + return false; + } + for (i = 0; i < output_buffer->depth; i++) + { + *output_pointer++ = '\t'; + } + output_buffer->offset += output_buffer->depth; + } + + /* print key */ + if (!print_string_ptr((unsigned char*)current_item->string, output_buffer)) + { + return false; + } + update_offset(output_buffer); + + length = (size_t) (output_buffer->format ? 2 : 1); + output_pointer = ensure(output_buffer, length); + if (output_pointer == NULL) + { + return false; + } + *output_pointer++ = ':'; + if (output_buffer->format) + { + *output_pointer++ = '\t'; + } + output_buffer->offset += length; + + /* print value */ + if (!print_value(current_item, output_buffer)) + { + return false; + } + update_offset(output_buffer); + + /* print comma if not last */ + length = (size_t) ((output_buffer->format ? 1 : 0) + (current_item->next ? 1 : 0)); + output_pointer = ensure(output_buffer, length + 1); + if (output_pointer == NULL) + { + return false; + } + if (current_item->next) + { + *output_pointer++ = ','; + } + + if (output_buffer->format) + { + *output_pointer++ = '\n'; + } + *output_pointer = '\0'; + output_buffer->offset += length; + + current_item = current_item->next; + } + + output_pointer = ensure(output_buffer, output_buffer->format ? (output_buffer->depth + 1) : 2); + if (output_pointer == NULL) + { + return false; + } + if (output_buffer->format) + { + size_t i; + for (i = 0; i < (output_buffer->depth - 1); i++) + { + *output_pointer++ = '\t'; + } + } + *output_pointer++ = '}'; + *output_pointer = '\0'; + output_buffer->depth--; + + return true; } /* Get Array size/item / object item. */ -CJSON_PUBLIC(int) cJSON_GetArraySize(const cJSON * array) +CJSON_PUBLIC(int) cJSON_GetArraySize(const cJSON *array) { - cJSON *child = NULL; - size_t size = 0; + cJSON *child = NULL; + size_t size = 0; - if(array == NULL) { - return 0; - } + if (array == NULL) + { + return 0; + } - child = array->child; + child = array->child; - while(child != NULL) { - size++; - child = child->next; - } + while(child != NULL) + { + size++; + child = child->next; + } - /* FIXME: Can overflow here. Cannot be fixed without breaking the API */ + /* FIXME: Can overflow here. Cannot be fixed without breaking the API */ - return (int) size; + return (int)size; } -static cJSON *get_array_item(const cJSON *array, size_t index) { - cJSON *current_child = NULL; +static cJSON* get_array_item(const cJSON *array, size_t index) +{ + cJSON *current_child = NULL; - if(array == NULL) { - return NULL; - } + if (array == NULL) + { + return NULL; + } - current_child = array->child; - while((current_child != NULL) && - (index > 0)) - { - index--; - current_child = current_child->next; - } + current_child = array->child; + while ((current_child != NULL) && (index > 0)) + { + index--; + current_child = current_child->next; + } - return current_child; + return current_child; } -CJSON_PUBLIC(cJSON *) cJSON_GetArrayItem(const cJSON * array, int index) +CJSON_PUBLIC(cJSON *) cJSON_GetArrayItem(const cJSON *array, int index) { - if(index < 0) { - return NULL; - } + if (index < 0) + { + return NULL; + } - return get_array_item(array, (size_t) index); + return get_array_item(array, (size_t)index); } -static cJSON *get_object_item(const cJSON *const object, const char *const name, - const cJSON_bool case_sensitive) { - cJSON *current_element = NULL; +static cJSON *get_object_item(const cJSON * const object, const char * const name, const cJSON_bool case_sensitive) +{ + cJSON *current_element = NULL; - if((object == NULL) || - (name == NULL)) - { - return NULL; - } + if ((object == NULL) || (name == NULL)) + { + return NULL; + } - current_element = object->child; - if(case_sensitive) { - while((current_element != NULL) && - (strcmp(name, current_element->string) != 0)) - { - current_element = current_element->next; - } - } else { - while((current_element != NULL) && - (case_insensitive_strcmp((const unsigned char *) name, - (const unsigned char *) ( - current_element->string)) - != 0)) - { - current_element = current_element->next; - } - } + current_element = object->child; + if (case_sensitive) + { + while ((current_element != NULL) && (strcmp(name, current_element->string) != 0)) + { + current_element = current_element->next; + } + } + else + { + while ((current_element != NULL) && (case_insensitive_strcmp((const unsigned char*)name, (const unsigned char*)(current_element->string)) != 0)) + { + current_element = current_element->next; + } + } - return current_element; + return current_element; } -CJSON_PUBLIC(cJSON *) cJSON_GetObjectItem(const cJSON * const object, - const char *const string) +CJSON_PUBLIC(cJSON *) cJSON_GetObjectItem(const cJSON * const object, const char * const string) { - return get_object_item(object, string, false); + return get_object_item(object, string, false); } -CJSON_PUBLIC(cJSON *) cJSON_GetObjectItemCaseSensitive( - const cJSON * const object, const char *const string) +CJSON_PUBLIC(cJSON *) cJSON_GetObjectItemCaseSensitive(const cJSON * const object, const char * const string) { - return get_object_item(object, string, true); + return get_object_item(object, string, true); } -CJSON_PUBLIC(cJSON_bool) cJSON_HasObjectItem(const cJSON * object, - const char *string) +CJSON_PUBLIC(cJSON_bool) cJSON_HasObjectItem(const cJSON *object, const char *string) { - return cJSON_GetObjectItem(object, string) ? 1 : 0; + return cJSON_GetObjectItem(object, string) ? 1 : 0; } /* Utility for array list handling. */ -static void suffix_object(cJSON *prev, cJSON *item) { - prev->next = item; - item->prev = prev; +static void suffix_object(cJSON *prev, cJSON *item) +{ + prev->next = item; + item->prev = prev; } /* Utility for handling references. */ -static cJSON *create_reference(const cJSON *item, - const internal_hooks *const hooks) { - cJSON *reference = NULL; - if(item == NULL) { - return NULL; - } - - reference = cJSON_New_Item(hooks); - if(reference == NULL) { - return NULL; - } - - memcpy(reference, item, sizeof(cJSON)); - reference->string = NULL; - reference->type |= cJSON_IsReference; - reference->next = reference->prev = NULL; - return reference; -} - -static cJSON_bool add_item_to_array(cJSON *array, cJSON *item) { - cJSON *child = NULL; - - if((item == NULL) || - (array == NULL)) - { - return false; - } - - child = array->child; - - if(child == NULL) { - /* list is empty, start new one */ - array->child = item; - } else { - /* append to the end */ - while(child->next) { - child = child->next; - } - suffix_object(child, item); - } - - return true; +static cJSON *create_reference(const cJSON *item, const internal_hooks * const hooks) +{ + cJSON *reference = NULL; + if (item == NULL) + { + return NULL; + } + + reference = cJSON_New_Item(hooks); + if (reference == NULL) + { + return NULL; + } + + memcpy(reference, item, sizeof(cJSON)); + reference->string = NULL; + reference->type |= cJSON_IsReference; + reference->next = reference->prev = NULL; + return reference; +} + +static cJSON_bool add_item_to_array(cJSON *array, cJSON *item) +{ + cJSON *child = NULL; + + if ((item == NULL) || (array == NULL)) + { + return false; + } + + child = array->child; + + if (child == NULL) + { + /* list is empty, start new one */ + array->child = item; + } + else + { + /* append to the end */ + while (child->next) + { + child = child->next; + } + suffix_object(child, item); + } + + return true; } /* Add item to array/object. */ -CJSON_PUBLIC(void) cJSON_AddItemToArray(cJSON * array, cJSON * item) +CJSON_PUBLIC(void) cJSON_AddItemToArray(cJSON *array, cJSON *item) { - add_item_to_array(array, item); + add_item_to_array(array, item); } -#if defined(__clang__) || \ - (defined(__GNUC__) && \ - ((__GNUC__ > 4) || \ - ((__GNUC__ == 4) && \ - (__GNUC_MINOR__ > 5)))) +#if defined(__clang__) || (defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 5)))) #pragma GCC diagnostic push #endif #ifdef __GNUC__ #pragma GCC diagnostic ignored "-Wcast-qual" #endif /* helper function to cast away const */ -static void *cast_away_const(const void *string) { - return (void *) string; -} -#if defined(__clang__) || \ - (defined(__GNUC__) && \ - ((__GNUC__ > 4) || \ - ((__GNUC__ == 4) && \ - (__GNUC_MINOR__ > 5)))) +static void* cast_away_const(const void* string) +{ + return (void*)string; +} +#if defined(__clang__) || (defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 5)))) #pragma GCC diagnostic pop #endif -static cJSON_bool add_item_to_object(cJSON *const object, - const char *const string, - cJSON *const item, - const internal_hooks *const hooks, - const cJSON_bool constant_key) +static cJSON_bool add_item_to_object(cJSON * const object, const char * const string, cJSON * const item, const internal_hooks * const hooks, const cJSON_bool constant_key) { - char *new_key = NULL; - int new_type = cJSON_Invalid; + char *new_key = NULL; + int new_type = cJSON_Invalid; - if((object == NULL) || - (string == NULL) || - (item == NULL)) - { - return false; - } + if ((object == NULL) || (string == NULL) || (item == NULL)) + { + return false; + } - if(constant_key) { - new_key = (char *) cast_away_const(string); - new_type = item->type | cJSON_StringIsConst; - } else { - new_key = (char *) cJSON_strdup((const unsigned char *) string, - hooks); - if(new_key == NULL) { - return false; - } + if (constant_key) + { + new_key = (char*)cast_away_const(string); + new_type = item->type | cJSON_StringIsConst; + } + else + { + new_key = (char*)cJSON_strdup((const unsigned char*)string, hooks); + if (new_key == NULL) + { + return false; + } - new_type = item->type & ~cJSON_StringIsConst; - } + new_type = item->type & ~cJSON_StringIsConst; + } - if(!(item->type & cJSON_StringIsConst) && - (item->string != NULL)) - { - hooks->deallocate(item->string); - } + if (!(item->type & cJSON_StringIsConst) && (item->string != NULL)) + { + hooks->deallocate(item->string); + } - item->string = new_key; - item->type = new_type; + item->string = new_key; + item->type = new_type; - return add_item_to_array(object, item); + return add_item_to_array(object, item); } -CJSON_PUBLIC(void) cJSON_AddItemToObject(cJSON * object, const char *string, - cJSON * item) +CJSON_PUBLIC(void) cJSON_AddItemToObject(cJSON *object, const char *string, cJSON *item) { - add_item_to_object(object, string, item, &global_hooks, false); + add_item_to_object(object, string, item, &global_hooks, false); } /* Add an item to an object with constant string as key */ -CJSON_PUBLIC(void) cJSON_AddItemToObjectCS(cJSON * object, const char *string, - cJSON * item) +CJSON_PUBLIC(void) cJSON_AddItemToObjectCS(cJSON *object, const char *string, cJSON *item) { - add_item_to_object(object, string, item, &global_hooks, true); + add_item_to_object(object, string, item, &global_hooks, true); } -CJSON_PUBLIC(void) cJSON_AddItemReferenceToArray(cJSON * array, cJSON * item) +CJSON_PUBLIC(void) cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item) { - if(array == NULL) { - return; - } + if (array == NULL) + { + return; + } - add_item_to_array(array, create_reference(item, &global_hooks)); + add_item_to_array(array, create_reference(item, &global_hooks)); } -CJSON_PUBLIC(void) cJSON_AddItemReferenceToObject(cJSON * object, - const char *string, - cJSON * item) +CJSON_PUBLIC(void) cJSON_AddItemReferenceToObject(cJSON *object, const char *string, cJSON *item) { - if((object == NULL) || - (string == NULL)) - { - return; - } + if ((object == NULL) || (string == NULL)) + { + return; + } - add_item_to_object(object, string, create_reference(item, - &global_hooks), &global_hooks, - false); + add_item_to_object(object, string, create_reference(item, &global_hooks), &global_hooks, false); } -CJSON_PUBLIC(cJSON *) cJSON_AddNullToObject(cJSON * const object, - const char *const name) +CJSON_PUBLIC(cJSON*) cJSON_AddNullToObject(cJSON * const object, const char * const name) { - cJSON *null = cJSON_CreateNull(); - if(add_item_to_object(object, name, null, &global_hooks, false)) { - return null; - } + cJSON *null = cJSON_CreateNull(); + if (add_item_to_object(object, name, null, &global_hooks, false)) + { + return null; + } - cJSON_Delete(null); - return NULL; + cJSON_Delete(null); + return NULL; } -CJSON_PUBLIC(cJSON *) cJSON_AddTrueToObject(cJSON * const object, - const char *const name) +CJSON_PUBLIC(cJSON*) cJSON_AddTrueToObject(cJSON * const object, const char * const name) { - cJSON *true_item = cJSON_CreateTrue(); - if(add_item_to_object(object, name, true_item, &global_hooks, false)) { - return true_item; - } + cJSON *true_item = cJSON_CreateTrue(); + if (add_item_to_object(object, name, true_item, &global_hooks, false)) + { + return true_item; + } - cJSON_Delete(true_item); - return NULL; + cJSON_Delete(true_item); + return NULL; } -CJSON_PUBLIC(cJSON *) cJSON_AddFalseToObject(cJSON * const object, - const char *const name) +CJSON_PUBLIC(cJSON*) cJSON_AddFalseToObject(cJSON * const object, const char * const name) { - cJSON *false_item = cJSON_CreateFalse(); - if(add_item_to_object(object, name, false_item, &global_hooks, false)) { - return false_item; - } + cJSON *false_item = cJSON_CreateFalse(); + if (add_item_to_object(object, name, false_item, &global_hooks, false)) + { + return false_item; + } - cJSON_Delete(false_item); - return NULL; + cJSON_Delete(false_item); + return NULL; } -CJSON_PUBLIC(cJSON *) cJSON_AddBoolToObject(cJSON * const object, - const char *const name, - const cJSON_bool boolean) +CJSON_PUBLIC(cJSON*) cJSON_AddBoolToObject(cJSON * const object, const char * const name, const cJSON_bool boolean) { - cJSON *bool_item = cJSON_CreateBool(boolean); - if(add_item_to_object(object, name, bool_item, &global_hooks, false)) { - return bool_item; - } + cJSON *bool_item = cJSON_CreateBool(boolean); + if (add_item_to_object(object, name, bool_item, &global_hooks, false)) + { + return bool_item; + } - cJSON_Delete(bool_item); - return NULL; + cJSON_Delete(bool_item); + return NULL; } -CJSON_PUBLIC(cJSON *) cJSON_AddNumberToObject(cJSON * const object, - const char *const name, - const double number) +CJSON_PUBLIC(cJSON*) cJSON_AddNumberToObject(cJSON * const object, const char * const name, const double number) { - cJSON *number_item = cJSON_CreateNumber(number); - if(add_item_to_object(object, name, number_item, &global_hooks, - false)) { - return number_item; - } + cJSON *number_item = cJSON_CreateNumber(number); + if (add_item_to_object(object, name, number_item, &global_hooks, false)) + { + return number_item; + } - cJSON_Delete(number_item); - return NULL; + cJSON_Delete(number_item); + return NULL; } -CJSON_PUBLIC(cJSON *) cJSON_AddStringToObject(cJSON * const object, - const char *const name, - const char *const string) +CJSON_PUBLIC(cJSON*) cJSON_AddStringToObject(cJSON * const object, const char * const name, const char * const string) { - cJSON *string_item = cJSON_CreateString(string); - if(add_item_to_object(object, name, string_item, &global_hooks, - false)) { - return string_item; - } + cJSON *string_item = cJSON_CreateString(string); + if (add_item_to_object(object, name, string_item, &global_hooks, false)) + { + return string_item; + } - cJSON_Delete(string_item); - return NULL; + cJSON_Delete(string_item); + return NULL; } -CJSON_PUBLIC(cJSON *) cJSON_AddRawToObject(cJSON * const object, - const char *const name, - const char *const raw) +CJSON_PUBLIC(cJSON*) cJSON_AddRawToObject(cJSON * const object, const char * const name, const char * const raw) { - cJSON *raw_item = cJSON_CreateRaw(raw); - if(add_item_to_object(object, name, raw_item, &global_hooks, false)) { - return raw_item; - } + cJSON *raw_item = cJSON_CreateRaw(raw); + if (add_item_to_object(object, name, raw_item, &global_hooks, false)) + { + return raw_item; + } - cJSON_Delete(raw_item); - return NULL; + cJSON_Delete(raw_item); + return NULL; } -CJSON_PUBLIC(cJSON *) cJSON_AddObjectToObject(cJSON * const object, - const char *const name) +CJSON_PUBLIC(cJSON*) cJSON_AddObjectToObject(cJSON * const object, const char * const name) { - cJSON *object_item = cJSON_CreateObject(); - if(add_item_to_object(object, name, object_item, &global_hooks, - false)) { - return object_item; - } + cJSON *object_item = cJSON_CreateObject(); + if (add_item_to_object(object, name, object_item, &global_hooks, false)) + { + return object_item; + } - cJSON_Delete(object_item); - return NULL; + cJSON_Delete(object_item); + return NULL; } -CJSON_PUBLIC(cJSON *) cJSON_AddArrayToObject(cJSON * const object, - const char *const name) +CJSON_PUBLIC(cJSON*) cJSON_AddArrayToObject(cJSON * const object, const char * const name) { - cJSON *array = cJSON_CreateArray(); - if(add_item_to_object(object, name, array, &global_hooks, false)) { - return array; - } + cJSON *array = cJSON_CreateArray(); + if (add_item_to_object(object, name, array, &global_hooks, false)) + { + return array; + } - cJSON_Delete(array); - return NULL; + cJSON_Delete(array); + return NULL; } -CJSON_PUBLIC(cJSON *) cJSON_DetachItemViaPointer(cJSON * parent, - cJSON * const item) +CJSON_PUBLIC(cJSON *) cJSON_DetachItemViaPointer(cJSON *parent, cJSON * const item) { - if((parent == NULL) || - (item == NULL)) - { - return NULL; - } + if ((parent == NULL) || (item == NULL)) + { + return NULL; + } - if(item->prev != NULL) { - /* not the first element */ - item->prev->next = item->next; - } - if(item->next != NULL) { - /* not the last element */ - item->next->prev = item->prev; - } + if (item->prev != NULL) + { + /* not the first element */ + item->prev->next = item->next; + } + if (item->next != NULL) + { + /* not the last element */ + item->next->prev = item->prev; + } - if(item == parent->child) { - /* first element */ - parent->child = item->next; - } - /* make sure the detached item doesn't point anywhere anymore */ - item->prev = NULL; - item->next = NULL; + if (item == parent->child) + { + /* first element */ + parent->child = item->next; + } + /* make sure the detached item doesn't point anywhere anymore */ + item->prev = NULL; + item->next = NULL; - return item; + return item; } -CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromArray(cJSON * array, int which) +CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromArray(cJSON *array, int which) { - if(which < 0) { - return NULL; - } + if (which < 0) + { + return NULL; + } - return cJSON_DetachItemViaPointer(array, - get_array_item(array, - (size_t) which)); + return cJSON_DetachItemViaPointer(array, get_array_item(array, (size_t)which)); } -CJSON_PUBLIC(void) cJSON_DeleteItemFromArray(cJSON * array, int which) +CJSON_PUBLIC(void) cJSON_DeleteItemFromArray(cJSON *array, int which) { - cJSON_Delete(cJSON_DetachItemFromArray(array, which)); + cJSON_Delete(cJSON_DetachItemFromArray(array, which)); } -CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObject(cJSON * object, - const char *string) +CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObject(cJSON *object, const char *string) { - cJSON *to_detach = cJSON_GetObjectItem(object, string); + cJSON *to_detach = cJSON_GetObjectItem(object, string); - return cJSON_DetachItemViaPointer(object, to_detach); + return cJSON_DetachItemViaPointer(object, to_detach); } -CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObjectCaseSensitive(cJSON * object, - const char *string) +CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObjectCaseSensitive(cJSON *object, const char *string) { - cJSON *to_detach = cJSON_GetObjectItemCaseSensitive(object, string); + cJSON *to_detach = cJSON_GetObjectItemCaseSensitive(object, string); - return cJSON_DetachItemViaPointer(object, to_detach); + return cJSON_DetachItemViaPointer(object, to_detach); } -CJSON_PUBLIC(void) cJSON_DeleteItemFromObject(cJSON * object, - const char *string) +CJSON_PUBLIC(void) cJSON_DeleteItemFromObject(cJSON *object, const char *string) { - cJSON_Delete(cJSON_DetachItemFromObject(object, string)); + cJSON_Delete(cJSON_DetachItemFromObject(object, string)); } -CJSON_PUBLIC(void) cJSON_DeleteItemFromObjectCaseSensitive(cJSON * object, - const char *string) +CJSON_PUBLIC(void) cJSON_DeleteItemFromObjectCaseSensitive(cJSON *object, const char *string) { - cJSON_Delete(cJSON_DetachItemFromObjectCaseSensitive(object, string)); + cJSON_Delete(cJSON_DetachItemFromObjectCaseSensitive(object, string)); } /* Replace array/object items with new ones. */ -CJSON_PUBLIC(void) cJSON_InsertItemInArray(cJSON * array, int which, - cJSON * newitem) -{ - cJSON *after_inserted = NULL; +CJSON_PUBLIC(void) cJSON_InsertItemInArray(cJSON *array, int which, cJSON *newitem) +{ + cJSON *after_inserted = NULL; - if(which < 0) { - return; - } + if (which < 0) + { + return; + } - after_inserted = get_array_item(array, (size_t) which); - if(after_inserted == NULL) { - add_item_to_array(array, newitem); - return; - } + after_inserted = get_array_item(array, (size_t)which); + if (after_inserted == NULL) + { + add_item_to_array(array, newitem); + return; + } - newitem->next = after_inserted; - newitem->prev = after_inserted->prev; - after_inserted->prev = newitem; - if(after_inserted == array->child) { - array->child = newitem; - } else { - newitem->prev->next = newitem; - } + newitem->next = after_inserted; + newitem->prev = after_inserted->prev; + after_inserted->prev = newitem; + if (after_inserted == array->child) + { + array->child = newitem; + } + else + { + newitem->prev->next = newitem; + } } -CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemViaPointer(cJSON * const parent, - cJSON * const item, - cJSON * replacement) +CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemViaPointer(cJSON * const parent, cJSON * const item, cJSON * replacement) { - if((parent == NULL) || - (replacement == NULL) || - (item == NULL)) - { - return false; - } + if ((parent == NULL) || (replacement == NULL) || (item == NULL)) + { + return false; + } - if(replacement == item) { - return true; - } + if (replacement == item) + { + return true; + } - replacement->next = item->next; - replacement->prev = item->prev; + replacement->next = item->next; + replacement->prev = item->prev; - if(replacement->next != NULL) { - replacement->next->prev = replacement; - } - if(replacement->prev != NULL) { - replacement->prev->next = replacement; - } - if(parent->child == item) { - parent->child = replacement; - } + if (replacement->next != NULL) + { + replacement->next->prev = replacement; + } + if (replacement->prev != NULL) + { + replacement->prev->next = replacement; + } + if (parent->child == item) + { + parent->child = replacement; + } - item->next = NULL; - item->prev = NULL; - cJSON_Delete(item); + item->next = NULL; + item->prev = NULL; + cJSON_Delete(item); - return true; + return true; } -CJSON_PUBLIC(void) cJSON_ReplaceItemInArray(cJSON * array, int which, - cJSON * newitem) +CJSON_PUBLIC(void) cJSON_ReplaceItemInArray(cJSON *array, int which, cJSON *newitem) { - if(which < 0) { - return; - } + if (which < 0) + { + return; + } - cJSON_ReplaceItemViaPointer(array, get_array_item(array, - (size_t) which), - newitem); + cJSON_ReplaceItemViaPointer(array, get_array_item(array, (size_t)which), newitem); } -static cJSON_bool replace_item_in_object(cJSON *object, const char *string, - cJSON *replacement, - cJSON_bool case_sensitive) { - if((replacement == NULL) || - (string == NULL)) - { - return false; - } +static cJSON_bool replace_item_in_object(cJSON *object, const char *string, cJSON *replacement, cJSON_bool case_sensitive) +{ + if ((replacement == NULL) || (string == NULL)) + { + return false; + } - /* replace the name in the replacement */ - if(!(replacement->type & cJSON_StringIsConst) && - (replacement->string != NULL)) - { - cJSON_free(replacement->string); - } - replacement->string = (char *) cJSON_strdup( - (const unsigned char *) string, &global_hooks); - replacement->type &= ~cJSON_StringIsConst; + /* replace the name in the replacement */ + if (!(replacement->type & cJSON_StringIsConst) && (replacement->string != NULL)) + { + cJSON_free(replacement->string); + } + replacement->string = (char*)cJSON_strdup((const unsigned char*)string, &global_hooks); + replacement->type &= ~cJSON_StringIsConst; - cJSON_ReplaceItemViaPointer(object, - get_object_item(object, string, - case_sensitive), - replacement); + cJSON_ReplaceItemViaPointer(object, get_object_item(object, string, case_sensitive), replacement); - return true; + return true; } -CJSON_PUBLIC(void) cJSON_ReplaceItemInObject(cJSON * object, const char *string, - cJSON * newitem) +CJSON_PUBLIC(void) cJSON_ReplaceItemInObject(cJSON *object, const char *string, cJSON *newitem) { - replace_item_in_object(object, string, newitem, false); + replace_item_in_object(object, string, newitem, false); } -CJSON_PUBLIC(void) cJSON_ReplaceItemInObjectCaseSensitive(cJSON * object, - const char *string, - cJSON * newitem) +CJSON_PUBLIC(void) cJSON_ReplaceItemInObjectCaseSensitive(cJSON *object, const char *string, cJSON *newitem) { - replace_item_in_object(object, string, newitem, true); + replace_item_in_object(object, string, newitem, true); } /* Create basic types: */ CJSON_PUBLIC(cJSON *) cJSON_CreateNull(void) { - cJSON *item = cJSON_New_Item(&global_hooks); - if(item) { - item->type = cJSON_NULL; - } + cJSON *item = cJSON_New_Item(&global_hooks); + if(item) + { + item->type = cJSON_NULL; + } - return item; + return item; } CJSON_PUBLIC(cJSON *) cJSON_CreateTrue(void) { - cJSON *item = cJSON_New_Item(&global_hooks); - if(item) { - item->type = cJSON_True; - } + cJSON *item = cJSON_New_Item(&global_hooks); + if(item) + { + item->type = cJSON_True; + } - return item; + return item; } CJSON_PUBLIC(cJSON *) cJSON_CreateFalse(void) { - cJSON *item = cJSON_New_Item(&global_hooks); - if(item) { - item->type = cJSON_False; - } + cJSON *item = cJSON_New_Item(&global_hooks); + if(item) + { + item->type = cJSON_False; + } - return item; + return item; } CJSON_PUBLIC(cJSON *) cJSON_CreateBool(cJSON_bool b) { - cJSON *item = cJSON_New_Item(&global_hooks); - if(item) { - item->type = b ? cJSON_True : cJSON_False; - } + cJSON *item = cJSON_New_Item(&global_hooks); + if(item) + { + item->type = b ? cJSON_True : cJSON_False; + } - return item; + return item; } CJSON_PUBLIC(cJSON *) cJSON_CreateNumber(double num) { - cJSON *item = cJSON_New_Item(&global_hooks); - if(item) { - item->type = cJSON_Number; - item->valuedouble = num; - - /* use saturation in case of overflow */ - if(num >= INT_MAX) { - item->valueint = INT_MAX; - } else if(num <= INT_MIN) { - item->valueint = INT_MIN; - } else { - item->valueint = (int) num; - } - } - - return item; + cJSON *item = cJSON_New_Item(&global_hooks); + if(item) + { + item->type = cJSON_Number; + item->valuedouble = num; + + /* use saturation in case of overflow */ + if (num >= INT_MAX) + { + item->valueint = INT_MAX; + } + else if (num <= INT_MIN) + { + item->valueint = INT_MIN; + } + else + { + item->valueint = (int)num; + } + } + + return item; } CJSON_PUBLIC(cJSON *) cJSON_CreateString(const char *string) { - cJSON *item = cJSON_New_Item(&global_hooks); - if(item) { - item->type = cJSON_String; - item->valuestring = (char *) cJSON_strdup( - (const unsigned char *) string, &global_hooks); - if(!item->valuestring) { - cJSON_Delete(item); - return NULL; - } - } + cJSON *item = cJSON_New_Item(&global_hooks); + if(item) + { + item->type = cJSON_String; + item->valuestring = (char*)cJSON_strdup((const unsigned char*)string, &global_hooks); + if(!item->valuestring) + { + cJSON_Delete(item); + return NULL; + } + } - return item; + return item; } CJSON_PUBLIC(cJSON *) cJSON_CreateStringReference(const char *string) { - cJSON *item = cJSON_New_Item(&global_hooks); - if(item != NULL) { - item->type = cJSON_String | cJSON_IsReference; - item->valuestring = (char *) cast_away_const(string); - } + cJSON *item = cJSON_New_Item(&global_hooks); + if (item != NULL) + { + item->type = cJSON_String | cJSON_IsReference; + item->valuestring = (char*)cast_away_const(string); + } - return item; + return item; } -CJSON_PUBLIC(cJSON *) cJSON_CreateObjectReference(const cJSON * child) +CJSON_PUBLIC(cJSON *) cJSON_CreateObjectReference(const cJSON *child) { - cJSON *item = cJSON_New_Item(&global_hooks); - if(item != NULL) { - item->type = cJSON_Object | cJSON_IsReference; - item->child = (cJSON *) cast_away_const(child); - } + cJSON *item = cJSON_New_Item(&global_hooks); + if (item != NULL) { + item->type = cJSON_Object | cJSON_IsReference; + item->child = (cJSON*)cast_away_const(child); + } - return item; + return item; } -CJSON_PUBLIC(cJSON *) cJSON_CreateArrayReference(const cJSON * child) { - cJSON *item = cJSON_New_Item(&global_hooks); - if(item != NULL) { - item->type = cJSON_Array | cJSON_IsReference; - item->child = (cJSON *) cast_away_const(child); - } +CJSON_PUBLIC(cJSON *) cJSON_CreateArrayReference(const cJSON *child) { + cJSON *item = cJSON_New_Item(&global_hooks); + if (item != NULL) { + item->type = cJSON_Array | cJSON_IsReference; + item->child = (cJSON*)cast_away_const(child); + } - return item; + return item; } CJSON_PUBLIC(cJSON *) cJSON_CreateRaw(const char *raw) { - cJSON *item = cJSON_New_Item(&global_hooks); - if(item) { - item->type = cJSON_Raw; - item->valuestring = (char *) cJSON_strdup( - (const unsigned char *) raw, &global_hooks); - if(!item->valuestring) { - cJSON_Delete(item); - return NULL; - } - } + cJSON *item = cJSON_New_Item(&global_hooks); + if(item) + { + item->type = cJSON_Raw; + item->valuestring = (char*)cJSON_strdup((const unsigned char*)raw, &global_hooks); + if(!item->valuestring) + { + cJSON_Delete(item); + return NULL; + } + } - return item; + return item; } CJSON_PUBLIC(cJSON *) cJSON_CreateArray(void) { - cJSON *item = cJSON_New_Item(&global_hooks); - if(item) { - item->type = cJSON_Array; - } + cJSON *item = cJSON_New_Item(&global_hooks); + if(item) + { + item->type=cJSON_Array; + } - return item; + return item; } CJSON_PUBLIC(cJSON *) cJSON_CreateObject(void) { - cJSON *item = cJSON_New_Item(&global_hooks); - if(item) { - item->type = cJSON_Object; - } + cJSON *item = cJSON_New_Item(&global_hooks); + if (item) + { + item->type = cJSON_Object; + } - return item; + return item; } /* Create Arrays: */ CJSON_PUBLIC(cJSON *) cJSON_CreateIntArray(const int *numbers, int count) { - size_t i = 0; - cJSON *n = NULL; - cJSON *p = NULL; - cJSON *a = NULL; - - if((count < 0) || - (numbers == NULL)) - { - return NULL; - } - - a = cJSON_CreateArray(); - for(i = 0; a && - (i < (size_t) count); i++) - { - n = cJSON_CreateNumber(numbers[i]); - if(!n) { - cJSON_Delete(a); - return NULL; - } - if(!i) { - a->child = n; - } else { - suffix_object(p, n); - } - p = n; - } - - return a; + size_t i = 0; + cJSON *n = NULL; + cJSON *p = NULL; + cJSON *a = NULL; + + if ((count < 0) || (numbers == NULL)) + { + return NULL; + } + + a = cJSON_CreateArray(); + for(i = 0; a && (i < (size_t)count); i++) + { + n = cJSON_CreateNumber(numbers[i]); + if (!n) + { + cJSON_Delete(a); + return NULL; + } + if(!i) + { + a->child = n; + } + else + { + suffix_object(p, n); + } + p = n; + } + + return a; } CJSON_PUBLIC(cJSON *) cJSON_CreateFloatArray(const float *numbers, int count) { - size_t i = 0; - cJSON *n = NULL; - cJSON *p = NULL; - cJSON *a = NULL; - - if((count < 0) || - (numbers == NULL)) - { - return NULL; - } - - a = cJSON_CreateArray(); - - for(i = 0; a && - (i < (size_t) count); i++) - { - n = cJSON_CreateNumber((double) numbers[i]); - if(!n) { - cJSON_Delete(a); - return NULL; - } - if(!i) { - a->child = n; - } else { - suffix_object(p, n); - } - p = n; - } - - return a; + size_t i = 0; + cJSON *n = NULL; + cJSON *p = NULL; + cJSON *a = NULL; + + if ((count < 0) || (numbers == NULL)) + { + return NULL; + } + + a = cJSON_CreateArray(); + + for(i = 0; a && (i < (size_t)count); i++) + { + n = cJSON_CreateNumber((double)numbers[i]); + if(!n) + { + cJSON_Delete(a); + return NULL; + } + if(!i) + { + a->child = n; + } + else + { + suffix_object(p, n); + } + p = n; + } + + return a; } CJSON_PUBLIC(cJSON *) cJSON_CreateDoubleArray(const double *numbers, int count) { - size_t i = 0; - cJSON *n = NULL; - cJSON *p = NULL; - cJSON *a = NULL; - - if((count < 0) || - (numbers == NULL)) - { - return NULL; - } - - a = cJSON_CreateArray(); - - for(i = 0; a && - (i < (size_t) count); i++) - { - n = cJSON_CreateNumber(numbers[i]); - if(!n) { - cJSON_Delete(a); - return NULL; - } - if(!i) { - a->child = n; - } else { - suffix_object(p, n); - } - p = n; - } - - return a; + size_t i = 0; + cJSON *n = NULL; + cJSON *p = NULL; + cJSON *a = NULL; + + if ((count < 0) || (numbers == NULL)) + { + return NULL; + } + + a = cJSON_CreateArray(); + + for(i = 0;a && (i < (size_t)count); i++) + { + n = cJSON_CreateNumber(numbers[i]); + if(!n) + { + cJSON_Delete(a); + return NULL; + } + if(!i) + { + a->child = n; + } + else + { + suffix_object(p, n); + } + p = n; + } + + return a; } CJSON_PUBLIC(cJSON *) cJSON_CreateStringArray(const char **strings, int count) { - size_t i = 0; - cJSON *n = NULL; - cJSON *p = NULL; - cJSON *a = NULL; - - if((count < 0) || - (strings == NULL)) - { - return NULL; - } - - a = cJSON_CreateArray(); - - for(i = 0; a && - (i < (size_t) count); i++) - { - n = cJSON_CreateString(strings[i]); - if(!n) { - cJSON_Delete(a); - return NULL; - } - if(!i) { - a->child = n; - } else { - suffix_object(p, n); - } - p = n; - } - - return a; + size_t i = 0; + cJSON *n = NULL; + cJSON *p = NULL; + cJSON *a = NULL; + + if ((count < 0) || (strings == NULL)) + { + return NULL; + } + + a = cJSON_CreateArray(); + + for (i = 0; a && (i < (size_t)count); i++) + { + n = cJSON_CreateString(strings[i]); + if(!n) + { + cJSON_Delete(a); + return NULL; + } + if(!i) + { + a->child = n; + } + else + { + suffix_object(p,n); + } + p = n; + } + + return a; } /* Duplication */ -CJSON_PUBLIC(cJSON *) cJSON_Duplicate(const cJSON * item, cJSON_bool recurse) -{ - cJSON *newitem = NULL; - cJSON *child = NULL; - cJSON *next = NULL; - cJSON *newchild = NULL; - - /* Bail on bad ptr */ - if(!item) { - goto fail; - } - /* Create new item */ - newitem = cJSON_New_Item(&global_hooks); - if(!newitem) { - goto fail; - } - /* Copy over all vars */ - newitem->type = item->type & (~cJSON_IsReference); - newitem->valueint = item->valueint; - newitem->valuedouble = item->valuedouble; - if(item->valuestring) { - newitem->valuestring = (char *) cJSON_strdup( - (unsigned char *) item->valuestring, &global_hooks); - if(!newitem->valuestring) { - goto fail; - } - } - if(item->string) { - newitem->string = - (item->type & - cJSON_StringIsConst) ? item->string : (char *) - cJSON_strdup(( - unsigned - char *) item->string, - &global_hooks); - if(!newitem->string) { - goto fail; - } - } - /* If non-recursive, then we're done! */ - if(!recurse) { - return newitem; - } - /* Walk the ->next chain for the child. */ - child = item->child; - while(child != NULL) { - newchild = cJSON_Duplicate(child, true); /* Duplicate (with recurse) each item in the ->next chain */ - if(!newchild) { - goto fail; - } - if(next != NULL) { - /* If newitem->child already set, then crosswire ->prev and ->next and move on */ - next->next = newchild; - newchild->prev = next; - next = newchild; - } else { - /* Set newitem->child and move to it */ - newitem->child = newchild; - next = newchild; - } - child = child->next; - } - - return newitem; +CJSON_PUBLIC(cJSON *) cJSON_Duplicate(const cJSON *item, cJSON_bool recurse) +{ + cJSON *newitem = NULL; + cJSON *child = NULL; + cJSON *next = NULL; + cJSON *newchild = NULL; + + /* Bail on bad ptr */ + if (!item) + { + goto fail; + } + /* Create new item */ + newitem = cJSON_New_Item(&global_hooks); + if (!newitem) + { + goto fail; + } + /* Copy over all vars */ + newitem->type = item->type & (~cJSON_IsReference); + newitem->valueint = item->valueint; + newitem->valuedouble = item->valuedouble; + if (item->valuestring) + { + newitem->valuestring = (char*)cJSON_strdup((unsigned char*)item->valuestring, &global_hooks); + if (!newitem->valuestring) + { + goto fail; + } + } + if (item->string) + { + newitem->string = (item->type&cJSON_StringIsConst) ? item->string : (char*)cJSON_strdup((unsigned char*)item->string, &global_hooks); + if (!newitem->string) + { + goto fail; + } + } + /* If non-recursive, then we're done! */ + if (!recurse) + { + return newitem; + } + /* Walk the ->next chain for the child. */ + child = item->child; + while (child != NULL) + { + newchild = cJSON_Duplicate(child, true); /* Duplicate (with recurse) each item in the ->next chain */ + if (!newchild) + { + goto fail; + } + if (next != NULL) + { + /* If newitem->child already set, then crosswire ->prev and ->next and move on */ + next->next = newchild; + newchild->prev = next; + next = newchild; + } + else + { + /* Set newitem->child and move to it */ + newitem->child = newchild; + next = newchild; + } + child = child->next; + } + + return newitem; fail: - if(newitem != NULL) { - cJSON_Delete(newitem); - } + if (newitem != NULL) + { + cJSON_Delete(newitem); + } - return NULL; + return NULL; } CJSON_PUBLIC(void) cJSON_Minify(char *json) { - unsigned char *into = (unsigned char *) json; - - if(json == NULL) { - return; - } - - while(*json) { - if(*json == ' ') { - json++; - } else if(*json == '\t') { - /* Whitespace characters. */ - json++; - } else if(*json == '\r') { - json++; - } else if(*json == '\n') { - json++; - } else if((*json == '/') && - (json[1] == '/')) - { - /* double-slash comments, to end of line. */ - while(*json && - (*json != '\n')) - { - json++; - } - } else if((*json == '/') && - (json[1] == '*')) - { - /* multiline comments. */ - while(*json && - !((*json == '*') && - (json[1] == '/'))) - { - json++; - } - json += 2; - } else if(*json == '\"') { - /* string literals, which are \" sensitive. */ - *into++ = (unsigned char) *json++; - while(*json && - (*json != '\"')) - { - if(*json == '\\') { - *into++ = (unsigned char) *json++; - } - *into++ = (unsigned char) *json++; - } - *into++ = (unsigned char) *json++; - } else { - /* All other characters. */ - *into++ = (unsigned char) *json++; - } - } - - /* and null-terminate. */ - *into = '\0'; + unsigned char *into = (unsigned char*)json; + + if (json == NULL) + { + return; + } + + while (*json) + { + if (*json == ' ') + { + json++; + } + else if (*json == '\t') + { + /* Whitespace characters. */ + json++; + } + else if (*json == '\r') + { + json++; + } + else if (*json=='\n') + { + json++; + } + else if ((*json == '/') && (json[1] == '/')) + { + /* double-slash comments, to end of line. */ + while (*json && (*json != '\n')) + { + json++; + } + } + else if ((*json == '/') && (json[1] == '*')) + { + /* multiline comments. */ + while (*json && !((*json == '*') && (json[1] == '/'))) + { + json++; + } + json += 2; + } + else if (*json == '\"') + { + /* string literals, which are \" sensitive. */ + *into++ = (unsigned char)*json++; + while (*json && (*json != '\"')) + { + if (*json == '\\') + { + *into++ = (unsigned char)*json++; + } + *into++ = (unsigned char)*json++; + } + *into++ = (unsigned char)*json++; + } + else + { + /* All other characters. */ + *into++ = (unsigned char)*json++; + } + } + + /* and null-terminate. */ + *into = '\0'; } CJSON_PUBLIC(cJSON_bool) cJSON_IsInvalid(const cJSON * const item) { - if(item == NULL) { - return false; - } + if (item == NULL) + { + return false; + } - return (item->type & 0xFF) == cJSON_Invalid; + return (item->type & 0xFF) == cJSON_Invalid; } CJSON_PUBLIC(cJSON_bool) cJSON_IsFalse(const cJSON * const item) { - if(item == NULL) { - return false; - } + if (item == NULL) + { + return false; + } - return (item->type & 0xFF) == cJSON_False; + return (item->type & 0xFF) == cJSON_False; } CJSON_PUBLIC(cJSON_bool) cJSON_IsTrue(const cJSON * const item) { - if(item == NULL) { - return false; - } + if (item == NULL) + { + return false; + } - return (item->type & 0xff) == cJSON_True; + return (item->type & 0xff) == cJSON_True; } CJSON_PUBLIC(cJSON_bool) cJSON_IsBool(const cJSON * const item) { - if(item == NULL) { - return false; - } + if (item == NULL) + { + return false; + } - return (item->type & (cJSON_True | cJSON_False)) != 0; + return (item->type & (cJSON_True | cJSON_False)) != 0; } CJSON_PUBLIC(cJSON_bool) cJSON_IsNull(const cJSON * const item) { - if(item == NULL) { - return false; - } + if (item == NULL) + { + return false; + } - return (item->type & 0xFF) == cJSON_NULL; + return (item->type & 0xFF) == cJSON_NULL; } CJSON_PUBLIC(cJSON_bool) cJSON_IsNumber(const cJSON * const item) { - if(item == NULL) { - return false; - } + if (item == NULL) + { + return false; + } - return (item->type & 0xFF) == cJSON_Number; + return (item->type & 0xFF) == cJSON_Number; } CJSON_PUBLIC(cJSON_bool) cJSON_IsString(const cJSON * const item) { - if(item == NULL) { - return false; - } + if (item == NULL) + { + return false; + } - return (item->type & 0xFF) == cJSON_String; + return (item->type & 0xFF) == cJSON_String; } CJSON_PUBLIC(cJSON_bool) cJSON_IsArray(const cJSON * const item) { - if(item == NULL) { - return false; - } + if (item == NULL) + { + return false; + } - return (item->type & 0xFF) == cJSON_Array; + return (item->type & 0xFF) == cJSON_Array; } CJSON_PUBLIC(cJSON_bool) cJSON_IsObject(const cJSON * const item) { - if(item == NULL) { - return false; - } + if (item == NULL) + { + return false; + } - return (item->type & 0xFF) == cJSON_Object; + return (item->type & 0xFF) == cJSON_Object; } CJSON_PUBLIC(cJSON_bool) cJSON_IsRaw(const cJSON * const item) { - if(item == NULL) { - return false; - } - - return (item->type & 0xFF) == cJSON_Raw; -} - -CJSON_PUBLIC(cJSON_bool) cJSON_Compare(const cJSON * const a, - const cJSON * const b, - const cJSON_bool case_sensitive) -{ - if((a == NULL) || - (b == NULL) || - ((a->type & 0xFF) != (b->type & 0xFF)) || - cJSON_IsInvalid(a)) - { - return false; - } - - /* check if type is valid */ - switch(a->type & 0xFF) { - case cJSON_False: - case cJSON_True: - case cJSON_NULL: - case cJSON_Number: - case cJSON_String: - case cJSON_Raw: - case cJSON_Array: - case cJSON_Object: - break; - - default: - return false; - } - - /* identical objects are equal */ - if(a == b) { - return true; - } - - switch(a->type & 0xFF) { - /* in these cases and equal type is enough */ - case cJSON_False: - case cJSON_True: - case cJSON_NULL: - return true; - - case cJSON_Number: - if(a->valuedouble == b->valuedouble) { - return true; - } - return false; - - case cJSON_String: - case cJSON_Raw: - if((a->valuestring == NULL) || - (b->valuestring == NULL)) - { - return false; - } - if(strcmp(a->valuestring, b->valuestring) == 0) { - return true; - } - - return false; - - case cJSON_Array: - { - cJSON *a_element = a->child; - cJSON *b_element = b->child; - - for( ; (a_element != NULL) && - (b_element != NULL); ) - { - if(!cJSON_Compare(a_element, b_element, - case_sensitive)) { - return false; - } - - a_element = a_element->next; - b_element = b_element->next; - } - - /* one of the arrays is longer than the other */ - if(a_element != b_element) { - return false; - } - - return true; - } - - case cJSON_Object: - { - cJSON *a_element = NULL; - cJSON *b_element = NULL; - cJSON_ArrayForEach(a_element, a) - { - /* TODO This has O(n^2) runtime, which is horrible! */ - b_element = get_object_item(b, a_element->string, - case_sensitive); - if(b_element == NULL) { - return false; - } - - if(!cJSON_Compare(a_element, b_element, - case_sensitive)) { - return false; - } - } - - /* doing this twice, once on a and b to prevent true comparison if a subset of b - * TODO: Do this the proper way, this is just a fix for now */ - cJSON_ArrayForEach(b_element, b) - { - a_element = get_object_item(a, b_element->string, - case_sensitive); - if(a_element == NULL) { - return false; - } - - if(!cJSON_Compare(b_element, a_element, - case_sensitive)) { - return false; - } - } - - return true; - } - - default: - return false; - } + if (item == NULL) + { + return false; + } + + return (item->type & 0xFF) == cJSON_Raw; +} + +CJSON_PUBLIC(cJSON_bool) cJSON_Compare(const cJSON * const a, const cJSON * const b, const cJSON_bool case_sensitive) +{ + if ((a == NULL) || (b == NULL) || ((a->type & 0xFF) != (b->type & 0xFF)) || cJSON_IsInvalid(a)) + { + return false; + } + + /* check if type is valid */ + switch (a->type & 0xFF) + { + case cJSON_False: + case cJSON_True: + case cJSON_NULL: + case cJSON_Number: + case cJSON_String: + case cJSON_Raw: + case cJSON_Array: + case cJSON_Object: + break; + + default: + return false; + } + + /* identical objects are equal */ + if (a == b) + { + return true; + } + + switch (a->type & 0xFF) + { + /* in these cases and equal type is enough */ + case cJSON_False: + case cJSON_True: + case cJSON_NULL: + return true; + + case cJSON_Number: + if (a->valuedouble == b->valuedouble) + { + return true; + } + return false; + + case cJSON_String: + case cJSON_Raw: + if ((a->valuestring == NULL) || (b->valuestring == NULL)) + { + return false; + } + if (strcmp(a->valuestring, b->valuestring) == 0) + { + return true; + } + + return false; + + case cJSON_Array: + { + cJSON *a_element = a->child; + cJSON *b_element = b->child; + + for (; (a_element != NULL) && (b_element != NULL);) + { + if (!cJSON_Compare(a_element, b_element, case_sensitive)) + { + return false; + } + + a_element = a_element->next; + b_element = b_element->next; + } + + /* one of the arrays is longer than the other */ + if (a_element != b_element) { + return false; + } + + return true; + } + + case cJSON_Object: + { + cJSON *a_element = NULL; + cJSON *b_element = NULL; + cJSON_ArrayForEach(a_element, a) + { + /* TODO This has O(n^2) runtime, which is horrible! */ + b_element = get_object_item(b, a_element->string, case_sensitive); + if (b_element == NULL) + { + return false; + } + + if (!cJSON_Compare(a_element, b_element, case_sensitive)) + { + return false; + } + } + + /* doing this twice, once on a and b to prevent true comparison if a subset of b + * TODO: Do this the proper way, this is just a fix for now */ + cJSON_ArrayForEach(b_element, b) + { + a_element = get_object_item(a, b_element->string, case_sensitive); + if (a_element == NULL) + { + return false; + } + + if (!cJSON_Compare(b_element, a_element, case_sensitive)) + { + return false; + } + } + + return true; + } + + default: + return false; + } } CJSON_PUBLIC(void *) cJSON_malloc(size_t size) { - return global_hooks.allocate(size); + return global_hooks.allocate(size); } CJSON_PUBLIC(void) cJSON_free(void *object) { - global_hooks.deallocate(object); + global_hooks.deallocate(object); } diff --git a/samples/client/petstore/c/external/cJSON.h b/samples/client/petstore/c/external/cJSON.h index f35925db6ff7..6e0bde93204b 100644 --- a/samples/client/petstore/c/external/cJSON.h +++ b/samples/client/petstore/c/external/cJSON.h @@ -1,24 +1,24 @@ /* - Copyright (c) 2009-2017 Dave Gamble and cJSON contributors - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - */ + Copyright (c) 2009-2017 Dave Gamble and cJSON contributors + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +*/ #ifndef cJSON__h #define cJSON__h @@ -37,94 +37,87 @@ extern "C" /* cJSON Types: */ #define cJSON_Invalid (0) -#define cJSON_False (1 << 0) -#define cJSON_True (1 << 1) -#define cJSON_NULL (1 << 2) +#define cJSON_False (1 << 0) +#define cJSON_True (1 << 1) +#define cJSON_NULL (1 << 2) #define cJSON_Number (1 << 3) #define cJSON_String (1 << 4) -#define cJSON_Array (1 << 5) +#define cJSON_Array (1 << 5) #define cJSON_Object (1 << 6) -#define cJSON_Raw (1 << 7) /* raw json */ +#define cJSON_Raw (1 << 7) /* raw json */ #define cJSON_IsReference 256 #define cJSON_StringIsConst 512 /* The cJSON structure: */ -typedef struct cJSON { - /* next/prev allow you to walk array/object chains. Alternatively, use GetArraySize/GetArrayItem/GetObjectItem */ - struct cJSON *next; - struct cJSON *prev; - /* An array or object item will have a child pointer pointing to a chain of the items in the array/object. */ - struct cJSON *child; - - /* The type of the item, as above. */ - int type; - - /* The item's string, if type==cJSON_String and type == cJSON_Raw */ - char *valuestring; - /* writing to valueint is DEPRECATED, use cJSON_SetNumberValue instead */ - int valueint; - /* The item's number, if type==cJSON_Number */ - double valuedouble; - - /* The item's name string, if this item is the child of, or is in the list of subitems of an object. */ - char *string; +typedef struct cJSON +{ + /* next/prev allow you to walk array/object chains. Alternatively, use GetArraySize/GetArrayItem/GetObjectItem */ + struct cJSON *next; + struct cJSON *prev; + /* An array or object item will have a child pointer pointing to a chain of the items in the array/object. */ + struct cJSON *child; + + /* The type of the item, as above. */ + int type; + + /* The item's string, if type==cJSON_String and type == cJSON_Raw */ + char *valuestring; + /* writing to valueint is DEPRECATED, use cJSON_SetNumberValue instead */ + int valueint; + /* The item's number, if type==cJSON_Number */ + double valuedouble; + + /* The item's name string, if this item is the child of, or is in the list of subitems of an object. */ + char *string; } cJSON; -typedef struct cJSON_Hooks { - void *(*malloc_fn)(size_t sz); - void (*free_fn)(void *ptr); +typedef struct cJSON_Hooks +{ + void *(*malloc_fn)(size_t sz); + void (*free_fn)(void *ptr); } cJSON_Hooks; typedef int cJSON_bool; -#if !defined(__WINDOWS__) && \ - (defined(WIN32) || \ - defined(WIN64) || \ - defined(_MSC_VER) || \ - defined(_WIN32)) +#if !defined(__WINDOWS__) && (defined(WIN32) || defined(WIN64) || defined(_MSC_VER) || defined(_WIN32)) #define __WINDOWS__ #endif #ifdef __WINDOWS__ /* When compiling for windows, we specify a specific calling convention to avoid issues where we are being called from a project with a different default calling convention. For windows you have 2 define options: - CJSON_HIDE_SYMBOLS - Define this in the case where you don't want to ever dllexport symbols - CJSON_EXPORT_SYMBOLS - Define this on library build when you want to dllexport symbols (default) - CJSON_IMPORT_SYMBOLS - Define this if you want to dllimport symbol +CJSON_HIDE_SYMBOLS - Define this in the case where you don't want to ever dllexport symbols +CJSON_EXPORT_SYMBOLS - Define this on library build when you want to dllexport symbols (default) +CJSON_IMPORT_SYMBOLS - Define this if you want to dllimport symbol - For *nix builds that support visibility attribute, you can define similar behavior by +For *nix builds that support visibility attribute, you can define similar behavior by - setting default visibility to hidden by adding - -fvisibility=hidden (for gcc) - or - -xldscope=hidden (for sun cc) - to CFLAGS +setting default visibility to hidden by adding +-fvisibility=hidden (for gcc) +or +-xldscope=hidden (for sun cc) +to CFLAGS - then using the CJSON_API_VISIBILITY flag to "export" the same symbols the way CJSON_EXPORT_SYMBOLS does +then using the CJSON_API_VISIBILITY flag to "export" the same symbols the way CJSON_EXPORT_SYMBOLS does - */ +*/ /* export symbols by default, this is necessary for copy pasting the C and header file */ -#if !defined(CJSON_HIDE_SYMBOLS) && \ - !defined(CJSON_IMPORT_SYMBOLS) && \ - !defined(CJSON_EXPORT_SYMBOLS) +#if !defined(CJSON_HIDE_SYMBOLS) && !defined(CJSON_IMPORT_SYMBOLS) && !defined(CJSON_EXPORT_SYMBOLS) #define CJSON_EXPORT_SYMBOLS #endif #if defined(CJSON_HIDE_SYMBOLS) -#define CJSON_PUBLIC(type) type __stdcall +#define CJSON_PUBLIC(type) type __stdcall #elif defined(CJSON_EXPORT_SYMBOLS) -#define CJSON_PUBLIC(type) __declspec(dllexport) type __stdcall +#define CJSON_PUBLIC(type) __declspec(dllexport) type __stdcall #elif defined(CJSON_IMPORT_SYMBOLS) -#define CJSON_PUBLIC(type) __declspec(dllimport) type __stdcall +#define CJSON_PUBLIC(type) __declspec(dllimport) type __stdcall #endif #else /* !WIN32 */ -#if (defined(__GNUC__) || \ - defined(__SUNPRO_CC) || \ - defined(__SUNPRO_C)) && \ - defined(CJSON_API_VISIBILITY) -#define CJSON_PUBLIC(type) __attribute__((visibility("default"))) type +#if (defined(__GNUC__) || defined(__SUNPRO_CC) || defined (__SUNPRO_C)) && defined(CJSON_API_VISIBILITY) +#define CJSON_PUBLIC(type) __attribute__((visibility("default"))) type #else #define CJSON_PUBLIC(type) type #endif @@ -137,51 +130,43 @@ typedef int cJSON_bool; #endif /* returns the version of cJSON as a string */ -CJSON_PUBLIC(const char *) cJSON_Version(void); +CJSON_PUBLIC(const char*) cJSON_Version(void); /* Supply malloc, realloc and free functions to cJSON */ -CJSON_PUBLIC(void) cJSON_InitHooks(cJSON_Hooks * hooks); +CJSON_PUBLIC(void) cJSON_InitHooks(cJSON_Hooks* hooks); /* Memory Management: the caller is always responsible to free the results from all variants of cJSON_Parse (with cJSON_Delete) and cJSON_Print (with stdlib free, cJSON_Hooks.free_fn, or cJSON_free as appropriate). The exception is cJSON_PrintPreallocated, where the caller has full responsibility of the buffer. */ /* Supply a block of JSON, and this returns a cJSON object you can interrogate. */ CJSON_PUBLIC(cJSON *) cJSON_Parse(const char *value); /* ParseWithOpts allows you to require (and check) that the JSON is null terminated, and to retrieve the pointer to the final byte parsed. */ /* If you supply a ptr in return_parse_end and parsing fails, then return_parse_end will contain a pointer to the error so will match cJSON_GetErrorPtr(). */ -CJSON_PUBLIC(cJSON *) cJSON_ParseWithOpts(const char *value, - const char **return_parse_end, - cJSON_bool require_null_terminated); +CJSON_PUBLIC(cJSON *) cJSON_ParseWithOpts(const char *value, const char **return_parse_end, cJSON_bool require_null_terminated); /* Render a cJSON entity to text for transfer/storage. */ -CJSON_PUBLIC(char *) cJSON_Print(const cJSON * item); +CJSON_PUBLIC(char *) cJSON_Print(const cJSON *item); /* Render a cJSON entity to text for transfer/storage without any formatting. */ -CJSON_PUBLIC(char *) cJSON_PrintUnformatted(const cJSON * item); +CJSON_PUBLIC(char *) cJSON_PrintUnformatted(const cJSON *item); /* Render a cJSON entity to text using a buffered strategy. prebuffer is a guess at the final size. guessing well reduces reallocation. fmt=0 gives unformatted, =1 gives formatted */ -CJSON_PUBLIC(char *) cJSON_PrintBuffered(const cJSON * item, int prebuffer, - cJSON_bool fmt); +CJSON_PUBLIC(char *) cJSON_PrintBuffered(const cJSON *item, int prebuffer, cJSON_bool fmt); /* Render a cJSON entity to text using a buffer already allocated in memory with given length. Returns 1 on success and 0 on failure. */ /* NOTE: cJSON is not always 100% accurate in estimating how much memory it will use, so to be safe allocate 5 bytes more than you actually need */ -CJSON_PUBLIC(cJSON_bool) cJSON_PrintPreallocated(cJSON * item, char *buffer, - const int length, - const cJSON_bool format); +CJSON_PUBLIC(cJSON_bool) cJSON_PrintPreallocated(cJSON *item, char *buffer, const int length, const cJSON_bool format); /* Delete a cJSON entity and all subentities. */ -CJSON_PUBLIC(void) cJSON_Delete(cJSON * c); +CJSON_PUBLIC(void) cJSON_Delete(cJSON *c); /* Returns the number of items in an array (or object). */ -CJSON_PUBLIC(int) cJSON_GetArraySize(const cJSON * array); +CJSON_PUBLIC(int) cJSON_GetArraySize(const cJSON *array); /* Retrieve item number "index" from array "array". Returns NULL if unsuccessful. */ -CJSON_PUBLIC(cJSON *) cJSON_GetArrayItem(const cJSON * array, int index); +CJSON_PUBLIC(cJSON *) cJSON_GetArrayItem(const cJSON *array, int index); /* Get item "string" from object. Case insensitive. */ -CJSON_PUBLIC(cJSON *) cJSON_GetObjectItem(const cJSON * const object, - const char *const string); -CJSON_PUBLIC(cJSON *) cJSON_GetObjectItemCaseSensitive( - const cJSON * const object, const char *const string); -CJSON_PUBLIC(cJSON_bool) cJSON_HasObjectItem(const cJSON * object, - const char *string); +CJSON_PUBLIC(cJSON *) cJSON_GetObjectItem(const cJSON * const object, const char * const string); +CJSON_PUBLIC(cJSON *) cJSON_GetObjectItemCaseSensitive(const cJSON * const object, const char * const string); +CJSON_PUBLIC(cJSON_bool) cJSON_HasObjectItem(const cJSON *object, const char *string); /* For analysing failed parses. This returns a pointer to the parse error. You'll probably need to look a few chars back to make sense of it. Defined when cJSON_Parse() returns 0. 0 when cJSON_Parse() succeeds. */ CJSON_PUBLIC(const char *) cJSON_GetErrorPtr(void); /* Check if the item is a string and return its valuestring */ -CJSON_PUBLIC(char *) cJSON_GetStringValue(cJSON * item); +CJSON_PUBLIC(char *) cJSON_GetStringValue(cJSON *item); /* These functions check the type of an item */ CJSON_PUBLIC(cJSON_bool) cJSON_IsInvalid(const cJSON * const item); @@ -212,8 +197,8 @@ CJSON_PUBLIC(cJSON *) cJSON_CreateObject(void); CJSON_PUBLIC(cJSON *) cJSON_CreateStringReference(const char *string); /* Create an object/arrray that only references it's elements so * they will not be freed by cJSON_Delete */ -CJSON_PUBLIC(cJSON *) cJSON_CreateObjectReference(const cJSON * child); -CJSON_PUBLIC(cJSON *) cJSON_CreateArrayReference(const cJSON * child); +CJSON_PUBLIC(cJSON *) cJSON_CreateObjectReference(const cJSON *child); +CJSON_PUBLIC(cJSON *) cJSON_CreateArrayReference(const cJSON *child); /* These utilities create an Array of count items. */ CJSON_PUBLIC(cJSON *) cJSON_CreateIntArray(const int *numbers, int count); @@ -222,109 +207,64 @@ CJSON_PUBLIC(cJSON *) cJSON_CreateDoubleArray(const double *numbers, int count); CJSON_PUBLIC(cJSON *) cJSON_CreateStringArray(const char **strings, int count); /* Append item to the specified array/object. */ -CJSON_PUBLIC(void) cJSON_AddItemToArray(cJSON * array, cJSON * item); -CJSON_PUBLIC(void) cJSON_AddItemToObject(cJSON * object, const char *string, - cJSON * item); +CJSON_PUBLIC(void) cJSON_AddItemToArray(cJSON *array, cJSON *item); +CJSON_PUBLIC(void) cJSON_AddItemToObject(cJSON *object, const char *string, cJSON *item); /* Use this when string is definitely const (i.e. a literal, or as good as), and will definitely survive the cJSON object. * WARNING: When this function was used, make sure to always check that (item->type & cJSON_StringIsConst) is zero before * writing to `item->string` */ -CJSON_PUBLIC(void) cJSON_AddItemToObjectCS(cJSON * object, const char *string, - cJSON * item); +CJSON_PUBLIC(void) cJSON_AddItemToObjectCS(cJSON *object, const char *string, cJSON *item); /* Append reference to item to the specified array/object. Use this when you want to add an existing cJSON to a new cJSON, but don't want to corrupt your existing cJSON. */ -CJSON_PUBLIC(void) cJSON_AddItemReferenceToArray(cJSON * array, cJSON * item); -CJSON_PUBLIC(void) cJSON_AddItemReferenceToObject(cJSON * object, - const char *string, - cJSON * item); +CJSON_PUBLIC(void) cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item); +CJSON_PUBLIC(void) cJSON_AddItemReferenceToObject(cJSON *object, const char *string, cJSON *item); /* Remove/Detatch items from Arrays/Objects. */ -CJSON_PUBLIC(cJSON *) cJSON_DetachItemViaPointer(cJSON * parent, - cJSON * const item); -CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromArray(cJSON * array, int which); -CJSON_PUBLIC(void) cJSON_DeleteItemFromArray(cJSON * array, int which); -CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObject(cJSON * object, - const char *string); -CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObjectCaseSensitive(cJSON * object, - const char *string); -CJSON_PUBLIC(void) cJSON_DeleteItemFromObject(cJSON * object, - const char *string); -CJSON_PUBLIC(void) cJSON_DeleteItemFromObjectCaseSensitive(cJSON * object, - const char *string); +CJSON_PUBLIC(cJSON *) cJSON_DetachItemViaPointer(cJSON *parent, cJSON * const item); +CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromArray(cJSON *array, int which); +CJSON_PUBLIC(void) cJSON_DeleteItemFromArray(cJSON *array, int which); +CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObject(cJSON *object, const char *string); +CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObjectCaseSensitive(cJSON *object, const char *string); +CJSON_PUBLIC(void) cJSON_DeleteItemFromObject(cJSON *object, const char *string); +CJSON_PUBLIC(void) cJSON_DeleteItemFromObjectCaseSensitive(cJSON *object, const char *string); /* Update array items. */ -CJSON_PUBLIC(void) cJSON_InsertItemInArray(cJSON * array, int which, - cJSON * newitem); /* Shifts pre-existing items to the right. */ -CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemViaPointer(cJSON * const parent, - cJSON * const item, - cJSON * replacement); -CJSON_PUBLIC(void) cJSON_ReplaceItemInArray(cJSON * array, int which, - cJSON * newitem); -CJSON_PUBLIC(void) cJSON_ReplaceItemInObject(cJSON * object, const char *string, - cJSON * newitem); -CJSON_PUBLIC(void) cJSON_ReplaceItemInObjectCaseSensitive(cJSON * object, - const char *string, - cJSON * newitem); +CJSON_PUBLIC(void) cJSON_InsertItemInArray(cJSON *array, int which, cJSON *newitem); /* Shifts pre-existing items to the right. */ +CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemViaPointer(cJSON * const parent, cJSON * const item, cJSON * replacement); +CJSON_PUBLIC(void) cJSON_ReplaceItemInArray(cJSON *array, int which, cJSON *newitem); +CJSON_PUBLIC(void) cJSON_ReplaceItemInObject(cJSON *object,const char *string,cJSON *newitem); +CJSON_PUBLIC(void) cJSON_ReplaceItemInObjectCaseSensitive(cJSON *object,const char *string,cJSON *newitem); /* Duplicate a cJSON item */ -CJSON_PUBLIC(cJSON *) cJSON_Duplicate(const cJSON * item, cJSON_bool recurse); +CJSON_PUBLIC(cJSON *) cJSON_Duplicate(const cJSON *item, cJSON_bool recurse); /* Duplicate will create a new, identical cJSON item to the one you pass, in new memory that will - need to be released. With recurse!=0, it will duplicate any children connected to the item. - The item->next and ->prev pointers are always zero on return from Duplicate. */ +need to be released. With recurse!=0, it will duplicate any children connected to the item. +The item->next and ->prev pointers are always zero on return from Duplicate. */ /* Recursively compare two cJSON items for equality. If either a or b is NULL or invalid, they will be considered unequal. * case_sensitive determines if object keys are treated case sensitive (1) or case insensitive (0) */ -CJSON_PUBLIC(cJSON_bool) cJSON_Compare(const cJSON * const a, - const cJSON * const b, - const cJSON_bool case_sensitive); +CJSON_PUBLIC(cJSON_bool) cJSON_Compare(const cJSON * const a, const cJSON * const b, const cJSON_bool case_sensitive); CJSON_PUBLIC(void) cJSON_Minify(char *json); /* Helper functions for creating and adding items to an object at the same time. * They return the added item or NULL on failure. */ -CJSON_PUBLIC(cJSON *) cJSON_AddNullToObject(cJSON * const object, - const char *const name); -CJSON_PUBLIC(cJSON *) cJSON_AddTrueToObject(cJSON * const object, - const char *const name); -CJSON_PUBLIC(cJSON *) cJSON_AddFalseToObject(cJSON * const object, - const char *const name); -CJSON_PUBLIC(cJSON *) cJSON_AddBoolToObject(cJSON * const object, - const char *const name, - const cJSON_bool boolean); -CJSON_PUBLIC(cJSON *) cJSON_AddNumberToObject(cJSON * const object, - const char *const name, - const double number); -CJSON_PUBLIC(cJSON *) cJSON_AddStringToObject(cJSON * const object, - const char *const name, - const char *const string); -CJSON_PUBLIC(cJSON *) cJSON_AddRawToObject(cJSON * const object, - const char *const name, - const char *const raw); -CJSON_PUBLIC(cJSON *) cJSON_AddObjectToObject(cJSON * const object, - const char *const name); -CJSON_PUBLIC(cJSON *) cJSON_AddArrayToObject(cJSON * const object, - const char *const name); +CJSON_PUBLIC(cJSON*) cJSON_AddNullToObject(cJSON * const object, const char * const name); +CJSON_PUBLIC(cJSON*) cJSON_AddTrueToObject(cJSON * const object, const char * const name); +CJSON_PUBLIC(cJSON*) cJSON_AddFalseToObject(cJSON * const object, const char * const name); +CJSON_PUBLIC(cJSON*) cJSON_AddBoolToObject(cJSON * const object, const char * const name, const cJSON_bool boolean); +CJSON_PUBLIC(cJSON*) cJSON_AddNumberToObject(cJSON * const object, const char * const name, const double number); +CJSON_PUBLIC(cJSON*) cJSON_AddStringToObject(cJSON * const object, const char * const name, const char * const string); +CJSON_PUBLIC(cJSON*) cJSON_AddRawToObject(cJSON * const object, const char * const name, const char * const raw); +CJSON_PUBLIC(cJSON*) cJSON_AddObjectToObject(cJSON * const object, const char * const name); +CJSON_PUBLIC(cJSON*) cJSON_AddArrayToObject(cJSON * const object, const char * const name); /* When assigning an integer value, it needs to be propagated to valuedouble too. */ -#define cJSON_SetIntValue(object, \ - number) ((object) ? (object)->valueint = \ - (object)->valuedouble = \ - (number) : (number)) +#define cJSON_SetIntValue(object, number) ((object) ? (object)->valueint = (object)->valuedouble = (number) : (number)) /* helper for the cJSON_SetNumberValue macro */ -CJSON_PUBLIC(double) cJSON_SetNumberHelper(cJSON * object, double number); -#define cJSON_SetNumberValue(object, \ - number) ((object != \ - NULL) ? cJSON_SetNumberHelper(object, \ - ( \ - double) \ - number) : ( \ - number)) +CJSON_PUBLIC(double) cJSON_SetNumberHelper(cJSON *object, double number); +#define cJSON_SetNumberValue(object, number) ((object != NULL) ? cJSON_SetNumberHelper(object, (double)number) : (number)) /* Macro for iterating over an array or object */ -#define cJSON_ArrayForEach(element, array) for(element = \ - (array != \ - NULL) ? (array)->child : \ - NULL; \ - element != NULL; \ - element = element->next) +#define cJSON_ArrayForEach(element, array) for(element = (array != NULL) ? (array)->child : NULL; element != NULL; element = element->next) /* malloc/free objects using the malloc/free functions that have been set with cJSON_InitHooks */ CJSON_PUBLIC(void *) cJSON_malloc(size_t size); diff --git a/samples/client/petstore/c/include/apiClient.h b/samples/client/petstore/c/include/apiClient.h index a000be9df125..aea3ec93738c 100644 --- a/samples/client/petstore/c/include/apiClient.h +++ b/samples/client/petstore/c/include/apiClient.h @@ -10,27 +10,24 @@ #include "../include/keyValuePair.h" typedef struct apiClient_t { - char *basePath; - void *dataReceived; - long response_code; - list_t *apiKeys; - char *accessToken; + char *basePath; + void *dataReceived; + long response_code; + list_t *apiKeys; + char *accessToken; } apiClient_t; -typedef struct binary_t { - uint8_t *data; - unsigned int len; +typedef struct binary_t +{ + uint8_t* data; + unsigned int len; } binary_t; -apiClient_t *apiClient_create(); +apiClient_t* apiClient_create(); void apiClient_free(apiClient_t *apiClient); -void apiClient_invoke(apiClient_t *apiClient, char *operationParameter, - list_t *queryParameters, list_t *headerParameters, - list_t *formParameters, list_t *headerType, - list_t *contentType, char *bodyParameters, - char *requestType); +void apiClient_invoke(apiClient_t *apiClient,char* operationParameter, list_t *queryParameters, list_t *headerParameters, list_t *formParameters,list_t *headerType,list_t *contentType, char *bodyParameters, char *requestType); char *strReplace(char *orig, char *rep, char *with); diff --git a/samples/client/petstore/c/include/keyValuePair.h b/samples/client/petstore/c/include/keyValuePair.h index 710b46f30e31..90f92e71f66b 100644 --- a/samples/client/petstore/c/include/keyValuePair.h +++ b/samples/client/petstore/c/include/keyValuePair.h @@ -1,11 +1,11 @@ #ifndef _keyValuePair_H_ #define _keyValuePair_H_ -#include +#include typedef struct keyValuePair_t { - char *key; - void *value; + char* key; + void* value; } keyValuePair_t; keyValuePair_t *keyValuePair_create(char *key, void *value); diff --git a/samples/client/petstore/c/include/list.h b/samples/client/petstore/c/include/list.h index ae35304139cd..7d98d7f306b1 100644 --- a/samples/client/petstore/c/include/list.h +++ b/samples/client/petstore/c/include/list.h @@ -9,40 +9,31 @@ typedef struct list_t list_t; typedef struct listEntry_t listEntry_t; struct listEntry_t { - listEntry_t *nextListEntry; - listEntry_t *prevListEntry; - void *data; + listEntry_t* nextListEntry; + listEntry_t* prevListEntry; + void* data; }; typedef struct list_t { - listEntry_t *firstEntry; - listEntry_t *lastEntry; + listEntry_t *firstEntry; + listEntry_t *lastEntry; - long count; + long count; } list_t; -#define list_ForEach(element, list) for(element = \ - (list != \ - NULL) ? (list)->firstEntry : \ - NULL; \ - element != NULL; \ - element = element->nextListEntry) - -list_t *list_create(); -void list_free(list_t *listToFree); - -void list_addElement(list_t *list, void *dataToAddInList); -listEntry_t *list_getElementAt(list_t *list, long indexOfElement); -listEntry_t *list_getWithIndex(list_t *list, int index); -void list_removeElement(list_t *list, listEntry_t *elementToRemove); - -void list_iterateThroughListForward(list_t *list, void (*operationToPerform)( - listEntry_t *, - void *), void *additionalDataNeededForCallbackFunction); -void list_iterateThroughListBackward(list_t *list, void (*operationToPerform)( - listEntry_t *, - void *), void *additionalDataNeededForCallbackFunction); - -void listEntry_printAsInt(listEntry_t *listEntry, void *additionalData); +#define list_ForEach(element, list) for(element = (list != NULL) ? (list)->firstEntry : NULL; element != NULL; element = element->nextListEntry) + +list_t* list_create(); +void list_free(list_t* listToFree); + +void list_addElement(list_t* list, void* dataToAddInList); +listEntry_t* list_getElementAt(list_t *list, long indexOfElement); +listEntry_t* list_getWithIndex(list_t* list, int index); +void list_removeElement(list_t* list, listEntry_t* elementToRemove); + +void list_iterateThroughListForward(list_t* list, void (*operationToPerform)(listEntry_t*, void*), void *additionalDataNeededForCallbackFunction); +void list_iterateThroughListBackward(list_t* list, void (*operationToPerform)(listEntry_t*, void*), void *additionalDataNeededForCallbackFunction); + +void listEntry_printAsInt(listEntry_t* listEntry, void *additionalData); void listEntry_free(listEntry_t *listEntry, void *additionalData); #endif // INCLUDE_LIST_H diff --git a/samples/client/petstore/c/model/api_response.c b/samples/client/petstore/c/model/api_response.c index 3201624063ca..569e58ef0c5e 100644 --- a/samples/client/petstore/c/model/api_response.c +++ b/samples/client/petstore/c/model/api_response.c @@ -5,11 +5,15 @@ -api_response_t *api_response_create(int code, char *type, char *message) { +api_response_t *api_response_create( + int code, + char *type, + char *message + ) { api_response_t *api_response_local_var = malloc(sizeof(api_response_t)); - if(!api_response_local_var) { - return NULL; - } + if (!api_response_local_var) { + return NULL; + } api_response_local_var->code = code; api_response_local_var->type = type; api_response_local_var->message = message; @@ -19,9 +23,9 @@ api_response_t *api_response_create(int code, char *type, char *message) { void api_response_free(api_response_t *api_response) { - listEntry_t *listEntry; - free(api_response->type); - free(api_response->message); + listEntry_t *listEntry; + free(api_response->type); + free(api_response->message); free(api_response); } @@ -29,80 +33,76 @@ cJSON *api_response_convertToJSON(api_response_t *api_response) { cJSON *item = cJSON_CreateObject(); // api_response->code - if(api_response->code) { - if(cJSON_AddNumberToObject(item, "code", - api_response->code) == NULL) - { - goto fail; // Numeric - } - } + if(api_response->code) { + if(cJSON_AddNumberToObject(item, "code", api_response->code) == NULL) { + goto fail; //Numeric + } + } // api_response->type - if(api_response->type) { - if(cJSON_AddStringToObject(item, "type", - api_response->type) == NULL) - { - goto fail; // String - } - } + if(api_response->type) { + if(cJSON_AddStringToObject(item, "type", api_response->type) == NULL) { + goto fail; //String + } + } // api_response->message - if(api_response->message) { - if(cJSON_AddStringToObject(item, "message", - api_response->message) == NULL) - { - goto fail; // String - } - } + if(api_response->message) { + if(cJSON_AddStringToObject(item, "message", api_response->message) == NULL) { + goto fail; //String + } + } return item; fail: - if(item) { - cJSON_Delete(item); - } + if (item) { + cJSON_Delete(item); + } return NULL; } -api_response_t *api_response_parseFromJSON(cJSON *api_responseJSON) { - api_response_t *api_response_local_var = NULL; - - // api_response->code - cJSON *code = - cJSON_GetObjectItemCaseSensitive(api_responseJSON, "code"); - if(code) { - if(!cJSON_IsNumber(code)) { - goto end; // Numeric - } - } - - // api_response->type - cJSON *type = - cJSON_GetObjectItemCaseSensitive(api_responseJSON, "type"); - if(type) { - if(!cJSON_IsString(type)) { - goto end; // String - } - } - - // api_response->message - cJSON *message = cJSON_GetObjectItemCaseSensitive(api_responseJSON, - "message"); - if(message) { - if(!cJSON_IsString(message)) { - goto end; // String - } - } - - - api_response_local_var = api_response_create( - code ? code->valuedouble : 0, - type ? strdup(type->valuestring) : NULL, - message ? strdup(message->valuestring) : NULL - ); - - return api_response_local_var; +api_response_t *api_response_parseFromJSON(cJSON *api_responseJSON){ + + api_response_t *api_response_local_var = NULL; + + // api_response->code + cJSON *code = cJSON_GetObjectItemCaseSensitive(api_responseJSON, "code"); + if (code) { + if(!cJSON_IsNumber(code)) + { + goto end; //Numeric + } + } + + // api_response->type + cJSON *type = cJSON_GetObjectItemCaseSensitive(api_responseJSON, "type"); + if (type) { + if(!cJSON_IsString(type)) + { + goto end; //String + } + } + + // api_response->message + cJSON *message = cJSON_GetObjectItemCaseSensitive(api_responseJSON, "message"); + if (message) { + if(!cJSON_IsString(message)) + { + goto end; //String + } + } + + + api_response_local_var = api_response_create ( + code ? code->valuedouble : 0, + type ? strdup(type->valuestring) : NULL, + message ? strdup(message->valuestring) : NULL + ); + + return api_response_local_var; end: - return NULL; + return NULL; + } diff --git a/samples/client/petstore/c/model/api_response.h b/samples/client/petstore/c/model/api_response.h index 73e92795eec8..0b0866e3d5a6 100644 --- a/samples/client/petstore/c/model/api_response.h +++ b/samples/client/petstore/c/model/api_response.h @@ -15,12 +15,17 @@ typedef struct api_response_t { - int code; // numeric - char *type; // string - char *message; // string + int code; //numeric + char *type; // string + char *message; // string + } api_response_t; -api_response_t *api_response_create(int code, char *type, char *message); +api_response_t *api_response_create( + int code, + char *type, + char *message +); void api_response_free(api_response_t *api_response); @@ -29,3 +34,4 @@ api_response_t *api_response_parseFromJSON(cJSON *api_responseJSON); cJSON *api_response_convertToJSON(api_response_t *api_response); #endif /* _api_response_H_ */ + diff --git a/samples/client/petstore/c/model/category.c b/samples/client/petstore/c/model/category.c index fe44d0afc96c..d2a721241731 100644 --- a/samples/client/petstore/c/model/category.c +++ b/samples/client/petstore/c/model/category.c @@ -5,11 +5,14 @@ -category_t *category_create(long id, char *name) { +category_t *category_create( + long id, + char *name + ) { category_t *category_local_var = malloc(sizeof(category_t)); - if(!category_local_var) { - return NULL; - } + if (!category_local_var) { + return NULL; + } category_local_var->id = id; category_local_var->name = name; @@ -18,8 +21,8 @@ category_t *category_create(long id, char *name) { void category_free(category_t *category) { - listEntry_t *listEntry; - free(category->name); + listEntry_t *listEntry; + free(category->name); free(category); } @@ -27,56 +30,58 @@ cJSON *category_convertToJSON(category_t *category) { cJSON *item = cJSON_CreateObject(); // category->id - if(category->id) { - if(cJSON_AddNumberToObject(item, "id", category->id) == NULL) { - goto fail; // Numeric - } - } + if(category->id) { + if(cJSON_AddNumberToObject(item, "id", category->id) == NULL) { + goto fail; //Numeric + } + } // category->name - if(category->name) { - if(cJSON_AddStringToObject(item, "name", - category->name) == NULL) - { - goto fail; // String - } - } + if(category->name) { + if(cJSON_AddStringToObject(item, "name", category->name) == NULL) { + goto fail; //String + } + } return item; fail: - if(item) { - cJSON_Delete(item); - } + if (item) { + cJSON_Delete(item); + } return NULL; } -category_t *category_parseFromJSON(cJSON *categoryJSON) { - category_t *category_local_var = NULL; +category_t *category_parseFromJSON(cJSON *categoryJSON){ - // category->id - cJSON *id = cJSON_GetObjectItemCaseSensitive(categoryJSON, "id"); - if(id) { - if(!cJSON_IsNumber(id)) { - goto end; // Numeric - } - } + category_t *category_local_var = NULL; - // category->name - cJSON *name = cJSON_GetObjectItemCaseSensitive(categoryJSON, "name"); - if(name) { - if(!cJSON_IsString(name)) { - goto end; // String - } - } + // category->id + cJSON *id = cJSON_GetObjectItemCaseSensitive(categoryJSON, "id"); + if (id) { + if(!cJSON_IsNumber(id)) + { + goto end; //Numeric + } + } + // category->name + cJSON *name = cJSON_GetObjectItemCaseSensitive(categoryJSON, "name"); + if (name) { + if(!cJSON_IsString(name)) + { + goto end; //String + } + } - category_local_var = category_create( - id ? id->valuedouble : 0, - name ? strdup(name->valuestring) : NULL - ); - return category_local_var; + category_local_var = category_create ( + id ? id->valuedouble : 0, + name ? strdup(name->valuestring) : NULL + ); + + return category_local_var; end: - return NULL; + return NULL; + } diff --git a/samples/client/petstore/c/model/category.h b/samples/client/petstore/c/model/category.h index 27c9387e2f59..e63a04e096c5 100644 --- a/samples/client/petstore/c/model/category.h +++ b/samples/client/petstore/c/model/category.h @@ -15,11 +15,15 @@ typedef struct category_t { - long id; // numeric - char *name; // string + long id; //numeric + char *name; // string + } category_t; -category_t *category_create(long id, char *name); +category_t *category_create( + long id, + char *name +); void category_free(category_t *category); @@ -28,3 +32,4 @@ category_t *category_parseFromJSON(cJSON *categoryJSON); cJSON *category_convertToJSON(category_t *category); #endif /* _category_H_ */ + diff --git a/samples/client/petstore/c/model/object.c b/samples/client/petstore/c/model/object.c index 410c31b6c6b2..d106693842f6 100644 --- a/samples/client/petstore/c/model/object.c +++ b/samples/client/petstore/c/model/object.c @@ -4,28 +4,28 @@ #include "object.h" object_t *object_create() { - object_t *object = malloc(sizeof(object_t)); + object_t *object = malloc(sizeof(object_t)); - return object; + return object; } void object_free(object_t *object) { - free(object); + free (object); } cJSON *object_convertToJSON(object_t *object) { - cJSON *item = cJSON_CreateObject(); + cJSON *item = cJSON_CreateObject(); - return item; + return item; fail: - cJSON_Delete(item); - return NULL; + cJSON_Delete(item); + return NULL; } -object_t *object_parseFromJSON(char *jsonString) { - object_t *object = NULL; +object_t *object_parseFromJSON(char *jsonString){ + object_t *object = NULL; - return object; + return object; end: - return NULL; + return NULL; } diff --git a/samples/client/petstore/c/model/object.h b/samples/client/petstore/c/model/object.h index 1dad2093fed2..6b1a77fc508a 100644 --- a/samples/client/petstore/c/model/object.h +++ b/samples/client/petstore/c/model/object.h @@ -12,7 +12,7 @@ typedef struct object_t { - void *temporary; + void *temporary; } object_t; object_t *object_create(); diff --git a/samples/client/petstore/c/model/order.c b/samples/client/petstore/c/model/order.c index de4c3db1959f..5afa7ce20a9b 100644 --- a/samples/client/petstore/c/model/order.c +++ b/samples/client/petstore/c/model/order.c @@ -4,30 +4,36 @@ #include "order.h" -char *statusorder_ToString(status_e status) { - char *statusArray[] = { "placed", "approved", "delivered" }; - return statusArray[status]; -} - -status_e statusorder_FromString(char *status) { - int stringToReturn = 0; - char *statusArray[] = { "placed", "approved", "delivered" }; - size_t sizeofArray = sizeof(statusArray) / sizeof(statusArray[0]); - while(stringToReturn < sizeofArray) { - if(strcmp(status, statusArray[stringToReturn]) == 0) { - return stringToReturn; - } - stringToReturn++; - } - return 0; -} - -order_t *order_create(long id, long petId, int quantity, char *shipDate, - status_e status, int complete) { + char* statusorder_ToString(status_e status){ + char *statusArray[] = { "placed","approved","delivered" }; + return statusArray[status]; + } + + status_e statusorder_FromString(char* status){ + int stringToReturn = 0; + char *statusArray[] = { "placed","approved","delivered" }; + size_t sizeofArray = sizeof(statusArray) / sizeof(statusArray[0]); + while(stringToReturn < sizeofArray) { + if(strcmp(status, statusArray[stringToReturn]) == 0) { + return stringToReturn; + } + stringToReturn++; + } + return 0; + } + +order_t *order_create( + long id, + long petId, + int quantity, + char *shipDate, + status_e status, + int complete + ) { order_t *order_local_var = malloc(sizeof(order_t)); - if(!order_local_var) { - return NULL; - } + if (!order_local_var) { + return NULL; + } order_local_var->id = id; order_local_var->petId = petId; order_local_var->quantity = quantity; @@ -40,8 +46,8 @@ order_t *order_create(long id, long petId, int quantity, char *shipDate, void order_free(order_t *order) { - listEntry_t *listEntry; - free(order->shipDate); + listEntry_t *listEntry; + free(order->shipDate); free(order); } @@ -49,137 +55,133 @@ cJSON *order_convertToJSON(order_t *order) { cJSON *item = cJSON_CreateObject(); // order->id - if(order->id) { - if(cJSON_AddNumberToObject(item, "id", order->id) == NULL) { - goto fail; // Numeric - } - } + if(order->id) { + if(cJSON_AddNumberToObject(item, "id", order->id) == NULL) { + goto fail; //Numeric + } + } // order->petId - if(order->petId) { - if(cJSON_AddNumberToObject(item, "petId", - order->petId) == NULL) - { - goto fail; // Numeric - } - } + if(order->petId) { + if(cJSON_AddNumberToObject(item, "petId", order->petId) == NULL) { + goto fail; //Numeric + } + } // order->quantity - if(order->quantity) { - if(cJSON_AddNumberToObject(item, "quantity", - order->quantity) == NULL) - { - goto fail; // Numeric - } - } + if(order->quantity) { + if(cJSON_AddNumberToObject(item, "quantity", order->quantity) == NULL) { + goto fail; //Numeric + } + } // order->shipDate - if(order->shipDate) { - if(cJSON_AddStringToObject(item, "shipDate", - order->shipDate) == NULL) - { - goto fail; // Date-Time - } - } + if(order->shipDate) { + if(cJSON_AddStringToObject(item, "shipDate", order->shipDate) == NULL) { + goto fail; //Date-Time + } + } // order->status - - if(cJSON_AddStringToObject(item, "status", - statusorder_ToString(order->status)) == NULL) - { - goto fail; // Enum - } - + + if(cJSON_AddStringToObject(item, "status", statusorder_ToString(order->status)) == NULL) + { + goto fail; //Enum + } + // order->complete - if(order->complete) { - if(cJSON_AddBoolToObject(item, "complete", - order->complete) == NULL) - { - goto fail; // Bool - } - } + if(order->complete) { + if(cJSON_AddBoolToObject(item, "complete", order->complete) == NULL) { + goto fail; //Bool + } + } return item; fail: - if(item) { - cJSON_Delete(item); - } + if (item) { + cJSON_Delete(item); + } return NULL; } -order_t *order_parseFromJSON(cJSON *orderJSON) { - order_t *order_local_var = NULL; - - // order->id - cJSON *id = cJSON_GetObjectItemCaseSensitive(orderJSON, "id"); - if(id) { - if(!cJSON_IsNumber(id)) { - goto end; // Numeric - } - } - - // order->petId - cJSON *petId = cJSON_GetObjectItemCaseSensitive(orderJSON, "petId"); - if(petId) { - if(!cJSON_IsNumber(petId)) { - goto end; // Numeric - } - } - - // order->quantity - cJSON *quantity = - cJSON_GetObjectItemCaseSensitive(orderJSON, "quantity"); - if(quantity) { - if(!cJSON_IsNumber(quantity)) { - goto end; // Numeric - } - } - - // order->shipDate - cJSON *shipDate = - cJSON_GetObjectItemCaseSensitive(orderJSON, "shipDate"); - if(shipDate) { - if(!cJSON_IsString(shipDate)) { - goto end; // DateTime - } - } - - // order->status - cJSON *status = cJSON_GetObjectItemCaseSensitive(orderJSON, "status"); - status_e statusVariable; - if(status) { - if(!cJSON_IsString(status)) { - goto end; // Enum - } - statusVariable = statusorder_FromString(status->valuestring); - } - - // order->complete - cJSON *complete = - cJSON_GetObjectItemCaseSensitive(orderJSON, "complete"); - if(complete) { - if(!cJSON_IsBool(complete)) { - goto end; // Bool - } - } - - - order_local_var = order_create( - id ? id->valuedouble : 0, - petId ? petId->valuedouble : 0, - quantity ? quantity->valuedouble : 0, - shipDate ? strdup(shipDate->valuestring) : NULL, - status ? statusVariable : -1, - complete ? complete->valueint : 0 - ); - - return order_local_var; +order_t *order_parseFromJSON(cJSON *orderJSON){ + + order_t *order_local_var = NULL; + + // order->id + cJSON *id = cJSON_GetObjectItemCaseSensitive(orderJSON, "id"); + if (id) { + if(!cJSON_IsNumber(id)) + { + goto end; //Numeric + } + } + + // order->petId + cJSON *petId = cJSON_GetObjectItemCaseSensitive(orderJSON, "petId"); + if (petId) { + if(!cJSON_IsNumber(petId)) + { + goto end; //Numeric + } + } + + // order->quantity + cJSON *quantity = cJSON_GetObjectItemCaseSensitive(orderJSON, "quantity"); + if (quantity) { + if(!cJSON_IsNumber(quantity)) + { + goto end; //Numeric + } + } + + // order->shipDate + cJSON *shipDate = cJSON_GetObjectItemCaseSensitive(orderJSON, "shipDate"); + if (shipDate) { + if(!cJSON_IsString(shipDate)) + { + goto end; //DateTime + } + } + + // order->status + cJSON *status = cJSON_GetObjectItemCaseSensitive(orderJSON, "status"); + status_e statusVariable; + if (status) { + if(!cJSON_IsString(status)) + { + goto end; //Enum + } + statusVariable = statusorder_FromString(status->valuestring); + } + + // order->complete + cJSON *complete = cJSON_GetObjectItemCaseSensitive(orderJSON, "complete"); + if (complete) { + if(!cJSON_IsBool(complete)) + { + goto end; //Bool + } + } + + + order_local_var = order_create ( + id ? id->valuedouble : 0, + petId ? petId->valuedouble : 0, + quantity ? quantity->valuedouble : 0, + shipDate ? strdup(shipDate->valuestring) : NULL, + status ? statusVariable : -1, + complete ? complete->valueint : 0 + ); + + return order_local_var; end: - return NULL; + return NULL; + } diff --git a/samples/client/petstore/c/model/order.h b/samples/client/petstore/c/model/order.h index ef99a5da98c2..e7f814e1fa13 100644 --- a/samples/client/petstore/c/model/order.h +++ b/samples/client/petstore/c/model/order.h @@ -12,24 +12,31 @@ #include "../include/list.h" #include "../include/keyValuePair.h" -typedef enum { placed, approved, delivered } status_e; + typedef enum { placed, approved, delivered } status_e; -char *status_ToString(status_e status); + char* status_ToString(status_e status); -status_e status_FromString(char *status); + status_e status_FromString(char* status); typedef struct order_t { - long id; // numeric - long petId; // numeric - int quantity; // numeric - char *shipDate; // date time - status_e status; // enum - int complete; // boolean + long id; //numeric + long petId; //numeric + int quantity; //numeric + char *shipDate; //date time + status_e status; //enum + int complete; //boolean + } order_t; -order_t *order_create(long id, long petId, int quantity, char *shipDate, - status_e status, int complete); +order_t *order_create( + long id, + long petId, + int quantity, + char *shipDate, + status_e status, + int complete +); void order_free(order_t *order); @@ -38,3 +45,4 @@ order_t *order_parseFromJSON(cJSON *orderJSON); cJSON *order_convertToJSON(order_t *order); #endif /* _order_H_ */ + diff --git a/samples/client/petstore/c/model/pet.c b/samples/client/petstore/c/model/pet.c index 73b6c4e28f45..1b28a6a2abde 100644 --- a/samples/client/petstore/c/model/pet.c +++ b/samples/client/petstore/c/model/pet.c @@ -4,30 +4,36 @@ #include "pet.h" -char *statuspet_ToString(status_e status) { - char *statusArray[] = { "available", "pending", "sold" }; - return statusArray[status]; -} - -status_e statuspet_FromString(char *status) { - int stringToReturn = 0; - char *statusArray[] = { "available", "pending", "sold" }; - size_t sizeofArray = sizeof(statusArray) / sizeof(statusArray[0]); - while(stringToReturn < sizeofArray) { - if(strcmp(status, statusArray[stringToReturn]) == 0) { - return stringToReturn; - } - stringToReturn++; - } - return 0; -} - -pet_t *pet_create(long id, category_t *category, char *name, list_t *photoUrls, - list_t *tags, status_e status) { + char* statuspet_ToString(status_e status){ + char *statusArray[] = { "available","pending","sold" }; + return statusArray[status]; + } + + status_e statuspet_FromString(char* status){ + int stringToReturn = 0; + char *statusArray[] = { "available","pending","sold" }; + size_t sizeofArray = sizeof(statusArray) / sizeof(statusArray[0]); + while(stringToReturn < sizeofArray) { + if(strcmp(status, statusArray[stringToReturn]) == 0) { + return stringToReturn; + } + stringToReturn++; + } + return 0; + } + +pet_t *pet_create( + long id, + category_t *category, + char *name, + list_t *photoUrls, + list_t *tags, + status_e status + ) { pet_t *pet_local_var = malloc(sizeof(pet_t)); - if(!pet_local_var) { - return NULL; - } + if (!pet_local_var) { + return NULL; + } pet_local_var->id = id; pet_local_var->category = category; pet_local_var->name = name; @@ -40,9 +46,9 @@ pet_t *pet_create(long id, category_t *category, char *name, list_t *photoUrls, void pet_free(pet_t *pet) { - listEntry_t *listEntry; - category_free(pet->category); - free(pet->name); + listEntry_t *listEntry; + category_free(pet->category); + free(pet->name); list_ForEach(listEntry, pet->photoUrls) { free(listEntry->data); } @@ -58,193 +64,191 @@ cJSON *pet_convertToJSON(pet_t *pet) { cJSON *item = cJSON_CreateObject(); // pet->id - if(pet->id) { - if(cJSON_AddNumberToObject(item, "id", pet->id) == NULL) { - goto fail; // Numeric - } - } + if(pet->id) { + if(cJSON_AddNumberToObject(item, "id", pet->id) == NULL) { + goto fail; //Numeric + } + } // pet->category - if(pet->category) { - cJSON *category_local_JSON = category_convertToJSON( - pet->category); - if(category_local_JSON == NULL) { - goto fail; // model - } - cJSON_AddItemToObject(item, "category", category_local_JSON); - if(item->child == NULL) { - goto fail; - } - } + if(pet->category) { + cJSON *category_local_JSON = category_convertToJSON(pet->category); + if(category_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "category", category_local_JSON); + if(item->child == NULL) { + goto fail; + } + } // pet->name - if(!pet->name) { - goto fail; - } - - if(cJSON_AddStringToObject(item, "name", pet->name) == NULL) { - goto fail; // String - } + if (!pet->name) { + goto fail; + } + + if(cJSON_AddStringToObject(item, "name", pet->name) == NULL) { + goto fail; //String + } // pet->photoUrls - if(!pet->photoUrls) { - goto fail; - } - + if (!pet->photoUrls) { + goto fail; + } + cJSON *photo_urls = cJSON_AddArrayToObject(item, "photoUrls"); if(photo_urls == NULL) { - goto fail; // primitive container + goto fail; //primitive container } listEntry_t *photo_urlsListEntry; - list_ForEach(photo_urlsListEntry, pet->photoUrls) { - if(cJSON_AddStringToObject(photo_urls, "", - (char *) photo_urlsListEntry->data) - == NULL) - { - goto fail; - } - } + list_ForEach(photo_urlsListEntry, pet->photoUrls) { + if(cJSON_AddStringToObject(photo_urls, "", (char*)photo_urlsListEntry->data) == NULL) + { + goto fail; + } + } // pet->tags - if(pet->tags) { - cJSON *tags = cJSON_AddArrayToObject(item, "tags"); - if(tags == NULL) { - goto fail; // nonprimitive container - } - - listEntry_t *tagsListEntry; - if(pet->tags) { - list_ForEach(tagsListEntry, pet->tags) { - cJSON *itemLocal = tag_convertToJSON( - tagsListEntry->data); - if(itemLocal == NULL) { - goto fail; - } - cJSON_AddItemToArray(tags, itemLocal); - } - } - } + if(pet->tags) { + cJSON *tags = cJSON_AddArrayToObject(item, "tags"); + if(tags == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *tagsListEntry; + if (pet->tags) { + list_ForEach(tagsListEntry, pet->tags) { + cJSON *itemLocal = tag_convertToJSON(tagsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(tags, itemLocal); + } + } + } // pet->status - - if(cJSON_AddStringToObject(item, "status", - statuspet_ToString(pet->status)) == NULL) - { - goto fail; // Enum - } - + + if(cJSON_AddStringToObject(item, "status", statuspet_ToString(pet->status)) == NULL) + { + goto fail; //Enum + } + return item; fail: - if(item) { - cJSON_Delete(item); - } + if (item) { + cJSON_Delete(item); + } return NULL; } -pet_t *pet_parseFromJSON(cJSON *petJSON) { - pet_t *pet_local_var = NULL; - - // pet->id - cJSON *id = cJSON_GetObjectItemCaseSensitive(petJSON, "id"); - if(id) { - if(!cJSON_IsNumber(id)) { - goto end; // Numeric - } - } - - // pet->category - cJSON *category = cJSON_GetObjectItemCaseSensitive(petJSON, "category"); - category_t *category_local_nonprim = NULL; - if(category) { - category_local_nonprim = category_parseFromJSON(category); // nonprimitive - } - - // pet->name - cJSON *name = cJSON_GetObjectItemCaseSensitive(petJSON, "name"); - if(!name) { - goto end; - } - - - if(!cJSON_IsString(name)) { - goto end; // String - } - - // pet->photoUrls - cJSON *photoUrls = - cJSON_GetObjectItemCaseSensitive(petJSON, "photoUrls"); - if(!photoUrls) { - goto end; - } - - list_t *photo_urlsList; - - cJSON *photo_urls_local; - if(!cJSON_IsArray(photoUrls)) { - goto end; // primitive container - } - photo_urlsList = list_create(); - - cJSON_ArrayForEach(photo_urls_local, photoUrls) - { - if(!cJSON_IsString(photo_urls_local)) { - goto end; - } - list_addElement(photo_urlsList, - strdup(photo_urls_local->valuestring)); - } - - // pet->tags - cJSON *tags = cJSON_GetObjectItemCaseSensitive(petJSON, "tags"); - list_t *tagsList; - if(tags) { - cJSON *tags_local_nonprimitive; - if(!cJSON_IsArray(tags)) { - goto end; // nonprimitive container - } - - tagsList = list_create(); - - cJSON_ArrayForEach(tags_local_nonprimitive, tags) - { - if(!cJSON_IsObject(tags_local_nonprimitive)) { - goto end; - } - tag_t *tagsItem = tag_parseFromJSON( - tags_local_nonprimitive); - - list_addElement(tagsList, tagsItem); - } - } - - // pet->status - cJSON *status = cJSON_GetObjectItemCaseSensitive(petJSON, "status"); - status_e statusVariable; - if(status) { - if(!cJSON_IsString(status)) { - goto end; // Enum - } - statusVariable = statuspet_FromString(status->valuestring); - } - - - pet_local_var = pet_create( - id ? id->valuedouble : 0, - category ? category_local_nonprim : NULL, - strdup(name->valuestring), - photo_urlsList, - tags ? tagsList : NULL, - status ? statusVariable : -1 - ); - - return pet_local_var; +pet_t *pet_parseFromJSON(cJSON *petJSON){ + + pet_t *pet_local_var = NULL; + + // pet->id + cJSON *id = cJSON_GetObjectItemCaseSensitive(petJSON, "id"); + if (id) { + if(!cJSON_IsNumber(id)) + { + goto end; //Numeric + } + } + + // pet->category + cJSON *category = cJSON_GetObjectItemCaseSensitive(petJSON, "category"); + category_t *category_local_nonprim = NULL; + if (category) { + category_local_nonprim = category_parseFromJSON(category); //nonprimitive + } + + // pet->name + cJSON *name = cJSON_GetObjectItemCaseSensitive(petJSON, "name"); + if (!name) { + goto end; + } + + + if(!cJSON_IsString(name)) + { + goto end; //String + } + + // pet->photoUrls + cJSON *photoUrls = cJSON_GetObjectItemCaseSensitive(petJSON, "photoUrls"); + if (!photoUrls) { + goto end; + } + + list_t *photo_urlsList; + + cJSON *photo_urls_local; + if(!cJSON_IsArray(photoUrls)) { + goto end;//primitive container + } + photo_urlsList = list_create(); + + cJSON_ArrayForEach(photo_urls_local, photoUrls) + { + if(!cJSON_IsString(photo_urls_local)) + { + goto end; + } + list_addElement(photo_urlsList , strdup(photo_urls_local->valuestring)); + } + + // pet->tags + cJSON *tags = cJSON_GetObjectItemCaseSensitive(petJSON, "tags"); + list_t *tagsList; + if (tags) { + cJSON *tags_local_nonprimitive; + if(!cJSON_IsArray(tags)){ + goto end; //nonprimitive container + } + + tagsList = list_create(); + + cJSON_ArrayForEach(tags_local_nonprimitive,tags ) + { + if(!cJSON_IsObject(tags_local_nonprimitive)){ + goto end; + } + tag_t *tagsItem = tag_parseFromJSON(tags_local_nonprimitive); + + list_addElement(tagsList, tagsItem); + } + } + + // pet->status + cJSON *status = cJSON_GetObjectItemCaseSensitive(petJSON, "status"); + status_e statusVariable; + if (status) { + if(!cJSON_IsString(status)) + { + goto end; //Enum + } + statusVariable = statuspet_FromString(status->valuestring); + } + + + pet_local_var = pet_create ( + id ? id->valuedouble : 0, + category ? category_local_nonprim : NULL, + strdup(name->valuestring), + photo_urlsList, + tags ? tagsList : NULL, + status ? statusVariable : -1 + ); + + return pet_local_var; end: - return NULL; + return NULL; + } diff --git a/samples/client/petstore/c/model/pet.h b/samples/client/petstore/c/model/pet.h index da5b3df5e7a6..a29280648d88 100644 --- a/samples/client/petstore/c/model/pet.h +++ b/samples/client/petstore/c/model/pet.h @@ -14,24 +14,31 @@ #include "category.h" #include "tag.h" -typedef enum { available, pending, sold } status_e; + typedef enum { available, pending, sold } status_e; -char *status_ToString(status_e status); + char* status_ToString(status_e status); -status_e status_FromString(char *status); + status_e status_FromString(char* status); typedef struct pet_t { - long id; // numeric - category_t *category; // model - char *name; // string - list_t *photoUrls; // primitive container - list_t *tags; // nonprimitive container - status_e status; // enum + long id; //numeric + category_t *category; //model + char *name; // string + list_t *photoUrls; //primitive container + list_t *tags; //nonprimitive container + status_e status; //enum + } pet_t; -pet_t *pet_create(long id, category_t *category, char *name, list_t *photoUrls, - list_t *tags, status_e status); +pet_t *pet_create( + long id, + category_t *category, + char *name, + list_t *photoUrls, + list_t *tags, + status_e status +); void pet_free(pet_t *pet); @@ -40,3 +47,4 @@ pet_t *pet_parseFromJSON(cJSON *petJSON); cJSON *pet_convertToJSON(pet_t *pet); #endif /* _pet_H_ */ + diff --git a/samples/client/petstore/c/model/tag.c b/samples/client/petstore/c/model/tag.c index ca6c9e9184e3..89f3c89b93e1 100644 --- a/samples/client/petstore/c/model/tag.c +++ b/samples/client/petstore/c/model/tag.c @@ -5,11 +5,14 @@ -tag_t *tag_create(long id, char *name) { +tag_t *tag_create( + long id, + char *name + ) { tag_t *tag_local_var = malloc(sizeof(tag_t)); - if(!tag_local_var) { - return NULL; - } + if (!tag_local_var) { + return NULL; + } tag_local_var->id = id; tag_local_var->name = name; @@ -18,8 +21,8 @@ tag_t *tag_create(long id, char *name) { void tag_free(tag_t *tag) { - listEntry_t *listEntry; - free(tag->name); + listEntry_t *listEntry; + free(tag->name); free(tag); } @@ -27,54 +30,58 @@ cJSON *tag_convertToJSON(tag_t *tag) { cJSON *item = cJSON_CreateObject(); // tag->id - if(tag->id) { - if(cJSON_AddNumberToObject(item, "id", tag->id) == NULL) { - goto fail; // Numeric - } - } + if(tag->id) { + if(cJSON_AddNumberToObject(item, "id", tag->id) == NULL) { + goto fail; //Numeric + } + } // tag->name - if(tag->name) { - if(cJSON_AddStringToObject(item, "name", tag->name) == NULL) { - goto fail; // String - } - } + if(tag->name) { + if(cJSON_AddStringToObject(item, "name", tag->name) == NULL) { + goto fail; //String + } + } return item; fail: - if(item) { - cJSON_Delete(item); - } + if (item) { + cJSON_Delete(item); + } return NULL; } -tag_t *tag_parseFromJSON(cJSON *tagJSON) { - tag_t *tag_local_var = NULL; +tag_t *tag_parseFromJSON(cJSON *tagJSON){ - // tag->id - cJSON *id = cJSON_GetObjectItemCaseSensitive(tagJSON, "id"); - if(id) { - if(!cJSON_IsNumber(id)) { - goto end; // Numeric - } - } + tag_t *tag_local_var = NULL; - // tag->name - cJSON *name = cJSON_GetObjectItemCaseSensitive(tagJSON, "name"); - if(name) { - if(!cJSON_IsString(name)) { - goto end; // String - } - } + // tag->id + cJSON *id = cJSON_GetObjectItemCaseSensitive(tagJSON, "id"); + if (id) { + if(!cJSON_IsNumber(id)) + { + goto end; //Numeric + } + } + // tag->name + cJSON *name = cJSON_GetObjectItemCaseSensitive(tagJSON, "name"); + if (name) { + if(!cJSON_IsString(name)) + { + goto end; //String + } + } - tag_local_var = tag_create( - id ? id->valuedouble : 0, - name ? strdup(name->valuestring) : NULL - ); - return tag_local_var; + tag_local_var = tag_create ( + id ? id->valuedouble : 0, + name ? strdup(name->valuestring) : NULL + ); + + return tag_local_var; end: - return NULL; + return NULL; + } diff --git a/samples/client/petstore/c/model/tag.h b/samples/client/petstore/c/model/tag.h index 235f7b2ea452..26f70686658e 100644 --- a/samples/client/petstore/c/model/tag.h +++ b/samples/client/petstore/c/model/tag.h @@ -15,11 +15,15 @@ typedef struct tag_t { - long id; // numeric - char *name; // string + long id; //numeric + char *name; // string + } tag_t; -tag_t *tag_create(long id, char *name); +tag_t *tag_create( + long id, + char *name +); void tag_free(tag_t *tag); @@ -28,3 +32,4 @@ tag_t *tag_parseFromJSON(cJSON *tagJSON); cJSON *tag_convertToJSON(tag_t *tag); #endif /* _tag_H_ */ + diff --git a/samples/client/petstore/c/model/user.c b/samples/client/petstore/c/model/user.c index a12f59bb3d4f..412336cdd520 100644 --- a/samples/client/petstore/c/model/user.c +++ b/samples/client/petstore/c/model/user.c @@ -5,12 +5,20 @@ -user_t *user_create(long id, char *username, char *firstName, char *lastName, - char *email, char *password, char *phone, int userStatus) { +user_t *user_create( + long id, + char *username, + char *firstName, + char *lastName, + char *email, + char *password, + char *phone, + int userStatus + ) { user_t *user_local_var = malloc(sizeof(user_t)); - if(!user_local_var) { - return NULL; - } + if (!user_local_var) { + return NULL; + } user_local_var->id = id; user_local_var->username = username; user_local_var->firstName = firstName; @@ -25,13 +33,13 @@ user_t *user_create(long id, char *username, char *firstName, char *lastName, void user_free(user_t *user) { - listEntry_t *listEntry; - free(user->username); - free(user->firstName); - free(user->lastName); - free(user->email); - free(user->password); - free(user->phone); + listEntry_t *listEntry; + free(user->username); + free(user->firstName); + free(user->lastName); + free(user->email); + free(user->password); + free(user->phone); free(user); } @@ -39,175 +47,166 @@ cJSON *user_convertToJSON(user_t *user) { cJSON *item = cJSON_CreateObject(); // user->id - if(user->id) { - if(cJSON_AddNumberToObject(item, "id", user->id) == NULL) { - goto fail; // Numeric - } - } + if(user->id) { + if(cJSON_AddNumberToObject(item, "id", user->id) == NULL) { + goto fail; //Numeric + } + } // user->username - if(user->username) { - if(cJSON_AddStringToObject(item, "username", - user->username) == NULL) - { - goto fail; // String - } - } + if(user->username) { + if(cJSON_AddStringToObject(item, "username", user->username) == NULL) { + goto fail; //String + } + } // user->firstName - if(user->firstName) { - if(cJSON_AddStringToObject(item, "firstName", - user->firstName) == NULL) - { - goto fail; // String - } - } + if(user->firstName) { + if(cJSON_AddStringToObject(item, "firstName", user->firstName) == NULL) { + goto fail; //String + } + } // user->lastName - if(user->lastName) { - if(cJSON_AddStringToObject(item, "lastName", - user->lastName) == NULL) - { - goto fail; // String - } - } + if(user->lastName) { + if(cJSON_AddStringToObject(item, "lastName", user->lastName) == NULL) { + goto fail; //String + } + } // user->email - if(user->email) { - if(cJSON_AddStringToObject(item, "email", - user->email) == NULL) - { - goto fail; // String - } - } + if(user->email) { + if(cJSON_AddStringToObject(item, "email", user->email) == NULL) { + goto fail; //String + } + } // user->password - if(user->password) { - if(cJSON_AddStringToObject(item, "password", - user->password) == NULL) - { - goto fail; // String - } - } + if(user->password) { + if(cJSON_AddStringToObject(item, "password", user->password) == NULL) { + goto fail; //String + } + } // user->phone - if(user->phone) { - if(cJSON_AddStringToObject(item, "phone", - user->phone) == NULL) - { - goto fail; // String - } - } + if(user->phone) { + if(cJSON_AddStringToObject(item, "phone", user->phone) == NULL) { + goto fail; //String + } + } // user->userStatus - if(user->userStatus) { - if(cJSON_AddNumberToObject(item, "userStatus", - user->userStatus) == NULL) - { - goto fail; // Numeric - } - } + if(user->userStatus) { + if(cJSON_AddNumberToObject(item, "userStatus", user->userStatus) == NULL) { + goto fail; //Numeric + } + } return item; fail: - if(item) { - cJSON_Delete(item); - } + if (item) { + cJSON_Delete(item); + } return NULL; } -user_t *user_parseFromJSON(cJSON *userJSON) { - user_t *user_local_var = NULL; - - // user->id - cJSON *id = cJSON_GetObjectItemCaseSensitive(userJSON, "id"); - if(id) { - if(!cJSON_IsNumber(id)) { - goto end; // Numeric - } - } - - // user->username - cJSON *username = - cJSON_GetObjectItemCaseSensitive(userJSON, "username"); - if(username) { - if(!cJSON_IsString(username)) { - goto end; // String - } - } - - // user->firstName - cJSON *firstName = cJSON_GetObjectItemCaseSensitive(userJSON, - "firstName"); - if(firstName) { - if(!cJSON_IsString(firstName)) { - goto end; // String - } - } - - // user->lastName - cJSON *lastName = - cJSON_GetObjectItemCaseSensitive(userJSON, "lastName"); - if(lastName) { - if(!cJSON_IsString(lastName)) { - goto end; // String - } - } - - // user->email - cJSON *email = cJSON_GetObjectItemCaseSensitive(userJSON, "email"); - if(email) { - if(!cJSON_IsString(email)) { - goto end; // String - } - } - - // user->password - cJSON *password = - cJSON_GetObjectItemCaseSensitive(userJSON, "password"); - if(password) { - if(!cJSON_IsString(password)) { - goto end; // String - } - } - - // user->phone - cJSON *phone = cJSON_GetObjectItemCaseSensitive(userJSON, "phone"); - if(phone) { - if(!cJSON_IsString(phone)) { - goto end; // String - } - } - - // user->userStatus - cJSON *userStatus = cJSON_GetObjectItemCaseSensitive(userJSON, - "userStatus"); - if(userStatus) { - if(!cJSON_IsNumber(userStatus)) { - goto end; // Numeric - } - } - - - user_local_var = user_create( - id ? id->valuedouble : 0, - username ? strdup(username->valuestring) : NULL, - firstName ? strdup(firstName->valuestring) : NULL, - lastName ? strdup(lastName->valuestring) : NULL, - email ? strdup(email->valuestring) : NULL, - password ? strdup(password->valuestring) : NULL, - phone ? strdup(phone->valuestring) : NULL, - userStatus ? userStatus->valuedouble : 0 - ); - - return user_local_var; +user_t *user_parseFromJSON(cJSON *userJSON){ + + user_t *user_local_var = NULL; + + // user->id + cJSON *id = cJSON_GetObjectItemCaseSensitive(userJSON, "id"); + if (id) { + if(!cJSON_IsNumber(id)) + { + goto end; //Numeric + } + } + + // user->username + cJSON *username = cJSON_GetObjectItemCaseSensitive(userJSON, "username"); + if (username) { + if(!cJSON_IsString(username)) + { + goto end; //String + } + } + + // user->firstName + cJSON *firstName = cJSON_GetObjectItemCaseSensitive(userJSON, "firstName"); + if (firstName) { + if(!cJSON_IsString(firstName)) + { + goto end; //String + } + } + + // user->lastName + cJSON *lastName = cJSON_GetObjectItemCaseSensitive(userJSON, "lastName"); + if (lastName) { + if(!cJSON_IsString(lastName)) + { + goto end; //String + } + } + + // user->email + cJSON *email = cJSON_GetObjectItemCaseSensitive(userJSON, "email"); + if (email) { + if(!cJSON_IsString(email)) + { + goto end; //String + } + } + + // user->password + cJSON *password = cJSON_GetObjectItemCaseSensitive(userJSON, "password"); + if (password) { + if(!cJSON_IsString(password)) + { + goto end; //String + } + } + + // user->phone + cJSON *phone = cJSON_GetObjectItemCaseSensitive(userJSON, "phone"); + if (phone) { + if(!cJSON_IsString(phone)) + { + goto end; //String + } + } + + // user->userStatus + cJSON *userStatus = cJSON_GetObjectItemCaseSensitive(userJSON, "userStatus"); + if (userStatus) { + if(!cJSON_IsNumber(userStatus)) + { + goto end; //Numeric + } + } + + + user_local_var = user_create ( + id ? id->valuedouble : 0, + username ? strdup(username->valuestring) : NULL, + firstName ? strdup(firstName->valuestring) : NULL, + lastName ? strdup(lastName->valuestring) : NULL, + email ? strdup(email->valuestring) : NULL, + password ? strdup(password->valuestring) : NULL, + phone ? strdup(phone->valuestring) : NULL, + userStatus ? userStatus->valuedouble : 0 + ); + + return user_local_var; end: - return NULL; + return NULL; + } diff --git a/samples/client/petstore/c/model/user.h b/samples/client/petstore/c/model/user.h index dfb704efb26c..954bc64a1282 100644 --- a/samples/client/petstore/c/model/user.h +++ b/samples/client/petstore/c/model/user.h @@ -15,18 +15,27 @@ typedef struct user_t { - long id; // numeric - char *username; // string - char *firstName; // string - char *lastName; // string - char *email; // string - char *password; // string - char *phone; // string - int userStatus; // numeric + long id; //numeric + char *username; // string + char *firstName; // string + char *lastName; // string + char *email; // string + char *password; // string + char *phone; // string + int userStatus; //numeric + } user_t; -user_t *user_create(long id, char *username, char *firstName, char *lastName, - char *email, char *password, char *phone, int userStatus); +user_t *user_create( + long id, + char *username, + char *firstName, + char *lastName, + char *email, + char *password, + char *phone, + int userStatus +); void user_free(user_t *user); @@ -35,3 +44,4 @@ user_t *user_parseFromJSON(cJSON *userJSON); cJSON *user_convertToJSON(user_t *user); #endif /* _user_H_ */ + diff --git a/samples/client/petstore/c/src/apiClient.c b/samples/client/petstore/c/src/apiClient.c index afb0e096cf15..492b05632032 100644 --- a/samples/client/petstore/c/src/apiClient.c +++ b/samples/client/petstore/c/src/apiClient.c @@ -10,451 +10,448 @@ size_t writeDataCallback(void *buffer, size_t size, size_t nmemb, void *userp); apiClient_t *apiClient_create() { - curl_global_init(CURL_GLOBAL_ALL); - apiClient_t *apiClient = malloc(sizeof(apiClient_t)); - apiClient->basePath = "http://petstore.swagger.io/v2"; - apiClient->dataReceived = NULL; - apiClient->response_code = 0; - apiClient->apiKeys = NULL; - apiClient->accessToken = NULL; - - return apiClient; + curl_global_init(CURL_GLOBAL_ALL); + apiClient_t *apiClient = malloc(sizeof(apiClient_t)); + apiClient->basePath = "http://petstore.swagger.io/v2"; + apiClient->dataReceived = NULL; + apiClient->response_code = 0; + apiClient->apiKeys = NULL; + apiClient->accessToken = NULL; + + return apiClient; } void apiClient_free(apiClient_t *apiClient) { - if(apiClient->apiKeys) { - list_free(apiClient->apiKeys); - } - if(apiClient->accessToken) { - free(apiClient->accessToken); - } - free(apiClient); - curl_global_cleanup(); + if(apiClient->accessToken) { + list_free(apiClient->apiKeys); + } + if(apiClient->accessToken) { + free(apiClient->accessToken); + } + free(apiClient); + curl_global_cleanup(); } void replaceSpaceWithPlus(char *stringToProcess) { - for(int i = 0; i < strlen(stringToProcess); i++) { - if(stringToProcess[i] == ' ') { - stringToProcess[i] = '+'; - } - } + for(int i = 0; i < strlen(stringToProcess); i++) { + if(stringToProcess[i] == ' ') { + stringToProcess[i] = '+'; + } + } } -char *assembleTargetUrl(char *basePath, char *operationParameter, - list_t *queryParameters) { - int neededBufferSizeForQueryParameters = 0; - listEntry_t *listEntry; - - if(queryParameters != NULL) { - list_ForEach(listEntry, queryParameters) { - keyValuePair_t *pair = listEntry->data; - neededBufferSizeForQueryParameters += - strlen(pair->key) + strlen(pair->value); - } - - neededBufferSizeForQueryParameters += - (queryParameters->count * 2); // each keyValuePair is separated by a = and a & except the last, but this makes up for the ? at the beginning - } - - int operationParameterLength = 0; - int basePathLength = strlen(basePath); - bool slashNeedsToBeAppendedToBasePath = false; - - if(operationParameter != NULL) { - operationParameterLength = (1 + strlen(operationParameter)); - } - if(basePath[strlen(basePath) - 1] != '/') { - slashNeedsToBeAppendedToBasePath = true; - basePathLength++; - } - - char *targetUrl = - malloc( - neededBufferSizeForQueryParameters + basePathLength + operationParameterLength + - 1); - - strcpy(targetUrl, basePath); - - if(operationParameter != NULL) { - strcat(targetUrl, operationParameter); - } - - if(queryParameters != NULL) { - strcat(targetUrl, "?"); - list_ForEach(listEntry, queryParameters) { - keyValuePair_t *pair = listEntry->data; - replaceSpaceWithPlus(pair->key); - strcat(targetUrl, pair->key); - strcat(targetUrl, "="); - replaceSpaceWithPlus(pair->value); - strcat(targetUrl, pair->value); - if(listEntry->nextListEntry != NULL) { - strcat(targetUrl, "&"); - } - } - } - - return targetUrl; +char *assembleTargetUrl(char *basePath, + char *operationParameter, + list_t *queryParameters) { + int neededBufferSizeForQueryParameters = 0; + listEntry_t *listEntry; + + if(queryParameters != NULL) { + list_ForEach(listEntry, queryParameters) { + keyValuePair_t *pair = listEntry->data; + neededBufferSizeForQueryParameters += + strlen(pair->key) + strlen(pair->value); + } + + neededBufferSizeForQueryParameters += + (queryParameters->count * 2); // each keyValuePair is separated by a = and a & except the last, but this makes up for the ? at the beginning + } + + int operationParameterLength = 0; + int basePathLength = strlen(basePath); + bool slashNeedsToBeAppendedToBasePath = false; + + if(operationParameter != NULL) { + operationParameterLength = (1 + strlen(operationParameter)); + } + if(basePath[strlen(basePath) - 1] != '/') { + slashNeedsToBeAppendedToBasePath = true; + basePathLength++; + } + + char *targetUrl = + malloc( + neededBufferSizeForQueryParameters + basePathLength + operationParameterLength + + 1); + + strcpy(targetUrl, basePath); + + if(operationParameter != NULL) { + strcat(targetUrl, operationParameter); + } + + if(queryParameters != NULL) { + strcat(targetUrl, "?"); + list_ForEach(listEntry, queryParameters) { + keyValuePair_t *pair = listEntry->data; + replaceSpaceWithPlus(pair->key); + strcat(targetUrl, pair->key); + strcat(targetUrl, "="); + replaceSpaceWithPlus(pair->value); + strcat(targetUrl, pair->value); + if(listEntry->nextListEntry != NULL) { + strcat(targetUrl, "&"); + } + } + } + + return targetUrl; } char *assembleHeaderField(char *key, char *value) { - char *header = malloc(strlen(key) + strlen(value) + 3); + char *header = malloc(strlen(key) + strlen(value) + 3); - strcpy(header, key), - strcat(header, ": "); - strcat(header, value); + strcpy(header, key), + strcat(header, ": "); + strcat(header, value); - return header; + return header; } void postData(CURL *handle, char *bodyParameters) { - curl_easy_setopt(handle, CURLOPT_POSTFIELDS, bodyParameters); - curl_easy_setopt(handle, CURLOPT_POSTFIELDSIZE_LARGE, - strlen(bodyParameters)); + curl_easy_setopt(handle, CURLOPT_POSTFIELDS, bodyParameters); + curl_easy_setopt(handle, CURLOPT_POSTFIELDSIZE_LARGE, + strlen(bodyParameters)); } int lengthOfKeyPair(keyValuePair_t *keyPair) { - long length = 0; - if((keyPair->key != NULL) && - (keyPair->value != NULL) ) - { - length = strlen(keyPair->key) + strlen(keyPair->value); - return length; - } - return 0; + long length = 0; + if((keyPair->key != NULL) && + (keyPair->value != NULL) ) + { + length = strlen(keyPair->key) + strlen(keyPair->value); + return length; + } + return 0; } -void apiClient_invoke(apiClient_t *apiClient, char *operationParameter, - list_t *queryParameters, list_t *headerParameters, - list_t *formParameters, list_t *headerType, - list_t *contentType, char *bodyParameters, - char *requestType) { - CURL *handle = curl_easy_init(); - CURLcode res; - - if(handle) { - listEntry_t *listEntry; - curl_mime *mime = NULL; - struct curl_slist *headers = NULL; - char *buffContent = NULL; - char *buffHeader = NULL; - binary_t *fileVar = NULL; - char *formString = NULL; - - if(headerType != NULL) { - list_ForEach(listEntry, headerType) { - if(strstr((char *) listEntry->data, - "xml") == NULL) - { - buffHeader = malloc(strlen( - "Accept: ") + - strlen((char *) - listEntry-> - data) + 1); - sprintf(buffHeader, "%s%s", "Accept: ", - (char *) listEntry->data); - headers = curl_slist_append(headers, - buffHeader); - free(buffHeader); - } - } - } - if(contentType != NULL) { - list_ForEach(listEntry, contentType) { - if(strstr((char *) listEntry->data, - "xml") == NULL) - { - buffContent = - malloc(strlen( - "Content-Type: ") + strlen( - (char *) - listEntry->data) + - 1); - sprintf(buffContent, "%s%s", - "Content-Type: ", - (char *) listEntry->data); - headers = curl_slist_append(headers, - buffContent); - } - } - } else { - headers = curl_slist_append(headers, - "Content-Type: application/json"); - } - - if(requestType != NULL) { - curl_easy_setopt(handle, CURLOPT_CUSTOMREQUEST, - requestType); - } - - if(formParameters != NULL) { - if(strstr(buffContent, - "application/x-www-form-urlencoded") != NULL) - { - long parameterLength = 0; - long keyPairLength = 0; - list_ForEach(listEntry, formParameters) { - keyValuePair_t *keyPair = - listEntry->data; - - keyPairLength = - lengthOfKeyPair(keyPair) + 1; - - if(listEntry->nextListEntry != NULL) { - parameterLength++; - } - parameterLength = parameterLength + - keyPairLength; - } - - formString = malloc(parameterLength + 1); - memset(formString, 0, parameterLength + 1); - - list_ForEach(listEntry, formParameters) { - keyValuePair_t *keyPair = - listEntry->data; - if((keyPair->key != NULL) && - (keyPair->value != NULL) ) - { - strcat(formString, - keyPair->key); - strcat(formString, "="); - strcat(formString, - keyPair->value); - if(listEntry->nextListEntry != - NULL) - { - strcat(formString, "&"); - } - } - } - curl_easy_setopt(handle, CURLOPT_POSTFIELDS, - formString); - } - if(strstr(buffContent, "multipart/form-data") != NULL) { - mime = curl_mime_init(handle); - list_ForEach(listEntry, formParameters) { - keyValuePair_t *keyValuePair = - listEntry->data; - - if((keyValuePair->key != NULL) && - (keyValuePair->value != NULL) ) - { - curl_mimepart *part = - curl_mime_addpart(mime); - - curl_mime_name(part, - keyValuePair->key); - - - if(strcmp(keyValuePair->key, - "file") == 0) - { - memcpy(&fileVar, - keyValuePair->value, - sizeof(fileVar)); - curl_mime_data(part, - fileVar->data, - fileVar->len); - curl_mime_filename(part, - "image.png"); - } else { - curl_mime_data(part, - keyValuePair->value, - CURL_ZERO_TERMINATED); - } - } - } - curl_easy_setopt(handle, CURLOPT_MIMEPOST, - mime); - } - } - - list_ForEach(listEntry, headerParameters) { - keyValuePair_t *keyValuePair = listEntry->data; - if((keyValuePair->key != NULL) && - (keyValuePair->value != NULL) ) - { - char *headerValueToWrite = assembleHeaderField( - keyValuePair->key, keyValuePair->value); - curl_slist_append(headers, headerValueToWrite); - free(headerValueToWrite); - } - } - // this would only be generated for apiKey authentication - if(apiClient->apiKeys != NULL) { - list_ForEach(listEntry, apiClient->apiKeys) { - keyValuePair_t *apiKey = listEntry->data; - if((apiKey->key != NULL) && - (apiKey->value != NULL) ) - { - char *headerValueToWrite = - assembleHeaderField( - apiKey->key, - apiKey->value); - curl_slist_append(headers, - headerValueToWrite); - free(headerValueToWrite); - } - } - } - - char *targetUrl = - assembleTargetUrl(apiClient->basePath, - operationParameter, - queryParameters); - - curl_easy_setopt(handle, CURLOPT_URL, targetUrl); - curl_easy_setopt(handle, - CURLOPT_WRITEFUNCTION, - writeDataCallback); - curl_easy_setopt(handle, - CURLOPT_WRITEDATA, - &apiClient->dataReceived); - curl_easy_setopt(handle, CURLOPT_HTTPHEADER, headers); - curl_easy_setopt(handle, CURLOPT_VERBOSE, 0); // to get curl debug msg 0: to disable, 1L:to enable - - // this would only be generated for OAuth2 authentication - if(apiClient->accessToken != NULL) { - // curl_easy_setopt(handle, CURLOPT_HTTPAUTH, CURLAUTH_BEARER); - curl_easy_setopt(handle, - CURLOPT_XOAUTH2_BEARER, - apiClient->accessToken); - } - - if(bodyParameters != NULL) { - postData(handle, bodyParameters); - } - - res = curl_easy_perform(handle); - - curl_slist_free_all(headers); - - free(targetUrl); - - if(contentType != NULL) { - free(buffContent); - } - - if(res == CURLE_OK) { - curl_easy_getinfo(handle, CURLINFO_RESPONSE_CODE, - &apiClient->response_code); - } else { - char *url, *ip, *scheme; - long port; - curl_easy_getinfo(handle, CURLINFO_EFFECTIVE_URL, &url); - curl_easy_getinfo(handle, CURLINFO_PRIMARY_IP, &ip); - curl_easy_getinfo(handle, CURLINFO_PRIMARY_PORT, &port); - curl_easy_getinfo(handle, CURLINFO_SCHEME, &scheme); - fprintf(stderr, - "curl_easy_perform() failed\n\nURL: %s\nIP: %s\nPORT: %li\nSCHEME: %s\nStrERROR: %s\n", url, ip, port, scheme, - curl_easy_strerror(res)); - } - - curl_easy_cleanup(handle); - if(formParameters != NULL) { - free(formString); - curl_mime_free(mime); - } - } +void apiClient_invoke(apiClient_t *apiClient, + char *operationParameter, + list_t *queryParameters, + list_t *headerParameters, + list_t *formParameters, + list_t *headerType, + list_t *contentType, + char *bodyParameters, + char *requestType) { + CURL *handle = curl_easy_init(); + CURLcode res; + + if(handle) { + listEntry_t *listEntry; + curl_mime *mime = NULL; + struct curl_slist *headers = NULL; + char *buffContent = NULL; + char *buffHeader = NULL; + binary_t *fileVar = NULL; + char *formString = NULL; + + if(headerType != NULL) { + list_ForEach(listEntry, headerType) { + if(strstr((char *) listEntry->data, + "xml") == NULL) + { + buffHeader = malloc(strlen( + "Accept: ") + + strlen((char *) + listEntry-> + data) + 1); + sprintf(buffHeader, "%s%s", "Accept: ", + (char *) listEntry->data); + headers = curl_slist_append(headers, + buffHeader); + free(buffHeader); + } + } + } + if(contentType != NULL) { + list_ForEach(listEntry, contentType) { + if(strstr((char *) listEntry->data, + "xml") == NULL) + { + buffContent = + malloc(strlen( + "Content-Type: ") + strlen( + (char *) + listEntry->data) + + 1); + sprintf(buffContent, "%s%s", + "Content-Type: ", + (char *) listEntry->data); + headers = curl_slist_append(headers, + buffContent); + } + } + } else { + headers = curl_slist_append(headers, + "Content-Type: application/json"); + } + + if(requestType != NULL) { + curl_easy_setopt(handle, CURLOPT_CUSTOMREQUEST, + requestType); + } + + if(formParameters != NULL) { + if(strstr(buffContent, + "application/x-www-form-urlencoded") != NULL) + { + long parameterLength = 0; + long keyPairLength = 0; + list_ForEach(listEntry, formParameters) { + keyValuePair_t *keyPair = + listEntry->data; + + keyPairLength = + lengthOfKeyPair(keyPair) + 1; + + if(listEntry->nextListEntry != NULL) { + parameterLength++; + } + parameterLength = parameterLength + + keyPairLength; + } + + formString = malloc(parameterLength + 1); + memset(formString, 0, parameterLength + 1); + + list_ForEach(listEntry, formParameters) { + keyValuePair_t *keyPair = + listEntry->data; + if((keyPair->key != NULL) && + (keyPair->value != NULL) ) + { + strcat(formString, + keyPair->key); + strcat(formString, "="); + strcat(formString, + keyPair->value); + if(listEntry->nextListEntry != + NULL) + { + strcat(formString, "&"); + } + } + } + curl_easy_setopt(handle, CURLOPT_POSTFIELDS, + formString); + } + if(strstr(buffContent, "multipart/form-data") != NULL) { + mime = curl_mime_init(handle); + list_ForEach(listEntry, formParameters) { + keyValuePair_t *keyValuePair = + listEntry->data; + + if((keyValuePair->key != NULL) && + (keyValuePair->value != NULL) ) + { + curl_mimepart *part = + curl_mime_addpart(mime); + + curl_mime_name(part, + keyValuePair->key); + + + if(strcmp(keyValuePair->key, + "file") == 0) + { + memcpy(&fileVar, + keyValuePair->value, + sizeof(fileVar)); + curl_mime_data(part, + fileVar->data, + fileVar->len); + curl_mime_filename(part, + "image.png"); + } else { + curl_mime_data(part, + keyValuePair->value, + CURL_ZERO_TERMINATED); + } + } + } + curl_easy_setopt(handle, CURLOPT_MIMEPOST, + mime); + } + } + + list_ForEach(listEntry, headerParameters) { + keyValuePair_t *keyValuePair = listEntry->data; + if((keyValuePair->key != NULL) && + (keyValuePair->value != NULL) ) + { + char *headerValueToWrite = assembleHeaderField( + keyValuePair->key, keyValuePair->value); + curl_slist_append(headers, headerValueToWrite); + free(headerValueToWrite); + } + } + // this would only be generated for apiKey authentication + if (apiClient->apiKeys != NULL) + { + list_ForEach(listEntry, apiClient->apiKeys) { + keyValuePair_t *apiKey = listEntry->data; + if((apiKey->key != NULL) && + (apiKey->value != NULL) ) + { + char *headerValueToWrite = assembleHeaderField( + apiKey->key, apiKey->value); + curl_slist_append(headers, headerValueToWrite); + free(headerValueToWrite); + } + } + } + + char *targetUrl = + assembleTargetUrl(apiClient->basePath, + operationParameter, + queryParameters); + + curl_easy_setopt(handle, CURLOPT_URL, targetUrl); + curl_easy_setopt(handle, + CURLOPT_WRITEFUNCTION, + writeDataCallback); + curl_easy_setopt(handle, + CURLOPT_WRITEDATA, + &apiClient->dataReceived); + curl_easy_setopt(handle, CURLOPT_HTTPHEADER, headers); + curl_easy_setopt(handle, CURLOPT_VERBOSE, 0); // to get curl debug msg 0: to disable, 1L:to enable + + // this would only be generated for OAuth2 authentication + if(apiClient->accessToken != NULL) { + // curl_easy_setopt(handle, CURLOPT_HTTPAUTH, CURLAUTH_BEARER); + curl_easy_setopt(handle, + CURLOPT_XOAUTH2_BEARER, + apiClient->accessToken); + } + + if(bodyParameters != NULL) { + postData(handle, bodyParameters); + } + + res = curl_easy_perform(handle); + + curl_slist_free_all(headers); + + free(targetUrl); + + if(contentType != NULL) { + free(buffContent); + } + + if(res == CURLE_OK) { + curl_easy_getinfo(handle, CURLINFO_RESPONSE_CODE, &apiClient->response_code); + } else { + char *url,*ip,*scheme; + long port; + curl_easy_getinfo(handle, CURLINFO_EFFECTIVE_URL, &url); + curl_easy_getinfo(handle, CURLINFO_PRIMARY_IP, &ip); + curl_easy_getinfo(handle, CURLINFO_PRIMARY_PORT, &port); + curl_easy_getinfo(handle, CURLINFO_SCHEME, &scheme); + fprintf(stderr, "curl_easy_perform() failed\n\nURL: %s\nIP: %s\nPORT: %li\nSCHEME: %s\nStrERROR: %s\n",url,ip,port,scheme, + curl_easy_strerror(res)); + } + + curl_easy_cleanup(handle); + if(formParameters != NULL) { + free(formString); + curl_mime_free(mime); + } + } } size_t writeDataCallback(void *buffer, size_t size, size_t nmemb, void *userp) { - *(char **) userp = strdup(buffer); + *(char **) userp = strdup(buffer); - return size * nmemb; + return size * nmemb; } char *strReplace(char *orig, char *rep, char *with) { - char *result; // the return string - char *ins; // the next insert point - char *tmp; // varies - int lenRep; // length of rep (the string to remove) - int lenWith; // length of with (the string to replace rep with) - int lenFront; // distance between rep and end of last rep - int count; // number of replacements - - // sanity checks and initialization - if(!orig || - !rep) - { - return NULL; - } - lenRep = strlen(rep); - if(lenRep == 0) { - return NULL; // empty rep causes infinite loop during count - } - if(!with) { - with = ""; - } - lenWith = strlen(with); - - // count the number of replacements needed - ins = orig; - for(count = 0; tmp = strstr(ins, rep); ++count) { - ins = tmp + lenRep; - } - - tmp = result = malloc(strlen(orig) + (lenWith - lenRep) * count + 1); - - if(!result) { - return NULL; - } - char *originalPointer = orig; // copying original pointer to free the memory - // first time through the loop, all the variable are set correctly - // from here on, - // tmp points to the end of the result string - // ins points to the next occurrence of rep in orig - // orig points to the remainder of orig after "end of rep" - while(count--) { - ins = strstr(orig, rep); - lenFront = ins - orig; - tmp = strncpy(tmp, orig, lenFront) + lenFront; - tmp = strcpy(tmp, with) + lenWith; - orig += lenFront + lenRep; // move to next "end of rep" - } - strcpy(tmp, orig); - free(originalPointer); - return result; + char *result; // the return string + char *ins; // the next insert point + char *tmp; // varies + int lenRep; // length of rep (the string to remove) + int lenWith; // length of with (the string to replace rep with) + int lenFront; // distance between rep and end of last rep + int count; // number of replacements + + // sanity checks and initialization + if(!orig || !rep) + { + return NULL; + } + lenRep = strlen(rep); + if(lenRep == 0) { + return NULL; // empty rep causes infinite loop during count + } + if(!with) { + with = ""; + } + lenWith = strlen(with); + + // count the number of replacements needed + ins = orig; + for(count = 0; tmp = strstr(ins, rep); ++count) { + ins = tmp + lenRep; + } + + tmp = result = malloc(strlen(orig) + (lenWith - lenRep) * count + 1); + + if(!result) { + return NULL; + } + char *originalPointer = orig; // copying original pointer to free the memory + // first time through the loop, all the variable are set correctly + // from here on, + // tmp points to the end of the result string + // ins points to the next occurrence of rep in orig + // orig points to the remainder of orig after "end of rep" + while(count--) { + ins = strstr(orig, rep); + lenFront = ins - orig; + tmp = strncpy(tmp, orig, lenFront) + lenFront; + tmp = strcpy(tmp, with) + lenWith; + orig += lenFront + lenRep; // move to next "end of rep" + } + strcpy(tmp, orig); + free(originalPointer); + return result; } -char *sbi_base64encode(const void *b64_encode_this, - int encode_this_many_bytes) { +char *sbi_base64encode (const void *b64_encode_this, int encode_this_many_bytes){ #ifdef OPENSSL - BIO *b64_bio, *mem_bio; // Declares two OpenSSL BIOs: a base64 filter and a memory BIO. - BUF_MEM *mem_bio_mem_ptr; // Pointer to a "memory BIO" structure holding our base64 data. - b64_bio = BIO_new(BIO_f_base64()); // Initialize our base64 filter BIO. - mem_bio = BIO_new(BIO_s_mem()); // Initialize our memory sink BIO. - BIO_push(b64_bio, mem_bio); // Link the BIOs by creating a filter-sink BIO chain. - BIO_set_flags(b64_bio, BIO_FLAGS_BASE64_NO_NL); // No newlines every 64 characters or less. - BIO_write(b64_bio, b64_encode_this, encode_this_many_bytes); // Records base64 encoded data. - BIO_flush(b64_bio); // Flush data. Necessary for b64 encoding, because of pad characters. - BIO_get_mem_ptr(mem_bio, &mem_bio_mem_ptr); // Store address of mem_bio's memory structure. - BIO_set_close(mem_bio, BIO_NOCLOSE); // Permit access to mem_ptr after BIOs are destroyed. - BIO_free_all(b64_bio); // Destroys all BIOs in chain, starting with b64 (i.e. the 1st one). - BUF_MEM_grow(mem_bio_mem_ptr, (*mem_bio_mem_ptr).length + 1); // Makes space for end null. - (*mem_bio_mem_ptr).data[(*mem_bio_mem_ptr).length] = '\0'; // Adds null-terminator to tail. - return (*mem_bio_mem_ptr).data; // Returns base-64 encoded data. (See: "buf_mem_st" struct). + BIO *b64_bio, *mem_bio; //Declares two OpenSSL BIOs: a base64 filter and a memory BIO. + BUF_MEM *mem_bio_mem_ptr; //Pointer to a "memory BIO" structure holding our base64 data. + b64_bio = BIO_new(BIO_f_base64()); //Initialize our base64 filter BIO. + mem_bio = BIO_new(BIO_s_mem()); //Initialize our memory sink BIO. + BIO_push(b64_bio, mem_bio); //Link the BIOs by creating a filter-sink BIO chain. + BIO_set_flags(b64_bio, BIO_FLAGS_BASE64_NO_NL); //No newlines every 64 characters or less. + BIO_write(b64_bio, b64_encode_this, encode_this_many_bytes); //Records base64 encoded data. + BIO_flush(b64_bio); //Flush data. Necessary for b64 encoding, because of pad characters. + BIO_get_mem_ptr(mem_bio, &mem_bio_mem_ptr); //Store address of mem_bio's memory structure. + BIO_set_close(mem_bio, BIO_NOCLOSE); //Permit access to mem_ptr after BIOs are destroyed. + BIO_free_all(b64_bio); //Destroys all BIOs in chain, starting with b64 (i.e. the 1st one). + BUF_MEM_grow(mem_bio_mem_ptr, (*mem_bio_mem_ptr).length + 1); //Makes space for end null. + (*mem_bio_mem_ptr).data[(*mem_bio_mem_ptr).length] = '\0'; //Adds null-terminator to tail. + return (*mem_bio_mem_ptr).data; //Returns base-64 encoded data. (See: "buf_mem_st" struct). #endif } -char *sbi_base64decode(const void *b64_decode_this, - int decode_this_many_bytes) { +char *sbi_base64decode (const void *b64_decode_this, int decode_this_many_bytes){ #ifdef OPENSSL - BIO *b64_bio, *mem_bio; // Declares two OpenSSL BIOs: a base64 filter and a memory BIO. - char *base64_decoded = calloc( (decode_this_many_bytes * 3) / 4 + 1, - sizeof(char) ); // +1 = null. - b64_bio = BIO_new(BIO_f_base64()); // Initialize our base64 filter BIO. - mem_bio = BIO_new(BIO_s_mem()); // Initialize our memory source BIO. - BIO_write(mem_bio, b64_decode_this, decode_this_many_bytes); // Base64 data saved in source. - BIO_push(b64_bio, mem_bio); // Link the BIOs by creating a filter-source BIO chain. - BIO_set_flags(b64_bio, BIO_FLAGS_BASE64_NO_NL); // Don't require trailing newlines. - int decoded_byte_index = 0; // Index where the next base64_decoded byte should be written. - while(0 < BIO_read(b64_bio, base64_decoded + decoded_byte_index, 1) ) { // Read byte-by-byte. - decoded_byte_index++; // Increment the index until read of BIO decoded data is complete. - } // Once we're done reading decoded data, BIO_read returns -1 even though there's no error. - BIO_free_all(b64_bio); // Destroys all BIOs in chain, starting with b64 (i.e. the 1st one). - return base64_decoded; // Returns base-64 decoded data with trailing null terminator. + BIO *b64_bio, *mem_bio; //Declares two OpenSSL BIOs: a base64 filter and a memory BIO. + char *base64_decoded = calloc( (decode_this_many_bytes*3)/4+1, sizeof(char) ); //+1 = null. + b64_bio = BIO_new(BIO_f_base64()); //Initialize our base64 filter BIO. + mem_bio = BIO_new(BIO_s_mem()); //Initialize our memory source BIO. + BIO_write(mem_bio, b64_decode_this, decode_this_many_bytes); //Base64 data saved in source. + BIO_push(b64_bio, mem_bio); //Link the BIOs by creating a filter-source BIO chain. + BIO_set_flags(b64_bio, BIO_FLAGS_BASE64_NO_NL); //Don't require trailing newlines. + int decoded_byte_index = 0; //Index where the next base64_decoded byte should be written. + while ( 0 < BIO_read(b64_bio, base64_decoded+decoded_byte_index, 1) ){ //Read byte-by-byte. + decoded_byte_index++; //Increment the index until read of BIO decoded data is complete. + } //Once we're done reading decoded data, BIO_read returns -1 even though there's no error. + BIO_free_all(b64_bio); //Destroys all BIOs in chain, starting with b64 (i.e. the 1st one). + return base64_decoded; //Returns base-64 decoded data with trailing null terminator. #endif } diff --git a/samples/client/petstore/c/src/apiKey.c b/samples/client/petstore/c/src/apiKey.c index a7e000eb3b15..2bf8fc3e9d06 100644 --- a/samples/client/petstore/c/src/apiKey.c +++ b/samples/client/petstore/c/src/apiKey.c @@ -3,12 +3,12 @@ #include "../include/keyValuePair.h" keyValuePair_t *keyValuePair_create(char *key, void *value) { - keyValuePair_t *keyValuePair = malloc(sizeof(keyValuePair_t)); - keyValuePair->key = key; - keyValuePair->value = value; - return keyValuePair; + keyValuePair_t *keyValuePair = malloc(sizeof(keyValuePair_t)); + keyValuePair->key = key; + keyValuePair->value = value; + return keyValuePair; } void keyValuePair_free(keyValuePair_t *keyValuePair) { - free(keyValuePair); + free(keyValuePair); } diff --git a/samples/client/petstore/c/src/list.c b/samples/client/petstore/c/src/list.c index dc3f78dab764..73eee13c24d4 100644 --- a/samples/client/petstore/c/src/list.c +++ b/samples/client/petstore/c/src/list.c @@ -4,161 +4,163 @@ #include "../include/list.h" static listEntry_t *listEntry_create(void *data) { - listEntry_t *createdListEntry = malloc(sizeof(listEntry_t)); - if(createdListEntry == NULL) { - // TODO Malloc Failure - return NULL; - } - createdListEntry->data = data; - - return createdListEntry; + listEntry_t *createdListEntry = malloc(sizeof(listEntry_t)); + if(createdListEntry == NULL) { + // TODO Malloc Failure + return NULL; + } + createdListEntry->data = data; + + return createdListEntry; } void listEntry_free(listEntry_t *listEntry, void *additionalData) { - free(listEntry); + free(listEntry); } void listEntry_printAsInt(listEntry_t *listEntry, void *additionalData) { - printf("%i\n", *((int *) (listEntry->data))); + printf("%i\n", *((int *) (listEntry->data))); } list_t *list_create() { - list_t *createdList = malloc(sizeof(list_t)); - if(createdList == NULL) { - // TODO Malloc Failure - return NULL; - } - createdList->firstEntry = NULL; - createdList->lastEntry = NULL; - createdList->count = 0; - - return createdList; + list_t *createdList = malloc(sizeof(list_t)); + if(createdList == NULL) { + // TODO Malloc Failure + return NULL; + } + createdList->firstEntry = NULL; + createdList->lastEntry = NULL; + createdList->count = 0; + + return createdList; } -void list_iterateThroughListForward(list_t *list, void (*operationToPerform)( - listEntry_t *, - void *callbackFunctionUsedData), +void list_iterateThroughListForward(list_t *list, + void (*operationToPerform)( + listEntry_t *, + void *callbackFunctionUsedData), void *additionalDataNeededForCallbackFunction) { - listEntry_t *currentListEntry = list->firstEntry; - listEntry_t *nextListEntry; + listEntry_t *currentListEntry = list->firstEntry; + listEntry_t *nextListEntry; - if(currentListEntry == NULL) { - return; - } + if(currentListEntry == NULL) { + return; + } - nextListEntry = currentListEntry->nextListEntry; + nextListEntry = currentListEntry->nextListEntry; - operationToPerform(currentListEntry, - additionalDataNeededForCallbackFunction); - currentListEntry = nextListEntry; + operationToPerform(currentListEntry, + additionalDataNeededForCallbackFunction); + currentListEntry = nextListEntry; - while(currentListEntry != NULL) { - nextListEntry = currentListEntry->nextListEntry; - operationToPerform(currentListEntry, - additionalDataNeededForCallbackFunction); - currentListEntry = nextListEntry; - } + while(currentListEntry != NULL) { + nextListEntry = currentListEntry->nextListEntry; + operationToPerform(currentListEntry, + additionalDataNeededForCallbackFunction); + currentListEntry = nextListEntry; + } } -void list_iterateThroughListBackward(list_t *list, void (*operationToPerform)( - listEntry_t *, - void *callbackFunctionUsedData), +void list_iterateThroughListBackward(list_t *list, + void (*operationToPerform)( + listEntry_t *, + void *callbackFunctionUsedData), void *additionalDataNeededForCallbackFunction) { - listEntry_t *currentListEntry = list->lastEntry; - listEntry_t *nextListEntry = currentListEntry->prevListEntry; - - if(currentListEntry == NULL) { - return; - } - - operationToPerform(currentListEntry, - additionalDataNeededForCallbackFunction); - currentListEntry = nextListEntry; - - while(currentListEntry != NULL) { - nextListEntry = currentListEntry->prevListEntry; - operationToPerform(currentListEntry, - additionalDataNeededForCallbackFunction); - currentListEntry = nextListEntry; - } + listEntry_t *currentListEntry = list->lastEntry; + listEntry_t *nextListEntry = currentListEntry->prevListEntry; + + if(currentListEntry == NULL) { + return; + } + + operationToPerform(currentListEntry, + additionalDataNeededForCallbackFunction); + currentListEntry = nextListEntry; + + while(currentListEntry != NULL) { + nextListEntry = currentListEntry->prevListEntry; + operationToPerform(currentListEntry, + additionalDataNeededForCallbackFunction); + currentListEntry = nextListEntry; + } } void list_free(list_t *list) { - list_iterateThroughListForward(list, listEntry_free, NULL); - free(list); + list_iterateThroughListForward(list, listEntry_free, NULL); + free(list); } void list_addElement(list_t *list, void *dataToAddInList) { - listEntry_t *newListEntry = listEntry_create(dataToAddInList); - if(newListEntry == NULL) { - // TODO Malloc Failure - return; - } - if(list->firstEntry == NULL) { - list->firstEntry = newListEntry; - list->lastEntry = newListEntry; + listEntry_t *newListEntry = listEntry_create(dataToAddInList); + if(newListEntry == NULL) { + // TODO Malloc Failure + return; + } + if(list->firstEntry == NULL) { + list->firstEntry = newListEntry; + list->lastEntry = newListEntry; - newListEntry->prevListEntry = NULL; - newListEntry->nextListEntry = NULL; + newListEntry->prevListEntry = NULL; + newListEntry->nextListEntry = NULL; - list->count++; + list->count++; - return; - } + return; + } - list->lastEntry->nextListEntry = newListEntry; - newListEntry->prevListEntry = list->lastEntry; - newListEntry->nextListEntry = NULL; - list->lastEntry = newListEntry; + list->lastEntry->nextListEntry = newListEntry; + newListEntry->prevListEntry = list->lastEntry; + newListEntry->nextListEntry = NULL; + list->lastEntry = newListEntry; - list->count++; + list->count++; } void list_removeElement(list_t *list, listEntry_t *elementToRemove) { - listEntry_t *elementBeforeElementToRemove = - elementToRemove->prevListEntry; - listEntry_t *elementAfterElementToRemove = - elementToRemove->nextListEntry; - - if(elementBeforeElementToRemove != NULL) { - elementBeforeElementToRemove->nextListEntry = - elementAfterElementToRemove; - } else { - list->firstEntry = elementAfterElementToRemove; - } - - if(elementAfterElementToRemove != NULL) { - elementAfterElementToRemove->prevListEntry = - elementBeforeElementToRemove; - } else { - list->lastEntry = elementBeforeElementToRemove; - } - - listEntry_free(elementToRemove, NULL); - - list->count--; + listEntry_t *elementBeforeElementToRemove = + elementToRemove->prevListEntry; + listEntry_t *elementAfterElementToRemove = + elementToRemove->nextListEntry; + + if(elementBeforeElementToRemove != NULL) { + elementBeforeElementToRemove->nextListEntry = + elementAfterElementToRemove; + } else { + list->firstEntry = elementAfterElementToRemove; + } + + if(elementAfterElementToRemove != NULL) { + elementAfterElementToRemove->prevListEntry = + elementBeforeElementToRemove; + } else { + list->lastEntry = elementBeforeElementToRemove; + } + + listEntry_free(elementToRemove, NULL); + + list->count--; } listEntry_t *list_getElementAt(list_t *list, long indexOfElement) { - listEntry_t *currentListEntry; + listEntry_t *currentListEntry; - if((list->count / 2) > indexOfElement) { - currentListEntry = list->firstEntry; + if((list->count / 2) > indexOfElement) { + currentListEntry = list->firstEntry; - for(int i = 0; i < indexOfElement; i++) { - currentListEntry = currentListEntry->nextListEntry; - } + for(int i = 0; i < indexOfElement; i++) { + currentListEntry = currentListEntry->nextListEntry; + } - return currentListEntry; - } else { - currentListEntry = list->lastEntry; + return currentListEntry; + } else { + currentListEntry = list->lastEntry; - for(int i = 1; i < (list->count - indexOfElement); i++) { - currentListEntry = currentListEntry->prevListEntry; - } + for(int i = 1; i < (list->count - indexOfElement); i++) { + currentListEntry = currentListEntry->prevListEntry; + } - return currentListEntry; - } + return currentListEntry; + } } diff --git a/samples/client/petstore/clojure/.openapi-generator/VERSION b/samples/client/petstore/clojure/.openapi-generator/VERSION index afa636560641..83a328a9227e 100644 --- a/samples/client/petstore/clojure/.openapi-generator/VERSION +++ b/samples/client/petstore/clojure/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/clojure/src/open_api_petstore/api/pet.clj b/samples/client/petstore/clojure/src/open_api_petstore/api/pet.clj index 4dc96302b70a..677bf99bb12e 100644 --- a/samples/client/petstore/clojure/src/open_api_petstore/api/pet.clj +++ b/samples/client/petstore/clojure/src/open_api_petstore/api/pet.clj @@ -3,10 +3,12 @@ [clojure.spec.alpha :as s] [spec-tools.core :as st] [orchestra.core :refer [defn-spec]] + [open-api-petstore.specs.inline-object :refer :all] [open-api-petstore.specs.tag :refer :all] [open-api-petstore.specs.category :refer :all] [open-api-petstore.specs.user :refer :all] [open-api-petstore.specs.pet :refer :all] + [open-api-petstore.specs.inline-object-1 :refer :all] [open-api-petstore.specs.order :refer :all] ) (:import (java.io File))) diff --git a/samples/client/petstore/clojure/src/open_api_petstore/api/store.clj b/samples/client/petstore/clojure/src/open_api_petstore/api/store.clj index a91c086c3fd4..50a95edb58aa 100644 --- a/samples/client/petstore/clojure/src/open_api_petstore/api/store.clj +++ b/samples/client/petstore/clojure/src/open_api_petstore/api/store.clj @@ -3,10 +3,12 @@ [clojure.spec.alpha :as s] [spec-tools.core :as st] [orchestra.core :refer [defn-spec]] + [open-api-petstore.specs.inline-object :refer :all] [open-api-petstore.specs.tag :refer :all] [open-api-petstore.specs.category :refer :all] [open-api-petstore.specs.user :refer :all] [open-api-petstore.specs.pet :refer :all] + [open-api-petstore.specs.inline-object-1 :refer :all] [open-api-petstore.specs.order :refer :all] ) (:import (java.io File))) @@ -93,7 +95,7 @@ :query-params {} :form-params {} :body-param order - :content-types [] + :content-types ["application/json"] :accepts ["application/json" "application/xml"] :auth-names []}))) diff --git a/samples/client/petstore/clojure/src/open_api_petstore/api/user.clj b/samples/client/petstore/clojure/src/open_api_petstore/api/user.clj index ee758efedcd6..44668dbc7a3e 100644 --- a/samples/client/petstore/clojure/src/open_api_petstore/api/user.clj +++ b/samples/client/petstore/clojure/src/open_api_petstore/api/user.clj @@ -3,10 +3,12 @@ [clojure.spec.alpha :as s] [spec-tools.core :as st] [orchestra.core :refer [defn-spec]] + [open-api-petstore.specs.inline-object :refer :all] [open-api-petstore.specs.tag :refer :all] [open-api-petstore.specs.category :refer :all] [open-api-petstore.specs.user :refer :all] [open-api-petstore.specs.pet :refer :all] + [open-api-petstore.specs.inline-object-1 :refer :all] [open-api-petstore.specs.order :refer :all] ) (:import (java.io File))) @@ -23,7 +25,7 @@ :query-params {} :form-params {} :body-param user - :content-types [] + :content-types ["application/json"] :accepts [] :auth-names []}))) @@ -48,7 +50,7 @@ :query-params {} :form-params {} :body-param user - :content-types [] + :content-types ["application/json"] :accepts [] :auth-names []}))) @@ -72,7 +74,7 @@ :query-params {} :form-params {} :body-param user - :content-types [] + :content-types ["application/json"] :accepts [] :auth-names []}))) @@ -188,7 +190,7 @@ :query-params {} :form-params {} :body-param user - :content-types [] + :content-types ["application/json"] :accepts [] :auth-names []}))) diff --git a/samples/client/petstore/clojure/src/open_api_petstore/specs/inline_object.clj b/samples/client/petstore/clojure/src/open_api_petstore/specs/inline_object.clj new file mode 100644 index 000000000000..c4003f6e0515 --- /dev/null +++ b/samples/client/petstore/clojure/src/open_api_petstore/specs/inline_object.clj @@ -0,0 +1,17 @@ +(ns open-api-petstore.specs.inline-object + (:require [clojure.spec.alpha :as s] + [spec-tools.data-spec :as ds] + ) + (:import (java.io File))) + + +(def inline-object-data + { + (ds/opt :name) string? + (ds/opt :status) string? + }) + +(def inline-object-spec + (ds/spec + {:name ::inline-object + :spec inline-object-data})) diff --git a/samples/client/petstore/clojure/src/open_api_petstore/specs/inline_object_1.clj b/samples/client/petstore/clojure/src/open_api_petstore/specs/inline_object_1.clj new file mode 100644 index 000000000000..93304968f75c --- /dev/null +++ b/samples/client/petstore/clojure/src/open_api_petstore/specs/inline_object_1.clj @@ -0,0 +1,17 @@ +(ns open-api-petstore.specs.inline-object-1 + (:require [clojure.spec.alpha :as s] + [spec-tools.data-spec :as ds] + ) + (:import (java.io File))) + + +(def inline-object-1-data + { + (ds/opt :additionalMetadata) string? + (ds/opt :file) any? + }) + +(def inline-object-1-spec + (ds/spec + {:name ::inline-object-1 + :spec inline-object-1-data})) diff --git a/samples/client/petstore/cpp-qt5-qhttpengine-server/.openapi-generator-ignore b/samples/client/petstore/cpp-qt5-qhttpengine-server/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/client/petstore/cpp-qt5-qhttpengine-server/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/cpp-qt5-qhttpengine-server/.openapi-generator/VERSION b/samples/client/petstore/cpp-qt5-qhttpengine-server/.openapi-generator/VERSION new file mode 100644 index 000000000000..83a328a9227e --- /dev/null +++ b/samples/client/petstore/cpp-qt5-qhttpengine-server/.openapi-generator/VERSION @@ -0,0 +1 @@ +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/cpp-qt5-qhttpengine-server/server/CMakeLists.txt b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/CMakeLists.txt new file mode 100644 index 000000000000..54e6d36d73fe --- /dev/null +++ b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/CMakeLists.txt @@ -0,0 +1,17 @@ +cmake_minimum_required(VERSION 3.2 FATAL_ERROR) +project(cpp-qt5-qhttpengine-server) + +include(ExternalProject) + +set(EXTERNAL_INSTALL_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/external) + +ExternalProject_Add(QHTTPENGINE + GIT_REPOSITORY https://github.com/etherealjoy/qhttpengine.git + CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTERNAL_INSTALL_LOCATION} + -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} +) + +include_directories(${EXTERNAL_INSTALL_LOCATION}/include) +link_directories(${EXTERNAL_INSTALL_LOCATION}/lib) + +add_subdirectory(src) diff --git a/samples/client/petstore/cpp-qt5-qhttpengine-server/server/Dockerfile b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/Dockerfile new file mode 100644 index 000000000000..b0c591d10f65 --- /dev/null +++ b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/Dockerfile @@ -0,0 +1,29 @@ +FROM alpine:latest AS build + +RUN apk add --update \ + cmake \ + alpine-sdk \ + openssl \ + qt5-qtbase-dev \ + qt5-qttools-dev + +WORKDIR /usr/server +ADD ./src ./src +ADD ./CMakeLists.txt ./ +RUN mkdir -p ./build +WORKDIR /usr/server/build +RUN cmake -DNODEBUG:STRING="ON" .. +RUN make + +FROM alpine:latest AS runtime +RUN apk add --update \ + libgcc \ + libstdc++ \ + qt5-qtbase \ + openssl + +WORKDIR /usr/server +COPY --from=build /usr/server/build/src/cpp-qt5-qhttpengine-server ./build/src/ +COPY --from=build /usr/server/external/ ./external +EXPOSE 8080/tcp +ENTRYPOINT ["/usr/server/build/src/cpp-qt5-qhttpengine-server"] \ No newline at end of file diff --git a/samples/client/petstore/cpp-qt5-qhttpengine-server/server/LICENSE.txt b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/LICENSE.txt new file mode 100644 index 000000000000..be59130f858c --- /dev/null +++ b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/LICENSE.txt @@ -0,0 +1,11 @@ +QHttpEngine + +The MIT License (MIT) + +Copyright (c) 2015 Nathan Osman + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/samples/client/petstore/cpp-qt5-qhttpengine-server/server/Makefile b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/Makefile new file mode 100644 index 000000000000..6df9ff327568 --- /dev/null +++ b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/Makefile @@ -0,0 +1,29 @@ +BUILD_DIR=build +DIST_DIR=. +ECHO=echo +CMAKE=cmake +RM=rm +MKDIR_P = mkdir -p +CD=cd + +default: all + +checkdir: +ifeq "$(wildcard $(BUILD_DIR) )" "" + @$(ECHO) "Build Directory not existing, creating..." + @${MKDIR_P} ${BUILD_DIR} +endif + +cmakestep: checkdir + $(CD) $(BUILD_DIR) && $(CMAKE) ../${DIST_DIR} + +all: cmakestep + $(MAKE) -j8 -C $(BUILD_DIR) all + +install: all + $(MAKE) -C $(BUILD_DIR) install + +clean: + $(RM) -rf $(BUILD_DIR)/* + +.PHONY: clean install diff --git a/samples/client/petstore/cpp-qt5-qhttpengine-server/server/README.MD b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/README.MD new file mode 100644 index 000000000000..5225ebb24fd9 --- /dev/null +++ b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/README.MD @@ -0,0 +1,119 @@ +# C++ Qt5 Server + +## Qt5 HTTP Server based on the Qhttpengine + +This server was generated by the [openapi-generator](https://openapi-generator.tech) project. +By using the [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate a server stub. + +To see how to make this your own, look here: + +[README]((https://openapi-generator.tech)) + +- API version: 1.0.0 + +## QHTTPEngine + +[![Build Status](https://travis-ci.org/nitroshare/qhttpengine.svg?branch=master)](https://travis-ci.org/nitroshare/qhttpengine) +[![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](http://opensource.org/licenses/MIT) + +Simple set of classes for developing HTTP server applications in Qt. + +### Documentation + +To learn more about building and using the library, please visit this page: + +[Link](https://ci.quickmediasolutions.com/job/qhttpengine-documentation/doxygen) + +### Viewing the code + +You can view the code using an editor like Microsoft Visual Studio Code or you can +Use QtCreator and browse for the root CMakeLists.txt and load it as a project + +### Build with make + +Install the tools [Linux/Debian] + +```shell +sudo apt install cmake build-essential libssl-dev qtbase5-dev qtbase5-dev-tools git curl +``` + +To build, go to the `server` folder + +```shell +make +``` + +To run the server + +```shell +./build/src/cpp-qt5-qhttpengine-server & +``` + +To override the default port via the command line, provide the parameters `port` and `address` like below + +```shell +cpp-qt5-qhttpengine-server --port 9080 --address 127.17.0.1 +``` +or + +```shell +cpp-qt5-qhttpengine-server -p 9080 -a 127.17.0.1 +``` + +#### Invoke an API + +```shell +curl -X GET http://localhost:8080/v2/store/inventory +curl -X POST http://localhost:8080/v2/store/order -H "Content-Type: application/json" -d "{ \"id\": 22, \"petId\": 1541, \"quantity\": 5, \"shipDate\": \"2018-06-16T18:31:43.870Z\", \"status\": \"placed\", \"complete\": \"true\" }" +curl -X GET http://localhost:8080/v2/pet/findByStatus +curl -X GET http://localhost:8080/v2/store/inventory +``` + +### Run and build with docker + +Building with docker multistage +If you dont have docker install [here](https://docs.docker.com/install) +Add yourself to the docker group + +```shell +docker build --network=host -t cpp-qt5-qhttpengine-server . +``` + +Running with docker + +```shell +docker run --rm -it --name=server-container cpp-qt5-qhttpengine-server +``` + +#### Invoking an API + +Mind the IP here + +```shell +curl -X GET http://172.17.0.2:8080/v2/store/inventory +curl -X POST http://172.17.0.2:8080/v2/store/order -H "Content-Type: application/json" -d "{ \"id\": 22, \"petId\": 1541, \"quantity\": 5, \"shipDate\": \"2018-06-16T18:31:43.870Z\", \"status\": \"placed\", \"complete\": \"true\" }" +``` + +use this command to get the container IP + +```shell +docker inspect server-container | grep "IPAddress" +``` + +To exit from the command line + +```shell +Ctrl + p + q +``` + +To stop container + +```shell +docker stop +``` + +or to terminate and quit + +```shell +Ctrl+C +``` diff --git a/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/CMakeLists.txt b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/CMakeLists.txt new file mode 100644 index 000000000000..0311ec2020ff --- /dev/null +++ b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/CMakeLists.txt @@ -0,0 +1,48 @@ +cmake_minimum_required(VERSION 3.2 FATAL_ERROR) + +set(CMAKE_VERBOSE_MAKEFILE ON) +set(CMAKE_INCLUDE_CURRENT_DIR ON) +set(CMAKE_AUTOMOC ON) + +OPTION(NODEBUG "Deactivate No debugging option" "OFF") + +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -Wall -Wno-unused-variable") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -std=c++14 -Wall -Wno-unused-variable") + +if(${NODEBUG} STREQUAL "OFF") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pg -g3") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg -g3") +else (${NODEBUG} STREQUAL "OFF") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -s -O3") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s -O3") +endif(${NODEBUG} STREQUAL "OFF") + +find_package(Qt5Core REQUIRED) +find_package(Qt5Network REQUIRED) + +file(GLOB SRCS + ${CMAKE_CURRENT_SOURCE_DIR}/models/*.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/handlers/*.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/requests/*.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp +) + +include_directories( + ${Qt5Core_INCLUDE_DIRS} + ${Qt5Network_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR}/models + ${CMAKE_CURRENT_SOURCE_DIR}/handlers + ${CMAKE_CURRENT_SOURCE_DIR}/requests +) + +link_directories( + ${CMAKE_PREFIX_PATH}/lib +) + +add_executable(${PROJECT_NAME} ${SRCS}) +add_dependencies(${PROJECT_NAME} QHTTPENGINE) +target_link_libraries(${PROJECT_NAME} Qt5Core Qt5Network ssl crypto qhttpengine) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD_REQUIRED ON) + +install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) diff --git a/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIApiRouter.cpp b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIApiRouter.cpp new file mode 100644 index 000000000000..0ea833a0ed4b --- /dev/null +++ b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIApiRouter.cpp @@ -0,0 +1,236 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +#include +#include +#include +#include + + +#include "OAIApiRouter.h" +#include "OAIPetApiRequest.h" +#include "OAIStoreApiRequest.h" +#include "OAIUserApiRequest.h" + + +namespace OpenAPI { + +OAIApiRouter::OAIApiRouter() { + createApiHandlers(); +} + +OAIApiRouter::~OAIApiRouter(){ + +} + +void OAIApiRouter::createApiHandlers() { + mOAIPetApiHandler = QSharedPointer::create(); + mOAIStoreApiHandler = QSharedPointer::create(); + mOAIUserApiHandler = QSharedPointer::create(); +} + + +void OAIApiRouter::setOAIPetApiHandler(QSharedPointer handler){ + mOAIPetApiHandler = handler; +} +void OAIApiRouter::setOAIStoreApiHandler(QSharedPointer handler){ + mOAIStoreApiHandler = handler; +} +void OAIApiRouter::setOAIUserApiHandler(QSharedPointer handler){ + mOAIUserApiHandler = handler; +} + +void OAIApiRouter::setUpRoutes() { + + Routes.insert(QString("%1 %2").arg("POST").arg("/v2/pet").toLower(), [this](QHttpEngine::Socket *socket) { + auto reqObj = new OAIPetApiRequest(socket, mOAIPetApiHandler); + reqObj->addPetRequest(); + }); + Routes.insert(QString("%1 %2").arg("GET").arg("/v2/pet/findByStatus").toLower(), [this](QHttpEngine::Socket *socket) { + auto reqObj = new OAIPetApiRequest(socket, mOAIPetApiHandler); + reqObj->findPetsByStatusRequest(); + }); + Routes.insert(QString("%1 %2").arg("GET").arg("/v2/pet/findByTags").toLower(), [this](QHttpEngine::Socket *socket) { + auto reqObj = new OAIPetApiRequest(socket, mOAIPetApiHandler); + reqObj->findPetsByTagsRequest(); + }); + Routes.insert(QString("%1 %2").arg("PUT").arg("/v2/pet").toLower(), [this](QHttpEngine::Socket *socket) { + auto reqObj = new OAIPetApiRequest(socket, mOAIPetApiHandler); + reqObj->updatePetRequest(); + }); + Routes.insert(QString("%1 %2").arg("GET").arg("/v2/store/inventory").toLower(), [this](QHttpEngine::Socket *socket) { + auto reqObj = new OAIStoreApiRequest(socket, mOAIStoreApiHandler); + reqObj->getInventoryRequest(); + }); + Routes.insert(QString("%1 %2").arg("POST").arg("/v2/store/order").toLower(), [this](QHttpEngine::Socket *socket) { + auto reqObj = new OAIStoreApiRequest(socket, mOAIStoreApiHandler); + reqObj->placeOrderRequest(); + }); + Routes.insert(QString("%1 %2").arg("POST").arg("/v2/user").toLower(), [this](QHttpEngine::Socket *socket) { + auto reqObj = new OAIUserApiRequest(socket, mOAIUserApiHandler); + reqObj->createUserRequest(); + }); + Routes.insert(QString("%1 %2").arg("POST").arg("/v2/user/createWithArray").toLower(), [this](QHttpEngine::Socket *socket) { + auto reqObj = new OAIUserApiRequest(socket, mOAIUserApiHandler); + reqObj->createUsersWithArrayInputRequest(); + }); + Routes.insert(QString("%1 %2").arg("POST").arg("/v2/user/createWithList").toLower(), [this](QHttpEngine::Socket *socket) { + auto reqObj = new OAIUserApiRequest(socket, mOAIUserApiHandler); + reqObj->createUsersWithListInputRequest(); + }); + Routes.insert(QString("%1 %2").arg("GET").arg("/v2/user/login").toLower(), [this](QHttpEngine::Socket *socket) { + auto reqObj = new OAIUserApiRequest(socket, mOAIUserApiHandler); + reqObj->loginUserRequest(); + }); + Routes.insert(QString("%1 %2").arg("GET").arg("/v2/user/logout").toLower(), [this](QHttpEngine::Socket *socket) { + auto reqObj = new OAIUserApiRequest(socket, mOAIUserApiHandler); + reqObj->logoutUserRequest(); + }); +} + +void OAIApiRouter::processRequest(QHttpEngine::Socket *socket){ + if( handleRequest(socket) ){ + return; + } + if( handleRequestAndExtractPathParam(socket) ){ + return; + } + socket->setStatusCode(QHttpEngine::Socket::NotFound); + if(socket->isOpen()){ + socket->writeHeaders(); + socket->close(); + } +} + +bool OAIApiRouter::handleRequest(QHttpEngine::Socket *socket){ + auto reqPath = QString("%1 %2").arg(fromQHttpEngineMethod(socket->method())).arg(socket->path()).toLower(); + if ( Routes.contains(reqPath) ) { + Routes.value(reqPath).operator()(socket); + return true; + } + return false; +} + +bool OAIApiRouter::handleRequestAndExtractPathParam(QHttpEngine::Socket *socket){ + auto reqPath = QString("%1 %2").arg(fromQHttpEngineMethod(socket->method())).arg(socket->path()).toLower(); + { + auto completePath = QString("%1 %2").arg("DELETE").arg("/v2/pet/{petId}").toLower(); + if ( reqPath.startsWith(completePath.leftRef( completePath.indexOf(QString("/{")))) ) { + QRegularExpressionMatch match = getRequestMatch( completePath, reqPath ); + if ( match.hasMatch() ){ + QString petId = match.captured(QString("petId").toLower()); + auto reqObj = new OAIPetApiRequest(socket, mOAIPetApiHandler); + reqObj->deletePetRequest(petId); + return true; + } + } + } + { + auto completePath = QString("%1 %2").arg("GET").arg("/v2/pet/{petId}").toLower(); + if ( reqPath.startsWith(completePath.leftRef( completePath.indexOf(QString("/{")))) ) { + QRegularExpressionMatch match = getRequestMatch( completePath, reqPath ); + if ( match.hasMatch() ){ + QString petId = match.captured(QString("petId").toLower()); + auto reqObj = new OAIPetApiRequest(socket, mOAIPetApiHandler); + reqObj->getPetByIdRequest(petId); + return true; + } + } + } + { + auto completePath = QString("%1 %2").arg("POST").arg("/v2/pet/{petId}").toLower(); + if ( reqPath.startsWith(completePath.leftRef( completePath.indexOf(QString("/{")))) ) { + QRegularExpressionMatch match = getRequestMatch( completePath, reqPath ); + if ( match.hasMatch() ){ + QString petId = match.captured(QString("petId").toLower()); + auto reqObj = new OAIPetApiRequest(socket, mOAIPetApiHandler); + reqObj->updatePetWithFormRequest(petId); + return true; + } + } + } + { + auto completePath = QString("%1 %2").arg("POST").arg("/v2/pet/{petId}/uploadImage").toLower(); + if ( reqPath.startsWith(completePath.leftRef( completePath.indexOf(QString("/{")))) ) { + QRegularExpressionMatch match = getRequestMatch( completePath, reqPath ); + if ( match.hasMatch() ){ + QString petId = match.captured(QString("petId").toLower()); + auto reqObj = new OAIPetApiRequest(socket, mOAIPetApiHandler); + reqObj->uploadFileRequest(petId); + return true; + } + } + } + { + auto completePath = QString("%1 %2").arg("DELETE").arg("/v2/store/order/{orderId}").toLower(); + if ( reqPath.startsWith(completePath.leftRef( completePath.indexOf(QString("/{")))) ) { + QRegularExpressionMatch match = getRequestMatch( completePath, reqPath ); + if ( match.hasMatch() ){ + QString orderId = match.captured(QString("orderId").toLower()); + auto reqObj = new OAIStoreApiRequest(socket, mOAIStoreApiHandler); + reqObj->deleteOrderRequest(orderId); + return true; + } + } + } + { + auto completePath = QString("%1 %2").arg("GET").arg("/v2/store/order/{orderId}").toLower(); + if ( reqPath.startsWith(completePath.leftRef( completePath.indexOf(QString("/{")))) ) { + QRegularExpressionMatch match = getRequestMatch( completePath, reqPath ); + if ( match.hasMatch() ){ + QString orderId = match.captured(QString("orderId").toLower()); + auto reqObj = new OAIStoreApiRequest(socket, mOAIStoreApiHandler); + reqObj->getOrderByIdRequest(orderId); + return true; + } + } + } + { + auto completePath = QString("%1 %2").arg("DELETE").arg("/v2/user/{username}").toLower(); + if ( reqPath.startsWith(completePath.leftRef( completePath.indexOf(QString("/{")))) ) { + QRegularExpressionMatch match = getRequestMatch( completePath, reqPath ); + if ( match.hasMatch() ){ + QString username = match.captured(QString("username").toLower()); + auto reqObj = new OAIUserApiRequest(socket, mOAIUserApiHandler); + reqObj->deleteUserRequest(username); + return true; + } + } + } + { + auto completePath = QString("%1 %2").arg("GET").arg("/v2/user/{username}").toLower(); + if ( reqPath.startsWith(completePath.leftRef( completePath.indexOf(QString("/{")))) ) { + QRegularExpressionMatch match = getRequestMatch( completePath, reqPath ); + if ( match.hasMatch() ){ + QString username = match.captured(QString("username").toLower()); + auto reqObj = new OAIUserApiRequest(socket, mOAIUserApiHandler); + reqObj->getUserByNameRequest(username); + return true; + } + } + } + { + auto completePath = QString("%1 %2").arg("PUT").arg("/v2/user/{username}").toLower(); + if ( reqPath.startsWith(completePath.leftRef( completePath.indexOf(QString("/{")))) ) { + QRegularExpressionMatch match = getRequestMatch( completePath, reqPath ); + if ( match.hasMatch() ){ + QString username = match.captured(QString("username").toLower()); + auto reqObj = new OAIUserApiRequest(socket, mOAIUserApiHandler); + reqObj->updateUserRequest(username); + return true; + } + } + } + return false; +} + +} diff --git a/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIApiRouter.h b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIApiRouter.h new file mode 100644 index 000000000000..ee1893cd59ab --- /dev/null +++ b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIApiRouter.h @@ -0,0 +1,112 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +#ifndef OAI_APIROUTER_H +#define OAI_APIROUTER_H + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "OAIPetApiHandler.h" +#include "OAIStoreApiHandler.h" +#include "OAIUserApiHandler.h" + + +namespace OpenAPI { + +class OAIApiRequestHandler : public QHttpEngine::QObjectHandler +{ + Q_OBJECT +signals: + void requestReceived(QHttpEngine::Socket *socket); + +protected: + virtual void process(QHttpEngine::Socket *socket, const QString &path){ + Q_UNUSED(path); + emit requestReceived(socket); + } +}; + +class OAIApiRouter : public QObject +{ + Q_OBJECT +public: + OAIApiRouter(); + virtual ~OAIApiRouter(); + + void setUpRoutes(); + void processRequest(QHttpEngine::Socket *socket); + + void setOAIPetApiHandler(QSharedPointer handler); + void setOAIStoreApiHandler(QSharedPointer handler); + void setOAIUserApiHandler(QSharedPointer handler); +private: + QMap> Routes; + QMultiMap> RoutesWithPathParam; + + bool handleRequest(QHttpEngine::Socket *socket); + bool handleRequestAndExtractPathParam(QHttpEngine::Socket *socket); + + + QSharedPointer mOAIPetApiHandler; + QSharedPointer mOAIStoreApiHandler; + QSharedPointer mOAIUserApiHandler; +protected: + // override this method to provide custom class derived from ApiHandler classes + virtual void createApiHandlers(); + +private : + inline QString fromQHttpEngineMethod(QHttpEngine::Socket::Method method){ + switch( method ){ + case QHttpEngine::Socket::Method::OPTIONS: + return QStringLiteral("OPTIONS"); + case QHttpEngine::Socket::Method::GET: + return QStringLiteral("GET"); + case QHttpEngine::Socket::Method::HEAD: + return QStringLiteral("HEAD"); + case QHttpEngine::Socket::Method::POST: + return QStringLiteral("POST"); + case QHttpEngine::Socket::Method::PUT: + return QStringLiteral("PUT"); + case QHttpEngine::Socket::Method::DELETE: + return QStringLiteral("DELETE"); + case QHttpEngine::Socket::Method::TRACE: + return QStringLiteral("TRACE"); + case QHttpEngine::Socket::Method::CONNECT: + return QStringLiteral("CONNECT"); + } + return QStringLiteral(""); + } + + inline QRegularExpressionMatch getRequestMatch(QString serverTemplatePath, QString requestPath){ + QRegularExpression parExpr( R"(\{([^\/\\s]+)\})" ); + serverTemplatePath.replace( parExpr, R"((?<\1>[^\/\s]+))" ); + serverTemplatePath.append("[\\/]?$"); + QRegularExpression pathExpr( serverTemplatePath ); + return pathExpr.match( requestPath ); + } + +}; + + +} + +#endif // OAI_APIROUTER_H \ No newline at end of file diff --git a/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIPetApiHandler.cpp b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIPetApiHandler.cpp new file mode 100644 index 000000000000..08a766dac11d --- /dev/null +++ b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIPetApiHandler.cpp @@ -0,0 +1,112 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +#include +#include +#include +#include +#include + +#include "OAIPetApiHandler.h" +#include "OAIPetApiRequest.h" + +namespace OpenAPI { + +OAIPetApiHandler::OAIPetApiHandler(){ + +} + +OAIPetApiHandler::~OAIPetApiHandler(){ + +} + +void OAIPetApiHandler::addPet(OAIPet oai_pet) { + Q_UNUSED(oai_pet); + auto reqObj = qobject_cast(sender()); + if( reqObj != nullptr ) + { + + reqObj->addPetResponse(); + } +} +void OAIPetApiHandler::deletePet(qint64 pet_id, QString api_key) { + Q_UNUSED(pet_id); + Q_UNUSED(api_key); + auto reqObj = qobject_cast(sender()); + if( reqObj != nullptr ) + { + + reqObj->deletePetResponse(); + } +} +void OAIPetApiHandler::findPetsByStatus(QList status) { + Q_UNUSED(status); + auto reqObj = qobject_cast(sender()); + if( reqObj != nullptr ) + { + QList res; + reqObj->findPetsByStatusResponse(res); + } +} +void OAIPetApiHandler::findPetsByTags(QList tags, qint32 max_count) { + Q_UNUSED(tags); + Q_UNUSED(max_count); + auto reqObj = qobject_cast(sender()); + if( reqObj != nullptr ) + { + QList res; + reqObj->findPetsByTagsResponse(res); + } +} +void OAIPetApiHandler::getPetById(qint64 pet_id) { + Q_UNUSED(pet_id); + auto reqObj = qobject_cast(sender()); + if( reqObj != nullptr ) + { + OAIPet res; + reqObj->getPetByIdResponse(res); + } +} +void OAIPetApiHandler::updatePet(OAIPet oai_pet) { + Q_UNUSED(oai_pet); + auto reqObj = qobject_cast(sender()); + if( reqObj != nullptr ) + { + + reqObj->updatePetResponse(); + } +} +void OAIPetApiHandler::updatePetWithForm(qint64 pet_id, QString name, QString status) { + Q_UNUSED(pet_id); + Q_UNUSED(name); + Q_UNUSED(status); + auto reqObj = qobject_cast(sender()); + if( reqObj != nullptr ) + { + + reqObj->updatePetWithFormResponse(); + } +} +void OAIPetApiHandler::uploadFile(qint64 pet_id, QString additional_metadata, QIODevice* file) { + Q_UNUSED(pet_id); + Q_UNUSED(additional_metadata); + Q_UNUSED(file); + auto reqObj = qobject_cast(sender()); + if( reqObj != nullptr ) + { + OAIApiResponse res; + reqObj->uploadFileResponse(res); + } +} + + +} diff --git a/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIPetApiHandler.h b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIPetApiHandler.h new file mode 100644 index 000000000000..d61329ce21d9 --- /dev/null +++ b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIPetApiHandler.h @@ -0,0 +1,49 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +#ifndef OAI_OAIPetApiHandler_H +#define OAI_OAIPetApiHandler_H + +#include + +#include "OAIApiResponse.h" +#include "OAIPet.h" +#include +#include + +namespace OpenAPI { + +class OAIPetApiHandler : public QObject +{ + Q_OBJECT + +public: + OAIPetApiHandler(); + virtual ~OAIPetApiHandler(); + + +public slots: + virtual void addPet(OAIPet oai_pet); + virtual void deletePet(qint64 pet_id, QString api_key); + virtual void findPetsByStatus(QList status); + virtual void findPetsByTags(QList tags, qint32 max_count); + virtual void getPetById(qint64 pet_id); + virtual void updatePet(OAIPet oai_pet); + virtual void updatePetWithForm(qint64 pet_id, QString name, QString status); + virtual void uploadFile(qint64 pet_id, QString additional_metadata, QIODevice* file); + + +}; + +} + +#endif // OAI_OAIPetApiHandler_H diff --git a/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIStoreApiHandler.cpp b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIStoreApiHandler.cpp new file mode 100644 index 000000000000..8b76f9258ab1 --- /dev/null +++ b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIStoreApiHandler.cpp @@ -0,0 +1,69 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +#include +#include +#include +#include +#include + +#include "OAIStoreApiHandler.h" +#include "OAIStoreApiRequest.h" + +namespace OpenAPI { + +OAIStoreApiHandler::OAIStoreApiHandler(){ + +} + +OAIStoreApiHandler::~OAIStoreApiHandler(){ + +} + +void OAIStoreApiHandler::deleteOrder(QString order_id) { + Q_UNUSED(order_id); + auto reqObj = qobject_cast(sender()); + if( reqObj != nullptr ) + { + + reqObj->deleteOrderResponse(); + } +} +void OAIStoreApiHandler::getInventory() { + auto reqObj = qobject_cast(sender()); + if( reqObj != nullptr ) + { + QMap res; + reqObj->getInventoryResponse(res); + } +} +void OAIStoreApiHandler::getOrderById(qint64 order_id) { + Q_UNUSED(order_id); + auto reqObj = qobject_cast(sender()); + if( reqObj != nullptr ) + { + OAIOrder res; + reqObj->getOrderByIdResponse(res); + } +} +void OAIStoreApiHandler::placeOrder(OAIOrder oai_order) { + Q_UNUSED(oai_order); + auto reqObj = qobject_cast(sender()); + if( reqObj != nullptr ) + { + OAIOrder res; + reqObj->placeOrderResponse(res); + } +} + + +} diff --git a/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIStoreApiHandler.h b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIStoreApiHandler.h new file mode 100644 index 000000000000..62b78c34d18a --- /dev/null +++ b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIStoreApiHandler.h @@ -0,0 +1,44 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +#ifndef OAI_OAIStoreApiHandler_H +#define OAI_OAIStoreApiHandler_H + +#include + +#include "OAIOrder.h" +#include +#include + +namespace OpenAPI { + +class OAIStoreApiHandler : public QObject +{ + Q_OBJECT + +public: + OAIStoreApiHandler(); + virtual ~OAIStoreApiHandler(); + + +public slots: + virtual void deleteOrder(QString order_id); + virtual void getInventory(); + virtual void getOrderById(qint64 order_id); + virtual void placeOrder(OAIOrder oai_order); + + +}; + +} + +#endif // OAI_OAIStoreApiHandler_H diff --git a/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIUserApiHandler.cpp b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIUserApiHandler.cpp new file mode 100644 index 000000000000..90d0d9fe05ca --- /dev/null +++ b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIUserApiHandler.cpp @@ -0,0 +1,107 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +#include +#include +#include +#include +#include + +#include "OAIUserApiHandler.h" +#include "OAIUserApiRequest.h" + +namespace OpenAPI { + +OAIUserApiHandler::OAIUserApiHandler(){ + +} + +OAIUserApiHandler::~OAIUserApiHandler(){ + +} + +void OAIUserApiHandler::createUser(OAIUser oai_user) { + Q_UNUSED(oai_user); + auto reqObj = qobject_cast(sender()); + if( reqObj != nullptr ) + { + + reqObj->createUserResponse(); + } +} +void OAIUserApiHandler::createUsersWithArrayInput(QList oai_user) { + Q_UNUSED(oai_user); + auto reqObj = qobject_cast(sender()); + if( reqObj != nullptr ) + { + + reqObj->createUsersWithArrayInputResponse(); + } +} +void OAIUserApiHandler::createUsersWithListInput(QList oai_user) { + Q_UNUSED(oai_user); + auto reqObj = qobject_cast(sender()); + if( reqObj != nullptr ) + { + + reqObj->createUsersWithListInputResponse(); + } +} +void OAIUserApiHandler::deleteUser(QString username) { + Q_UNUSED(username); + auto reqObj = qobject_cast(sender()); + if( reqObj != nullptr ) + { + + reqObj->deleteUserResponse(); + } +} +void OAIUserApiHandler::getUserByName(QString username) { + Q_UNUSED(username); + auto reqObj = qobject_cast(sender()); + if( reqObj != nullptr ) + { + OAIUser res; + reqObj->getUserByNameResponse(res); + } +} +void OAIUserApiHandler::loginUser(QString username, QString password) { + Q_UNUSED(username); + Q_UNUSED(password); + auto reqObj = qobject_cast(sender()); + if( reqObj != nullptr ) + { + QString res; + reqObj->loginUserResponse(res); + } +} +void OAIUserApiHandler::logoutUser() { + auto reqObj = qobject_cast(sender()); + if( reqObj != nullptr ) + { + + reqObj->logoutUserResponse(); + } +} +void OAIUserApiHandler::updateUser(QString username, OAIUser oai_user) { + Q_UNUSED(username); + Q_UNUSED(oai_user); + auto reqObj = qobject_cast(sender()); + if( reqObj != nullptr ) + { + + reqObj->updateUserResponse(); + } +} + + +} diff --git a/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIUserApiHandler.h b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIUserApiHandler.h new file mode 100644 index 000000000000..e55e24354164 --- /dev/null +++ b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIUserApiHandler.h @@ -0,0 +1,48 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +#ifndef OAI_OAIUserApiHandler_H +#define OAI_OAIUserApiHandler_H + +#include + +#include "OAIUser.h" +#include +#include + +namespace OpenAPI { + +class OAIUserApiHandler : public QObject +{ + Q_OBJECT + +public: + OAIUserApiHandler(); + virtual ~OAIUserApiHandler(); + + +public slots: + virtual void createUser(OAIUser oai_user); + virtual void createUsersWithArrayInput(QList oai_user); + virtual void createUsersWithListInput(QList oai_user); + virtual void deleteUser(QString username); + virtual void getUserByName(QString username); + virtual void loginUser(QString username, QString password); + virtual void logoutUser(); + virtual void updateUser(QString username, OAIUser oai_user); + + +}; + +} + +#endif // OAI_OAIUserApiHandler_H diff --git a/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/main.cpp b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/main.cpp new file mode 100644 index 000000000000..d6b3af798d06 --- /dev/null +++ b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/main.cpp @@ -0,0 +1,100 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef __linux__ +#include +#include +#endif +#include +#include "OAIApiRouter.h" + +#ifdef __linux__ +void catchUnixSignals(QList quitSignals) { + auto handler = [](int sig) -> void { + // blocking and not aysnc-signal-safe func are valid + qDebug() << "\nquit the application by signal " << sig; + QCoreApplication::quit(); + }; + + sigset_t blocking_mask; + sigemptyset(&blocking_mask); + for (auto sig : quitSignals) + sigaddset(&blocking_mask, sig); + + struct sigaction sa; + sa.sa_handler = handler; + sa.sa_mask = blocking_mask; + sa.sa_flags = 0; + + for (auto sig : quitSignals) + sigaction(sig, &sa, nullptr); +} +#endif + +int main(int argc, char * argv[]) +{ + QCoreApplication a(argc, argv); +#ifdef __linux__ + QList sigs({SIGQUIT, SIGINT, SIGTERM, SIGHUP}); + catchUnixSignals(sigs); +#endif + // Build the command-line options + QCommandLineParser parser; + QCommandLineOption addressOption( + QStringList() << "a" << "address", + "address to bind to", + "address", + "0.0.0.0" + ); + parser.addOption(addressOption); + QCommandLineOption portOption( + QStringList() << "p" << "port", + "port to listen on", + "port", + "8080" + ); + parser.addOption(portOption); + parser.addHelpOption(); + + // Parse the options that were provided + parser.process(a); + + // Obtain the values + QHostAddress address = QHostAddress(parser.value(addressOption)); + quint16 port = static_cast(parser.value(portOption).toInt()); + + QSharedPointer handler(new OpenAPI::OAIApiRequestHandler()); + auto router = QSharedPointer::create(); + router->setUpRoutes(); + QObject::connect(handler.data(), &OpenAPI::OAIApiRequestHandler::requestReceived, [&](QHttpEngine::Socket *socket) { + router->processRequest(socket); + }); + + QHttpEngine::Server server(handler.data()); + qDebug() << "Serving on " << address.toString() << ":" << port; + // Attempt to listen on the specified port + if (!server.listen(address, port)) { + qCritical("Unable to listen on the specified port."); + return 1; + } + + return a.exec(); +} diff --git a/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIApiResponse.cpp b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIApiResponse.cpp new file mode 100644 index 000000000000..9d4dd1eb8174 --- /dev/null +++ b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIApiResponse.cpp @@ -0,0 +1,149 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +#include "OAIApiResponse.h" + +#include "OAIHelpers.h" + +#include +#include +#include +#include + +namespace OpenAPI { + +OAIApiResponse::OAIApiResponse(QString json) { + this->init(); + this->fromJson(json); +} + +OAIApiResponse::OAIApiResponse() { + this->init(); +} + +OAIApiResponse::~OAIApiResponse() { + +} + +void +OAIApiResponse::init() { + + m_code_isSet = false; + m_code_isValid = false; + + m_type_isSet = false; + m_type_isValid = false; + + m_message_isSet = false; + m_message_isValid = false; + } + +void +OAIApiResponse::fromJson(QString jsonString) { + QByteArray array (jsonString.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); +} + +void +OAIApiResponse::fromJsonObject(QJsonObject json) { + + m_code_isValid = ::OpenAPI::fromJsonValue(code, json[QString("code")]); + + + m_type_isValid = ::OpenAPI::fromJsonValue(type, json[QString("type")]); + + + m_message_isValid = ::OpenAPI::fromJsonValue(message, json[QString("message")]); + + +} + +QString +OAIApiResponse::asJson () const { + QJsonObject obj = this->asJsonObject(); + QJsonDocument doc(obj); + QByteArray bytes = doc.toJson(); + return QString(bytes); +} + +QJsonObject +OAIApiResponse::asJsonObject() const { + QJsonObject obj; + if(m_code_isSet){ + obj.insert(QString("code"), ::OpenAPI::toJsonValue(code)); + } + if(m_type_isSet){ + obj.insert(QString("type"), ::OpenAPI::toJsonValue(type)); + } + if(m_message_isSet){ + obj.insert(QString("message"), ::OpenAPI::toJsonValue(message)); + } + return obj; +} + + +qint32 +OAIApiResponse::getCode() const { + return code; +} +void +OAIApiResponse::setCode(const qint32 &code) { + this->code = code; + this->m_code_isSet = true; +} + + +QString +OAIApiResponse::getType() const { + return type; +} +void +OAIApiResponse::setType(const QString &type) { + this->type = type; + this->m_type_isSet = true; +} + + +QString +OAIApiResponse::getMessage() const { + return message; +} +void +OAIApiResponse::setMessage(const QString &message) { + this->message = message; + this->m_message_isSet = true; +} + +bool +OAIApiResponse::isSet() const { + bool isObjectUpdated = false; + do{ + if(m_code_isSet){ isObjectUpdated = true; break;} + + if(m_type_isSet){ isObjectUpdated = true; break;} + + if(m_message_isSet){ isObjectUpdated = true; break;} + }while(false); + return isObjectUpdated; +} + +bool +OAIApiResponse::isValid() const { + // only required properties are required for the object to be considered valid + return true; +} + +} + diff --git a/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIApiResponse.h b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIApiResponse.h new file mode 100644 index 000000000000..2fe8209ac10a --- /dev/null +++ b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIApiResponse.h @@ -0,0 +1,81 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * OAIApiResponse.h + * + * Describes the result of uploading an image resource + */ + +#ifndef OAIApiResponse_H +#define OAIApiResponse_H + +#include + + +#include + +#include "OAIObject.h" +#include "OAIEnum.h" + +namespace OpenAPI { + +class OAIApiResponse: public OAIObject { +public: + OAIApiResponse(); + OAIApiResponse(QString json); + ~OAIApiResponse() override; + + QString asJson () const override; + QJsonObject asJsonObject() const override; + void fromJsonObject(QJsonObject json) override; + void fromJson(QString jsonString) override; + + + qint32 getCode() const; + void setCode(const qint32 &code); + + + QString getType() const; + void setType(const QString &type); + + + QString getMessage() const; + void setMessage(const QString &message); + + + + virtual bool isSet() const override; + virtual bool isValid() const override; + +private: + void init(); + + qint32 code; + bool m_code_isSet; + bool m_code_isValid; + + QString type; + bool m_type_isSet; + bool m_type_isValid; + + QString message; + bool m_message_isSet; + bool m_message_isValid; + + }; + +} + +Q_DECLARE_METATYPE(OpenAPI::OAIApiResponse) + +#endif // OAIApiResponse_H diff --git a/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAICategory.cpp b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAICategory.cpp new file mode 100644 index 000000000000..752f6bdbba95 --- /dev/null +++ b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAICategory.cpp @@ -0,0 +1,127 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +#include "OAICategory.h" + +#include "OAIHelpers.h" + +#include +#include +#include +#include + +namespace OpenAPI { + +OAICategory::OAICategory(QString json) { + this->init(); + this->fromJson(json); +} + +OAICategory::OAICategory() { + this->init(); +} + +OAICategory::~OAICategory() { + +} + +void +OAICategory::init() { + + m_id_isSet = false; + m_id_isValid = false; + + m_name_isSet = false; + m_name_isValid = false; + } + +void +OAICategory::fromJson(QString jsonString) { + QByteArray array (jsonString.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); +} + +void +OAICategory::fromJsonObject(QJsonObject json) { + + m_id_isValid = ::OpenAPI::fromJsonValue(id, json[QString("id")]); + + + m_name_isValid = ::OpenAPI::fromJsonValue(name, json[QString("name")]); + + +} + +QString +OAICategory::asJson () const { + QJsonObject obj = this->asJsonObject(); + QJsonDocument doc(obj); + QByteArray bytes = doc.toJson(); + return QString(bytes); +} + +QJsonObject +OAICategory::asJsonObject() const { + QJsonObject obj; + if(m_id_isSet){ + obj.insert(QString("id"), ::OpenAPI::toJsonValue(id)); + } + if(m_name_isSet){ + obj.insert(QString("name"), ::OpenAPI::toJsonValue(name)); + } + return obj; +} + + +qint64 +OAICategory::getId() const { + return id; +} +void +OAICategory::setId(const qint64 &id) { + this->id = id; + this->m_id_isSet = true; +} + + +QString +OAICategory::getName() const { + return name; +} +void +OAICategory::setName(const QString &name) { + this->name = name; + this->m_name_isSet = true; +} + +bool +OAICategory::isSet() const { + bool isObjectUpdated = false; + do{ + if(m_id_isSet){ isObjectUpdated = true; break;} + + if(m_name_isSet){ isObjectUpdated = true; break;} + }while(false); + return isObjectUpdated; +} + +bool +OAICategory::isValid() const { + // only required properties are required for the object to be considered valid + return true; +} + +} + diff --git a/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAICategory.h b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAICategory.h new file mode 100644 index 000000000000..129d97485766 --- /dev/null +++ b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAICategory.h @@ -0,0 +1,73 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * OAICategory.h + * + * A category for a pet + */ + +#ifndef OAICategory_H +#define OAICategory_H + +#include + + +#include + +#include "OAIObject.h" +#include "OAIEnum.h" + +namespace OpenAPI { + +class OAICategory: public OAIObject { +public: + OAICategory(); + OAICategory(QString json); + ~OAICategory() override; + + QString asJson () const override; + QJsonObject asJsonObject() const override; + void fromJsonObject(QJsonObject json) override; + void fromJson(QString jsonString) override; + + + qint64 getId() const; + void setId(const qint64 &id); + + + QString getName() const; + void setName(const QString &name); + + + + virtual bool isSet() const override; + virtual bool isValid() const override; + +private: + void init(); + + qint64 id; + bool m_id_isSet; + bool m_id_isValid; + + QString name; + bool m_name_isSet; + bool m_name_isValid; + + }; + +} + +Q_DECLARE_METATYPE(OpenAPI::OAICategory) + +#endif // OAICategory_H diff --git a/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIEnum.h b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIEnum.h new file mode 100644 index 000000000000..a5e619960fba --- /dev/null +++ b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIEnum.h @@ -0,0 +1,67 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +#ifndef OAI_ENUM_H +#define OAI_ENUM_H + +#include +#include +#include + +namespace OpenAPI { + +class OAIEnum { + public: + OAIEnum() { + + } + + OAIEnum(QString jsonString) { + fromJson(jsonString); + } + + virtual ~OAIEnum(){ + + } + + virtual QJsonValue asJsonValue() const { + return QJsonValue(jstr); + } + + virtual QString asJson() const { + return jstr; + } + + virtual void fromJson(QString jsonString) { + jstr = jsonString; + } + + virtual void fromJsonValue(QJsonValue jval) { + jstr = jval.toString(); + } + + virtual bool isSet() const { + return false; + } + + virtual bool isValid() const { + return true; + } +private : + QString jstr; +}; + +} + +Q_DECLARE_METATYPE(OpenAPI::OAIEnum) + +#endif // OAI_ENUM_H diff --git a/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIHelpers.cpp b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIHelpers.cpp new file mode 100644 index 000000000000..bbe372ea8563 --- /dev/null +++ b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIHelpers.cpp @@ -0,0 +1,349 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +#include +#include "OAIHelpers.h" + + +namespace OpenAPI { + + +QString +toStringValue(const QString &value) { + return value; +} + +QString +toStringValue(const QDateTime &value){ + // ISO 8601 + return value.toString("yyyy-MM-ddTHH:mm:ss[Z|[+|-]HH:mm]"); +} + +QString +toStringValue(const QByteArray &value){ + return QString(value); +} + +QString +toStringValue(const QDate &value){ + // ISO 8601 + return value.toString(Qt::DateFormat::ISODate); +} + +QString +toStringValue(const qint32 &value) { + return QString::number(value); +} + +QString +toStringValue(const qint64 &value) { + return QString::number(value); +} + +QString +toStringValue(const bool &value) { + return QString(value ? "true" : "false"); +} + +QString +toStringValue(const float &value){ + return QString::number(static_cast(value)); +} + +QString +toStringValue(const double &value){ + return QString::number(value); +} + +QString +toStringValue(const OAIEnum &value){ + return value.asJson(); +} + +QJsonValue +toJsonValue(const QString &value){ + return QJsonValue(value); +} + +QJsonValue +toJsonValue(const QDateTime &value){ + return QJsonValue(value.toString(Qt::ISODate)); +} + +QJsonValue +toJsonValue(const QByteArray &value){ + return QJsonValue(QString(value.toBase64())); +} + +QJsonValue +toJsonValue(const QDate &value){ + return QJsonValue(value.toString(Qt::ISODate)); +} + +QJsonValue +toJsonValue(const qint32 &value){ + return QJsonValue(value); +} + +QJsonValue +toJsonValue(const qint64 &value){ + return QJsonValue(value); +} + +QJsonValue +toJsonValue(const bool &value){ + return QJsonValue(value); +} + +QJsonValue +toJsonValue(const float &value){ + return QJsonValue(static_cast(value)); +} + +QJsonValue +toJsonValue(const double &value){ + return QJsonValue(value); +} + +QJsonValue +toJsonValue(const OAIObject &value){ + return value.asJsonObject(); +} + +QJsonValue +toJsonValue(const OAIEnum &value){ + return value.asJsonValue(); +} + +bool +fromStringValue(const QString &inStr, QString &value){ + value.clear(); + value.append(inStr); + return !inStr.isEmpty(); +} + +bool +fromStringValue(const QString &inStr, QDateTime &value){ + if(inStr.isEmpty()){ + return false; + } + else{ + auto dateTime = QDateTime::fromString(inStr, "yyyy-MM-ddTHH:mm:ss[Z|[+|-]HH:mm]"); + if(dateTime.isValid()){ + value.setDate(dateTime.date()); + value.setTime(dateTime.time()); + } + else{ + qDebug() << "DateTime is invalid"; + } + return dateTime.isValid(); + } +} + +bool +fromStringValue(const QString &inStr, QByteArray &value){ + if(inStr.isEmpty()){ + return false; + } + else{ + value.clear(); + value.append(inStr.toUtf8()); + return value.count() > 0; + } +} + +bool +fromStringValue(const QString &inStr, QDate &value){ + if(inStr.isEmpty()){ + return false; + } + else{ + auto date = QDate::fromString(inStr, Qt::DateFormat::ISODate); + if(date.isValid()){ + value.setDate(date.year(), date.month(), date.day()); + } + else{ + qDebug() << "Date is invalid"; + } + return date.isValid(); + } +} + +bool +fromStringValue(const QString &inStr, qint32 &value){ + bool ok = false; + value = QVariant(inStr).toInt(&ok); + return ok; +} + +bool +fromStringValue(const QString &inStr, qint64 &value){ + bool ok = false; + value = QVariant(inStr).toLongLong(&ok); + return ok; +} + +bool +fromStringValue(const QString &inStr, bool &value){ + value = QVariant(inStr).toBool(); + return ((inStr == "true") || (inStr == "false")); +} + +bool +fromStringValue(const QString &inStr, float &value){ + bool ok = false; + value = QVariant(inStr).toFloat(&ok); + return ok; +} + +bool +fromStringValue(const QString &inStr, double &value){ + bool ok = false; + value = QVariant(inStr).toDouble(&ok); + return ok; +} + +bool +fromStringValue(const QString &inStr, OAIEnum &value){ + value.fromJson(inStr); + return true; +} + +bool +fromJsonValue(QString &value, const QJsonValue &jval){ + bool ok = true; + if(!jval.isUndefined() && !jval.isNull()){ + if(jval.isString()){ + value = jval.toString(); + } else if(jval.isBool()) { + value = jval.toBool() ? "true" : "false"; + } else if(jval.isDouble()){ + value = QString::number(jval.toDouble()); + } else { + ok = false; + } + } else { + ok = false; + } + return ok; +} + +bool +fromJsonValue(QDateTime &value, const QJsonValue &jval){ + bool ok = true; + if(!jval.isUndefined() && !jval.isNull() && jval.isString()){ + value = QDateTime::fromString(jval.toString(), Qt::ISODate); + ok = value.isValid(); + } else { + ok = false; + } + return ok; +} + +bool +fromJsonValue(QByteArray &value, const QJsonValue &jval){ + bool ok = true; + if(!jval.isUndefined() && !jval.isNull() && jval.isString()) { + value = QByteArray::fromBase64(QByteArray::fromStdString(jval.toString().toStdString())); + ok = value.size() > 0 ; + } else { + ok = false; + } + return ok; +} + +bool +fromJsonValue(QDate &value, const QJsonValue &jval){ + bool ok = true; + if(!jval.isUndefined() && !jval.isNull() && jval.isString()){ + value = QDate::fromString(jval.toString(), Qt::ISODate); + ok = value.isValid(); + } else { + ok = false; + } + return ok; +} + +bool +fromJsonValue(qint32 &value, const QJsonValue &jval){ + bool ok = true; + if(!jval.isUndefined() && !jval.isNull() && !jval.isObject() && !jval.isArray()){ + value = jval.toInt(); + } else { + ok = false; + } + return ok; +} + +bool +fromJsonValue(qint64 &value, const QJsonValue &jval){ + bool ok = true; + if(!jval.isUndefined() && !jval.isNull() && !jval.isObject() && !jval.isArray()){ + value = jval.toVariant().toLongLong(); + } else { + ok = false; + } + return ok; +} + +bool +fromJsonValue(bool &value, const QJsonValue &jval){ + bool ok = true; + if(jval.isBool()){ + value = jval.toBool(); + } else { + ok = false; + } + return ok; +} + +bool +fromJsonValue(float &value, const QJsonValue &jval){ + bool ok = true; + if(jval.isDouble()){ + value = static_cast(jval.toDouble()); + } else { + ok = false; + } + return ok; +} + +bool +fromJsonValue(double &value, const QJsonValue &jval){ + bool ok = true; + if(jval.isDouble()){ + value = jval.toDouble(); + } else { + ok = false; + } + return ok; +} + +bool +fromJsonValue(OAIObject &value, const QJsonValue &jval){ + bool ok = true; + if(jval.isObject()){ + value.fromJsonObject(jval.toObject()); + ok = value.isValid(); + } else { + ok = false; + } + return ok; +} + +bool +fromJsonValue(OAIEnum &value, const QJsonValue &jval){ + value.fromJsonValue(jval); + return true; +} + +} diff --git a/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIHelpers.h b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIHelpers.h new file mode 100644 index 000000000000..ce7cec3fc710 --- /dev/null +++ b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIHelpers.h @@ -0,0 +1,163 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +#ifndef OAI_HELPERS_H +#define OAI_HELPERS_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "OAIObject.h" +#include "OAIEnum.h" + +namespace OpenAPI { + + QString toStringValue(const QString &value); + QString toStringValue(const QDateTime &value); + QString toStringValue(const QByteArray &value); + QString toStringValue(const QDate &value); + QString toStringValue(const qint32 &value); + QString toStringValue(const qint64 &value); + QString toStringValue(const bool &value); + QString toStringValue(const float &value); + QString toStringValue(const double &value); + QString toStringValue(const OAIEnum &value); + + template + QString toStringValue(const QList &val) { + QString strArray; + for(const auto& item : val) { + strArray.append(toStringValue(item) + ","); + } + if(val.count() > 0) { + strArray.chop(1); + } + return strArray; + } + + QJsonValue toJsonValue(const QString &value); + QJsonValue toJsonValue(const QDateTime &value); + QJsonValue toJsonValue(const QByteArray &value); + QJsonValue toJsonValue(const QDate &value); + QJsonValue toJsonValue(const qint32 &value); + QJsonValue toJsonValue(const qint64 &value); + QJsonValue toJsonValue(const bool &value); + QJsonValue toJsonValue(const float &value); + QJsonValue toJsonValue(const double &value); + QJsonValue toJsonValue(const OAIObject &value); + QJsonValue toJsonValue(const OAIEnum &value); + + template + QJsonValue toJsonValue(const QList &val) { + QJsonArray jArray; + for(const auto& item : val) { + jArray.append(toJsonValue(item)); + } + return jArray; + } + + template + QJsonValue toJsonValue(const QMap &val) { + QJsonObject jObject; + for(const auto& itemkey : val.keys()) { + jObject.insert(itemkey, toJsonValue(val.value(itemkey))); + } + return jObject; + } + + bool fromStringValue(const QString &inStr, QString &value); + bool fromStringValue(const QString &inStr, QDateTime &value); + bool fromStringValue(const QString &inStr, QByteArray &value); + bool fromStringValue(const QString &inStr, QDate &value); + bool fromStringValue(const QString &inStr, qint32 &value); + bool fromStringValue(const QString &inStr, qint64 &value); + bool fromStringValue(const QString &inStr, bool &value); + bool fromStringValue(const QString &inStr, float &value); + bool fromStringValue(const QString &inStr, double &value); + bool fromStringValue(const QString &inStr, OAIEnum &value); + + template + bool fromStringValue(const QList &inStr, QList &val) { + bool ok = (inStr.count() > 0); + for(const auto& item: inStr){ + T itemVal; + ok &= fromStringValue(item, itemVal); + val.push_back(itemVal); + } + return ok; + } + + template + bool fromStringValue(const QMap &inStr, QMap &val) { + bool ok = (inStr.count() > 0); + for(const auto& itemkey : inStr.keys()){ + T itemVal; + ok &= fromStringValue(inStr.value(itemkey), itemVal); + val.insert(itemkey, itemVal); + } + return ok; + } + + bool fromJsonValue(QString &value, const QJsonValue &jval); + bool fromJsonValue(QDateTime &value, const QJsonValue &jval); + bool fromJsonValue(QByteArray &value, const QJsonValue &jval); + bool fromJsonValue(QDate &value, const QJsonValue &jval); + bool fromJsonValue(qint32 &value, const QJsonValue &jval); + bool fromJsonValue(qint64 &value, const QJsonValue &jval); + bool fromJsonValue(bool &value, const QJsonValue &jval); + bool fromJsonValue(float &value, const QJsonValue &jval); + bool fromJsonValue(double &value, const QJsonValue &jval); + bool fromJsonValue(OAIObject &value, const QJsonValue &jval); + bool fromJsonValue(OAIEnum &value, const QJsonValue &jval); + + template + bool fromJsonValue(QList &val, const QJsonValue &jval) { + bool ok = true; + if(jval.isArray()){ + for(const auto& jitem : jval.toArray()){ + T item; + ok &= fromJsonValue(item, jitem); + val.push_back(item); + } + } else { + ok = false; + } + return ok; + } + + template + bool fromJsonValue(QMap &val, const QJsonValue &jval) { + bool ok = true; + if(jval.isObject()){ + auto varmap = jval.toObject().toVariantMap(); + if(varmap.count() > 0){ + for(const auto& itemkey : varmap.keys() ){ + T itemVal; + ok &= fromJsonValue(itemVal, QJsonValue::fromVariant(varmap.value(itemkey))); + val.insert(itemkey, itemVal); + } + } + } else { + ok = false; + } + return ok; + } + +} + +#endif // OAI_HELPERS_H diff --git a/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIInline_object.cpp b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIInline_object.cpp new file mode 100644 index 000000000000..5d5218fb1040 --- /dev/null +++ b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIInline_object.cpp @@ -0,0 +1,127 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +#include "OAIInline_object.h" + +#include "OAIHelpers.h" + +#include +#include +#include +#include + +namespace OpenAPI { + +OAIInline_object::OAIInline_object(QString json) { + this->init(); + this->fromJson(json); +} + +OAIInline_object::OAIInline_object() { + this->init(); +} + +OAIInline_object::~OAIInline_object() { + +} + +void +OAIInline_object::init() { + + m_name_isSet = false; + m_name_isValid = false; + + m_status_isSet = false; + m_status_isValid = false; + } + +void +OAIInline_object::fromJson(QString jsonString) { + QByteArray array (jsonString.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); +} + +void +OAIInline_object::fromJsonObject(QJsonObject json) { + + m_name_isValid = ::OpenAPI::fromJsonValue(name, json[QString("name")]); + + + m_status_isValid = ::OpenAPI::fromJsonValue(status, json[QString("status")]); + + +} + +QString +OAIInline_object::asJson () const { + QJsonObject obj = this->asJsonObject(); + QJsonDocument doc(obj); + QByteArray bytes = doc.toJson(); + return QString(bytes); +} + +QJsonObject +OAIInline_object::asJsonObject() const { + QJsonObject obj; + if(m_name_isSet){ + obj.insert(QString("name"), ::OpenAPI::toJsonValue(name)); + } + if(m_status_isSet){ + obj.insert(QString("status"), ::OpenAPI::toJsonValue(status)); + } + return obj; +} + + +QString +OAIInline_object::getName() const { + return name; +} +void +OAIInline_object::setName(const QString &name) { + this->name = name; + this->m_name_isSet = true; +} + + +QString +OAIInline_object::getStatus() const { + return status; +} +void +OAIInline_object::setStatus(const QString &status) { + this->status = status; + this->m_status_isSet = true; +} + +bool +OAIInline_object::isSet() const { + bool isObjectUpdated = false; + do{ + if(m_name_isSet){ isObjectUpdated = true; break;} + + if(m_status_isSet){ isObjectUpdated = true; break;} + }while(false); + return isObjectUpdated; +} + +bool +OAIInline_object::isValid() const { + // only required properties are required for the object to be considered valid + return true; +} + +} + diff --git a/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIInline_object.h b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIInline_object.h new file mode 100644 index 000000000000..e8ca3e166f27 --- /dev/null +++ b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIInline_object.h @@ -0,0 +1,73 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * OAIInline_object.h + * + * + */ + +#ifndef OAIInline_object_H +#define OAIInline_object_H + +#include + + +#include + +#include "OAIObject.h" +#include "OAIEnum.h" + +namespace OpenAPI { + +class OAIInline_object: public OAIObject { +public: + OAIInline_object(); + OAIInline_object(QString json); + ~OAIInline_object() override; + + QString asJson () const override; + QJsonObject asJsonObject() const override; + void fromJsonObject(QJsonObject json) override; + void fromJson(QString jsonString) override; + + + QString getName() const; + void setName(const QString &name); + + + QString getStatus() const; + void setStatus(const QString &status); + + + + virtual bool isSet() const override; + virtual bool isValid() const override; + +private: + void init(); + + QString name; + bool m_name_isSet; + bool m_name_isValid; + + QString status; + bool m_status_isSet; + bool m_status_isValid; + + }; + +} + +Q_DECLARE_METATYPE(OpenAPI::OAIInline_object) + +#endif // OAIInline_object_H diff --git a/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIInline_object_1.cpp b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIInline_object_1.cpp new file mode 100644 index 000000000000..0031e5d01e1e --- /dev/null +++ b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIInline_object_1.cpp @@ -0,0 +1,127 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +#include "OAIInline_object_1.h" + +#include "OAIHelpers.h" + +#include +#include +#include +#include + +namespace OpenAPI { + +OAIInline_object_1::OAIInline_object_1(QString json) { + this->init(); + this->fromJson(json); +} + +OAIInline_object_1::OAIInline_object_1() { + this->init(); +} + +OAIInline_object_1::~OAIInline_object_1() { + +} + +void +OAIInline_object_1::init() { + + m_additional_metadata_isSet = false; + m_additional_metadata_isValid = false; + + m_file_isSet = false; + m_file_isValid = false; + } + +void +OAIInline_object_1::fromJson(QString jsonString) { + QByteArray array (jsonString.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); +} + +void +OAIInline_object_1::fromJsonObject(QJsonObject json) { + + m_additional_metadata_isValid = ::OpenAPI::fromJsonValue(additional_metadata, json[QString("additionalMetadata")]); + + + m_file_isValid = ::OpenAPI::fromJsonValue(file, json[QString("file")]); + + +} + +QString +OAIInline_object_1::asJson () const { + QJsonObject obj = this->asJsonObject(); + QJsonDocument doc(obj); + QByteArray bytes = doc.toJson(); + return QString(bytes); +} + +QJsonObject +OAIInline_object_1::asJsonObject() const { + QJsonObject obj; + if(m_additional_metadata_isSet){ + obj.insert(QString("additionalMetadata"), ::OpenAPI::toJsonValue(additional_metadata)); + } + if(file.isSet()){ + obj.insert(QString("file"), ::OpenAPI::toJsonValue(file)); + } + return obj; +} + + +QString +OAIInline_object_1::getAdditionalMetadata() const { + return additional_metadata; +} +void +OAIInline_object_1::setAdditionalMetadata(const QString &additional_metadata) { + this->additional_metadata = additional_metadata; + this->m_additional_metadata_isSet = true; +} + + +QIODevice* +OAIInline_object_1::getFile() const { + return file; +} +void +OAIInline_object_1::setFile(const QIODevice* &file) { + this->file = file; + this->m_file_isSet = true; +} + +bool +OAIInline_object_1::isSet() const { + bool isObjectUpdated = false; + do{ + if(m_additional_metadata_isSet){ isObjectUpdated = true; break;} + + if(file.isSet()){ isObjectUpdated = true; break;} + }while(false); + return isObjectUpdated; +} + +bool +OAIInline_object_1::isValid() const { + // only required properties are required for the object to be considered valid + return true; +} + +} + diff --git a/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIInline_object_1.h b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIInline_object_1.h new file mode 100644 index 000000000000..d51758652046 --- /dev/null +++ b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIInline_object_1.h @@ -0,0 +1,74 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * OAIInline_object_1.h + * + * + */ + +#ifndef OAIInline_object_1_H +#define OAIInline_object_1_H + +#include + + +#include +#include + +#include "OAIObject.h" +#include "OAIEnum.h" + +namespace OpenAPI { + +class OAIInline_object_1: public OAIObject { +public: + OAIInline_object_1(); + OAIInline_object_1(QString json); + ~OAIInline_object_1() override; + + QString asJson () const override; + QJsonObject asJsonObject() const override; + void fromJsonObject(QJsonObject json) override; + void fromJson(QString jsonString) override; + + + QString getAdditionalMetadata() const; + void setAdditionalMetadata(const QString &additional_metadata); + + + QIODevice* getFile() const; + void setFile(const QIODevice* &file); + + + + virtual bool isSet() const override; + virtual bool isValid() const override; + +private: + void init(); + + QString additional_metadata; + bool m_additional_metadata_isSet; + bool m_additional_metadata_isValid; + + QIODevice* file; + bool m_file_isSet; + bool m_file_isValid; + + }; + +} + +Q_DECLARE_METATYPE(OpenAPI::OAIInline_object_1) + +#endif // OAIInline_object_1_H diff --git a/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIObject.h b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIObject.h new file mode 100644 index 000000000000..babc1e64fbbf --- /dev/null +++ b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIObject.h @@ -0,0 +1,69 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +#ifndef OAI_OBJECT_H +#define OAI_OBJECT_H + +#include +#include +#include + +namespace OpenAPI { + +class OAIObject { + public: + OAIObject() { + + } + + OAIObject(QString jsonString) { + fromJson(jsonString); + } + + virtual ~OAIObject(){ + + } + + virtual QJsonObject asJsonObject() const { + return jObj; + } + + virtual QString asJson() const { + QJsonDocument doc(jObj); + return doc.toJson(QJsonDocument::Compact); + } + + virtual void fromJson(QString jsonString) { + QJsonDocument doc = QJsonDocument::fromJson(jsonString.toUtf8()); + jObj = doc.object(); + } + + virtual void fromJsonObject(QJsonObject json) { + jObj = json; + } + + virtual bool isSet() const { + return false; + } + + virtual bool isValid() const { + return true; + } +private : + QJsonObject jObj; +}; + +} + +Q_DECLARE_METATYPE(OpenAPI::OAIObject) + +#endif // OAI_OBJECT_H diff --git a/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIOrder.cpp b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIOrder.cpp new file mode 100644 index 000000000000..1ea3fba155de --- /dev/null +++ b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIOrder.cpp @@ -0,0 +1,215 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +#include "OAIOrder.h" + +#include "OAIHelpers.h" + +#include +#include +#include +#include + +namespace OpenAPI { + +OAIOrder::OAIOrder(QString json) { + this->init(); + this->fromJson(json); +} + +OAIOrder::OAIOrder() { + this->init(); +} + +OAIOrder::~OAIOrder() { + +} + +void +OAIOrder::init() { + + m_id_isSet = false; + m_id_isValid = false; + + m_pet_id_isSet = false; + m_pet_id_isValid = false; + + m_quantity_isSet = false; + m_quantity_isValid = false; + + m_ship_date_isSet = false; + m_ship_date_isValid = false; + + m_status_isSet = false; + m_status_isValid = false; + + m_complete_isSet = false; + m_complete_isValid = false; + } + +void +OAIOrder::fromJson(QString jsonString) { + QByteArray array (jsonString.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); +} + +void +OAIOrder::fromJsonObject(QJsonObject json) { + + m_id_isValid = ::OpenAPI::fromJsonValue(id, json[QString("id")]); + + + m_pet_id_isValid = ::OpenAPI::fromJsonValue(pet_id, json[QString("petId")]); + + + m_quantity_isValid = ::OpenAPI::fromJsonValue(quantity, json[QString("quantity")]); + + + m_ship_date_isValid = ::OpenAPI::fromJsonValue(ship_date, json[QString("shipDate")]); + + + m_status_isValid = ::OpenAPI::fromJsonValue(status, json[QString("status")]); + + + m_complete_isValid = ::OpenAPI::fromJsonValue(complete, json[QString("complete")]); + + +} + +QString +OAIOrder::asJson () const { + QJsonObject obj = this->asJsonObject(); + QJsonDocument doc(obj); + QByteArray bytes = doc.toJson(); + return QString(bytes); +} + +QJsonObject +OAIOrder::asJsonObject() const { + QJsonObject obj; + if(m_id_isSet){ + obj.insert(QString("id"), ::OpenAPI::toJsonValue(id)); + } + if(m_pet_id_isSet){ + obj.insert(QString("petId"), ::OpenAPI::toJsonValue(pet_id)); + } + if(m_quantity_isSet){ + obj.insert(QString("quantity"), ::OpenAPI::toJsonValue(quantity)); + } + if(m_ship_date_isSet){ + obj.insert(QString("shipDate"), ::OpenAPI::toJsonValue(ship_date)); + } + if(m_status_isSet){ + obj.insert(QString("status"), ::OpenAPI::toJsonValue(status)); + } + if(m_complete_isSet){ + obj.insert(QString("complete"), ::OpenAPI::toJsonValue(complete)); + } + return obj; +} + + +qint64 +OAIOrder::getId() const { + return id; +} +void +OAIOrder::setId(const qint64 &id) { + this->id = id; + this->m_id_isSet = true; +} + + +qint64 +OAIOrder::getPetId() const { + return pet_id; +} +void +OAIOrder::setPetId(const qint64 &pet_id) { + this->pet_id = pet_id; + this->m_pet_id_isSet = true; +} + + +qint32 +OAIOrder::getQuantity() const { + return quantity; +} +void +OAIOrder::setQuantity(const qint32 &quantity) { + this->quantity = quantity; + this->m_quantity_isSet = true; +} + + +QDateTime +OAIOrder::getShipDate() const { + return ship_date; +} +void +OAIOrder::setShipDate(const QDateTime &ship_date) { + this->ship_date = ship_date; + this->m_ship_date_isSet = true; +} + + +QString +OAIOrder::getStatus() const { + return status; +} +void +OAIOrder::setStatus(const QString &status) { + this->status = status; + this->m_status_isSet = true; +} + + +bool +OAIOrder::isComplete() const { + return complete; +} +void +OAIOrder::setComplete(const bool &complete) { + this->complete = complete; + this->m_complete_isSet = true; +} + +bool +OAIOrder::isSet() const { + bool isObjectUpdated = false; + do{ + if(m_id_isSet){ isObjectUpdated = true; break;} + + if(m_pet_id_isSet){ isObjectUpdated = true; break;} + + if(m_quantity_isSet){ isObjectUpdated = true; break;} + + if(m_ship_date_isSet){ isObjectUpdated = true; break;} + + if(m_status_isSet){ isObjectUpdated = true; break;} + + if(m_complete_isSet){ isObjectUpdated = true; break;} + }while(false); + return isObjectUpdated; +} + +bool +OAIOrder::isValid() const { + // only required properties are required for the object to be considered valid + return true; +} + +} + diff --git a/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIOrder.h b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIOrder.h new file mode 100644 index 000000000000..c9b006d36320 --- /dev/null +++ b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIOrder.h @@ -0,0 +1,106 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * OAIOrder.h + * + * An order for a pets from the pet store + */ + +#ifndef OAIOrder_H +#define OAIOrder_H + +#include + + +#include +#include + +#include "OAIObject.h" +#include "OAIEnum.h" + +namespace OpenAPI { + +class OAIOrder: public OAIObject { +public: + OAIOrder(); + OAIOrder(QString json); + ~OAIOrder() override; + + QString asJson () const override; + QJsonObject asJsonObject() const override; + void fromJsonObject(QJsonObject json) override; + void fromJson(QString jsonString) override; + + + qint64 getId() const; + void setId(const qint64 &id); + + + qint64 getPetId() const; + void setPetId(const qint64 &pet_id); + + + qint32 getQuantity() const; + void setQuantity(const qint32 &quantity); + + + QDateTime getShipDate() const; + void setShipDate(const QDateTime &ship_date); + + + QString getStatus() const; + void setStatus(const QString &status); + + + bool isComplete() const; + void setComplete(const bool &complete); + + + + virtual bool isSet() const override; + virtual bool isValid() const override; + +private: + void init(); + + qint64 id; + bool m_id_isSet; + bool m_id_isValid; + + qint64 pet_id; + bool m_pet_id_isSet; + bool m_pet_id_isValid; + + qint32 quantity; + bool m_quantity_isSet; + bool m_quantity_isValid; + + QDateTime ship_date; + bool m_ship_date_isSet; + bool m_ship_date_isValid; + + QString status; + bool m_status_isSet; + bool m_status_isValid; + + bool complete; + bool m_complete_isSet; + bool m_complete_isValid; + + }; + +} + +Q_DECLARE_METATYPE(OpenAPI::OAIOrder) + +#endif // OAIOrder_H diff --git a/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIPet.cpp b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIPet.cpp new file mode 100644 index 000000000000..c611d2d82ab2 --- /dev/null +++ b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIPet.cpp @@ -0,0 +1,217 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +#include "OAIPet.h" + +#include "OAIHelpers.h" + +#include +#include +#include +#include + +namespace OpenAPI { + +OAIPet::OAIPet(QString json) { + this->init(); + this->fromJson(json); +} + +OAIPet::OAIPet() { + this->init(); +} + +OAIPet::~OAIPet() { + +} + +void +OAIPet::init() { + + m_id_isSet = false; + m_id_isValid = false; + + m_category_isSet = false; + m_category_isValid = false; + + m_name_isSet = false; + m_name_isValid = false; + + m_photo_urls_isSet = false; + m_photo_urls_isValid = false; + + m_tags_isSet = false; + m_tags_isValid = false; + + m_status_isSet = false; + m_status_isValid = false; + } + +void +OAIPet::fromJson(QString jsonString) { + QByteArray array (jsonString.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); +} + +void +OAIPet::fromJsonObject(QJsonObject json) { + + m_id_isValid = ::OpenAPI::fromJsonValue(id, json[QString("id")]); + + + m_category_isValid = ::OpenAPI::fromJsonValue(category, json[QString("category")]); + + + m_name_isValid = ::OpenAPI::fromJsonValue(name, json[QString("name")]); + + + + m_photo_urls_isValid = ::OpenAPI::fromJsonValue(photo_urls, json[QString("photoUrls")]); + + + m_tags_isValid = ::OpenAPI::fromJsonValue(tags, json[QString("tags")]); + + m_status_isValid = ::OpenAPI::fromJsonValue(status, json[QString("status")]); + + +} + +QString +OAIPet::asJson () const { + QJsonObject obj = this->asJsonObject(); + QJsonDocument doc(obj); + QByteArray bytes = doc.toJson(); + return QString(bytes); +} + +QJsonObject +OAIPet::asJsonObject() const { + QJsonObject obj; + if(m_id_isSet){ + obj.insert(QString("id"), ::OpenAPI::toJsonValue(id)); + } + if(category.isSet()){ + obj.insert(QString("category"), ::OpenAPI::toJsonValue(category)); + } + if(m_name_isSet){ + obj.insert(QString("name"), ::OpenAPI::toJsonValue(name)); + } + + if(photo_urls.size() > 0){ + obj.insert(QString("photoUrls"), ::OpenAPI::toJsonValue(photo_urls)); + } + + if(tags.size() > 0){ + obj.insert(QString("tags"), ::OpenAPI::toJsonValue(tags)); + } + if(m_status_isSet){ + obj.insert(QString("status"), ::OpenAPI::toJsonValue(status)); + } + return obj; +} + + +qint64 +OAIPet::getId() const { + return id; +} +void +OAIPet::setId(const qint64 &id) { + this->id = id; + this->m_id_isSet = true; +} + + +OAICategory +OAIPet::getCategory() const { + return category; +} +void +OAIPet::setCategory(const OAICategory &category) { + this->category = category; + this->m_category_isSet = true; +} + + +QString +OAIPet::getName() const { + return name; +} +void +OAIPet::setName(const QString &name) { + this->name = name; + this->m_name_isSet = true; +} + + +QList +OAIPet::getPhotoUrls() const { + return photo_urls; +} +void +OAIPet::setPhotoUrls(const QList &photo_urls) { + this->photo_urls = photo_urls; + this->m_photo_urls_isSet = true; +} + + +QList +OAIPet::getTags() const { + return tags; +} +void +OAIPet::setTags(const QList &tags) { + this->tags = tags; + this->m_tags_isSet = true; +} + + +QString +OAIPet::getStatus() const { + return status; +} +void +OAIPet::setStatus(const QString &status) { + this->status = status; + this->m_status_isSet = true; +} + +bool +OAIPet::isSet() const { + bool isObjectUpdated = false; + do{ + if(m_id_isSet){ isObjectUpdated = true; break;} + + if(category.isSet()){ isObjectUpdated = true; break;} + + if(m_name_isSet){ isObjectUpdated = true; break;} + + if(photo_urls.size() > 0){ isObjectUpdated = true; break;} + + if(tags.size() > 0){ isObjectUpdated = true; break;} + + if(m_status_isSet){ isObjectUpdated = true; break;} + }while(false); + return isObjectUpdated; +} + +bool +OAIPet::isValid() const { + // only required properties are required for the object to be considered valid + return m_name_isValid && m_photo_urls_isValid && true; +} + +} + diff --git a/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIPet.h b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIPet.h new file mode 100644 index 000000000000..6bec604d216c --- /dev/null +++ b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIPet.h @@ -0,0 +1,108 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * OAIPet.h + * + * A pet for sale in the pet store + */ + +#ifndef OAIPet_H +#define OAIPet_H + +#include + + +#include "OAICategory.h" +#include "OAITag.h" +#include +#include + +#include "OAIObject.h" +#include "OAIEnum.h" + +namespace OpenAPI { + +class OAIPet: public OAIObject { +public: + OAIPet(); + OAIPet(QString json); + ~OAIPet() override; + + QString asJson () const override; + QJsonObject asJsonObject() const override; + void fromJsonObject(QJsonObject json) override; + void fromJson(QString jsonString) override; + + + qint64 getId() const; + void setId(const qint64 &id); + + + OAICategory getCategory() const; + void setCategory(const OAICategory &category); + + + QString getName() const; + void setName(const QString &name); + + + QList getPhotoUrls() const; + void setPhotoUrls(const QList &photo_urls); + + + QList getTags() const; + void setTags(const QList &tags); + + + QString getStatus() const; + void setStatus(const QString &status); + + + + virtual bool isSet() const override; + virtual bool isValid() const override; + +private: + void init(); + + qint64 id; + bool m_id_isSet; + bool m_id_isValid; + + OAICategory category; + bool m_category_isSet; + bool m_category_isValid; + + QString name; + bool m_name_isSet; + bool m_name_isValid; + + QList photo_urls; + bool m_photo_urls_isSet; + bool m_photo_urls_isValid; + + QList tags; + bool m_tags_isSet; + bool m_tags_isValid; + + QString status; + bool m_status_isSet; + bool m_status_isValid; + + }; + +} + +Q_DECLARE_METATYPE(OpenAPI::OAIPet) + +#endif // OAIPet_H diff --git a/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAITag.cpp b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAITag.cpp new file mode 100644 index 000000000000..4cf8d349b452 --- /dev/null +++ b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAITag.cpp @@ -0,0 +1,127 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +#include "OAITag.h" + +#include "OAIHelpers.h" + +#include +#include +#include +#include + +namespace OpenAPI { + +OAITag::OAITag(QString json) { + this->init(); + this->fromJson(json); +} + +OAITag::OAITag() { + this->init(); +} + +OAITag::~OAITag() { + +} + +void +OAITag::init() { + + m_id_isSet = false; + m_id_isValid = false; + + m_name_isSet = false; + m_name_isValid = false; + } + +void +OAITag::fromJson(QString jsonString) { + QByteArray array (jsonString.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); +} + +void +OAITag::fromJsonObject(QJsonObject json) { + + m_id_isValid = ::OpenAPI::fromJsonValue(id, json[QString("id")]); + + + m_name_isValid = ::OpenAPI::fromJsonValue(name, json[QString("name")]); + + +} + +QString +OAITag::asJson () const { + QJsonObject obj = this->asJsonObject(); + QJsonDocument doc(obj); + QByteArray bytes = doc.toJson(); + return QString(bytes); +} + +QJsonObject +OAITag::asJsonObject() const { + QJsonObject obj; + if(m_id_isSet){ + obj.insert(QString("id"), ::OpenAPI::toJsonValue(id)); + } + if(m_name_isSet){ + obj.insert(QString("name"), ::OpenAPI::toJsonValue(name)); + } + return obj; +} + + +qint64 +OAITag::getId() const { + return id; +} +void +OAITag::setId(const qint64 &id) { + this->id = id; + this->m_id_isSet = true; +} + + +QString +OAITag::getName() const { + return name; +} +void +OAITag::setName(const QString &name) { + this->name = name; + this->m_name_isSet = true; +} + +bool +OAITag::isSet() const { + bool isObjectUpdated = false; + do{ + if(m_id_isSet){ isObjectUpdated = true; break;} + + if(m_name_isSet){ isObjectUpdated = true; break;} + }while(false); + return isObjectUpdated; +} + +bool +OAITag::isValid() const { + // only required properties are required for the object to be considered valid + return true; +} + +} + diff --git a/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAITag.h b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAITag.h new file mode 100644 index 000000000000..497a021f0858 --- /dev/null +++ b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAITag.h @@ -0,0 +1,73 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * OAITag.h + * + * A tag for a pet + */ + +#ifndef OAITag_H +#define OAITag_H + +#include + + +#include + +#include "OAIObject.h" +#include "OAIEnum.h" + +namespace OpenAPI { + +class OAITag: public OAIObject { +public: + OAITag(); + OAITag(QString json); + ~OAITag() override; + + QString asJson () const override; + QJsonObject asJsonObject() const override; + void fromJsonObject(QJsonObject json) override; + void fromJson(QString jsonString) override; + + + qint64 getId() const; + void setId(const qint64 &id); + + + QString getName() const; + void setName(const QString &name); + + + + virtual bool isSet() const override; + virtual bool isValid() const override; + +private: + void init(); + + qint64 id; + bool m_id_isSet; + bool m_id_isValid; + + QString name; + bool m_name_isSet; + bool m_name_isValid; + + }; + +} + +Q_DECLARE_METATYPE(OpenAPI::OAITag) + +#endif // OAITag_H diff --git a/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIUser.cpp b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIUser.cpp new file mode 100644 index 000000000000..52431c0367bb --- /dev/null +++ b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIUser.cpp @@ -0,0 +1,259 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +#include "OAIUser.h" + +#include "OAIHelpers.h" + +#include +#include +#include +#include + +namespace OpenAPI { + +OAIUser::OAIUser(QString json) { + this->init(); + this->fromJson(json); +} + +OAIUser::OAIUser() { + this->init(); +} + +OAIUser::~OAIUser() { + +} + +void +OAIUser::init() { + + m_id_isSet = false; + m_id_isValid = false; + + m_username_isSet = false; + m_username_isValid = false; + + m_first_name_isSet = false; + m_first_name_isValid = false; + + m_last_name_isSet = false; + m_last_name_isValid = false; + + m_email_isSet = false; + m_email_isValid = false; + + m_password_isSet = false; + m_password_isValid = false; + + m_phone_isSet = false; + m_phone_isValid = false; + + m_user_status_isSet = false; + m_user_status_isValid = false; + } + +void +OAIUser::fromJson(QString jsonString) { + QByteArray array (jsonString.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); +} + +void +OAIUser::fromJsonObject(QJsonObject json) { + + m_id_isValid = ::OpenAPI::fromJsonValue(id, json[QString("id")]); + + + m_username_isValid = ::OpenAPI::fromJsonValue(username, json[QString("username")]); + + + m_first_name_isValid = ::OpenAPI::fromJsonValue(first_name, json[QString("firstName")]); + + + m_last_name_isValid = ::OpenAPI::fromJsonValue(last_name, json[QString("lastName")]); + + + m_email_isValid = ::OpenAPI::fromJsonValue(email, json[QString("email")]); + + + m_password_isValid = ::OpenAPI::fromJsonValue(password, json[QString("password")]); + + + m_phone_isValid = ::OpenAPI::fromJsonValue(phone, json[QString("phone")]); + + + m_user_status_isValid = ::OpenAPI::fromJsonValue(user_status, json[QString("userStatus")]); + + +} + +QString +OAIUser::asJson () const { + QJsonObject obj = this->asJsonObject(); + QJsonDocument doc(obj); + QByteArray bytes = doc.toJson(); + return QString(bytes); +} + +QJsonObject +OAIUser::asJsonObject() const { + QJsonObject obj; + if(m_id_isSet){ + obj.insert(QString("id"), ::OpenAPI::toJsonValue(id)); + } + if(m_username_isSet){ + obj.insert(QString("username"), ::OpenAPI::toJsonValue(username)); + } + if(m_first_name_isSet){ + obj.insert(QString("firstName"), ::OpenAPI::toJsonValue(first_name)); + } + if(m_last_name_isSet){ + obj.insert(QString("lastName"), ::OpenAPI::toJsonValue(last_name)); + } + if(m_email_isSet){ + obj.insert(QString("email"), ::OpenAPI::toJsonValue(email)); + } + if(m_password_isSet){ + obj.insert(QString("password"), ::OpenAPI::toJsonValue(password)); + } + if(m_phone_isSet){ + obj.insert(QString("phone"), ::OpenAPI::toJsonValue(phone)); + } + if(m_user_status_isSet){ + obj.insert(QString("userStatus"), ::OpenAPI::toJsonValue(user_status)); + } + return obj; +} + + +qint64 +OAIUser::getId() const { + return id; +} +void +OAIUser::setId(const qint64 &id) { + this->id = id; + this->m_id_isSet = true; +} + + +QString +OAIUser::getUsername() const { + return username; +} +void +OAIUser::setUsername(const QString &username) { + this->username = username; + this->m_username_isSet = true; +} + + +QString +OAIUser::getFirstName() const { + return first_name; +} +void +OAIUser::setFirstName(const QString &first_name) { + this->first_name = first_name; + this->m_first_name_isSet = true; +} + + +QString +OAIUser::getLastName() const { + return last_name; +} +void +OAIUser::setLastName(const QString &last_name) { + this->last_name = last_name; + this->m_last_name_isSet = true; +} + + +QString +OAIUser::getEmail() const { + return email; +} +void +OAIUser::setEmail(const QString &email) { + this->email = email; + this->m_email_isSet = true; +} + + +QString +OAIUser::getPassword() const { + return password; +} +void +OAIUser::setPassword(const QString &password) { + this->password = password; + this->m_password_isSet = true; +} + + +QString +OAIUser::getPhone() const { + return phone; +} +void +OAIUser::setPhone(const QString &phone) { + this->phone = phone; + this->m_phone_isSet = true; +} + + +qint32 +OAIUser::getUserStatus() const { + return user_status; +} +void +OAIUser::setUserStatus(const qint32 &user_status) { + this->user_status = user_status; + this->m_user_status_isSet = true; +} + +bool +OAIUser::isSet() const { + bool isObjectUpdated = false; + do{ + if(m_id_isSet){ isObjectUpdated = true; break;} + + if(m_username_isSet){ isObjectUpdated = true; break;} + + if(m_first_name_isSet){ isObjectUpdated = true; break;} + + if(m_last_name_isSet){ isObjectUpdated = true; break;} + + if(m_email_isSet){ isObjectUpdated = true; break;} + + if(m_password_isSet){ isObjectUpdated = true; break;} + + if(m_phone_isSet){ isObjectUpdated = true; break;} + + if(m_user_status_isSet){ isObjectUpdated = true; break;} + }while(false); + return isObjectUpdated; +} + +bool +OAIUser::isValid() const { + // only required properties are required for the object to be considered valid + return true; +} + +} + diff --git a/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIUser.h b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIUser.h new file mode 100644 index 000000000000..556de322584e --- /dev/null +++ b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIUser.h @@ -0,0 +1,121 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * OAIUser.h + * + * A User who is purchasing from the pet store + */ + +#ifndef OAIUser_H +#define OAIUser_H + +#include + + +#include + +#include "OAIObject.h" +#include "OAIEnum.h" + +namespace OpenAPI { + +class OAIUser: public OAIObject { +public: + OAIUser(); + OAIUser(QString json); + ~OAIUser() override; + + QString asJson () const override; + QJsonObject asJsonObject() const override; + void fromJsonObject(QJsonObject json) override; + void fromJson(QString jsonString) override; + + + qint64 getId() const; + void setId(const qint64 &id); + + + QString getUsername() const; + void setUsername(const QString &username); + + + QString getFirstName() const; + void setFirstName(const QString &first_name); + + + QString getLastName() const; + void setLastName(const QString &last_name); + + + QString getEmail() const; + void setEmail(const QString &email); + + + QString getPassword() const; + void setPassword(const QString &password); + + + QString getPhone() const; + void setPhone(const QString &phone); + + + qint32 getUserStatus() const; + void setUserStatus(const qint32 &user_status); + + + + virtual bool isSet() const override; + virtual bool isValid() const override; + +private: + void init(); + + qint64 id; + bool m_id_isSet; + bool m_id_isValid; + + QString username; + bool m_username_isSet; + bool m_username_isValid; + + QString first_name; + bool m_first_name_isSet; + bool m_first_name_isValid; + + QString last_name; + bool m_last_name_isSet; + bool m_last_name_isValid; + + QString email; + bool m_email_isSet; + bool m_email_isValid; + + QString password; + bool m_password_isSet; + bool m_password_isValid; + + QString phone; + bool m_phone_isSet; + bool m_phone_isValid; + + qint32 user_status; + bool m_user_status_isSet; + bool m_user_status_isValid; + + }; + +} + +Q_DECLARE_METATYPE(OpenAPI::OAIUser) + +#endif // OAIUser_H diff --git a/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIPetApiRequest.cpp b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIPetApiRequest.cpp new file mode 100644 index 000000000000..84f1e9529adb --- /dev/null +++ b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIPetApiRequest.cpp @@ -0,0 +1,358 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +#include +#include +#include +#include +#include + +#include "OAIHelpers.h" +#include "OAIPetApiRequest.h" + +namespace OpenAPI { + +OAIPetApiRequest::OAIPetApiRequest(QHttpEngine::Socket *s, QSharedPointer hdl) : QObject(s), socket(s), handler(hdl) { + auto headers = s->headers(); + for(auto itr = headers.begin(); itr != headers.end(); itr++) { + requestHeaders.insert(QString(itr.key()), QString(itr.value())); + } +} + +OAIPetApiRequest::~OAIPetApiRequest(){ + disconnect(this, nullptr, nullptr, nullptr); + qDebug() << "OAIPetApiRequest::~OAIPetApiRequest()"; +} + +QMap +OAIPetApiRequest::getRequestHeaders() const { + return requestHeaders; +} + +void OAIPetApiRequest::setResponseHeaders(const QMultiMap& headers){ + for(auto itr = headers.begin(); itr != headers.end(); ++itr) { + responseHeaders.insert(itr.key(), itr.value()); + } +} + + +QHttpEngine::Socket* OAIPetApiRequest::getRawSocket(){ + return socket; +} + + +void OAIPetApiRequest::addPetRequest(){ + qDebug() << "/v2/pet"; + connect(this, &OAIPetApiRequest::addPet, handler.data(), &OAIPetApiHandler::addPet); + + + + + QJsonDocument doc; + socket->readJson(doc); + QJsonObject obj = doc.object(); + OAIPet oai_pet; + ::OpenAPI::fromJsonValue(oai_pet, obj); + + + emit addPet(oai_pet); +} + + +void OAIPetApiRequest::deletePetRequest(const QString& pet_idstr){ + qDebug() << "/v2/pet/{petId}"; + connect(this, &OAIPetApiRequest::deletePet, handler.data(), &OAIPetApiHandler::deletePet); + + + qint64 pet_id; + fromStringValue(pet_idstr, pet_id); + + QString api_key; + if(socket->headers().keys().contains("api_key")){ + fromStringValue(socket->queryString().value("api_key"), api_key); + } + + + emit deletePet(pet_id, api_key); +} + + +void OAIPetApiRequest::findPetsByStatusRequest(){ + qDebug() << "/v2/pet/findByStatus"; + connect(this, &OAIPetApiRequest::findPetsByStatus, handler.data(), &OAIPetApiHandler::findPetsByStatus); + + + QList status; + if(socket->queryString().keys().contains("status")){ + fromStringValue(socket->queryString().values("status"), status); + } + + + + emit findPetsByStatus(status); +} + + +void OAIPetApiRequest::findPetsByTagsRequest(){ + qDebug() << "/v2/pet/findByTags"; + connect(this, &OAIPetApiRequest::findPetsByTags, handler.data(), &OAIPetApiHandler::findPetsByTags); + + + QList tags; + if(socket->queryString().keys().contains("tags")){ + fromStringValue(socket->queryString().values("tags"), tags); + } + + qint32 max_count; + if(socket->queryString().keys().contains("max_count")){ + fromStringValue(socket->queryString().value("max_count"), max_count); + } + + + + emit findPetsByTags(tags, max_count); +} + + +void OAIPetApiRequest::getPetByIdRequest(const QString& pet_idstr){ + qDebug() << "/v2/pet/{petId}"; + connect(this, &OAIPetApiRequest::getPetById, handler.data(), &OAIPetApiHandler::getPetById); + + + qint64 pet_id; + fromStringValue(pet_idstr, pet_id); + + + emit getPetById(pet_id); +} + + +void OAIPetApiRequest::updatePetRequest(){ + qDebug() << "/v2/pet"; + connect(this, &OAIPetApiRequest::updatePet, handler.data(), &OAIPetApiHandler::updatePet); + + + + + QJsonDocument doc; + socket->readJson(doc); + QJsonObject obj = doc.object(); + OAIPet oai_pet; + ::OpenAPI::fromJsonValue(oai_pet, obj); + + + emit updatePet(oai_pet); +} + + +void OAIPetApiRequest::updatePetWithFormRequest(const QString& pet_idstr){ + qDebug() << "/v2/pet/{petId}"; + connect(this, &OAIPetApiRequest::updatePetWithForm, handler.data(), &OAIPetApiHandler::updatePetWithForm); + + + qint64 pet_id; + fromStringValue(pet_idstr, pet_id); + + QString name; + QString status; + + emit updatePetWithForm(pet_id, name, status); +} + + +void OAIPetApiRequest::uploadFileRequest(const QString& pet_idstr){ + qDebug() << "/v2/pet/{petId}/uploadImage"; + connect(this, &OAIPetApiRequest::uploadFile, handler.data(), &OAIPetApiHandler::uploadFile); + + + qint64 pet_id; + fromStringValue(pet_idstr, pet_id); + + QString additional_metadata; + QIODevice* file; + + emit uploadFile(pet_id, additional_metadata, file); +} + + + +void OAIPetApiRequest::addPetResponse(){ + writeResponseHeaders(); + socket->setStatusCode(QHttpEngine::Socket::OK); + if(socket->isOpen()){ + socket->close(); + } +} + +void OAIPetApiRequest::deletePetResponse(){ + writeResponseHeaders(); + socket->setStatusCode(QHttpEngine::Socket::OK); + if(socket->isOpen()){ + socket->close(); + } +} + +void OAIPetApiRequest::findPetsByStatusResponse(const QList& res){ + writeResponseHeaders(); + QJsonDocument resDoc(::OpenAPI::toJsonValue(res).toArray()); + socket->writeJson(resDoc); + if(socket->isOpen()){ + socket->close(); + } +} + +void OAIPetApiRequest::findPetsByTagsResponse(const QList& res){ + writeResponseHeaders(); + QJsonDocument resDoc(::OpenAPI::toJsonValue(res).toArray()); + socket->writeJson(resDoc); + if(socket->isOpen()){ + socket->close(); + } +} + +void OAIPetApiRequest::getPetByIdResponse(const OAIPet& res){ + writeResponseHeaders(); + QJsonDocument resDoc(::OpenAPI::toJsonValue(res).toObject()); + socket->writeJson(resDoc); + if(socket->isOpen()){ + socket->close(); + } +} + +void OAIPetApiRequest::updatePetResponse(){ + writeResponseHeaders(); + socket->setStatusCode(QHttpEngine::Socket::OK); + if(socket->isOpen()){ + socket->close(); + } +} + +void OAIPetApiRequest::updatePetWithFormResponse(){ + writeResponseHeaders(); + socket->setStatusCode(QHttpEngine::Socket::OK); + if(socket->isOpen()){ + socket->close(); + } +} + +void OAIPetApiRequest::uploadFileResponse(const OAIApiResponse& res){ + writeResponseHeaders(); + QJsonDocument resDoc(::OpenAPI::toJsonValue(res).toObject()); + socket->writeJson(resDoc); + if(socket->isOpen()){ + socket->close(); + } +} + + +void OAIPetApiRequest::addPetError(QNetworkReply::NetworkError error_type, QString& error_str){ + Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors + writeResponseHeaders(); + socket->setStatusCode(QHttpEngine::Socket::NotFound); + socket->write(error_str.toUtf8()); + if(socket->isOpen()){ + socket->close(); + } +} + +void OAIPetApiRequest::deletePetError(QNetworkReply::NetworkError error_type, QString& error_str){ + Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors + writeResponseHeaders(); + socket->setStatusCode(QHttpEngine::Socket::NotFound); + socket->write(error_str.toUtf8()); + if(socket->isOpen()){ + socket->close(); + } +} + +void OAIPetApiRequest::findPetsByStatusError(const QList& res, QNetworkReply::NetworkError error_type, QString& error_str){ + Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors + writeResponseHeaders(); + Q_UNUSED(error_str); // response will be used instead of error string + QJsonDocument resDoc(::OpenAPI::toJsonValue(res).toArray()); + socket->writeJson(resDoc); + if(socket->isOpen()){ + socket->close(); + } +} + +void OAIPetApiRequest::findPetsByTagsError(const QList& res, QNetworkReply::NetworkError error_type, QString& error_str){ + Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors + writeResponseHeaders(); + Q_UNUSED(error_str); // response will be used instead of error string + QJsonDocument resDoc(::OpenAPI::toJsonValue(res).toArray()); + socket->writeJson(resDoc); + if(socket->isOpen()){ + socket->close(); + } +} + +void OAIPetApiRequest::getPetByIdError(const OAIPet& res, QNetworkReply::NetworkError error_type, QString& error_str){ + Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors + writeResponseHeaders(); + Q_UNUSED(error_str); // response will be used instead of error string + QJsonDocument resDoc(::OpenAPI::toJsonValue(res).toObject()); + socket->writeJson(resDoc); + if(socket->isOpen()){ + socket->close(); + } +} + +void OAIPetApiRequest::updatePetError(QNetworkReply::NetworkError error_type, QString& error_str){ + Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors + writeResponseHeaders(); + socket->setStatusCode(QHttpEngine::Socket::NotFound); + socket->write(error_str.toUtf8()); + if(socket->isOpen()){ + socket->close(); + } +} + +void OAIPetApiRequest::updatePetWithFormError(QNetworkReply::NetworkError error_type, QString& error_str){ + Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors + writeResponseHeaders(); + socket->setStatusCode(QHttpEngine::Socket::NotFound); + socket->write(error_str.toUtf8()); + if(socket->isOpen()){ + socket->close(); + } +} + +void OAIPetApiRequest::uploadFileError(const OAIApiResponse& res, QNetworkReply::NetworkError error_type, QString& error_str){ + Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors + writeResponseHeaders(); + Q_UNUSED(error_str); // response will be used instead of error string + QJsonDocument resDoc(::OpenAPI::toJsonValue(res).toObject()); + socket->writeJson(resDoc); + if(socket->isOpen()){ + socket->close(); + } +} + + +void OAIPetApiRequest::sendCustomResponse(QByteArray & res, QNetworkReply::NetworkError error_type){ + Q_UNUSED(error_type); // TODO + socket->write(res); + if(socket->isOpen()){ + socket->close(); + } +} + +void OAIPetApiRequest::sendCustomResponse(QIODevice *res, QNetworkReply::NetworkError error_type){ + Q_UNUSED(error_type); // TODO + socket->write(res->readAll()); + if(socket->isOpen()){ + socket->close(); + } +} + +} diff --git a/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIPetApiRequest.h b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIPetApiRequest.h new file mode 100644 index 000000000000..a12368283a3f --- /dev/null +++ b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIPetApiRequest.h @@ -0,0 +1,108 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +#ifndef OAI_OAIPetApiRequest_H +#define OAI_OAIPetApiRequest_H + +#include +#include +#include +#include +#include + +#include +#include "OAIApiResponse.h" +#include "OAIPet.h" +#include +#include +#include "OAIPetApiHandler.h" + +namespace OpenAPI { + +class OAIPetApiRequest : public QObject +{ + Q_OBJECT + +public: + OAIPetApiRequest(QHttpEngine::Socket *s, QSharedPointer handler); + virtual ~OAIPetApiRequest(); + + void addPetRequest(); + void deletePetRequest(const QString& pet_id); + void findPetsByStatusRequest(); + void findPetsByTagsRequest(); + void getPetByIdRequest(const QString& pet_id); + void updatePetRequest(); + void updatePetWithFormRequest(const QString& pet_id); + void uploadFileRequest(const QString& pet_id); + + + void addPetResponse(); + void deletePetResponse(); + void findPetsByStatusResponse(const QList& res); + void findPetsByTagsResponse(const QList& res); + void getPetByIdResponse(const OAIPet& res); + void updatePetResponse(); + void updatePetWithFormResponse(); + void uploadFileResponse(const OAIApiResponse& res); + + + void addPetError(QNetworkReply::NetworkError error_type, QString& error_str); + void deletePetError(QNetworkReply::NetworkError error_type, QString& error_str); + void findPetsByStatusError(const QList& res, QNetworkReply::NetworkError error_type, QString& error_str); + void findPetsByTagsError(const QList& res, QNetworkReply::NetworkError error_type, QString& error_str); + void getPetByIdError(const OAIPet& res, QNetworkReply::NetworkError error_type, QString& error_str); + void updatePetError(QNetworkReply::NetworkError error_type, QString& error_str); + void updatePetWithFormError(QNetworkReply::NetworkError error_type, QString& error_str); + void uploadFileError(const OAIApiResponse& res, QNetworkReply::NetworkError error_type, QString& error_str); + + + void sendCustomResponse(QByteArray & res, QNetworkReply::NetworkError error_type); + + void sendCustomResponse(QIODevice *res, QNetworkReply::NetworkError error_type); + + QMap getRequestHeaders() const; + + QHttpEngine::Socket* getRawSocket(); + + void setResponseHeaders(const QMultiMap& headers); + +signals: + void addPet(OAIPet oai_pet); + void deletePet(qint64 pet_id, QString api_key); + void findPetsByStatus(QList status); + void findPetsByTags(QList tags, qint32 max_count); + void getPetById(qint64 pet_id); + void updatePet(OAIPet oai_pet); + void updatePetWithForm(qint64 pet_id, QString name, QString status); + void uploadFile(qint64 pet_id, QString additional_metadata, QIODevice* file); + + +private: + QMap requestHeaders; + QMap responseHeaders; + QHttpEngine::Socket *socket; + QSharedPointer handler; + + inline void writeResponseHeaders(){ + QHttpEngine::Socket::HeaderMap resHeaders; + for(auto itr = responseHeaders.begin(); itr != responseHeaders.end(); ++itr) { + resHeaders.insert(itr.key().toUtf8(), itr.value().toUtf8()); + } + socket->setHeaders(resHeaders); + socket->writeHeaders(); + } +}; + +} + +#endif // OAI_OAIPetApiRequest_H diff --git a/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIStoreApiRequest.cpp b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIStoreApiRequest.cpp new file mode 100644 index 000000000000..5a20a571f9c9 --- /dev/null +++ b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIStoreApiRequest.cpp @@ -0,0 +1,205 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +#include +#include +#include +#include +#include + +#include "OAIHelpers.h" +#include "OAIStoreApiRequest.h" + +namespace OpenAPI { + +OAIStoreApiRequest::OAIStoreApiRequest(QHttpEngine::Socket *s, QSharedPointer hdl) : QObject(s), socket(s), handler(hdl) { + auto headers = s->headers(); + for(auto itr = headers.begin(); itr != headers.end(); itr++) { + requestHeaders.insert(QString(itr.key()), QString(itr.value())); + } +} + +OAIStoreApiRequest::~OAIStoreApiRequest(){ + disconnect(this, nullptr, nullptr, nullptr); + qDebug() << "OAIStoreApiRequest::~OAIStoreApiRequest()"; +} + +QMap +OAIStoreApiRequest::getRequestHeaders() const { + return requestHeaders; +} + +void OAIStoreApiRequest::setResponseHeaders(const QMultiMap& headers){ + for(auto itr = headers.begin(); itr != headers.end(); ++itr) { + responseHeaders.insert(itr.key(), itr.value()); + } +} + + +QHttpEngine::Socket* OAIStoreApiRequest::getRawSocket(){ + return socket; +} + + +void OAIStoreApiRequest::deleteOrderRequest(const QString& order_idstr){ + qDebug() << "/v2/store/order/{orderId}"; + connect(this, &OAIStoreApiRequest::deleteOrder, handler.data(), &OAIStoreApiHandler::deleteOrder); + + + QString order_id; + fromStringValue(order_idstr, order_id); + + + emit deleteOrder(order_id); +} + + +void OAIStoreApiRequest::getInventoryRequest(){ + qDebug() << "/v2/store/inventory"; + connect(this, &OAIStoreApiRequest::getInventory, handler.data(), &OAIStoreApiHandler::getInventory); + + + + + emit getInventory(); +} + + +void OAIStoreApiRequest::getOrderByIdRequest(const QString& order_idstr){ + qDebug() << "/v2/store/order/{orderId}"; + connect(this, &OAIStoreApiRequest::getOrderById, handler.data(), &OAIStoreApiHandler::getOrderById); + + + qint64 order_id; + fromStringValue(order_idstr, order_id); + + + emit getOrderById(order_id); +} + + +void OAIStoreApiRequest::placeOrderRequest(){ + qDebug() << "/v2/store/order"; + connect(this, &OAIStoreApiRequest::placeOrder, handler.data(), &OAIStoreApiHandler::placeOrder); + + + + + QJsonDocument doc; + socket->readJson(doc); + QJsonObject obj = doc.object(); + OAIOrder oai_order; + ::OpenAPI::fromJsonValue(oai_order, obj); + + + emit placeOrder(oai_order); +} + + + +void OAIStoreApiRequest::deleteOrderResponse(){ + writeResponseHeaders(); + socket->setStatusCode(QHttpEngine::Socket::OK); + if(socket->isOpen()){ + socket->close(); + } +} + +void OAIStoreApiRequest::getInventoryResponse(const QMap& res){ + writeResponseHeaders(); + QJsonDocument resDoc(::OpenAPI::toJsonValue(res).toObject()); + socket->writeJson(resDoc); + if(socket->isOpen()){ + socket->close(); + } +} + +void OAIStoreApiRequest::getOrderByIdResponse(const OAIOrder& res){ + writeResponseHeaders(); + QJsonDocument resDoc(::OpenAPI::toJsonValue(res).toObject()); + socket->writeJson(resDoc); + if(socket->isOpen()){ + socket->close(); + } +} + +void OAIStoreApiRequest::placeOrderResponse(const OAIOrder& res){ + writeResponseHeaders(); + QJsonDocument resDoc(::OpenAPI::toJsonValue(res).toObject()); + socket->writeJson(resDoc); + if(socket->isOpen()){ + socket->close(); + } +} + + +void OAIStoreApiRequest::deleteOrderError(QNetworkReply::NetworkError error_type, QString& error_str){ + Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors + writeResponseHeaders(); + socket->setStatusCode(QHttpEngine::Socket::NotFound); + socket->write(error_str.toUtf8()); + if(socket->isOpen()){ + socket->close(); + } +} + +void OAIStoreApiRequest::getInventoryError(const QMap& res, QNetworkReply::NetworkError error_type, QString& error_str){ + Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors + writeResponseHeaders(); + Q_UNUSED(error_str); // response will be used instead of error string + QJsonDocument resDoc(::OpenAPI::toJsonValue(res).toObject()); + socket->writeJson(resDoc); + if(socket->isOpen()){ + socket->close(); + } +} + +void OAIStoreApiRequest::getOrderByIdError(const OAIOrder& res, QNetworkReply::NetworkError error_type, QString& error_str){ + Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors + writeResponseHeaders(); + Q_UNUSED(error_str); // response will be used instead of error string + QJsonDocument resDoc(::OpenAPI::toJsonValue(res).toObject()); + socket->writeJson(resDoc); + if(socket->isOpen()){ + socket->close(); + } +} + +void OAIStoreApiRequest::placeOrderError(const OAIOrder& res, QNetworkReply::NetworkError error_type, QString& error_str){ + Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors + writeResponseHeaders(); + Q_UNUSED(error_str); // response will be used instead of error string + QJsonDocument resDoc(::OpenAPI::toJsonValue(res).toObject()); + socket->writeJson(resDoc); + if(socket->isOpen()){ + socket->close(); + } +} + + +void OAIStoreApiRequest::sendCustomResponse(QByteArray & res, QNetworkReply::NetworkError error_type){ + Q_UNUSED(error_type); // TODO + socket->write(res); + if(socket->isOpen()){ + socket->close(); + } +} + +void OAIStoreApiRequest::sendCustomResponse(QIODevice *res, QNetworkReply::NetworkError error_type){ + Q_UNUSED(error_type); // TODO + socket->write(res->readAll()); + if(socket->isOpen()){ + socket->close(); + } +} + +} diff --git a/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIStoreApiRequest.h b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIStoreApiRequest.h new file mode 100644 index 000000000000..150729dbaeb2 --- /dev/null +++ b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIStoreApiRequest.h @@ -0,0 +1,91 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +#ifndef OAI_OAIStoreApiRequest_H +#define OAI_OAIStoreApiRequest_H + +#include +#include +#include +#include +#include + +#include +#include "OAIOrder.h" +#include +#include +#include "OAIStoreApiHandler.h" + +namespace OpenAPI { + +class OAIStoreApiRequest : public QObject +{ + Q_OBJECT + +public: + OAIStoreApiRequest(QHttpEngine::Socket *s, QSharedPointer handler); + virtual ~OAIStoreApiRequest(); + + void deleteOrderRequest(const QString& order_id); + void getInventoryRequest(); + void getOrderByIdRequest(const QString& order_id); + void placeOrderRequest(); + + + void deleteOrderResponse(); + void getInventoryResponse(const QMap& res); + void getOrderByIdResponse(const OAIOrder& res); + void placeOrderResponse(const OAIOrder& res); + + + void deleteOrderError(QNetworkReply::NetworkError error_type, QString& error_str); + void getInventoryError(const QMap& res, QNetworkReply::NetworkError error_type, QString& error_str); + void getOrderByIdError(const OAIOrder& res, QNetworkReply::NetworkError error_type, QString& error_str); + void placeOrderError(const OAIOrder& res, QNetworkReply::NetworkError error_type, QString& error_str); + + + void sendCustomResponse(QByteArray & res, QNetworkReply::NetworkError error_type); + + void sendCustomResponse(QIODevice *res, QNetworkReply::NetworkError error_type); + + QMap getRequestHeaders() const; + + QHttpEngine::Socket* getRawSocket(); + + void setResponseHeaders(const QMultiMap& headers); + +signals: + void deleteOrder(QString order_id); + void getInventory(); + void getOrderById(qint64 order_id); + void placeOrder(OAIOrder oai_order); + + +private: + QMap requestHeaders; + QMap responseHeaders; + QHttpEngine::Socket *socket; + QSharedPointer handler; + + inline void writeResponseHeaders(){ + QHttpEngine::Socket::HeaderMap resHeaders; + for(auto itr = responseHeaders.begin(); itr != responseHeaders.end(); ++itr) { + resHeaders.insert(itr.key().toUtf8(), itr.value().toUtf8()); + } + socket->setHeaders(resHeaders); + socket->writeHeaders(); + } +}; + +} + +#endif // OAI_OAIStoreApiRequest_H diff --git a/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIUserApiRequest.cpp b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIUserApiRequest.cpp new file mode 100644 index 000000000000..1d47a23b4a1c --- /dev/null +++ b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIUserApiRequest.cpp @@ -0,0 +1,358 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +#include +#include +#include +#include +#include + +#include "OAIHelpers.h" +#include "OAIUserApiRequest.h" + +namespace OpenAPI { + +OAIUserApiRequest::OAIUserApiRequest(QHttpEngine::Socket *s, QSharedPointer hdl) : QObject(s), socket(s), handler(hdl) { + auto headers = s->headers(); + for(auto itr = headers.begin(); itr != headers.end(); itr++) { + requestHeaders.insert(QString(itr.key()), QString(itr.value())); + } +} + +OAIUserApiRequest::~OAIUserApiRequest(){ + disconnect(this, nullptr, nullptr, nullptr); + qDebug() << "OAIUserApiRequest::~OAIUserApiRequest()"; +} + +QMap +OAIUserApiRequest::getRequestHeaders() const { + return requestHeaders; +} + +void OAIUserApiRequest::setResponseHeaders(const QMultiMap& headers){ + for(auto itr = headers.begin(); itr != headers.end(); ++itr) { + responseHeaders.insert(itr.key(), itr.value()); + } +} + + +QHttpEngine::Socket* OAIUserApiRequest::getRawSocket(){ + return socket; +} + + +void OAIUserApiRequest::createUserRequest(){ + qDebug() << "/v2/user"; + connect(this, &OAIUserApiRequest::createUser, handler.data(), &OAIUserApiHandler::createUser); + + + + + QJsonDocument doc; + socket->readJson(doc); + QJsonObject obj = doc.object(); + OAIUser oai_user; + ::OpenAPI::fromJsonValue(oai_user, obj); + + + emit createUser(oai_user); +} + + +void OAIUserApiRequest::createUsersWithArrayInputRequest(){ + qDebug() << "/v2/user/createWithArray"; + connect(this, &OAIUserApiRequest::createUsersWithArrayInput, handler.data(), &OAIUserApiHandler::createUsersWithArrayInput); + + + + QJsonDocument doc; + QList oai_user; + if(socket->readJson(doc)){ + QJsonArray jsonArray = doc.array(); + foreach(QJsonValue obj, jsonArray) { + OAIUser o; + ::OpenAPI::fromJsonValue(o, obj); + oai_user.append(o); + } + } + + + emit createUsersWithArrayInput(oai_user); +} + + +void OAIUserApiRequest::createUsersWithListInputRequest(){ + qDebug() << "/v2/user/createWithList"; + connect(this, &OAIUserApiRequest::createUsersWithListInput, handler.data(), &OAIUserApiHandler::createUsersWithListInput); + + + + QJsonDocument doc; + QList oai_user; + if(socket->readJson(doc)){ + QJsonArray jsonArray = doc.array(); + foreach(QJsonValue obj, jsonArray) { + OAIUser o; + ::OpenAPI::fromJsonValue(o, obj); + oai_user.append(o); + } + } + + + emit createUsersWithListInput(oai_user); +} + + +void OAIUserApiRequest::deleteUserRequest(const QString& usernamestr){ + qDebug() << "/v2/user/{username}"; + connect(this, &OAIUserApiRequest::deleteUser, handler.data(), &OAIUserApiHandler::deleteUser); + + + QString username; + fromStringValue(usernamestr, username); + + + emit deleteUser(username); +} + + +void OAIUserApiRequest::getUserByNameRequest(const QString& usernamestr){ + qDebug() << "/v2/user/{username}"; + connect(this, &OAIUserApiRequest::getUserByName, handler.data(), &OAIUserApiHandler::getUserByName); + + + QString username; + fromStringValue(usernamestr, username); + + + emit getUserByName(username); +} + + +void OAIUserApiRequest::loginUserRequest(){ + qDebug() << "/v2/user/login"; + connect(this, &OAIUserApiRequest::loginUser, handler.data(), &OAIUserApiHandler::loginUser); + + + QString username; + if(socket->queryString().keys().contains("username")){ + fromStringValue(socket->queryString().value("username"), username); + } + + QString password; + if(socket->queryString().keys().contains("password")){ + fromStringValue(socket->queryString().value("password"), password); + } + + + + emit loginUser(username, password); +} + + +void OAIUserApiRequest::logoutUserRequest(){ + qDebug() << "/v2/user/logout"; + connect(this, &OAIUserApiRequest::logoutUser, handler.data(), &OAIUserApiHandler::logoutUser); + + + + + emit logoutUser(); +} + + +void OAIUserApiRequest::updateUserRequest(const QString& usernamestr){ + qDebug() << "/v2/user/{username}"; + connect(this, &OAIUserApiRequest::updateUser, handler.data(), &OAIUserApiHandler::updateUser); + + + QString username; + fromStringValue(usernamestr, username); + + + QJsonDocument doc; + socket->readJson(doc); + QJsonObject obj = doc.object(); + OAIUser oai_user; + ::OpenAPI::fromJsonValue(oai_user, obj); + + + emit updateUser(username, oai_user); +} + + + +void OAIUserApiRequest::createUserResponse(){ + writeResponseHeaders(); + socket->setStatusCode(QHttpEngine::Socket::OK); + if(socket->isOpen()){ + socket->close(); + } +} + +void OAIUserApiRequest::createUsersWithArrayInputResponse(){ + writeResponseHeaders(); + socket->setStatusCode(QHttpEngine::Socket::OK); + if(socket->isOpen()){ + socket->close(); + } +} + +void OAIUserApiRequest::createUsersWithListInputResponse(){ + writeResponseHeaders(); + socket->setStatusCode(QHttpEngine::Socket::OK); + if(socket->isOpen()){ + socket->close(); + } +} + +void OAIUserApiRequest::deleteUserResponse(){ + writeResponseHeaders(); + socket->setStatusCode(QHttpEngine::Socket::OK); + if(socket->isOpen()){ + socket->close(); + } +} + +void OAIUserApiRequest::getUserByNameResponse(const OAIUser& res){ + writeResponseHeaders(); + QJsonDocument resDoc(::OpenAPI::toJsonValue(res).toObject()); + socket->writeJson(resDoc); + if(socket->isOpen()){ + socket->close(); + } +} + +void OAIUserApiRequest::loginUserResponse(const QString& res){ + writeResponseHeaders(); + socket->write(::OpenAPI::toStringValue(res).toUtf8()); + if(socket->isOpen()){ + socket->close(); + } +} + +void OAIUserApiRequest::logoutUserResponse(){ + writeResponseHeaders(); + socket->setStatusCode(QHttpEngine::Socket::OK); + if(socket->isOpen()){ + socket->close(); + } +} + +void OAIUserApiRequest::updateUserResponse(){ + writeResponseHeaders(); + socket->setStatusCode(QHttpEngine::Socket::OK); + if(socket->isOpen()){ + socket->close(); + } +} + + +void OAIUserApiRequest::createUserError(QNetworkReply::NetworkError error_type, QString& error_str){ + Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors + writeResponseHeaders(); + socket->setStatusCode(QHttpEngine::Socket::NotFound); + socket->write(error_str.toUtf8()); + if(socket->isOpen()){ + socket->close(); + } +} + +void OAIUserApiRequest::createUsersWithArrayInputError(QNetworkReply::NetworkError error_type, QString& error_str){ + Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors + writeResponseHeaders(); + socket->setStatusCode(QHttpEngine::Socket::NotFound); + socket->write(error_str.toUtf8()); + if(socket->isOpen()){ + socket->close(); + } +} + +void OAIUserApiRequest::createUsersWithListInputError(QNetworkReply::NetworkError error_type, QString& error_str){ + Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors + writeResponseHeaders(); + socket->setStatusCode(QHttpEngine::Socket::NotFound); + socket->write(error_str.toUtf8()); + if(socket->isOpen()){ + socket->close(); + } +} + +void OAIUserApiRequest::deleteUserError(QNetworkReply::NetworkError error_type, QString& error_str){ + Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors + writeResponseHeaders(); + socket->setStatusCode(QHttpEngine::Socket::NotFound); + socket->write(error_str.toUtf8()); + if(socket->isOpen()){ + socket->close(); + } +} + +void OAIUserApiRequest::getUserByNameError(const OAIUser& res, QNetworkReply::NetworkError error_type, QString& error_str){ + Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors + writeResponseHeaders(); + Q_UNUSED(error_str); // response will be used instead of error string + QJsonDocument resDoc(::OpenAPI::toJsonValue(res).toObject()); + socket->writeJson(resDoc); + if(socket->isOpen()){ + socket->close(); + } +} + +void OAIUserApiRequest::loginUserError(const QString& res, QNetworkReply::NetworkError error_type, QString& error_str){ + Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors + writeResponseHeaders(); + Q_UNUSED(error_str); // response will be used instead of error string + socket->write(::OpenAPI::toStringValue(res).toUtf8()); + if(socket->isOpen()){ + socket->close(); + } +} + +void OAIUserApiRequest::logoutUserError(QNetworkReply::NetworkError error_type, QString& error_str){ + Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors + writeResponseHeaders(); + socket->setStatusCode(QHttpEngine::Socket::NotFound); + socket->write(error_str.toUtf8()); + if(socket->isOpen()){ + socket->close(); + } +} + +void OAIUserApiRequest::updateUserError(QNetworkReply::NetworkError error_type, QString& error_str){ + Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors + writeResponseHeaders(); + socket->setStatusCode(QHttpEngine::Socket::NotFound); + socket->write(error_str.toUtf8()); + if(socket->isOpen()){ + socket->close(); + } +} + + +void OAIUserApiRequest::sendCustomResponse(QByteArray & res, QNetworkReply::NetworkError error_type){ + Q_UNUSED(error_type); // TODO + socket->write(res); + if(socket->isOpen()){ + socket->close(); + } +} + +void OAIUserApiRequest::sendCustomResponse(QIODevice *res, QNetworkReply::NetworkError error_type){ + Q_UNUSED(error_type); // TODO + socket->write(res->readAll()); + if(socket->isOpen()){ + socket->close(); + } +} + +} diff --git a/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIUserApiRequest.h b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIUserApiRequest.h new file mode 100644 index 000000000000..a399747b1530 --- /dev/null +++ b/samples/client/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIUserApiRequest.h @@ -0,0 +1,107 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +#ifndef OAI_OAIUserApiRequest_H +#define OAI_OAIUserApiRequest_H + +#include +#include +#include +#include +#include + +#include +#include "OAIUser.h" +#include +#include +#include "OAIUserApiHandler.h" + +namespace OpenAPI { + +class OAIUserApiRequest : public QObject +{ + Q_OBJECT + +public: + OAIUserApiRequest(QHttpEngine::Socket *s, QSharedPointer handler); + virtual ~OAIUserApiRequest(); + + void createUserRequest(); + void createUsersWithArrayInputRequest(); + void createUsersWithListInputRequest(); + void deleteUserRequest(const QString& username); + void getUserByNameRequest(const QString& username); + void loginUserRequest(); + void logoutUserRequest(); + void updateUserRequest(const QString& username); + + + void createUserResponse(); + void createUsersWithArrayInputResponse(); + void createUsersWithListInputResponse(); + void deleteUserResponse(); + void getUserByNameResponse(const OAIUser& res); + void loginUserResponse(const QString& res); + void logoutUserResponse(); + void updateUserResponse(); + + + void createUserError(QNetworkReply::NetworkError error_type, QString& error_str); + void createUsersWithArrayInputError(QNetworkReply::NetworkError error_type, QString& error_str); + void createUsersWithListInputError(QNetworkReply::NetworkError error_type, QString& error_str); + void deleteUserError(QNetworkReply::NetworkError error_type, QString& error_str); + void getUserByNameError(const OAIUser& res, QNetworkReply::NetworkError error_type, QString& error_str); + void loginUserError(const QString& res, QNetworkReply::NetworkError error_type, QString& error_str); + void logoutUserError(QNetworkReply::NetworkError error_type, QString& error_str); + void updateUserError(QNetworkReply::NetworkError error_type, QString& error_str); + + + void sendCustomResponse(QByteArray & res, QNetworkReply::NetworkError error_type); + + void sendCustomResponse(QIODevice *res, QNetworkReply::NetworkError error_type); + + QMap getRequestHeaders() const; + + QHttpEngine::Socket* getRawSocket(); + + void setResponseHeaders(const QMultiMap& headers); + +signals: + void createUser(OAIUser oai_user); + void createUsersWithArrayInput(QList oai_user); + void createUsersWithListInput(QList oai_user); + void deleteUser(QString username); + void getUserByName(QString username); + void loginUser(QString username, QString password); + void logoutUser(); + void updateUser(QString username, OAIUser oai_user); + + +private: + QMap requestHeaders; + QMap responseHeaders; + QHttpEngine::Socket *socket; + QSharedPointer handler; + + inline void writeResponseHeaders(){ + QHttpEngine::Socket::HeaderMap resHeaders; + for(auto itr = responseHeaders.begin(); itr != responseHeaders.end(); ++itr) { + resHeaders.insert(itr.key().toUtf8(), itr.value().toUtf8()); + } + socket->setHeaders(resHeaders); + socket->writeHeaders(); + } +}; + +} + +#endif // OAI_OAIUserApiRequest_H diff --git a/samples/client/petstore/cpp-qt5/client/OAIInline_object.cpp b/samples/client/petstore/cpp-qt5/client/OAIInline_object.cpp new file mode 100644 index 000000000000..5d5218fb1040 --- /dev/null +++ b/samples/client/petstore/cpp-qt5/client/OAIInline_object.cpp @@ -0,0 +1,127 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +#include "OAIInline_object.h" + +#include "OAIHelpers.h" + +#include +#include +#include +#include + +namespace OpenAPI { + +OAIInline_object::OAIInline_object(QString json) { + this->init(); + this->fromJson(json); +} + +OAIInline_object::OAIInline_object() { + this->init(); +} + +OAIInline_object::~OAIInline_object() { + +} + +void +OAIInline_object::init() { + + m_name_isSet = false; + m_name_isValid = false; + + m_status_isSet = false; + m_status_isValid = false; + } + +void +OAIInline_object::fromJson(QString jsonString) { + QByteArray array (jsonString.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); +} + +void +OAIInline_object::fromJsonObject(QJsonObject json) { + + m_name_isValid = ::OpenAPI::fromJsonValue(name, json[QString("name")]); + + + m_status_isValid = ::OpenAPI::fromJsonValue(status, json[QString("status")]); + + +} + +QString +OAIInline_object::asJson () const { + QJsonObject obj = this->asJsonObject(); + QJsonDocument doc(obj); + QByteArray bytes = doc.toJson(); + return QString(bytes); +} + +QJsonObject +OAIInline_object::asJsonObject() const { + QJsonObject obj; + if(m_name_isSet){ + obj.insert(QString("name"), ::OpenAPI::toJsonValue(name)); + } + if(m_status_isSet){ + obj.insert(QString("status"), ::OpenAPI::toJsonValue(status)); + } + return obj; +} + + +QString +OAIInline_object::getName() const { + return name; +} +void +OAIInline_object::setName(const QString &name) { + this->name = name; + this->m_name_isSet = true; +} + + +QString +OAIInline_object::getStatus() const { + return status; +} +void +OAIInline_object::setStatus(const QString &status) { + this->status = status; + this->m_status_isSet = true; +} + +bool +OAIInline_object::isSet() const { + bool isObjectUpdated = false; + do{ + if(m_name_isSet){ isObjectUpdated = true; break;} + + if(m_status_isSet){ isObjectUpdated = true; break;} + }while(false); + return isObjectUpdated; +} + +bool +OAIInline_object::isValid() const { + // only required properties are required for the object to be considered valid + return true; +} + +} + diff --git a/samples/client/petstore/cpp-qt5/client/OAIInline_object.h b/samples/client/petstore/cpp-qt5/client/OAIInline_object.h new file mode 100644 index 000000000000..cde555a97c69 --- /dev/null +++ b/samples/client/petstore/cpp-qt5/client/OAIInline_object.h @@ -0,0 +1,73 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * OAIInline_object.h + * + * + */ + +#ifndef OAIInline_object_H +#define OAIInline_object_H + +#include + + +#include + +#include "OAIObject.h" +#include "OAIEnum.h" + +namespace OpenAPI { + +class OAIInline_object: public OAIObject { +public: + OAIInline_object(); + OAIInline_object(QString json); + ~OAIInline_object() override; + + QString asJson () const override; + QJsonObject asJsonObject() const override; + void fromJsonObject(QJsonObject json) override; + void fromJson(QString jsonString) override; + + + QString getName() const; + void setName(const QString &name); + + + QString getStatus() const; + void setStatus(const QString &status); + + + + virtual bool isSet() const override; + virtual bool isValid() const override; + +private: + void init(); + + QString name; + bool m_name_isSet; + bool m_name_isValid; + + QString status; + bool m_status_isSet; + bool m_status_isValid; + + }; + +} + +Q_DECLARE_METATYPE(OpenAPI::OAIInline_object) + +#endif // OAIInline_object_H diff --git a/samples/client/petstore/cpp-qt5/client/OAIInline_object_1.cpp b/samples/client/petstore/cpp-qt5/client/OAIInline_object_1.cpp new file mode 100644 index 000000000000..3624546e32e7 --- /dev/null +++ b/samples/client/petstore/cpp-qt5/client/OAIInline_object_1.cpp @@ -0,0 +1,127 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +#include "OAIInline_object_1.h" + +#include "OAIHelpers.h" + +#include +#include +#include +#include + +namespace OpenAPI { + +OAIInline_object_1::OAIInline_object_1(QString json) { + this->init(); + this->fromJson(json); +} + +OAIInline_object_1::OAIInline_object_1() { + this->init(); +} + +OAIInline_object_1::~OAIInline_object_1() { + +} + +void +OAIInline_object_1::init() { + + m_additional_metadata_isSet = false; + m_additional_metadata_isValid = false; + + m_file_isSet = false; + m_file_isValid = false; + } + +void +OAIInline_object_1::fromJson(QString jsonString) { + QByteArray array (jsonString.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); +} + +void +OAIInline_object_1::fromJsonObject(QJsonObject json) { + + m_additional_metadata_isValid = ::OpenAPI::fromJsonValue(additional_metadata, json[QString("additionalMetadata")]); + + + m_file_isValid = ::OpenAPI::fromJsonValue(file, json[QString("file")]); + + +} + +QString +OAIInline_object_1::asJson () const { + QJsonObject obj = this->asJsonObject(); + QJsonDocument doc(obj); + QByteArray bytes = doc.toJson(); + return QString(bytes); +} + +QJsonObject +OAIInline_object_1::asJsonObject() const { + QJsonObject obj; + if(m_additional_metadata_isSet){ + obj.insert(QString("additionalMetadata"), ::OpenAPI::toJsonValue(additional_metadata)); + } + if(file.isSet()){ + obj.insert(QString("file"), ::OpenAPI::toJsonValue(file)); + } + return obj; +} + + +QString +OAIInline_object_1::getAdditionalMetadata() const { + return additional_metadata; +} +void +OAIInline_object_1::setAdditionalMetadata(const QString &additional_metadata) { + this->additional_metadata = additional_metadata; + this->m_additional_metadata_isSet = true; +} + + +OAIHttpRequestInputFileElement* +OAIInline_object_1::getFile() const { + return file; +} +void +OAIInline_object_1::setFile(const OAIHttpRequestInputFileElement* &file) { + this->file = file; + this->m_file_isSet = true; +} + +bool +OAIInline_object_1::isSet() const { + bool isObjectUpdated = false; + do{ + if(m_additional_metadata_isSet){ isObjectUpdated = true; break;} + + if(file.isSet()){ isObjectUpdated = true; break;} + }while(false); + return isObjectUpdated; +} + +bool +OAIInline_object_1::isValid() const { + // only required properties are required for the object to be considered valid + return true; +} + +} + diff --git a/samples/client/petstore/cpp-qt5/client/OAIInline_object_1.h b/samples/client/petstore/cpp-qt5/client/OAIInline_object_1.h new file mode 100644 index 000000000000..3f2ff572eec2 --- /dev/null +++ b/samples/client/petstore/cpp-qt5/client/OAIInline_object_1.h @@ -0,0 +1,74 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * OAIInline_object_1.h + * + * + */ + +#ifndef OAIInline_object_1_H +#define OAIInline_object_1_H + +#include + + +#include "OAIHttpRequest.h" +#include + +#include "OAIObject.h" +#include "OAIEnum.h" + +namespace OpenAPI { + +class OAIInline_object_1: public OAIObject { +public: + OAIInline_object_1(); + OAIInline_object_1(QString json); + ~OAIInline_object_1() override; + + QString asJson () const override; + QJsonObject asJsonObject() const override; + void fromJsonObject(QJsonObject json) override; + void fromJson(QString jsonString) override; + + + QString getAdditionalMetadata() const; + void setAdditionalMetadata(const QString &additional_metadata); + + + OAIHttpRequestInputFileElement* getFile() const; + void setFile(const OAIHttpRequestInputFileElement* &file); + + + + virtual bool isSet() const override; + virtual bool isValid() const override; + +private: + void init(); + + QString additional_metadata; + bool m_additional_metadata_isSet; + bool m_additional_metadata_isValid; + + OAIHttpRequestInputFileElement* file; + bool m_file_isSet; + bool m_file_isValid; + + }; + +} + +Q_DECLARE_METATYPE(OpenAPI::OAIInline_object_1) + +#endif // OAIInline_object_1_H diff --git a/samples/client/petstore/cpp-qt5/client/OAIPetApi.cpp b/samples/client/petstore/cpp-qt5/client/OAIPetApi.cpp index 1341a73c3b95..808206ac29f5 100644 --- a/samples/client/petstore/cpp-qt5/client/OAIPetApi.cpp +++ b/samples/client/petstore/cpp-qt5/client/OAIPetApi.cpp @@ -52,7 +52,7 @@ void OAIPetApi::addHeaders(const QString& key, const QString& value){ void -OAIPetApi::addPet(const OAIPet& body) { +OAIPetApi::addPet(const OAIPet& oai_pet) { QString fullPath; fullPath.append(this->host).append(this->basePath).append("/pet"); @@ -61,7 +61,7 @@ OAIPetApi::addPet(const OAIPet& body) { OAIHttpRequestInput input(fullPath, "POST"); - QString output = body.asJson(); + QString output = oai_pet.asJson(); input.request_body.append(output); @@ -247,7 +247,7 @@ OAIPetApi::findPetsByStatusCallback(OAIHttpRequestWorker * worker) { } void -OAIPetApi::findPetsByTags(const QList& tags) { +OAIPetApi::findPetsByTags(const QList& tags, const qint32& max_count) { QString fullPath; fullPath.append(this->host).append(this->basePath).append("/pet/findByTags"); @@ -291,6 +291,14 @@ OAIPetApi::findPetsByTags(const QList& tags) { } } + if (fullPath.indexOf("?") > 0) + fullPath.append("&"); + else + fullPath.append("?"); + fullPath.append(QUrl::toPercentEncoding("maxCount")) + .append("=") + .append(QUrl::toPercentEncoding(::OpenAPI::toStringValue(max_count))); + OAIHttpRequestWorker *worker = new OAIHttpRequestWorker(); worker->setTimeOut(timeout); OAIHttpRequestInput input(fullPath, "GET"); @@ -391,7 +399,7 @@ OAIPetApi::getPetByIdCallback(OAIHttpRequestWorker * worker) { } void -OAIPetApi::updatePet(const OAIPet& body) { +OAIPetApi::updatePet(const OAIPet& oai_pet) { QString fullPath; fullPath.append(this->host).append(this->basePath).append("/pet"); @@ -400,7 +408,7 @@ OAIPetApi::updatePet(const OAIPet& body) { OAIHttpRequestInput input(fullPath, "PUT"); - QString output = body.asJson(); + QString output = oai_pet.asJson(); input.request_body.append(output); diff --git a/samples/client/petstore/cpp-qt5/client/OAIPetApi.h b/samples/client/petstore/cpp-qt5/client/OAIPetApi.h index 449de958530e..2e89093994e9 100644 --- a/samples/client/petstore/cpp-qt5/client/OAIPetApi.h +++ b/samples/client/petstore/cpp-qt5/client/OAIPetApi.h @@ -37,12 +37,12 @@ class OAIPetApi: public QObject { void setApiTimeOutMs(const int tout); void addHeaders(const QString& key, const QString& value); - void addPet(const OAIPet& body); + void addPet(const OAIPet& oai_pet); void deletePet(const qint64& pet_id, const QString& api_key); void findPetsByStatus(const QList& status); - void findPetsByTags(const QList& tags); + void findPetsByTags(const QList& tags, const qint32& max_count); void getPetById(const qint64& pet_id); - void updatePet(const OAIPet& body); + void updatePet(const OAIPet& oai_pet); void updatePetWithForm(const qint64& pet_id, const QString& name, const QString& status); void uploadFile(const qint64& pet_id, const QString& additional_metadata, const OAIHttpRequestInputFileElement*& file); diff --git a/samples/client/petstore/cpp-qt5/client/OAIStoreApi.cpp b/samples/client/petstore/cpp-qt5/client/OAIStoreApi.cpp index 7b2e37f635b4..681dc87f76a5 100644 --- a/samples/client/petstore/cpp-qt5/client/OAIStoreApi.cpp +++ b/samples/client/petstore/cpp-qt5/client/OAIStoreApi.cpp @@ -204,7 +204,7 @@ OAIStoreApi::getOrderByIdCallback(OAIHttpRequestWorker * worker) { } void -OAIStoreApi::placeOrder(const OAIOrder& body) { +OAIStoreApi::placeOrder(const OAIOrder& oai_order) { QString fullPath; fullPath.append(this->host).append(this->basePath).append("/store/order"); @@ -213,7 +213,7 @@ OAIStoreApi::placeOrder(const OAIOrder& body) { OAIHttpRequestInput input(fullPath, "POST"); - QString output = body.asJson(); + QString output = oai_order.asJson(); input.request_body.append(output); diff --git a/samples/client/petstore/cpp-qt5/client/OAIStoreApi.h b/samples/client/petstore/cpp-qt5/client/OAIStoreApi.h index 2f9d41b99853..ebda579b9ba1 100644 --- a/samples/client/petstore/cpp-qt5/client/OAIStoreApi.h +++ b/samples/client/petstore/cpp-qt5/client/OAIStoreApi.h @@ -39,7 +39,7 @@ class OAIStoreApi: public QObject { void deleteOrder(const QString& order_id); void getInventory(); void getOrderById(const qint64& order_id); - void placeOrder(const OAIOrder& body); + void placeOrder(const OAIOrder& oai_order); private: QString basePath; diff --git a/samples/client/petstore/cpp-qt5/client/OAIUserApi.cpp b/samples/client/petstore/cpp-qt5/client/OAIUserApi.cpp index 57556eab7882..f14ab4d08dd7 100644 --- a/samples/client/petstore/cpp-qt5/client/OAIUserApi.cpp +++ b/samples/client/petstore/cpp-qt5/client/OAIUserApi.cpp @@ -52,7 +52,7 @@ void OAIUserApi::addHeaders(const QString& key, const QString& value){ void -OAIUserApi::createUser(const OAIUser& body) { +OAIUserApi::createUser(const OAIUser& oai_user) { QString fullPath; fullPath.append(this->host).append(this->basePath).append("/user"); @@ -61,7 +61,7 @@ OAIUserApi::createUser(const OAIUser& body) { OAIHttpRequestInput input(fullPath, "POST"); - QString output = body.asJson(); + QString output = oai_user.asJson(); input.request_body.append(output); @@ -101,7 +101,7 @@ OAIUserApi::createUserCallback(OAIHttpRequestWorker * worker) { } void -OAIUserApi::createUsersWithArrayInput(const QList& body) { +OAIUserApi::createUsersWithArrayInput(const QList& oai_user) { QString fullPath; fullPath.append(this->host).append(this->basePath).append("/user/createWithArray"); @@ -110,7 +110,7 @@ OAIUserApi::createUsersWithArrayInput(const QList& body) { OAIHttpRequestInput input(fullPath, "POST"); - QJsonDocument doc(::OpenAPI::toJsonValue(body).toArray()); + QJsonDocument doc(::OpenAPI::toJsonValue(oai_user).toArray()); QByteArray bytes = doc.toJson(); input.request_body.append(bytes); @@ -151,7 +151,7 @@ OAIUserApi::createUsersWithArrayInputCallback(OAIHttpRequestWorker * worker) { } void -OAIUserApi::createUsersWithListInput(const QList& body) { +OAIUserApi::createUsersWithListInput(const QList& oai_user) { QString fullPath; fullPath.append(this->host).append(this->basePath).append("/user/createWithList"); @@ -160,7 +160,7 @@ OAIUserApi::createUsersWithListInput(const QList& body) { OAIHttpRequestInput input(fullPath, "POST"); - QJsonDocument doc(::OpenAPI::toJsonValue(body).toArray()); + QJsonDocument doc(::OpenAPI::toJsonValue(oai_user).toArray()); QByteArray bytes = doc.toJson(); input.request_body.append(bytes); @@ -406,7 +406,7 @@ OAIUserApi::logoutUserCallback(OAIHttpRequestWorker * worker) { } void -OAIUserApi::updateUser(const QString& username, const OAIUser& body) { +OAIUserApi::updateUser(const QString& username, const OAIUser& oai_user) { QString fullPath; fullPath.append(this->host).append(this->basePath).append("/user/{username}"); QString usernamePathParam("{"); @@ -418,7 +418,7 @@ OAIUserApi::updateUser(const QString& username, const OAIUser& body) { OAIHttpRequestInput input(fullPath, "PUT"); - QString output = body.asJson(); + QString output = oai_user.asJson(); input.request_body.append(output); diff --git a/samples/client/petstore/cpp-qt5/client/OAIUserApi.h b/samples/client/petstore/cpp-qt5/client/OAIUserApi.h index 454210caa6d2..b72cc28e42b3 100644 --- a/samples/client/petstore/cpp-qt5/client/OAIUserApi.h +++ b/samples/client/petstore/cpp-qt5/client/OAIUserApi.h @@ -36,14 +36,14 @@ class OAIUserApi: public QObject { void setApiTimeOutMs(const int tout); void addHeaders(const QString& key, const QString& value); - void createUser(const OAIUser& body); - void createUsersWithArrayInput(const QList& body); - void createUsersWithListInput(const QList& body); + void createUser(const OAIUser& oai_user); + void createUsersWithArrayInput(const QList& oai_user); + void createUsersWithListInput(const QList& oai_user); void deleteUser(const QString& username); void getUserByName(const QString& username); void loginUser(const QString& username, const QString& password); void logoutUser(); - void updateUser(const QString& username, const OAIUser& body); + void updateUser(const QString& username, const OAIUser& oai_user); private: QString basePath; diff --git a/samples/client/petstore/cpp-qt5/client/client.pri b/samples/client/petstore/cpp-qt5/client/client.pri index ca6c9b552457..e51b4c310803 100644 --- a/samples/client/petstore/cpp-qt5/client/client.pri +++ b/samples/client/petstore/cpp-qt5/client/client.pri @@ -4,6 +4,8 @@ HEADERS += \ # Models $${PWD}/OAIApiResponse.h \ $${PWD}/OAICategory.h \ + $${PWD}/OAIInline_object.h \ + $${PWD}/OAIInline_object_1.h \ $${PWD}/OAIOrder.h \ $${PWD}/OAIPet.h \ $${PWD}/OAITag.h \ @@ -22,6 +24,8 @@ SOURCES += \ # Models $${PWD}/OAIApiResponse.cpp \ $${PWD}/OAICategory.cpp \ + $${PWD}/OAIInline_object.cpp \ + $${PWD}/OAIInline_object_1.cpp \ $${PWD}/OAIOrder.cpp \ $${PWD}/OAIPet.cpp \ $${PWD}/OAITag.cpp \ diff --git a/samples/client/petstore/cpp-restsdk/client/.gitignore b/samples/client/petstore/cpp-restsdk/client/.gitignore new file mode 100644 index 000000000000..4581ef2eeefc --- /dev/null +++ b/samples/client/petstore/cpp-restsdk/client/.gitignore @@ -0,0 +1,29 @@ +# Compiled Object files +*.slo +*.lo +*.o +*.obj + +# Precompiled Headers +*.gch +*.pch + +# Compiled Dynamic libraries +*.so +*.dylib +*.dll + +# Fortran module files +*.mod +*.smod + +# Compiled Static libraries +*.lai +*.la +*.a +*.lib + +# Executables +*.exe +*.out +*.app diff --git a/samples/client/petstore/cpp-restsdk/client/.openapi-generator-ignore b/samples/client/petstore/cpp-restsdk/client/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/client/petstore/cpp-restsdk/client/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/cpp-restsdk/client/.openapi-generator/VERSION b/samples/client/petstore/cpp-restsdk/client/.openapi-generator/VERSION new file mode 100644 index 000000000000..83a328a9227e --- /dev/null +++ b/samples/client/petstore/cpp-restsdk/client/.openapi-generator/VERSION @@ -0,0 +1 @@ +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/cpp-restsdk/client/ApiClient.cpp b/samples/client/petstore/cpp-restsdk/client/ApiClient.cpp index 384eb8a8bc54..7322c22305cc 100644 --- a/samples/client/petstore/cpp-restsdk/client/ApiClient.cpp +++ b/samples/client/petstore/cpp-restsdk/client/ApiClient.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/ApiClient.h b/samples/client/petstore/cpp-restsdk/client/ApiClient.h index 5c5d78c765e2..c41ffa71558b 100644 --- a/samples/client/petstore/cpp-restsdk/client/ApiClient.h +++ b/samples/client/petstore/cpp-restsdk/client/ApiClient.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.cpp b/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.cpp index 251b0d0d2992..6d189ae20915 100644 --- a/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.cpp +++ b/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.h b/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.h index f6f352059908..12701aabdd2c 100644 --- a/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.h +++ b/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/ApiException.cpp b/samples/client/petstore/cpp-restsdk/client/ApiException.cpp index b0a637cf6003..f45ee1f01794 100644 --- a/samples/client/petstore/cpp-restsdk/client/ApiException.cpp +++ b/samples/client/petstore/cpp-restsdk/client/ApiException.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/ApiException.h b/samples/client/petstore/cpp-restsdk/client/ApiException.h index 30f5ef51df32..882f9941ca76 100644 --- a/samples/client/petstore/cpp-restsdk/client/ApiException.h +++ b/samples/client/petstore/cpp-restsdk/client/ApiException.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/HttpContent.cpp b/samples/client/petstore/cpp-restsdk/client/HttpContent.cpp index 6dedcd299088..595b5368ea5f 100644 --- a/samples/client/petstore/cpp-restsdk/client/HttpContent.cpp +++ b/samples/client/petstore/cpp-restsdk/client/HttpContent.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/HttpContent.h b/samples/client/petstore/cpp-restsdk/client/HttpContent.h index b357475da38b..aadb725cedd5 100644 --- a/samples/client/petstore/cpp-restsdk/client/HttpContent.h +++ b/samples/client/petstore/cpp-restsdk/client/HttpContent.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/IHttpBody.h b/samples/client/petstore/cpp-restsdk/client/IHttpBody.h index 865bd467f304..de53bbe061d3 100644 --- a/samples/client/petstore/cpp-restsdk/client/IHttpBody.h +++ b/samples/client/petstore/cpp-restsdk/client/IHttpBody.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/JsonBody.cpp b/samples/client/petstore/cpp-restsdk/client/JsonBody.cpp index e2edc1b67ef4..d0a8630ded6e 100644 --- a/samples/client/petstore/cpp-restsdk/client/JsonBody.cpp +++ b/samples/client/petstore/cpp-restsdk/client/JsonBody.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/JsonBody.h b/samples/client/petstore/cpp-restsdk/client/JsonBody.h index fba123dfc425..cc5132f968a4 100644 --- a/samples/client/petstore/cpp-restsdk/client/JsonBody.h +++ b/samples/client/petstore/cpp-restsdk/client/JsonBody.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/ModelBase.cpp b/samples/client/petstore/cpp-restsdk/client/ModelBase.cpp index 8b9f859dd6e8..d96cb32a9c62 100644 --- a/samples/client/petstore/cpp-restsdk/client/ModelBase.cpp +++ b/samples/client/petstore/cpp-restsdk/client/ModelBase.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/ModelBase.h b/samples/client/petstore/cpp-restsdk/client/ModelBase.h index 26459aa58951..903259b35683 100644 --- a/samples/client/petstore/cpp-restsdk/client/ModelBase.h +++ b/samples/client/petstore/cpp-restsdk/client/ModelBase.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/MultipartFormData.cpp b/samples/client/petstore/cpp-restsdk/client/MultipartFormData.cpp index ec6af2de5e0e..c9dbb87ccbc7 100644 --- a/samples/client/petstore/cpp-restsdk/client/MultipartFormData.cpp +++ b/samples/client/petstore/cpp-restsdk/client/MultipartFormData.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/MultipartFormData.h b/samples/client/petstore/cpp-restsdk/client/MultipartFormData.h index 96d8c3a662a7..d8eec95b3338 100644 --- a/samples/client/petstore/cpp-restsdk/client/MultipartFormData.h +++ b/samples/client/petstore/cpp-restsdk/client/MultipartFormData.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/Object.cpp b/samples/client/petstore/cpp-restsdk/client/Object.cpp index 3624e24a0172..4ff21f093752 100644 --- a/samples/client/petstore/cpp-restsdk/client/Object.cpp +++ b/samples/client/petstore/cpp-restsdk/client/Object.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/Object.h b/samples/client/petstore/cpp-restsdk/client/Object.h index bc2c7aa7573c..c688e4f28d6f 100644 --- a/samples/client/petstore/cpp-restsdk/client/Object.h +++ b/samples/client/petstore/cpp-restsdk/client/Object.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/api/PetApi.cpp b/samples/client/petstore/cpp-restsdk/client/api/PetApi.cpp index 0c67b5ecbf5b..93e5d8d48973 100644 --- a/samples/client/petstore/cpp-restsdk/client/api/PetApi.cpp +++ b/samples/client/petstore/cpp-restsdk/client/api/PetApi.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/api/PetApi.h b/samples/client/petstore/cpp-restsdk/client/api/PetApi.h index 09b2f06da9bc..f95c29ddd4cf 100644 --- a/samples/client/petstore/cpp-restsdk/client/api/PetApi.h +++ b/samples/client/petstore/cpp-restsdk/client/api/PetApi.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/api/StoreApi.cpp b/samples/client/petstore/cpp-restsdk/client/api/StoreApi.cpp index a7bcf614ee2e..e991f48b07f2 100644 --- a/samples/client/petstore/cpp-restsdk/client/api/StoreApi.cpp +++ b/samples/client/petstore/cpp-restsdk/client/api/StoreApi.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/api/StoreApi.h b/samples/client/petstore/cpp-restsdk/client/api/StoreApi.h index 2aaf9bf59699..cc2420fe3ae5 100644 --- a/samples/client/petstore/cpp-restsdk/client/api/StoreApi.h +++ b/samples/client/petstore/cpp-restsdk/client/api/StoreApi.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/api/UserApi.cpp b/samples/client/petstore/cpp-restsdk/client/api/UserApi.cpp index a4c4f1bf462b..dadd8fdbe149 100644 --- a/samples/client/petstore/cpp-restsdk/client/api/UserApi.cpp +++ b/samples/client/petstore/cpp-restsdk/client/api/UserApi.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/api/UserApi.h b/samples/client/petstore/cpp-restsdk/client/api/UserApi.h index aa840cf1f900..cce86a501868 100644 --- a/samples/client/petstore/cpp-restsdk/client/api/UserApi.h +++ b/samples/client/petstore/cpp-restsdk/client/api/UserApi.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.cpp b/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.cpp index 3fa6061fb049..22a5325268fd 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.cpp +++ b/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.h b/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.h index 9b1d7abc1a72..430d8263a823 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.h +++ b/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Category.cpp b/samples/client/petstore/cpp-restsdk/client/model/Category.cpp index 8d21469964cd..e3dacdc5a71e 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/Category.cpp +++ b/samples/client/petstore/cpp-restsdk/client/model/Category.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Category.h b/samples/client/petstore/cpp-restsdk/client/model/Category.h index 1d425850a5bb..2f84432cfc52 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/Category.h +++ b/samples/client/petstore/cpp-restsdk/client/model/Category.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Order.cpp b/samples/client/petstore/cpp-restsdk/client/model/Order.cpp index e137a045fa60..e0c8efb0def5 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/Order.cpp +++ b/samples/client/petstore/cpp-restsdk/client/model/Order.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Order.h b/samples/client/petstore/cpp-restsdk/client/model/Order.h index 9d6975874041..c1dd6cc72a5b 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/Order.h +++ b/samples/client/petstore/cpp-restsdk/client/model/Order.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Pet.cpp b/samples/client/petstore/cpp-restsdk/client/model/Pet.cpp index 76a39be3db67..3f595e302140 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/Pet.cpp +++ b/samples/client/petstore/cpp-restsdk/client/model/Pet.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Pet.h b/samples/client/petstore/cpp-restsdk/client/model/Pet.h index 3ebb80bf285a..875754ec678f 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/Pet.h +++ b/samples/client/petstore/cpp-restsdk/client/model/Pet.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Tag.cpp b/samples/client/petstore/cpp-restsdk/client/model/Tag.cpp index a4af089387e2..20585ada3623 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/Tag.cpp +++ b/samples/client/petstore/cpp-restsdk/client/model/Tag.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Tag.h b/samples/client/petstore/cpp-restsdk/client/model/Tag.h index db92cc2549c9..0ff1241b09f1 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/Tag.h +++ b/samples/client/petstore/cpp-restsdk/client/model/Tag.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/User.cpp b/samples/client/petstore/cpp-restsdk/client/model/User.cpp index 8ffd2ea50d08..33547426e0ff 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/User.cpp +++ b/samples/client/petstore/cpp-restsdk/client/model/User.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/User.h b/samples/client/petstore/cpp-restsdk/client/model/User.h index e3a970cb4df7..9ff871a61088 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/User.h +++ b/samples/client/petstore/cpp-restsdk/client/model/User.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-tizen/.openapi-generator/VERSION b/samples/client/petstore/cpp-tizen/.openapi-generator/VERSION index 4395ff592326..83a328a9227e 100644 --- a/samples/client/petstore/cpp-tizen/.openapi-generator/VERSION +++ b/samples/client/petstore/cpp-tizen/.openapi-generator/VERSION @@ -1 +1 @@ -3.2.0-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/cpp-tizen/doc/README.md b/samples/client/petstore/cpp-tizen/doc/README.md index e61e17da79ef..96fae8659750 100644 --- a/samples/client/petstore/cpp-tizen/doc/README.md +++ b/samples/client/petstore/cpp-tizen/doc/README.md @@ -96,6 +96,8 @@ Class | Description ------------- | ------------- *ApiResponse* | Describes the result of uploading an image resource *Category* | A category for a pet + *Inline_object* | + *Inline_object_1* | *Order* | An order for a pets from the pet store *Pet* | A pet for sale in the pet store *Tag* | A tag for a pet diff --git a/samples/client/petstore/cpp-tizen/src/InlineObject.cpp b/samples/client/petstore/cpp-tizen/src/InlineObject.cpp new file mode 100644 index 000000000000..c7dc655adaea --- /dev/null +++ b/samples/client/petstore/cpp-tizen/src/InlineObject.cpp @@ -0,0 +1,135 @@ +#include +#include +#include +#include +#include "Helpers.h" + + +#include "Inline_object.h" + +using namespace std; +using namespace Tizen::ArtikCloud; + +Inline_object::Inline_object() +{ + //__init(); +} + +Inline_object::~Inline_object() +{ + //__cleanup(); +} + +void +Inline_object::__init() +{ + //name = std::string(); + //status = std::string(); +} + +void +Inline_object::__cleanup() +{ + //if(name != NULL) { + // + //delete name; + //name = NULL; + //} + //if(status != NULL) { + // + //delete status; + //status = NULL; + //} + // +} + +void +Inline_object::fromJson(char* jsonStr) +{ + JsonObject *pJsonObject = json_node_get_object(json_from_string(jsonStr,NULL)); + JsonNode *node; + const gchar *nameKey = "name"; + node = json_object_get_member(pJsonObject, nameKey); + if (node !=NULL) { + + + if (isprimitive("std::string")) { + jsonToValue(&name, node, "std::string", ""); + } else { + + } + } + const gchar *statusKey = "status"; + node = json_object_get_member(pJsonObject, statusKey); + if (node !=NULL) { + + + if (isprimitive("std::string")) { + jsonToValue(&status, node, "std::string", ""); + } else { + + } + } +} + +Inline_object::Inline_object(char* json) +{ + this->fromJson(json); +} + +char* +Inline_object::toJson() +{ + JsonObject *pJsonObject = json_object_new(); + JsonNode *node; + if (isprimitive("std::string")) { + std::string obj = getName(); + node = converttoJson(&obj, "std::string", ""); + } + else { + + } + const gchar *nameKey = "name"; + json_object_set_member(pJsonObject, nameKey, node); + if (isprimitive("std::string")) { + std::string obj = getStatus(); + node = converttoJson(&obj, "std::string", ""); + } + else { + + } + const gchar *statusKey = "status"; + json_object_set_member(pJsonObject, statusKey, node); + node = json_node_alloc(); + json_node_init(node, JSON_NODE_OBJECT); + json_node_take_object(node, pJsonObject); + char * ret = json_to_string(node, false); + json_node_free(node); + return ret; +} + +std::string +Inline_object::getName() +{ + return name; +} + +void +Inline_object::setName(std::string name) +{ + this->name = name; +} + +std::string +Inline_object::getStatus() +{ + return status; +} + +void +Inline_object::setStatus(std::string status) +{ + this->status = status; +} + + diff --git a/samples/client/petstore/cpp-tizen/src/InlineObject.h b/samples/client/petstore/cpp-tizen/src/InlineObject.h new file mode 100644 index 000000000000..c6f85a55a5cb --- /dev/null +++ b/samples/client/petstore/cpp-tizen/src/InlineObject.h @@ -0,0 +1,73 @@ +/* + * Inline_object.h + * + * + */ + +#ifndef _Inline_object_H_ +#define _Inline_object_H_ + + +#include +#include "Object.h" + +/** \defgroup Models Data Structures for API + * Classes containing all the Data Structures needed for calling/returned by API endpoints + * + */ + +namespace Tizen { +namespace ArtikCloud { + + +/*! \brief + * + * \ingroup Models + * + */ + +class Inline_object : public Object { +public: + /*! \brief Constructor. + */ + Inline_object(); + Inline_object(char* str); + + /*! \brief Destructor. + */ + virtual ~Inline_object(); + + /*! \brief Retrieve a string JSON representation of this class. + */ + char* toJson(); + + /*! \brief Fills in members of this class from JSON string representing it. + */ + void fromJson(char* jsonStr); + + /*! \brief Get Updated name of the pet + */ + std::string getName(); + + /*! \brief Set Updated name of the pet + */ + void setName(std::string name); + /*! \brief Get Updated status of the pet + */ + std::string getStatus(); + + /*! \brief Set Updated status of the pet + */ + void setStatus(std::string status); + +private: + std::string name; + std::string status; + void __init(); + void __cleanup(); + +}; +} +} + +#endif /* _Inline_object_H_ */ diff --git a/samples/client/petstore/cpp-tizen/src/InlineObject1.cpp b/samples/client/petstore/cpp-tizen/src/InlineObject1.cpp new file mode 100644 index 000000000000..53a80c0678be --- /dev/null +++ b/samples/client/petstore/cpp-tizen/src/InlineObject1.cpp @@ -0,0 +1,143 @@ +#include +#include +#include +#include +#include "Helpers.h" + + +#include "Inline_object_1.h" + +using namespace std; +using namespace Tizen::ArtikCloud; + +Inline_object_1::Inline_object_1() +{ + //__init(); +} + +Inline_object_1::~Inline_object_1() +{ + //__cleanup(); +} + +void +Inline_object_1::__init() +{ + //additionalMetadata = std::string(); + //file = std::string(); +} + +void +Inline_object_1::__cleanup() +{ + //if(additionalMetadata != NULL) { + // + //delete additionalMetadata; + //additionalMetadata = NULL; + //} + //if(file != NULL) { + // + //delete file; + //file = NULL; + //} + // +} + +void +Inline_object_1::fromJson(char* jsonStr) +{ + JsonObject *pJsonObject = json_node_get_object(json_from_string(jsonStr,NULL)); + JsonNode *node; + const gchar *additionalMetadataKey = "additionalMetadata"; + node = json_object_get_member(pJsonObject, additionalMetadataKey); + if (node !=NULL) { + + + if (isprimitive("std::string")) { + jsonToValue(&additionalMetadata, node, "std::string", ""); + } else { + + } + } + const gchar *fileKey = "file"; + node = json_object_get_member(pJsonObject, fileKey); + if (node !=NULL) { + + + if (isprimitive("std::string")) { + jsonToValue(&file, node, "std::string", ""); + } else { + + std::string* obj = static_cast (&file); + obj->fromJson(json_to_string(node, false)); + + } + } +} + +Inline_object_1::Inline_object_1(char* json) +{ + this->fromJson(json); +} + +char* +Inline_object_1::toJson() +{ + JsonObject *pJsonObject = json_object_new(); + JsonNode *node; + if (isprimitive("std::string")) { + std::string obj = getAdditionalMetadata(); + node = converttoJson(&obj, "std::string", ""); + } + else { + + } + const gchar *additionalMetadataKey = "additionalMetadata"; + json_object_set_member(pJsonObject, additionalMetadataKey, node); + if (isprimitive("std::string")) { + std::string obj = getFile(); + node = converttoJson(&obj, "std::string", ""); + } + else { + + std::string obj = static_cast (getFile()); + GError *mygerror; + mygerror = NULL; + node = json_from_string(obj.toJson(), &mygerror); + + } + const gchar *fileKey = "file"; + json_object_set_member(pJsonObject, fileKey, node); + node = json_node_alloc(); + json_node_init(node, JSON_NODE_OBJECT); + json_node_take_object(node, pJsonObject); + char * ret = json_to_string(node, false); + json_node_free(node); + return ret; +} + +std::string +Inline_object_1::getAdditionalMetadata() +{ + return additionalMetadata; +} + +void +Inline_object_1::setAdditionalMetadata(std::string additionalMetadata) +{ + this->additionalMetadata = additionalMetadata; +} + +std::string +Inline_object_1::getFile() +{ + return file; +} + +void +Inline_object_1::setFile(std::string file) +{ + this->file = file; +} + + diff --git a/samples/client/petstore/cpp-tizen/src/InlineObject1.h b/samples/client/petstore/cpp-tizen/src/InlineObject1.h new file mode 100644 index 000000000000..df3cdefb0772 --- /dev/null +++ b/samples/client/petstore/cpp-tizen/src/InlineObject1.h @@ -0,0 +1,73 @@ +/* + * Inline_object_1.h + * + * + */ + +#ifndef _Inline_object_1_H_ +#define _Inline_object_1_H_ + + +#include +#include "Object.h" + +/** \defgroup Models Data Structures for API + * Classes containing all the Data Structures needed for calling/returned by API endpoints + * + */ + +namespace Tizen { +namespace ArtikCloud { + + +/*! \brief + * + * \ingroup Models + * + */ + +class Inline_object_1 : public Object { +public: + /*! \brief Constructor. + */ + Inline_object_1(); + Inline_object_1(char* str); + + /*! \brief Destructor. + */ + virtual ~Inline_object_1(); + + /*! \brief Retrieve a string JSON representation of this class. + */ + char* toJson(); + + /*! \brief Fills in members of this class from JSON string representing it. + */ + void fromJson(char* jsonStr); + + /*! \brief Get Additional data to pass to server + */ + std::string getAdditionalMetadata(); + + /*! \brief Set Additional data to pass to server + */ + void setAdditionalMetadata(std::string additionalMetadata); + /*! \brief Get file to upload + */ + std::string getFile(); + + /*! \brief Set file to upload + */ + void setFile(std::string file); + +private: + std::string additionalMetadata; + std::string file; + void __init(); + void __cleanup(); + +}; +} +} + +#endif /* _Inline_object_1_H_ */ diff --git a/samples/client/petstore/cpp-tizen/src/PetManager.cpp b/samples/client/petstore/cpp-tizen/src/PetManager.cpp index 0c6a57eee3fe..cf63e5dec892 100644 --- a/samples/client/petstore/cpp-tizen/src/PetManager.cpp +++ b/samples/client/petstore/cpp-tizen/src/PetManager.cpp @@ -514,7 +514,7 @@ static bool findPetsByTagsProcessor(MemoryStruct_s p_chunk, long code, char* err } static bool findPetsByTagsHelper(char * accessToken, - std::list tags, + std::list tags, int maxCount, void(* handler)(std::list, Error, void* ) , void* userData, bool isAsync) { @@ -537,6 +537,13 @@ static bool findPetsByTagsHelper(char * accessToken, queryParams.insert(pair("tags", itemAt)); } + + itemAtq = stringify(&maxCount, "int"); + queryParams.insert(pair("maxCount", itemAtq)); + if( itemAtq.empty()==true){ + queryParams.erase("maxCount"); + } + string mBody = ""; JsonNode* node; JsonArray* json_array; @@ -591,22 +598,22 @@ static bool findPetsByTagsHelper(char * accessToken, bool PetManager::findPetsByTagsAsync(char * accessToken, - std::list tags, + std::list tags, int maxCount, void(* handler)(std::list, Error, void* ) , void* userData) { return findPetsByTagsHelper(accessToken, - tags, + tags, maxCount, handler, userData, true); } bool PetManager::findPetsByTagsSync(char * accessToken, - std::list tags, + std::list tags, int maxCount, void(* handler)(std::list, Error, void* ) , void* userData) { return findPetsByTagsHelper(accessToken, - tags, + tags, maxCount, handler, userData, false); } diff --git a/samples/client/petstore/cpp-tizen/src/PetManager.h b/samples/client/petstore/cpp-tizen/src/PetManager.h index e3ab9a775b17..1f013cf89f4f 100644 --- a/samples/client/petstore/cpp-tizen/src/PetManager.h +++ b/samples/client/petstore/cpp-tizen/src/PetManager.h @@ -112,12 +112,13 @@ bool findPetsByStatusAsync(char * accessToken, * * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * \param tags Tags to filter by *Required* + * \param maxCount Maximum number of items to return * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool findPetsByTagsSync(char * accessToken, - std::list tags, + std::list tags, int maxCount, void(* handler)(std::list, Error, void* ) , void* userData); @@ -125,12 +126,13 @@ bool findPetsByTagsSync(char * accessToken, * * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * \param tags Tags to filter by *Required* + * \param maxCount Maximum number of items to return * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool findPetsByTagsAsync(char * accessToken, - std::list tags, + std::list tags, int maxCount, void(* handler)(std::list, Error, void* ) , void* userData); diff --git a/samples/client/petstore/cpp-tizen/src/UserManager.cpp b/samples/client/petstore/cpp-tizen/src/UserManager.cpp index bd51f9bc0516..5dc79b3810ff 100644 --- a/samples/client/petstore/cpp-tizen/src/UserManager.cpp +++ b/samples/client/petstore/cpp-tizen/src/UserManager.cpp @@ -219,7 +219,7 @@ static bool createUsersWithArrayInputProcessor(MemoryStruct_s p_chunk, long code } static bool createUsersWithArrayInputHelper(char * accessToken, - std::list user, + std::list user, void(* handler)(Error, void* ) , void* userData, bool isAsync) { @@ -240,14 +240,14 @@ static bool createUsersWithArrayInputHelper(char * accessToken, JsonNode* node; JsonArray* json_array; //TODO: Map Container - if (isprimitive("std::list")) { - node = converttoJson(&user, "std::list", "array"); + if (isprimitive("User")) { + node = converttoJson(&user, "User", "array"); } else { node = json_node_alloc(); json_array = json_array_new(); for (std::list - ::iterator bodyIter = user.begin(); bodyIter != user.end(); ++bodyIter) { - std::list itemAt = (*bodyIter); + ::iterator bodyIter = user.begin(); bodyIter != user.end(); ++bodyIter) { + User itemAt = (*bodyIter); char *jsonStr = itemAt.toJson(); JsonNode *node_temp = json_from_string(jsonStr, NULL); g_free(static_cast(jsonStr)); @@ -315,7 +315,7 @@ static bool createUsersWithArrayInputHelper(char * accessToken, bool UserManager::createUsersWithArrayInputAsync(char * accessToken, - std::list user, + std::list user, void(* handler)(Error, void* ) , void* userData) { @@ -325,7 +325,7 @@ bool UserManager::createUsersWithArrayInputAsync(char * accessToken, } bool UserManager::createUsersWithArrayInputSync(char * accessToken, - std::list user, + std::list user, void(* handler)(Error, void* ) , void* userData) { @@ -368,7 +368,7 @@ static bool createUsersWithListInputProcessor(MemoryStruct_s p_chunk, long code, } static bool createUsersWithListInputHelper(char * accessToken, - std::list user, + std::list user, void(* handler)(Error, void* ) , void* userData, bool isAsync) { @@ -389,14 +389,14 @@ static bool createUsersWithListInputHelper(char * accessToken, JsonNode* node; JsonArray* json_array; //TODO: Map Container - if (isprimitive("std::list")) { - node = converttoJson(&user, "std::list", "array"); + if (isprimitive("User")) { + node = converttoJson(&user, "User", "array"); } else { node = json_node_alloc(); json_array = json_array_new(); for (std::list - ::iterator bodyIter = user.begin(); bodyIter != user.end(); ++bodyIter) { - std::list itemAt = (*bodyIter); + ::iterator bodyIter = user.begin(); bodyIter != user.end(); ++bodyIter) { + User itemAt = (*bodyIter); char *jsonStr = itemAt.toJson(); JsonNode *node_temp = json_from_string(jsonStr, NULL); g_free(static_cast(jsonStr)); @@ -464,7 +464,7 @@ static bool createUsersWithListInputHelper(char * accessToken, bool UserManager::createUsersWithListInputAsync(char * accessToken, - std::list user, + std::list user, void(* handler)(Error, void* ) , void* userData) { @@ -474,7 +474,7 @@ bool UserManager::createUsersWithListInputAsync(char * accessToken, } bool UserManager::createUsersWithListInputSync(char * accessToken, - std::list user, + std::list user, void(* handler)(Error, void* ) , void* userData) { diff --git a/samples/client/petstore/cpp-tizen/src/UserManager.h b/samples/client/petstore/cpp-tizen/src/UserManager.h index 7429af29f3aa..4a3b6ce828f2 100644 --- a/samples/client/petstore/cpp-tizen/src/UserManager.h +++ b/samples/client/petstore/cpp-tizen/src/UserManager.h @@ -61,7 +61,7 @@ bool createUserAsync(char * accessToken, * \param userData The user data to be passed to the callback function. */ bool createUsersWithArrayInputSync(char * accessToken, - std::list user, + std::list user, void(* handler)(Error, void* ) , void* userData); @@ -74,7 +74,7 @@ bool createUsersWithArrayInputSync(char * accessToken, * \param userData The user data to be passed to the callback function. */ bool createUsersWithArrayInputAsync(char * accessToken, - std::list user, + std::list user, void(* handler)(Error, void* ) , void* userData); @@ -88,7 +88,7 @@ bool createUsersWithArrayInputAsync(char * accessToken, * \param userData The user data to be passed to the callback function. */ bool createUsersWithListInputSync(char * accessToken, - std::list user, + std::list user, void(* handler)(Error, void* ) , void* userData); @@ -101,7 +101,7 @@ bool createUsersWithListInputSync(char * accessToken, * \param userData The user data to be passed to the callback function. */ bool createUsersWithListInputAsync(char * accessToken, - std::list user, + std::list user, void(* handler)(Error, void* ) , void* userData); diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/.openapi-generator/VERSION b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/.openapi-generator/VERSION index afa636560641..83a328a9227e 100644 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/README.md b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/README.md index b68ca22592ad..4682564f3fa0 100644 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/README.md +++ b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/README.md @@ -53,12 +53,12 @@ namespace Example Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(); - var body = new Pet(); // Pet | Pet object that needs to be added to the store + var pet = new Pet(); // Pet | Pet object that needs to be added to the store try { // Add a new pet to the store - apiInstance.AddPet(body); + apiInstance.AddPet(pet); } catch (Exception e) { @@ -103,6 +103,8 @@ Class | Method | HTTP request | Description - [Org.OpenAPITools.Model.ApiResponse](docs/ApiResponse.md) - [Org.OpenAPITools.Model.Category](docs/Category.md) + - [Org.OpenAPITools.Model.InlineObject](docs/InlineObject.md) + - [Org.OpenAPITools.Model.InlineObject1](docs/InlineObject1.md) - [Org.OpenAPITools.Model.Order](docs/Order.md) - [Org.OpenAPITools.Model.Pet](docs/Pet.md) - [Org.OpenAPITools.Model.Tag](docs/Tag.md) @@ -119,6 +121,13 @@ Class | Method | HTTP request | Description - **API key parameter name**: api_key - **Location**: HTTP header + +### auth_cookie + +- **Type**: API key +- **API key parameter name**: AUTH_KEY +- **Location**: + ### petstore_auth diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/InlineObject.md b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/InlineObject.md new file mode 100644 index 000000000000..40e16da1bb7d --- /dev/null +++ b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/InlineObject.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.InlineObject +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | Updated name of the pet | [optional] +**Status** | **string** | Updated status of the pet | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/InlineObject1.md b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/InlineObject1.md new file mode 100644 index 000000000000..2e6d226754e4 --- /dev/null +++ b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/InlineObject1.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.InlineObject1 +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AdditionalMetadata** | **string** | Additional data to pass to server | [optional] +**File** | **System.IO.Stream** | file to upload | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/PetApi.md b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/PetApi.md index 3ce062d25aa1..255f444992fa 100644 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/PetApi.md +++ b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/PetApi.md @@ -16,7 +16,7 @@ Method | HTTP request | Description # **AddPet** -> void AddPet (Pet body) +> void AddPet (Pet pet) Add a new pet to the store @@ -39,12 +39,12 @@ namespace Example Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(); - var body = new Pet(); // Pet | Pet object that needs to be added to the store + var pet = new Pet(); // Pet | Pet object that needs to be added to the store try { // Add a new pet to the store - apiInstance.AddPet(body); + apiInstance.AddPet(pet); } catch (Exception e) { @@ -59,7 +59,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -207,7 +207,7 @@ Name | Type | Description | Notes # **FindPetsByTags** -> List FindPetsByTags (List tags) +> List FindPetsByTags (List tags, int? maxCount) Finds Pets by tags @@ -233,11 +233,12 @@ namespace Example var apiInstance = new PetApi(); var tags = new List(); // List | Tags to filter by + var maxCount = 56; // int? | Maximum number of items to return (optional) try { // Finds Pets by tags - List<Pet> result = apiInstance.FindPetsByTags(tags); + List<Pet> result = apiInstance.FindPetsByTags(tags, maxCount); Debug.WriteLine(result); } catch (Exception e) @@ -254,6 +255,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **tags** | [**List**](string.md)| Tags to filter by | + **maxCount** | **int?**| Maximum number of items to return | [optional] ### Return type @@ -339,7 +341,7 @@ Name | Type | Description | Notes # **UpdatePet** -> void UpdatePet (Pet body) +> void UpdatePet (Pet pet) Update an existing pet @@ -362,12 +364,12 @@ namespace Example Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(); - var body = new Pet(); // Pet | Pet object that needs to be added to the store + var pet = new Pet(); // Pet | Pet object that needs to be added to the store try { // Update an existing pet - apiInstance.UpdatePet(body); + apiInstance.UpdatePet(pet); } catch (Exception e) { @@ -382,7 +384,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/StoreApi.md b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/StoreApi.md index 9ee43d09cc19..c49894a3ff1f 100644 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/StoreApi.md +++ b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/StoreApi.md @@ -198,7 +198,7 @@ No authorization required # **PlaceOrder** -> Order PlaceOrder (Order body) +> Order PlaceOrder (Order order) Place an order for a pet @@ -218,12 +218,12 @@ namespace Example { var apiInstance = new StoreApi(); - var body = new Order(); // Order | order placed for purchasing the pet + var order = new Order(); // Order | order placed for purchasing the pet try { // Place an order for a pet - Order result = apiInstance.PlaceOrder(body); + Order result = apiInstance.PlaceOrder(order); Debug.WriteLine(result); } catch (Exception e) @@ -239,7 +239,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | + **order** | [**Order**](Order.md)| order placed for purchasing the pet | ### Return type @@ -251,7 +251,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/xml, application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/UserApi.md b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/UserApi.md index 75a3595de6c8..a49291968f39 100644 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/UserApi.md +++ b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/UserApi.md @@ -16,7 +16,7 @@ Method | HTTP request | Description # **CreateUser** -> void CreateUser (User body) +> void CreateUser (User user) Create user @@ -37,13 +37,18 @@ namespace Example public void main() { + // Configure API key authorization: auth_cookie + Configuration.Default.ApiKey.Add("AUTH_KEY", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // Configuration.Default.ApiKeyPrefix.Add("AUTH_KEY", "Bearer"); + var apiInstance = new UserApi(); - var body = new User(); // User | Created user object + var user = new User(); // User | Created user object try { // Create user - apiInstance.CreateUser(body); + apiInstance.CreateUser(user); } catch (Exception e) { @@ -58,7 +63,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | + **user** | [**User**](User.md)| Created user object | ### Return type @@ -66,18 +71,18 @@ void (empty response body) ### Authorization -No authorization required +[auth_cookie](../README.md#auth_cookie) ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **CreateUsersWithArrayInput** -> void CreateUsersWithArrayInput (List body) +> void CreateUsersWithArrayInput (List user) Creates list of users with given input array @@ -96,13 +101,18 @@ namespace Example public void main() { + // Configure API key authorization: auth_cookie + Configuration.Default.ApiKey.Add("AUTH_KEY", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // Configuration.Default.ApiKeyPrefix.Add("AUTH_KEY", "Bearer"); + var apiInstance = new UserApi(); - var body = new List(); // List | List of user object + var user = new List(); // List | List of user object try { // Creates list of users with given input array - apiInstance.CreateUsersWithArrayInput(body); + apiInstance.CreateUsersWithArrayInput(user); } catch (Exception e) { @@ -117,7 +127,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List**](List.md)| List of user object | + **user** | [**List**](User.md)| List of user object | ### Return type @@ -125,18 +135,18 @@ void (empty response body) ### Authorization -No authorization required +[auth_cookie](../README.md#auth_cookie) ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **CreateUsersWithListInput** -> void CreateUsersWithListInput (List body) +> void CreateUsersWithListInput (List user) Creates list of users with given input array @@ -155,13 +165,18 @@ namespace Example public void main() { + // Configure API key authorization: auth_cookie + Configuration.Default.ApiKey.Add("AUTH_KEY", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // Configuration.Default.ApiKeyPrefix.Add("AUTH_KEY", "Bearer"); + var apiInstance = new UserApi(); - var body = new List(); // List | List of user object + var user = new List(); // List | List of user object try { // Creates list of users with given input array - apiInstance.CreateUsersWithListInput(body); + apiInstance.CreateUsersWithListInput(user); } catch (Exception e) { @@ -176,7 +191,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List**](List.md)| List of user object | + **user** | [**List**](User.md)| List of user object | ### Return type @@ -184,11 +199,11 @@ void (empty response body) ### Authorization -No authorization required +[auth_cookie](../README.md#auth_cookie) ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -216,6 +231,11 @@ namespace Example public void main() { + // Configure API key authorization: auth_cookie + Configuration.Default.ApiKey.Add("AUTH_KEY", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // Configuration.Default.ApiKeyPrefix.Add("AUTH_KEY", "Bearer"); + var apiInstance = new UserApi(); var username = username_example; // string | The name that needs to be deleted @@ -245,7 +265,7 @@ void (empty response body) ### Authorization -No authorization required +[auth_cookie](../README.md#auth_cookie) ### HTTP request headers @@ -397,6 +417,11 @@ namespace Example public void main() { + // Configure API key authorization: auth_cookie + Configuration.Default.ApiKey.Add("AUTH_KEY", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // Configuration.Default.ApiKeyPrefix.Add("AUTH_KEY", "Bearer"); + var apiInstance = new UserApi(); try @@ -422,7 +447,7 @@ void (empty response body) ### Authorization -No authorization required +[auth_cookie](../README.md#auth_cookie) ### HTTP request headers @@ -433,7 +458,7 @@ No authorization required # **UpdateUser** -> void UpdateUser (string username, User body) +> void UpdateUser (string username, User user) Updated user @@ -454,14 +479,19 @@ namespace Example public void main() { + // Configure API key authorization: auth_cookie + Configuration.Default.ApiKey.Add("AUTH_KEY", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // Configuration.Default.ApiKeyPrefix.Add("AUTH_KEY", "Bearer"); + var apiInstance = new UserApi(); var username = username_example; // string | name that need to be deleted - var body = new User(); // User | Updated user object + var user = new User(); // User | Updated user object try { // Updated user - apiInstance.UpdateUser(username, body); + apiInstance.UpdateUser(username, user); } catch (Exception e) { @@ -477,7 +507,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **string**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | + **user** | [**User**](User.md)| Updated user object | ### Return type @@ -485,11 +515,11 @@ void (empty response body) ### Authorization -No authorization required +[auth_cookie](../README.md#auth_cookie) ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Api/PetApi.cs index 48b1119b50af..cb40fc9ea44b 100644 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Api/PetApi.cs @@ -14,9 +14,9 @@ public interface IPetApi /// /// Add a new pet to the store /// - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// - void AddPet (Pet body); + void AddPet (Pet pet); /// /// Deletes a pet /// @@ -34,8 +34,9 @@ public interface IPetApi /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. /// /// Tags to filter by + /// Maximum number of items to return /// List<Pet> - List FindPetsByTags (List tags); + List FindPetsByTags (List tags, int? maxCount); /// /// Find pet by ID Returns a single pet /// @@ -45,9 +46,9 @@ public interface IPetApi /// /// Update an existing pet /// - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// - void UpdatePet (Pet body); + void UpdatePet (Pet pet); /// /// Updates a pet in the store with form data /// @@ -122,13 +123,13 @@ public String GetBasePath(String basePath) /// /// Add a new pet to the store /// - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// - public void AddPet (Pet body) + public void AddPet (Pet pet) { - // verify the required parameter 'body' is set - if (body == null) throw new ApiException(400, "Missing required parameter 'body' when calling AddPet"); + // verify the required parameter 'pet' is set + if (pet == null) throw new ApiException(400, "Missing required parameter 'pet' when calling AddPet"); var path = "/pet"; @@ -140,7 +141,7 @@ public void AddPet (Pet body) var fileParams = new Dictionary(); String postBody = null; - postBody = ApiClient.Serialize(body); // http body (model) parameter + postBody = ApiClient.Serialize(pet); // http body (model) parameter // authentication setting, if any String[] authSettings = new String[] { "petstore_auth" }; @@ -236,8 +237,9 @@ public List FindPetsByStatus (List status) /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. /// /// Tags to filter by + /// Maximum number of items to return /// List<Pet> - public List FindPetsByTags (List tags) + public List FindPetsByTags (List tags, int? maxCount) { // verify the required parameter 'tags' is set @@ -254,6 +256,7 @@ public List FindPetsByTags (List tags) String postBody = null; if (tags != null) queryParams.Add("tags", ApiClient.ParameterToString(tags)); // query parameter + if (maxCount != null) queryParams.Add("maxCount", ApiClient.ParameterToString(maxCount)); // query parameter // authentication setting, if any String[] authSettings = new String[] { "petstore_auth" }; @@ -309,13 +312,13 @@ public Pet GetPetById (long? petId) /// /// Update an existing pet /// - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// - public void UpdatePet (Pet body) + public void UpdatePet (Pet pet) { - // verify the required parameter 'body' is set - if (body == null) throw new ApiException(400, "Missing required parameter 'body' when calling UpdatePet"); + // verify the required parameter 'pet' is set + if (pet == null) throw new ApiException(400, "Missing required parameter 'pet' when calling UpdatePet"); var path = "/pet"; @@ -327,7 +330,7 @@ public void UpdatePet (Pet body) var fileParams = new Dictionary(); String postBody = null; - postBody = ApiClient.Serialize(body); // http body (model) parameter + postBody = ApiClient.Serialize(pet); // http body (model) parameter // authentication setting, if any String[] authSettings = new String[] { "petstore_auth" }; diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Api/StoreApi.cs index df7be44e7b95..3390bbbcaba7 100644 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Api/StoreApi.cs @@ -31,9 +31,9 @@ public interface IStoreApi /// /// Place an order for a pet /// - /// order placed for purchasing the pet + /// order placed for purchasing the pet /// Order - Order PlaceOrder (Order body); + Order PlaceOrder (Order order); } /// @@ -198,13 +198,13 @@ public Order GetOrderById (long? orderId) /// /// Place an order for a pet /// - /// order placed for purchasing the pet + /// order placed for purchasing the pet /// Order - public Order PlaceOrder (Order body) + public Order PlaceOrder (Order order) { - // verify the required parameter 'body' is set - if (body == null) throw new ApiException(400, "Missing required parameter 'body' when calling PlaceOrder"); + // verify the required parameter 'order' is set + if (order == null) throw new ApiException(400, "Missing required parameter 'order' when calling PlaceOrder"); var path = "/store/order"; @@ -216,7 +216,7 @@ public Order PlaceOrder (Order body) var fileParams = new Dictionary(); String postBody = null; - postBody = ApiClient.Serialize(body); // http body (model) parameter + postBody = ApiClient.Serialize(order); // http body (model) parameter // authentication setting, if any String[] authSettings = new String[] { }; diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Api/UserApi.cs index 3f453e6b9b21..b05d18104766 100644 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Api/UserApi.cs @@ -14,21 +14,21 @@ public interface IUserApi /// /// Create user This can only be done by the logged in user. /// - /// Created user object + /// Created user object /// - void CreateUser (User body); + void CreateUser (User user); /// /// Creates list of users with given input array /// - /// List of user object + /// List of user object /// - void CreateUsersWithArrayInput (List body); + void CreateUsersWithArrayInput (List user); /// /// Creates list of users with given input array /// - /// List of user object + /// List of user object /// - void CreateUsersWithListInput (List body); + void CreateUsersWithListInput (List user); /// /// Delete user This can only be done by the logged in user. /// @@ -57,9 +57,9 @@ public interface IUserApi /// Updated user This can only be done by the logged in user. /// /// name that need to be deleted - /// Updated user object + /// Updated user object /// - void UpdateUser (string username, User body); + void UpdateUser (string username, User user); } /// @@ -118,13 +118,13 @@ public String GetBasePath(String basePath) /// /// Create user This can only be done by the logged in user. /// - /// Created user object + /// Created user object /// - public void CreateUser (User body) + public void CreateUser (User user) { - // verify the required parameter 'body' is set - if (body == null) throw new ApiException(400, "Missing required parameter 'body' when calling CreateUser"); + // verify the required parameter 'user' is set + if (user == null) throw new ApiException(400, "Missing required parameter 'user' when calling CreateUser"); var path = "/user"; @@ -136,10 +136,10 @@ public void CreateUser (User body) var fileParams = new Dictionary(); String postBody = null; - postBody = ApiClient.Serialize(body); // http body (model) parameter + postBody = ApiClient.Serialize(user); // http body (model) parameter // authentication setting, if any - String[] authSettings = new String[] { }; + String[] authSettings = new String[] { "auth_cookie" }; // make the HTTP request IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); @@ -155,13 +155,13 @@ public void CreateUser (User body) /// /// Creates list of users with given input array /// - /// List of user object + /// List of user object /// - public void CreateUsersWithArrayInput (List body) + public void CreateUsersWithArrayInput (List user) { - // verify the required parameter 'body' is set - if (body == null) throw new ApiException(400, "Missing required parameter 'body' when calling CreateUsersWithArrayInput"); + // verify the required parameter 'user' is set + if (user == null) throw new ApiException(400, "Missing required parameter 'user' when calling CreateUsersWithArrayInput"); var path = "/user/createWithArray"; @@ -173,10 +173,10 @@ public void CreateUsersWithArrayInput (List body) var fileParams = new Dictionary(); String postBody = null; - postBody = ApiClient.Serialize(body); // http body (model) parameter + postBody = ApiClient.Serialize(user); // http body (model) parameter // authentication setting, if any - String[] authSettings = new String[] { }; + String[] authSettings = new String[] { "auth_cookie" }; // make the HTTP request IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); @@ -192,13 +192,13 @@ public void CreateUsersWithArrayInput (List body) /// /// Creates list of users with given input array /// - /// List of user object + /// List of user object /// - public void CreateUsersWithListInput (List body) + public void CreateUsersWithListInput (List user) { - // verify the required parameter 'body' is set - if (body == null) throw new ApiException(400, "Missing required parameter 'body' when calling CreateUsersWithListInput"); + // verify the required parameter 'user' is set + if (user == null) throw new ApiException(400, "Missing required parameter 'user' when calling CreateUsersWithListInput"); var path = "/user/createWithList"; @@ -210,10 +210,10 @@ public void CreateUsersWithListInput (List body) var fileParams = new Dictionary(); String postBody = null; - postBody = ApiClient.Serialize(body); // http body (model) parameter + postBody = ApiClient.Serialize(user); // http body (model) parameter // authentication setting, if any - String[] authSettings = new String[] { }; + String[] authSettings = new String[] { "auth_cookie" }; // make the HTTP request IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); @@ -250,7 +250,7 @@ public void DeleteUser (string username) // authentication setting, if any - String[] authSettings = new String[] { }; + String[] authSettings = new String[] { "auth_cookie" }; // make the HTTP request IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, authSettings); @@ -361,7 +361,7 @@ public void LogoutUser () // authentication setting, if any - String[] authSettings = new String[] { }; + String[] authSettings = new String[] { "auth_cookie" }; // make the HTTP request IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); @@ -378,16 +378,16 @@ public void LogoutUser () /// Updated user This can only be done by the logged in user. /// /// name that need to be deleted - /// Updated user object + /// Updated user object /// - public void UpdateUser (string username, User body) + public void UpdateUser (string username, User user) { // verify the required parameter 'username' is set if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling UpdateUser"); - // verify the required parameter 'body' is set - if (body == null) throw new ApiException(400, "Missing required parameter 'body' when calling UpdateUser"); + // verify the required parameter 'user' is set + if (user == null) throw new ApiException(400, "Missing required parameter 'user' when calling UpdateUser"); var path = "/user/{username}"; @@ -400,10 +400,10 @@ public void UpdateUser (string username, User body) var fileParams = new Dictionary(); String postBody = null; - postBody = ApiClient.Serialize(body); // http body (model) parameter + postBody = ApiClient.Serialize(user); // http body (model) parameter // authentication setting, if any - String[] authSettings = new String[] { }; + String[] authSettings = new String[] { "auth_cookie" }; // make the HTTP request IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, authSettings); diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Client/ApiClient.cs index 095f97997ec3..f6aad437dc4e 100644 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Client/ApiClient.cs @@ -260,6 +260,10 @@ public void UpdateParamsForAuth(Dictionary queryParams, Dictiona case "api_key": headerParams["api_key"] = GetApiKeyWithPrefix("api_key"); + break; + case "auth_cookie": + + break; case "petstore_auth": diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/.openapi-generator/VERSION b/samples/client/petstore/csharp/OpenAPIClientNet35/.openapi-generator/VERSION index 06b5019af3f4..83a328a9227e 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.1-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/README.md b/samples/client/petstore/csharp/OpenAPIClientNet35/README.md index 6319d9193e9a..dcdb39631c54 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/README.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/README.md @@ -64,7 +64,7 @@ Then, publish to a [local feed](https://docs.microsoft.com/en-us/nuget/hosting-p ## Getting Started ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -74,10 +74,11 @@ namespace Example { public class Example { - public void main() + public static void Main() { - var apiInstance = new AnotherFakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new AnotherFakeApi(Configuration.Default); var body = new ModelClient(); // ModelClient | client model try @@ -86,9 +87,11 @@ namespace Example ModelClient result = apiInstance.Call123TestSpecialTags(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling AnotherFakeApi.Call123TestSpecialTags: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/AnotherFakeApi.md b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/AnotherFakeApi.md index d13566caf343..5af41a1862c2 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/AnotherFakeApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/AnotherFakeApi.md @@ -19,7 +19,7 @@ To test special tags and operation ID starting with number ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -29,9 +29,10 @@ namespace Example { public class Call123TestSpecialTagsExample { - public void main() + public static void Main() { - var apiInstance = new AnotherFakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new AnotherFakeApi(Configuration.Default); var body = new ModelClient(); // ModelClient | client model try @@ -40,9 +41,11 @@ namespace Example ModelClient result = apiInstance.Call123TestSpecialTags(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling AnotherFakeApi.Call123TestSpecialTags: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -69,6 +72,11 @@ No authorization required - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/FakeApi.md b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/FakeApi.md index a2284ba8f3e7..8a53b02b5e1e 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/FakeApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/FakeApi.md @@ -31,7 +31,7 @@ this route creates an XmlItem ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -41,9 +41,10 @@ namespace Example { public class CreateXmlItemExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var xmlItem = new XmlItem(); // XmlItem | XmlItem Body try @@ -51,9 +52,11 @@ namespace Example // creates an XmlItem apiInstance.CreateXmlItem(xmlItem); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.CreateXmlItem: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -80,6 +83,11 @@ No authorization required - **Content-Type**: application/xml, application/xml; charset=utf-8, application/xml; charset=utf-16, text/xml, text/xml; charset=utf-8, text/xml; charset=utf-16 - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -97,7 +105,7 @@ Test serialization of outer boolean types ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -107,9 +115,10 @@ namespace Example { public class FakeOuterBooleanSerializeExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var body = true; // bool? | Input boolean as post body (optional) try @@ -117,9 +126,11 @@ namespace Example bool? result = apiInstance.FakeOuterBooleanSerialize(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.FakeOuterBooleanSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -146,6 +157,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: */* +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output boolean | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -163,7 +179,7 @@ Test serialization of object with outer number type ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -173,9 +189,10 @@ namespace Example { public class FakeOuterCompositeSerializeExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var body = new OuterComposite(); // OuterComposite | Input composite as post body (optional) try @@ -183,9 +200,11 @@ namespace Example OuterComposite result = apiInstance.FakeOuterCompositeSerialize(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.FakeOuterCompositeSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -212,6 +231,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: */* +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output composite | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -229,7 +253,7 @@ Test serialization of outer number types ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -239,9 +263,10 @@ namespace Example { public class FakeOuterNumberSerializeExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var body = 8.14; // decimal? | Input number as post body (optional) try @@ -249,9 +274,11 @@ namespace Example decimal? result = apiInstance.FakeOuterNumberSerialize(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.FakeOuterNumberSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -278,6 +305,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: */* +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output number | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -295,7 +327,7 @@ Test serialization of outer string types ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -305,9 +337,10 @@ namespace Example { public class FakeOuterStringSerializeExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var body = body_example; // string | Input string as post body (optional) try @@ -315,9 +348,11 @@ namespace Example string result = apiInstance.FakeOuterStringSerialize(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.FakeOuterStringSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -344,6 +379,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: */* +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output string | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -361,7 +401,7 @@ For this test, the body for this request much reference a schema named `File`. ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -371,18 +411,21 @@ namespace Example { public class TestBodyWithFileSchemaExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var body = new FileSchemaTestClass(); // FileSchemaTestClass | try { apiInstance.TestBodyWithFileSchema(body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestBodyWithFileSchema: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -409,6 +452,11 @@ No authorization required - **Content-Type**: application/json - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -424,7 +472,7 @@ No authorization required ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -434,9 +482,10 @@ namespace Example { public class TestBodyWithQueryParamsExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var query = query_example; // string | var body = new User(); // User | @@ -444,9 +493,11 @@ namespace Example { apiInstance.TestBodyWithQueryParams(query, body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestBodyWithQueryParams: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -474,6 +525,11 @@ No authorization required - **Content-Type**: application/json - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -491,7 +547,7 @@ To test \"client\" model ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -501,9 +557,10 @@ namespace Example { public class TestClientModelExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var body = new ModelClient(); // ModelClient | client model try @@ -512,9 +569,11 @@ namespace Example ModelClient result = apiInstance.TestClientModel(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestClientModel: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -541,6 +600,11 @@ No authorization required - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -558,7 +622,7 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -568,13 +632,14 @@ namespace Example { public class TestEndpointParametersExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure HTTP basic authorization: http_basic_test Configuration.Default.Username = "YOUR_USERNAME"; Configuration.Default.Password = "YOUR_PASSWORD"; - var apiInstance = new FakeApi(); + var apiInstance = new FakeApi(Configuration.Default); var number = 8.14; // decimal? | None var _double = 1.2D; // double? | None var patternWithoutDelimiter = patternWithoutDelimiter_example; // string | None @@ -595,9 +660,11 @@ namespace Example // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 apiInstance.TestEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestEndpointParameters: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -637,6 +704,12 @@ void (empty response body) - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -654,7 +727,7 @@ To test enum parameters ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -664,9 +737,10 @@ namespace Example { public class TestEnumParametersExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var enumHeaderStringArray = enumHeaderStringArray_example; // List | Header parameter enum test (string array) (optional) var enumHeaderString = enumHeaderString_example; // string | Header parameter enum test (string) (optional) (default to -efg) var enumQueryStringArray = enumQueryStringArray_example; // List | Query parameter enum test (string array) (optional) @@ -681,9 +755,11 @@ namespace Example // To test enum parameters apiInstance.TestEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestEnumParameters: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -717,6 +793,12 @@ No authorization required - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid request | - | +| **404** | Not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -734,7 +816,7 @@ Fake endpoint to test group parameters (optional) ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -744,9 +826,10 @@ namespace Example { public class TestGroupParametersExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var requiredStringGroup = 56; // int? | Required String in group parameters var requiredBooleanGroup = true; // bool? | Required Boolean in group parameters var requiredInt64Group = 789; // long? | Required Integer in group parameters @@ -759,9 +842,11 @@ namespace Example // Fake endpoint to test group parameters (optional) apiInstance.TestGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestGroupParameters: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -793,6 +878,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Someting wrong | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -808,7 +898,7 @@ test inline additionalProperties ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -818,9 +908,10 @@ namespace Example { public class TestInlineAdditionalPropertiesExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var param = new Dictionary(); // Dictionary | request body try @@ -828,9 +919,11 @@ namespace Example // test inline additionalProperties apiInstance.TestInlineAdditionalProperties(param); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestInlineAdditionalProperties: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -857,6 +950,11 @@ No authorization required - **Content-Type**: application/json - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -872,7 +970,7 @@ test json serialization of form data ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -882,9 +980,10 @@ namespace Example { public class TestJsonFormDataExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var param = param_example; // string | field1 var param2 = param2_example; // string | field2 @@ -893,9 +992,11 @@ namespace Example // test json serialization of form data apiInstance.TestJsonFormData(param, param2); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestJsonFormData: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -923,6 +1024,11 @@ No authorization required - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/FakeClassnameTags123Api.md b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/FakeClassnameTags123Api.md index cc0cd83d12ca..deb97a27697f 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/FakeClassnameTags123Api.md @@ -19,7 +19,7 @@ To test class name in snake case ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -29,14 +29,15 @@ namespace Example { public class TestClassnameExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure API key authorization: api_key_query Configuration.Default.AddApiKey("api_key_query", "YOUR_API_KEY"); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Configuration.Default.AddApiKeyPrefix("api_key_query", "Bearer"); - var apiInstance = new FakeClassnameTags123Api(); + var apiInstance = new FakeClassnameTags123Api(Configuration.Default); var body = new ModelClient(); // ModelClient | client model try @@ -45,9 +46,11 @@ namespace Example ModelClient result = apiInstance.TestClassname(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeClassnameTags123Api.TestClassname: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -74,6 +77,11 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/PetApi.md b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/PetApi.md index d2e2075bfd7b..c45dd7854a73 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/PetApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/PetApi.md @@ -25,7 +25,7 @@ Add a new pet to the store ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -35,12 +35,13 @@ namespace Example { public class AddPetExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var body = new Pet(); // Pet | Pet object that needs to be added to the store try @@ -48,9 +49,11 @@ namespace Example // Add a new pet to the store apiInstance.AddPet(body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.AddPet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -77,6 +80,12 @@ void (empty response body) - **Content-Type**: application/json, application/xml - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **405** | Invalid input | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -92,7 +101,7 @@ Deletes a pet ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -102,12 +111,13 @@ namespace Example { public class DeletePetExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var petId = 789; // long? | Pet id to delete var apiKey = apiKey_example; // string | (optional) @@ -116,9 +126,11 @@ namespace Example // Deletes a pet apiInstance.DeletePet(petId, apiKey); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.DeletePet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -146,6 +158,12 @@ void (empty response body) - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid pet value | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -154,7 +172,7 @@ void (empty response body) ## FindPetsByStatus -> List FindPetsByStatus (List status) +> List<Pet> FindPetsByStatus (List status) Finds Pets by status @@ -163,7 +181,7 @@ Multiple status values can be provided with comma separated strings ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -173,23 +191,26 @@ namespace Example { public class FindPetsByStatusExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var status = status_example; // List | Status values that need to be considered for filter try { // Finds Pets by status - List<Pet> result = apiInstance.FindPetsByStatus(status); + List result = apiInstance.FindPetsByStatus(status); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.FindPetsByStatus: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -205,7 +226,7 @@ Name | Type | Description | Notes ### Return type -[**List**](Pet.md) +[**List<Pet>**](Pet.md) ### Authorization @@ -216,6 +237,12 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid status value | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -224,7 +251,7 @@ Name | Type | Description | Notes ## FindPetsByTags -> List FindPetsByTags (List tags) +> List<Pet> FindPetsByTags (List tags) Finds Pets by tags @@ -233,7 +260,7 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -243,23 +270,26 @@ namespace Example { public class FindPetsByTagsExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var tags = new List(); // List | Tags to filter by try { // Finds Pets by tags - List<Pet> result = apiInstance.FindPetsByTags(tags); + List result = apiInstance.FindPetsByTags(tags); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.FindPetsByTags: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -275,7 +305,7 @@ Name | Type | Description | Notes ### Return type -[**List**](Pet.md) +[**List<Pet>**](Pet.md) ### Authorization @@ -286,6 +316,12 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid tag value | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -303,7 +339,7 @@ Returns a single pet ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -313,14 +349,15 @@ namespace Example { public class GetPetByIdExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure API key authorization: api_key Configuration.Default.AddApiKey("api_key", "YOUR_API_KEY"); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Configuration.Default.AddApiKeyPrefix("api_key", "Bearer"); - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var petId = 789; // long? | ID of pet to return try @@ -329,9 +366,11 @@ namespace Example Pet result = apiInstance.GetPetById(petId); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.GetPetById: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -358,6 +397,13 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -373,7 +419,7 @@ Update an existing pet ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -383,12 +429,13 @@ namespace Example { public class UpdatePetExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var body = new Pet(); // Pet | Pet object that needs to be added to the store try @@ -396,9 +443,11 @@ namespace Example // Update an existing pet apiInstance.UpdatePet(body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.UpdatePet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -425,6 +474,14 @@ void (empty response body) - **Content-Type**: application/json, application/xml - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | +| **405** | Validation exception | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -440,7 +497,7 @@ Updates a pet in the store with form data ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -450,12 +507,13 @@ namespace Example { public class UpdatePetWithFormExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var petId = 789; // long? | ID of pet that needs to be updated var name = name_example; // string | Updated name of the pet (optional) var status = status_example; // string | Updated status of the pet (optional) @@ -465,9 +523,11 @@ namespace Example // Updates a pet in the store with form data apiInstance.UpdatePetWithForm(petId, name, status); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.UpdatePetWithForm: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -496,6 +556,11 @@ void (empty response body) - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **405** | Invalid input | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -511,7 +576,7 @@ uploads an image ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -521,12 +586,13 @@ namespace Example { public class UploadFileExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var petId = 789; // long? | ID of pet to update var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional) var file = BINARY_DATA_HERE; // System.IO.Stream | file to upload (optional) @@ -537,9 +603,11 @@ namespace Example ApiResponse result = apiInstance.UploadFile(petId, additionalMetadata, file); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.UploadFile: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -568,6 +636,11 @@ Name | Type | Description | Notes - **Content-Type**: multipart/form-data - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -583,7 +656,7 @@ uploads an image (required) ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -593,12 +666,13 @@ namespace Example { public class UploadFileWithRequiredFileExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var petId = 789; // long? | ID of pet to update var requiredFile = BINARY_DATA_HERE; // System.IO.Stream | file to upload var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional) @@ -609,9 +683,11 @@ namespace Example ApiResponse result = apiInstance.UploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.UploadFileWithRequiredFile: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -640,6 +716,11 @@ Name | Type | Description | Notes - **Content-Type**: multipart/form-data - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/StoreApi.md b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/StoreApi.md index 0f6d9e4e3dc2..b4dc72258a05 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/StoreApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/StoreApi.md @@ -22,7 +22,7 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -32,9 +32,10 @@ namespace Example { public class DeleteOrderExample { - public void main() + public static void Main() { - var apiInstance = new StoreApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(Configuration.Default); var orderId = orderId_example; // string | ID of the order that needs to be deleted try @@ -42,9 +43,11 @@ namespace Example // Delete purchase order by ID apiInstance.DeleteOrder(orderId); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling StoreApi.DeleteOrder: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -71,6 +74,12 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -79,7 +88,7 @@ No authorization required ## GetInventory -> Dictionary GetInventory () +> Dictionary<string, int?> GetInventory () Returns pet inventories by status @@ -88,7 +97,7 @@ Returns a map of status codes to quantities ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -98,24 +107,27 @@ namespace Example { public class GetInventoryExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure API key authorization: api_key Configuration.Default.AddApiKey("api_key", "YOUR_API_KEY"); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Configuration.Default.AddApiKeyPrefix("api_key", "Bearer"); - var apiInstance = new StoreApi(); + var apiInstance = new StoreApi(Configuration.Default); try { // Returns pet inventories by status - Dictionary<string, int?> result = apiInstance.GetInventory(); + Dictionary result = apiInstance.GetInventory(); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling StoreApi.GetInventory: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -139,6 +151,11 @@ This endpoint does not need any parameter. - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -156,7 +173,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -166,9 +183,10 @@ namespace Example { public class GetOrderByIdExample { - public void main() + public static void Main() { - var apiInstance = new StoreApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(Configuration.Default); var orderId = 789; // long? | ID of pet that needs to be fetched try @@ -177,9 +195,11 @@ namespace Example Order result = apiInstance.GetOrderById(orderId); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling StoreApi.GetOrderById: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -206,6 +226,13 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -221,7 +248,7 @@ Place an order for a pet ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -231,9 +258,10 @@ namespace Example { public class PlaceOrderExample { - public void main() + public static void Main() { - var apiInstance = new StoreApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(Configuration.Default); var body = new Order(); // Order | order placed for purchasing the pet try @@ -242,9 +270,11 @@ namespace Example Order result = apiInstance.PlaceOrder(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling StoreApi.PlaceOrder: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -271,6 +301,12 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid Order | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/UserApi.md b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/UserApi.md index b9f592bdd710..1385d840413c 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/UserApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/UserApi.md @@ -26,7 +26,7 @@ This can only be done by the logged in user. ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -36,9 +36,10 @@ namespace Example { public class CreateUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var body = new User(); // User | Created user object try @@ -46,9 +47,11 @@ namespace Example // Create user apiInstance.CreateUser(body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.CreateUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -75,6 +78,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -90,7 +98,7 @@ Creates list of users with given input array ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -100,9 +108,10 @@ namespace Example { public class CreateUsersWithArrayInputExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var body = new List(); // List | List of user object try @@ -110,9 +119,11 @@ namespace Example // Creates list of users with given input array apiInstance.CreateUsersWithArrayInput(body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.CreateUsersWithArrayInput: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -124,7 +135,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type @@ -139,6 +150,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -154,7 +170,7 @@ Creates list of users with given input array ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -164,9 +180,10 @@ namespace Example { public class CreateUsersWithListInputExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var body = new List(); // List | List of user object try @@ -174,9 +191,11 @@ namespace Example // Creates list of users with given input array apiInstance.CreateUsersWithListInput(body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.CreateUsersWithListInput: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -188,7 +207,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type @@ -203,6 +222,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -220,7 +244,7 @@ This can only be done by the logged in user. ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -230,9 +254,10 @@ namespace Example { public class DeleteUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var username = username_example; // string | The name that needs to be deleted try @@ -240,9 +265,11 @@ namespace Example // Delete user apiInstance.DeleteUser(username); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.DeleteUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -269,6 +296,12 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -284,7 +317,7 @@ Get user by user name ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -294,9 +327,10 @@ namespace Example { public class GetUserByNameExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var username = username_example; // string | The name that needs to be fetched. Use user1 for testing. try @@ -305,9 +339,11 @@ namespace Example User result = apiInstance.GetUserByName(username); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.GetUserByName: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -334,6 +370,13 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -349,7 +392,7 @@ Logs user into the system ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -359,9 +402,10 @@ namespace Example { public class LoginUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var username = username_example; // string | The user name for login var password = password_example; // string | The password for login in clear text @@ -371,9 +415,11 @@ namespace Example string result = apiInstance.LoginUser(username, password); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.LoginUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -401,6 +447,12 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
| +| **400** | Invalid username/password supplied | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -416,7 +468,7 @@ Logs out current logged in user session ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -426,18 +478,21 @@ namespace Example { public class LogoutUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); try { // Logs out current logged in user session apiInstance.LogoutUser(); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.LogoutUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -461,6 +516,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -478,7 +538,7 @@ This can only be done by the logged in user. ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -488,9 +548,10 @@ namespace Example { public class UpdateUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var username = username_example; // string | name that need to be deleted var body = new User(); // User | Updated user object @@ -499,9 +560,11 @@ namespace Example // Updated user apiInstance.UpdateUser(username, body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.UpdateUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -529,6 +592,12 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid user supplied | - | +| **404** | User not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/.openapi-generator/VERSION b/samples/client/petstore/csharp/OpenAPIClientNet40/.openapi-generator/VERSION index 06b5019af3f4..83a328a9227e 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.1-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/README.md b/samples/client/petstore/csharp/OpenAPIClientNet40/README.md index 6319d9193e9a..dcdb39631c54 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/README.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/README.md @@ -64,7 +64,7 @@ Then, publish to a [local feed](https://docs.microsoft.com/en-us/nuget/hosting-p ## Getting Started ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -74,10 +74,11 @@ namespace Example { public class Example { - public void main() + public static void Main() { - var apiInstance = new AnotherFakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new AnotherFakeApi(Configuration.Default); var body = new ModelClient(); // ModelClient | client model try @@ -86,9 +87,11 @@ namespace Example ModelClient result = apiInstance.Call123TestSpecialTags(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling AnotherFakeApi.Call123TestSpecialTags: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/AnotherFakeApi.md b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/AnotherFakeApi.md index d13566caf343..5af41a1862c2 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/AnotherFakeApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/AnotherFakeApi.md @@ -19,7 +19,7 @@ To test special tags and operation ID starting with number ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -29,9 +29,10 @@ namespace Example { public class Call123TestSpecialTagsExample { - public void main() + public static void Main() { - var apiInstance = new AnotherFakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new AnotherFakeApi(Configuration.Default); var body = new ModelClient(); // ModelClient | client model try @@ -40,9 +41,11 @@ namespace Example ModelClient result = apiInstance.Call123TestSpecialTags(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling AnotherFakeApi.Call123TestSpecialTags: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -69,6 +72,11 @@ No authorization required - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/FakeApi.md b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/FakeApi.md index a2284ba8f3e7..8a53b02b5e1e 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/FakeApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/FakeApi.md @@ -31,7 +31,7 @@ this route creates an XmlItem ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -41,9 +41,10 @@ namespace Example { public class CreateXmlItemExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var xmlItem = new XmlItem(); // XmlItem | XmlItem Body try @@ -51,9 +52,11 @@ namespace Example // creates an XmlItem apiInstance.CreateXmlItem(xmlItem); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.CreateXmlItem: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -80,6 +83,11 @@ No authorization required - **Content-Type**: application/xml, application/xml; charset=utf-8, application/xml; charset=utf-16, text/xml, text/xml; charset=utf-8, text/xml; charset=utf-16 - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -97,7 +105,7 @@ Test serialization of outer boolean types ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -107,9 +115,10 @@ namespace Example { public class FakeOuterBooleanSerializeExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var body = true; // bool? | Input boolean as post body (optional) try @@ -117,9 +126,11 @@ namespace Example bool? result = apiInstance.FakeOuterBooleanSerialize(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.FakeOuterBooleanSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -146,6 +157,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: */* +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output boolean | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -163,7 +179,7 @@ Test serialization of object with outer number type ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -173,9 +189,10 @@ namespace Example { public class FakeOuterCompositeSerializeExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var body = new OuterComposite(); // OuterComposite | Input composite as post body (optional) try @@ -183,9 +200,11 @@ namespace Example OuterComposite result = apiInstance.FakeOuterCompositeSerialize(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.FakeOuterCompositeSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -212,6 +231,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: */* +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output composite | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -229,7 +253,7 @@ Test serialization of outer number types ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -239,9 +263,10 @@ namespace Example { public class FakeOuterNumberSerializeExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var body = 8.14; // decimal? | Input number as post body (optional) try @@ -249,9 +274,11 @@ namespace Example decimal? result = apiInstance.FakeOuterNumberSerialize(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.FakeOuterNumberSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -278,6 +305,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: */* +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output number | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -295,7 +327,7 @@ Test serialization of outer string types ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -305,9 +337,10 @@ namespace Example { public class FakeOuterStringSerializeExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var body = body_example; // string | Input string as post body (optional) try @@ -315,9 +348,11 @@ namespace Example string result = apiInstance.FakeOuterStringSerialize(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.FakeOuterStringSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -344,6 +379,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: */* +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output string | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -361,7 +401,7 @@ For this test, the body for this request much reference a schema named `File`. ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -371,18 +411,21 @@ namespace Example { public class TestBodyWithFileSchemaExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var body = new FileSchemaTestClass(); // FileSchemaTestClass | try { apiInstance.TestBodyWithFileSchema(body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestBodyWithFileSchema: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -409,6 +452,11 @@ No authorization required - **Content-Type**: application/json - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -424,7 +472,7 @@ No authorization required ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -434,9 +482,10 @@ namespace Example { public class TestBodyWithQueryParamsExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var query = query_example; // string | var body = new User(); // User | @@ -444,9 +493,11 @@ namespace Example { apiInstance.TestBodyWithQueryParams(query, body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestBodyWithQueryParams: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -474,6 +525,11 @@ No authorization required - **Content-Type**: application/json - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -491,7 +547,7 @@ To test \"client\" model ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -501,9 +557,10 @@ namespace Example { public class TestClientModelExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var body = new ModelClient(); // ModelClient | client model try @@ -512,9 +569,11 @@ namespace Example ModelClient result = apiInstance.TestClientModel(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestClientModel: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -541,6 +600,11 @@ No authorization required - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -558,7 +622,7 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -568,13 +632,14 @@ namespace Example { public class TestEndpointParametersExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure HTTP basic authorization: http_basic_test Configuration.Default.Username = "YOUR_USERNAME"; Configuration.Default.Password = "YOUR_PASSWORD"; - var apiInstance = new FakeApi(); + var apiInstance = new FakeApi(Configuration.Default); var number = 8.14; // decimal? | None var _double = 1.2D; // double? | None var patternWithoutDelimiter = patternWithoutDelimiter_example; // string | None @@ -595,9 +660,11 @@ namespace Example // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 apiInstance.TestEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestEndpointParameters: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -637,6 +704,12 @@ void (empty response body) - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -654,7 +727,7 @@ To test enum parameters ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -664,9 +737,10 @@ namespace Example { public class TestEnumParametersExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var enumHeaderStringArray = enumHeaderStringArray_example; // List | Header parameter enum test (string array) (optional) var enumHeaderString = enumHeaderString_example; // string | Header parameter enum test (string) (optional) (default to -efg) var enumQueryStringArray = enumQueryStringArray_example; // List | Query parameter enum test (string array) (optional) @@ -681,9 +755,11 @@ namespace Example // To test enum parameters apiInstance.TestEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestEnumParameters: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -717,6 +793,12 @@ No authorization required - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid request | - | +| **404** | Not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -734,7 +816,7 @@ Fake endpoint to test group parameters (optional) ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -744,9 +826,10 @@ namespace Example { public class TestGroupParametersExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var requiredStringGroup = 56; // int? | Required String in group parameters var requiredBooleanGroup = true; // bool? | Required Boolean in group parameters var requiredInt64Group = 789; // long? | Required Integer in group parameters @@ -759,9 +842,11 @@ namespace Example // Fake endpoint to test group parameters (optional) apiInstance.TestGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestGroupParameters: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -793,6 +878,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Someting wrong | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -808,7 +898,7 @@ test inline additionalProperties ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -818,9 +908,10 @@ namespace Example { public class TestInlineAdditionalPropertiesExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var param = new Dictionary(); // Dictionary | request body try @@ -828,9 +919,11 @@ namespace Example // test inline additionalProperties apiInstance.TestInlineAdditionalProperties(param); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestInlineAdditionalProperties: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -857,6 +950,11 @@ No authorization required - **Content-Type**: application/json - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -872,7 +970,7 @@ test json serialization of form data ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -882,9 +980,10 @@ namespace Example { public class TestJsonFormDataExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var param = param_example; // string | field1 var param2 = param2_example; // string | field2 @@ -893,9 +992,11 @@ namespace Example // test json serialization of form data apiInstance.TestJsonFormData(param, param2); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestJsonFormData: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -923,6 +1024,11 @@ No authorization required - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/FakeClassnameTags123Api.md b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/FakeClassnameTags123Api.md index cc0cd83d12ca..deb97a27697f 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/FakeClassnameTags123Api.md @@ -19,7 +19,7 @@ To test class name in snake case ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -29,14 +29,15 @@ namespace Example { public class TestClassnameExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure API key authorization: api_key_query Configuration.Default.AddApiKey("api_key_query", "YOUR_API_KEY"); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Configuration.Default.AddApiKeyPrefix("api_key_query", "Bearer"); - var apiInstance = new FakeClassnameTags123Api(); + var apiInstance = new FakeClassnameTags123Api(Configuration.Default); var body = new ModelClient(); // ModelClient | client model try @@ -45,9 +46,11 @@ namespace Example ModelClient result = apiInstance.TestClassname(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeClassnameTags123Api.TestClassname: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -74,6 +77,11 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/PetApi.md b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/PetApi.md index d2e2075bfd7b..c45dd7854a73 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/PetApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/PetApi.md @@ -25,7 +25,7 @@ Add a new pet to the store ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -35,12 +35,13 @@ namespace Example { public class AddPetExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var body = new Pet(); // Pet | Pet object that needs to be added to the store try @@ -48,9 +49,11 @@ namespace Example // Add a new pet to the store apiInstance.AddPet(body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.AddPet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -77,6 +80,12 @@ void (empty response body) - **Content-Type**: application/json, application/xml - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **405** | Invalid input | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -92,7 +101,7 @@ Deletes a pet ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -102,12 +111,13 @@ namespace Example { public class DeletePetExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var petId = 789; // long? | Pet id to delete var apiKey = apiKey_example; // string | (optional) @@ -116,9 +126,11 @@ namespace Example // Deletes a pet apiInstance.DeletePet(petId, apiKey); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.DeletePet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -146,6 +158,12 @@ void (empty response body) - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid pet value | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -154,7 +172,7 @@ void (empty response body) ## FindPetsByStatus -> List FindPetsByStatus (List status) +> List<Pet> FindPetsByStatus (List status) Finds Pets by status @@ -163,7 +181,7 @@ Multiple status values can be provided with comma separated strings ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -173,23 +191,26 @@ namespace Example { public class FindPetsByStatusExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var status = status_example; // List | Status values that need to be considered for filter try { // Finds Pets by status - List<Pet> result = apiInstance.FindPetsByStatus(status); + List result = apiInstance.FindPetsByStatus(status); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.FindPetsByStatus: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -205,7 +226,7 @@ Name | Type | Description | Notes ### Return type -[**List**](Pet.md) +[**List<Pet>**](Pet.md) ### Authorization @@ -216,6 +237,12 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid status value | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -224,7 +251,7 @@ Name | Type | Description | Notes ## FindPetsByTags -> List FindPetsByTags (List tags) +> List<Pet> FindPetsByTags (List tags) Finds Pets by tags @@ -233,7 +260,7 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -243,23 +270,26 @@ namespace Example { public class FindPetsByTagsExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var tags = new List(); // List | Tags to filter by try { // Finds Pets by tags - List<Pet> result = apiInstance.FindPetsByTags(tags); + List result = apiInstance.FindPetsByTags(tags); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.FindPetsByTags: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -275,7 +305,7 @@ Name | Type | Description | Notes ### Return type -[**List**](Pet.md) +[**List<Pet>**](Pet.md) ### Authorization @@ -286,6 +316,12 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid tag value | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -303,7 +339,7 @@ Returns a single pet ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -313,14 +349,15 @@ namespace Example { public class GetPetByIdExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure API key authorization: api_key Configuration.Default.AddApiKey("api_key", "YOUR_API_KEY"); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Configuration.Default.AddApiKeyPrefix("api_key", "Bearer"); - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var petId = 789; // long? | ID of pet to return try @@ -329,9 +366,11 @@ namespace Example Pet result = apiInstance.GetPetById(petId); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.GetPetById: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -358,6 +397,13 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -373,7 +419,7 @@ Update an existing pet ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -383,12 +429,13 @@ namespace Example { public class UpdatePetExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var body = new Pet(); // Pet | Pet object that needs to be added to the store try @@ -396,9 +443,11 @@ namespace Example // Update an existing pet apiInstance.UpdatePet(body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.UpdatePet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -425,6 +474,14 @@ void (empty response body) - **Content-Type**: application/json, application/xml - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | +| **405** | Validation exception | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -440,7 +497,7 @@ Updates a pet in the store with form data ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -450,12 +507,13 @@ namespace Example { public class UpdatePetWithFormExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var petId = 789; // long? | ID of pet that needs to be updated var name = name_example; // string | Updated name of the pet (optional) var status = status_example; // string | Updated status of the pet (optional) @@ -465,9 +523,11 @@ namespace Example // Updates a pet in the store with form data apiInstance.UpdatePetWithForm(petId, name, status); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.UpdatePetWithForm: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -496,6 +556,11 @@ void (empty response body) - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **405** | Invalid input | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -511,7 +576,7 @@ uploads an image ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -521,12 +586,13 @@ namespace Example { public class UploadFileExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var petId = 789; // long? | ID of pet to update var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional) var file = BINARY_DATA_HERE; // System.IO.Stream | file to upload (optional) @@ -537,9 +603,11 @@ namespace Example ApiResponse result = apiInstance.UploadFile(petId, additionalMetadata, file); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.UploadFile: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -568,6 +636,11 @@ Name | Type | Description | Notes - **Content-Type**: multipart/form-data - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -583,7 +656,7 @@ uploads an image (required) ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -593,12 +666,13 @@ namespace Example { public class UploadFileWithRequiredFileExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var petId = 789; // long? | ID of pet to update var requiredFile = BINARY_DATA_HERE; // System.IO.Stream | file to upload var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional) @@ -609,9 +683,11 @@ namespace Example ApiResponse result = apiInstance.UploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.UploadFileWithRequiredFile: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -640,6 +716,11 @@ Name | Type | Description | Notes - **Content-Type**: multipart/form-data - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/StoreApi.md b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/StoreApi.md index 0f6d9e4e3dc2..b4dc72258a05 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/StoreApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/StoreApi.md @@ -22,7 +22,7 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -32,9 +32,10 @@ namespace Example { public class DeleteOrderExample { - public void main() + public static void Main() { - var apiInstance = new StoreApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(Configuration.Default); var orderId = orderId_example; // string | ID of the order that needs to be deleted try @@ -42,9 +43,11 @@ namespace Example // Delete purchase order by ID apiInstance.DeleteOrder(orderId); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling StoreApi.DeleteOrder: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -71,6 +74,12 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -79,7 +88,7 @@ No authorization required ## GetInventory -> Dictionary GetInventory () +> Dictionary<string, int?> GetInventory () Returns pet inventories by status @@ -88,7 +97,7 @@ Returns a map of status codes to quantities ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -98,24 +107,27 @@ namespace Example { public class GetInventoryExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure API key authorization: api_key Configuration.Default.AddApiKey("api_key", "YOUR_API_KEY"); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Configuration.Default.AddApiKeyPrefix("api_key", "Bearer"); - var apiInstance = new StoreApi(); + var apiInstance = new StoreApi(Configuration.Default); try { // Returns pet inventories by status - Dictionary<string, int?> result = apiInstance.GetInventory(); + Dictionary result = apiInstance.GetInventory(); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling StoreApi.GetInventory: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -139,6 +151,11 @@ This endpoint does not need any parameter. - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -156,7 +173,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -166,9 +183,10 @@ namespace Example { public class GetOrderByIdExample { - public void main() + public static void Main() { - var apiInstance = new StoreApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(Configuration.Default); var orderId = 789; // long? | ID of pet that needs to be fetched try @@ -177,9 +195,11 @@ namespace Example Order result = apiInstance.GetOrderById(orderId); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling StoreApi.GetOrderById: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -206,6 +226,13 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -221,7 +248,7 @@ Place an order for a pet ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -231,9 +258,10 @@ namespace Example { public class PlaceOrderExample { - public void main() + public static void Main() { - var apiInstance = new StoreApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(Configuration.Default); var body = new Order(); // Order | order placed for purchasing the pet try @@ -242,9 +270,11 @@ namespace Example Order result = apiInstance.PlaceOrder(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling StoreApi.PlaceOrder: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -271,6 +301,12 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid Order | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/UserApi.md b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/UserApi.md index b9f592bdd710..1385d840413c 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/UserApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/UserApi.md @@ -26,7 +26,7 @@ This can only be done by the logged in user. ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -36,9 +36,10 @@ namespace Example { public class CreateUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var body = new User(); // User | Created user object try @@ -46,9 +47,11 @@ namespace Example // Create user apiInstance.CreateUser(body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.CreateUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -75,6 +78,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -90,7 +98,7 @@ Creates list of users with given input array ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -100,9 +108,10 @@ namespace Example { public class CreateUsersWithArrayInputExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var body = new List(); // List | List of user object try @@ -110,9 +119,11 @@ namespace Example // Creates list of users with given input array apiInstance.CreateUsersWithArrayInput(body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.CreateUsersWithArrayInput: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -124,7 +135,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type @@ -139,6 +150,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -154,7 +170,7 @@ Creates list of users with given input array ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -164,9 +180,10 @@ namespace Example { public class CreateUsersWithListInputExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var body = new List(); // List | List of user object try @@ -174,9 +191,11 @@ namespace Example // Creates list of users with given input array apiInstance.CreateUsersWithListInput(body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.CreateUsersWithListInput: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -188,7 +207,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type @@ -203,6 +222,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -220,7 +244,7 @@ This can only be done by the logged in user. ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -230,9 +254,10 @@ namespace Example { public class DeleteUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var username = username_example; // string | The name that needs to be deleted try @@ -240,9 +265,11 @@ namespace Example // Delete user apiInstance.DeleteUser(username); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.DeleteUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -269,6 +296,12 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -284,7 +317,7 @@ Get user by user name ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -294,9 +327,10 @@ namespace Example { public class GetUserByNameExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var username = username_example; // string | The name that needs to be fetched. Use user1 for testing. try @@ -305,9 +339,11 @@ namespace Example User result = apiInstance.GetUserByName(username); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.GetUserByName: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -334,6 +370,13 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -349,7 +392,7 @@ Logs user into the system ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -359,9 +402,10 @@ namespace Example { public class LoginUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var username = username_example; // string | The user name for login var password = password_example; // string | The password for login in clear text @@ -371,9 +415,11 @@ namespace Example string result = apiInstance.LoginUser(username, password); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.LoginUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -401,6 +447,12 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
| +| **400** | Invalid username/password supplied | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -416,7 +468,7 @@ Logs out current logged in user session ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -426,18 +478,21 @@ namespace Example { public class LogoutUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); try { // Logs out current logged in user session apiInstance.LogoutUser(); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.LogoutUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -461,6 +516,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -478,7 +538,7 @@ This can only be done by the logged in user. ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -488,9 +548,10 @@ namespace Example { public class UpdateUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var username = username_example; // string | name that need to be deleted var body = new User(); // User | Updated user object @@ -499,9 +560,11 @@ namespace Example // Updated user apiInstance.UpdateUser(username, body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.UpdateUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -529,6 +592,12 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid user supplied | - | +| **404** | User not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/.openapi-generator/VERSION b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/.openapi-generator/VERSION index 096bf47efe31..83a328a9227e 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.0-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/README.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/README.md index 2676c56acc9e..260c3df449ad 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/README.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/README.md @@ -8,34 +8,39 @@ This C# SDK is automatically generated by the [OpenAPI Generator](https://openap - SDK version: 1.0.0 - Build package: org.openapitools.codegen.languages.CSharpClientCodegen - ## Frameworks supported + + - .NET Core >=1.0 - .NET Framework >=4.6 - Mono/Xamarin >=vNext - UWP >=10.0 - ## Dependencies + + - FubarCoder.RestSharp.Portable.Core >=4.0.7 - FubarCoder.RestSharp.Portable.HttpClient >=4.0.7 - Newtonsoft.Json >=10.0.3 - ## Installation + Generate the DLL using your preferred tool Then include the DLL (under the `bin` folder) in the C# project, and use the namespaces: + ```csharp using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; using Org.OpenAPITools.Model; + ``` - + + ## Getting Started ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -45,21 +50,24 @@ namespace Example { public class Example { - public void main() + public static void Main() { - var apiInstance = new AnotherFakeApi(); - var modelClient = new ModelClient(); // ModelClient | client model + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new AnotherFakeApi(Configuration.Default); + var body = new ModelClient(); // ModelClient | client model try { // To test special tags - ModelClient result = apiInstance.TestSpecialTags(modelClient); + ModelClient result = apiInstance.Call123TestSpecialTags(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { - Debug.Print("Exception when calling AnotherFakeApi.TestSpecialTags: " + e.Message ); + Debug.Print("Exception when calling AnotherFakeApi.Call123TestSpecialTags: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } @@ -67,22 +75,24 @@ namespace Example } ``` - ## Documentation for API Endpoints All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*AnotherFakeApi* | [**TestSpecialTags**](docs/AnotherFakeApi.md#testspecialtags) | **PATCH** /another-fake/dummy | To test special tags +*AnotherFakeApi* | [**Call123TestSpecialTags**](docs/AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags +*FakeApi* | [**CreateXmlItem**](docs/FakeApi.md#createxmlitem) | **POST** /fake/create_xml_item | creates an XmlItem *FakeApi* | [**FakeOuterBooleanSerialize**](docs/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | *FakeApi* | [**FakeOuterCompositeSerialize**](docs/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | *FakeApi* | [**FakeOuterNumberSerialize**](docs/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | *FakeApi* | [**FakeOuterStringSerialize**](docs/FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | +*FakeApi* | [**TestBodyWithFileSchema**](docs/FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | *FakeApi* | [**TestBodyWithQueryParams**](docs/FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | *FakeApi* | [**TestClientModel**](docs/FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model *FakeApi* | [**TestEndpointParameters**](docs/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeApi* | [**TestEnumParameters**](docs/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters +*FakeApi* | [**TestGroupParameters**](docs/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**TestInlineAdditionalProperties**](docs/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties *FakeApi* | [**TestJsonFormData**](docs/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data *FakeClassnameTags123Api* | [**TestClassname**](docs/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case @@ -94,6 +104,7 @@ Class | Method | HTTP request | Description *PetApi* | [**UpdatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet *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 +*PetApi* | [**UploadFileWithRequiredFile**](docs/PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) *StoreApi* | [**DeleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID *StoreApi* | [**GetInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status *StoreApi* | [**GetOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID @@ -108,24 +119,33 @@ Class | Method | HTTP request | Description *UserApi* | [**UpdateUser**](docs/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user - ## Documentation for Models + - [Model.AdditionalPropertiesAnyType](docs/AdditionalPropertiesAnyType.md) + - [Model.AdditionalPropertiesArray](docs/AdditionalPropertiesArray.md) + - [Model.AdditionalPropertiesBoolean](docs/AdditionalPropertiesBoolean.md) - [Model.AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) + - [Model.AdditionalPropertiesInteger](docs/AdditionalPropertiesInteger.md) + - [Model.AdditionalPropertiesNumber](docs/AdditionalPropertiesNumber.md) + - [Model.AdditionalPropertiesObject](docs/AdditionalPropertiesObject.md) + - [Model.AdditionalPropertiesString](docs/AdditionalPropertiesString.md) - [Model.Animal](docs/Animal.md) - - [Model.AnimalFarm](docs/AnimalFarm.md) - [Model.ApiResponse](docs/ApiResponse.md) - [Model.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - [Model.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [Model.ArrayTest](docs/ArrayTest.md) - [Model.Capitalization](docs/Capitalization.md) - [Model.Cat](docs/Cat.md) + - [Model.CatAllOf](docs/CatAllOf.md) - [Model.Category](docs/Category.md) - [Model.ClassModel](docs/ClassModel.md) - [Model.Dog](docs/Dog.md) + - [Model.DogAllOf](docs/DogAllOf.md) - [Model.EnumArrays](docs/EnumArrays.md) - [Model.EnumClass](docs/EnumClass.md) - [Model.EnumTest](docs/EnumTest.md) + - [Model.File](docs/File.md) + - [Model.FileSchemaTestClass](docs/FileSchemaTestClass.md) - [Model.FormatTest](docs/FormatTest.md) - [Model.HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - [Model.List](docs/List.md) @@ -143,34 +163,40 @@ Class | Method | HTTP request | Description - [Model.Return](docs/Return.md) - [Model.SpecialModelName](docs/SpecialModelName.md) - [Model.Tag](docs/Tag.md) + - [Model.TypeHolderDefault](docs/TypeHolderDefault.md) + - [Model.TypeHolderExample](docs/TypeHolderExample.md) - [Model.User](docs/User.md) + - [Model.XmlItem](docs/XmlItem.md) - ## Documentation for Authorization - + ### api_key - **Type**: API key + - **API key parameter name**: api_key - **Location**: HTTP header - + ### api_key_query - **Type**: API key + - **API key parameter name**: api_key_query - **Location**: URL query string - + ### http_basic_test + - **Type**: HTTP basic authentication - + ### petstore_auth + - **Type**: OAuth - **Flow**: implicit - **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesAnyType.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesAnyType.md new file mode 100644 index 000000000000..fd118d3bfc5e --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesAnyType.md @@ -0,0 +1,13 @@ + +# Org.OpenAPITools.Model.AdditionalPropertiesAnyType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesArray.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesArray.md new file mode 100644 index 000000000000..3d0606cea5f0 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesArray.md @@ -0,0 +1,13 @@ + +# Org.OpenAPITools.Model.AdditionalPropertiesArray + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesBoolean.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesBoolean.md new file mode 100644 index 000000000000..bb4b2498263f --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesBoolean.md @@ -0,0 +1,13 @@ + +# Org.OpenAPITools.Model.AdditionalPropertiesBoolean + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesClass.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesClass.md index 057f5bd65dfc..32d7ffc76537 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesClass.md @@ -1,10 +1,23 @@ + # Org.OpenAPITools.Model.AdditionalPropertiesClass + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**MapProperty** | **Dictionary<string, string>** | | [optional] -**MapOfMapProperty** | **Dictionary<string, Dictionary<string, string>>** | | [optional] +**MapString** | **Dictionary<string, string>** | | [optional] +**MapNumber** | **Dictionary<string, decimal?>** | | [optional] +**MapInteger** | **Dictionary<string, int?>** | | [optional] +**MapBoolean** | **Dictionary<string, bool?>** | | [optional] +**MapArrayInteger** | **Dictionary<string, List<int?>>** | | [optional] +**MapArrayAnytype** | **Dictionary<string, List<Object>>** | | [optional] +**MapMapString** | **Dictionary<string, Dictionary<string, string>>** | | [optional] +**MapMapAnytype** | **Dictionary<string, Dictionary<string, Object>>** | | [optional] +**Anytype1** | [**Object**](.md) | | [optional] +**Anytype2** | [**Object**](.md) | | [optional] +**Anytype3** | [**Object**](.md) | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesInteger.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesInteger.md new file mode 100644 index 000000000000..86a6259ecc96 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesInteger.md @@ -0,0 +1,13 @@ + +# Org.OpenAPITools.Model.AdditionalPropertiesInteger + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesNumber.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesNumber.md new file mode 100644 index 000000000000..8dc46024e037 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesNumber.md @@ -0,0 +1,13 @@ + +# Org.OpenAPITools.Model.AdditionalPropertiesNumber + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesObject.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesObject.md new file mode 100644 index 000000000000..455456fe6dd5 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesObject.md @@ -0,0 +1,13 @@ + +# Org.OpenAPITools.Model.AdditionalPropertiesObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesString.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesString.md new file mode 100644 index 000000000000..0f7cf8041672 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesString.md @@ -0,0 +1,13 @@ + +# Org.OpenAPITools.Model.AdditionalPropertiesString + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Animal.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Animal.md index a97ce49b8018..0a05bcdf0616 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Animal.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Animal.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.Animal + ## Properties Name | Type | Description | Notes @@ -6,5 +8,7 @@ Name | Type | Description | Notes **ClassName** | **string** | | **Color** | **string** | | [optional] [default to "red"] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AnotherFakeApi.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AnotherFakeApi.md index 2dca444f2768..5af41a1862c2 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AnotherFakeApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AnotherFakeApi.md @@ -4,20 +4,22 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**TestSpecialTags**](AnotherFakeApi.md#testspecialtags) | **PATCH** /another-fake/dummy | To test special tags +[**Call123TestSpecialTags**](AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags - -# **TestSpecialTags** -> ModelClient TestSpecialTags (ModelClient modelClient) -To test special tags +## Call123TestSpecialTags + +> ModelClient Call123TestSpecialTags (ModelClient body) To test special tags +To test special tags and operation ID starting with number + ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -25,22 +27,25 @@ using Org.OpenAPITools.Model; namespace Example { - public class TestSpecialTagsExample + public class Call123TestSpecialTagsExample { - public void main() + public static void Main() { - var apiInstance = new AnotherFakeApi(); - var modelClient = new ModelClient(); // ModelClient | client model + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new AnotherFakeApi(Configuration.Default); + var body = new ModelClient(); // ModelClient | client model try { // To test special tags - ModelClient result = apiInstance.TestSpecialTags(modelClient); + ModelClient result = apiInstance.Call123TestSpecialTags(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { - Debug.Print("Exception when calling AnotherFakeApi.TestSpecialTags: " + e.Message ); + Debug.Print("Exception when calling AnotherFakeApi.Call123TestSpecialTags: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -49,9 +54,10 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **modelClient** | [**ModelClient**](ModelClient.md)| client model | + **body** | [**ModelClient**](ModelClient.md)| client model | ### Return type @@ -63,8 +69,16 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/ApiResponse.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/ApiResponse.md index 01b35815bd40..e16dea75cc2e 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/ApiResponse.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/ApiResponse.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.ApiResponse + ## Properties Name | Type | Description | Notes @@ -7,5 +9,7 @@ Name | Type | Description | Notes **Type** | **string** | | [optional] **Message** | **string** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/ArrayOfArrayOfNumberOnly.md index 614546d32564..12616c6718b9 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/ArrayOfArrayOfNumberOnly.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/ArrayOfArrayOfNumberOnly.md @@ -1,9 +1,13 @@ + # Org.OpenAPITools.Model.ArrayOfArrayOfNumberOnly + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **ArrayArrayNumber** | **List<List<decimal?>>** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/ArrayOfNumberOnly.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/ArrayOfNumberOnly.md index 1886a6edcb46..04facf7d5d1b 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/ArrayOfNumberOnly.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/ArrayOfNumberOnly.md @@ -1,9 +1,13 @@ + # Org.OpenAPITools.Model.ArrayOfNumberOnly + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **ArrayNumber** | **List<decimal?>** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/ArrayTest.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/ArrayTest.md index ff6a6cb24b0e..9c297f062a99 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/ArrayTest.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/ArrayTest.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.ArrayTest + ## Properties Name | Type | Description | Notes @@ -7,5 +9,7 @@ Name | Type | Description | Notes **ArrayArrayOfInteger** | **List<List<long?>>** | | [optional] **ArrayArrayOfModel** | **List<List<ReadOnlyFirst>>** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Capitalization.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Capitalization.md index 74c1ab66db29..0c66f2d2d440 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Capitalization.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Capitalization.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.Capitalization + ## Properties Name | Type | Description | Notes @@ -10,5 +12,7 @@ Name | Type | Description | Notes **SCAETHFlowPoints** | **string** | | [optional] **ATT_NAME** | **string** | Name of the pet | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Cat.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Cat.md index 4b79315204f3..4545a1243692 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Cat.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Cat.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.Cat + ## Properties Name | Type | Description | Notes @@ -7,5 +9,7 @@ Name | Type | Description | Notes **Color** | **string** | | [optional] [default to "red"] **Declawed** | **bool?** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/CatAllOf.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/CatAllOf.md new file mode 100644 index 000000000000..1a6307604551 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/CatAllOf.md @@ -0,0 +1,13 @@ + +# Org.OpenAPITools.Model.CatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Declawed** | **bool?** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Category.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Category.md index 860a468e35c8..87ad855ca6f7 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Category.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Category.md @@ -1,10 +1,14 @@ + # Org.OpenAPITools.Model.Category + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Id** | **long?** | | [optional] -**Name** | **string** | | [optional] +**Name** | **string** | | [default to "default-name"] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/ClassModel.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/ClassModel.md index 556b05db2410..b2b42407d2b0 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/ClassModel.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/ClassModel.md @@ -1,9 +1,13 @@ + # Org.OpenAPITools.Model.ClassModel + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Class** | **string** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Dog.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Dog.md index aa5df1a927a1..1f39769d2b93 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Dog.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Dog.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.Dog + ## Properties Name | Type | Description | Notes @@ -7,5 +9,7 @@ Name | Type | Description | Notes **Color** | **string** | | [optional] [default to "red"] **Breed** | **string** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/DogAllOf.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/DogAllOf.md new file mode 100644 index 000000000000..d72134a0f5f6 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/DogAllOf.md @@ -0,0 +1,13 @@ + +# Org.OpenAPITools.Model.DogAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Breed** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/EnumArrays.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/EnumArrays.md index 2dfe0e223884..9d58d25f9729 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/EnumArrays.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/EnumArrays.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.EnumArrays + ## Properties Name | Type | Description | Notes @@ -6,5 +8,7 @@ Name | Type | Description | Notes **JustSymbol** | **string** | | [optional] **ArrayEnum** | **List<string>** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/EnumClass.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/EnumClass.md index 4fb1eae9c066..16d21587b4c8 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/EnumClass.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/EnumClass.md @@ -1,8 +1,12 @@ + # Org.OpenAPITools.Model.EnumClass + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/EnumTest.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/EnumTest.md index 65bc4d2cb044..8e213c3335f9 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/EnumTest.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/EnumTest.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.EnumTest + ## Properties Name | Type | Description | Notes @@ -9,5 +11,7 @@ Name | Type | Description | Notes **EnumNumber** | **double?** | | [optional] **OuterEnum** | **OuterEnum** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/FakeApi.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/FakeApi.md index 2a4fb6094ae0..8a53b02b5e1e 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/FakeApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/FakeApi.md @@ -4,20 +4,98 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- +[**CreateXmlItem**](FakeApi.md#createxmlitem) | **POST** /fake/create_xml_item | creates an XmlItem [**FakeOuterBooleanSerialize**](FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | [**FakeOuterCompositeSerialize**](FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | [**FakeOuterNumberSerialize**](FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | [**FakeOuterStringSerialize**](FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | +[**TestBodyWithFileSchema**](FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | [**TestBodyWithQueryParams**](FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | [**TestClientModel**](FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model [**TestEndpointParameters**](FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**TestEnumParameters**](FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters +[**TestGroupParameters**](FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**TestInlineAdditionalProperties**](FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**TestJsonFormData**](FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data - -# **FakeOuterBooleanSerialize** + +## CreateXmlItem + +> void CreateXmlItem (XmlItem xmlItem) + +creates an XmlItem + +this route creates an XmlItem + +### Example + +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class CreateXmlItemExample + { + public static void Main() + { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); + var xmlItem = new XmlItem(); // XmlItem | XmlItem Body + + try + { + // creates an XmlItem + apiInstance.CreateXmlItem(xmlItem); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.CreateXmlItem: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xmlItem** | [**XmlItem**](XmlItem.md)| XmlItem Body | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/xml, application/xml; charset=utf-8, application/xml; charset=utf-16, text/xml, text/xml; charset=utf-8, text/xml; charset=utf-16 +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FakeOuterBooleanSerialize + > bool? FakeOuterBooleanSerialize (bool? body = null) @@ -25,8 +103,9 @@ Method | HTTP request | Description Test serialization of outer boolean types ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -36,9 +115,10 @@ namespace Example { public class FakeOuterBooleanSerializeExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var body = true; // bool? | Input boolean as post body (optional) try @@ -46,9 +126,11 @@ namespace Example bool? result = apiInstance.FakeOuterBooleanSerialize(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.FakeOuterBooleanSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -57,6 +139,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | **bool?**| Input boolean as post body | [optional] @@ -71,22 +154,32 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: */* +- **Content-Type**: Not defined +- **Accept**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output boolean | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +## FakeOuterCompositeSerialize - -# **FakeOuterCompositeSerialize** -> OuterComposite FakeOuterCompositeSerialize (OuterComposite outerComposite = null) +> OuterComposite FakeOuterCompositeSerialize (OuterComposite body = null) Test serialization of object with outer number type ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -96,19 +189,22 @@ namespace Example { public class FakeOuterCompositeSerializeExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); - var outerComposite = new OuterComposite(); // OuterComposite | Input composite as post body (optional) + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); + var body = new OuterComposite(); // OuterComposite | Input composite as post body (optional) try { - OuterComposite result = apiInstance.FakeOuterCompositeSerialize(outerComposite); + OuterComposite result = apiInstance.FakeOuterCompositeSerialize(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.FakeOuterCompositeSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -117,9 +213,10 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] ### Return type @@ -131,13 +228,22 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: */* +- **Content-Type**: Not defined +- **Accept**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output composite | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FakeOuterNumberSerialize - -# **FakeOuterNumberSerialize** > decimal? FakeOuterNumberSerialize (decimal? body = null) @@ -145,8 +251,9 @@ No authorization required Test serialization of outer number types ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -156,19 +263,22 @@ namespace Example { public class FakeOuterNumberSerializeExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); - var body = 1.2; // decimal? | Input number as post body (optional) + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); + var body = 8.14; // decimal? | Input number as post body (optional) try { decimal? result = apiInstance.FakeOuterNumberSerialize(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.FakeOuterNumberSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -177,6 +287,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | **decimal?**| Input number as post body | [optional] @@ -191,13 +302,22 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: */* +- **Content-Type**: Not defined +- **Accept**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output number | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **FakeOuterStringSerialize** +## FakeOuterStringSerialize + > string FakeOuterStringSerialize (string body = null) @@ -205,8 +325,9 @@ No authorization required Test serialization of outer string types ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -216,9 +337,10 @@ namespace Example { public class FakeOuterStringSerializeExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var body = body_example; // string | Input string as post body (optional) try @@ -226,9 +348,11 @@ namespace Example string result = apiInstance.FakeOuterStringSerialize(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.FakeOuterStringSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -237,6 +361,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | **string**| Input string as post body | [optional] @@ -251,20 +376,103 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: */* +- **Content-Type**: Not defined +- **Accept**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output string | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## TestBodyWithFileSchema + +> void TestBodyWithFileSchema (FileSchemaTestClass body) + + + +For this test, the body for this request much reference a schema named `File`. + +### Example + +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestBodyWithFileSchemaExample + { + public static void Main() + { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); + var body = new FileSchemaTestClass(); // FileSchemaTestClass | + + try + { + apiInstance.TestBodyWithFileSchema(body); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestBodyWithFileSchema: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | - -# **TestBodyWithQueryParams** -> void TestBodyWithQueryParams (string query, User user) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## TestBodyWithQueryParams + +> void TestBodyWithQueryParams (string query, User body) ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -274,19 +482,22 @@ namespace Example { public class TestBodyWithQueryParamsExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var query = query_example; // string | - var user = new User(); // User | + var body = new User(); // User | try { - apiInstance.TestBodyWithQueryParams(query, user); + apiInstance.TestBodyWithQueryParams(query, body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestBodyWithQueryParams: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -295,10 +506,11 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **query** | **string**| | - **user** | [**User**](User.md)| | + **body** | [**User**](User.md)| | ### Return type @@ -310,22 +522,32 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: Not defined +- **Content-Type**: application/json +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) - -# **TestClientModel** -> ModelClient TestClientModel (ModelClient modelClient) + +## TestClientModel + +> ModelClient TestClientModel (ModelClient body) To test \"client\" model To test \"client\" model ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -335,20 +557,23 @@ namespace Example { public class TestClientModelExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); - var modelClient = new ModelClient(); // ModelClient | client model + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); + var body = new ModelClient(); // ModelClient | client model try { // To test \"client\" model - ModelClient result = apiInstance.TestClientModel(modelClient); + ModelClient result = apiInstance.TestClientModel(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestClientModel: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -357,9 +582,10 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **modelClient** | [**ModelClient**](ModelClient.md)| client model | + **body** | [**ModelClient**](ModelClient.md)| client model | ### Return type @@ -371,13 +597,22 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **TestEndpointParameters** +## TestEndpointParameters + > void TestEndpointParameters (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null) Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -385,8 +620,9 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -396,21 +632,22 @@ namespace Example { public class TestEndpointParametersExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure HTTP basic authorization: http_basic_test Configuration.Default.Username = "YOUR_USERNAME"; Configuration.Default.Password = "YOUR_PASSWORD"; - var apiInstance = new FakeApi(); + var apiInstance = new FakeApi(Configuration.Default); var number = 8.14; // decimal? | None - var _double = 1.2; // double? | None + var _double = 1.2D; // double? | None var patternWithoutDelimiter = patternWithoutDelimiter_example; // string | None var _byte = BYTE_ARRAY_DATA_HERE; // byte[] | None var integer = 56; // int? | None (optional) var int32 = 56; // int? | None (optional) var int64 = 789; // long? | None (optional) - var _float = 3.4; // float? | None (optional) + var _float = 3.4F; // float? | None (optional) var _string = _string_example; // string | None (optional) var binary = BINARY_DATA_HERE; // System.IO.Stream | None (optional) var date = 2013-10-20; // DateTime? | None (optional) @@ -423,9 +660,11 @@ namespace Example // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 apiInstance.TestEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestEndpointParameters: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -434,6 +673,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **number** | **decimal?**| None | @@ -461,13 +701,23 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +## TestEnumParameters - -# **TestEnumParameters** > void TestEnumParameters (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null) To test enum parameters @@ -475,8 +725,9 @@ To test enum parameters To test enum parameters ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -486,16 +737,17 @@ namespace Example { public class TestEnumParametersExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var enumHeaderStringArray = enumHeaderStringArray_example; // List | Header parameter enum test (string array) (optional) var enumHeaderString = enumHeaderString_example; // string | Header parameter enum test (string) (optional) (default to -efg) var enumQueryStringArray = enumQueryStringArray_example; // List | Query parameter enum test (string array) (optional) var enumQueryString = enumQueryString_example; // string | Query parameter enum test (string) (optional) (default to -efg) var enumQueryInteger = 56; // int? | Query parameter enum test (double) (optional) - var enumQueryDouble = 1.2; // double? | Query parameter enum test (double) (optional) - var enumFormStringArray = enumFormStringArray_example; // List | Form parameter enum test (string array) (optional) (default to $) + var enumQueryDouble = 1.2D; // double? | Query parameter enum test (double) (optional) + var enumFormStringArray = new List(); // List | Form parameter enum test (string array) (optional) (default to $) var enumFormString = enumFormString_example; // string | Form parameter enum test (string) (optional) (default to -efg) try @@ -503,9 +755,11 @@ namespace Example // To test enum parameters apiInstance.TestEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestEnumParameters: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -514,6 +768,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **enumHeaderStringArray** | **List<string>**| Header parameter enum test (string array) | [optional] @@ -522,7 +777,7 @@ Name | Type | Description | Notes **enumQueryString** | **string**| Query parameter enum test (string) | [optional] [default to -efg] **enumQueryInteger** | **int?**| Query parameter enum test (double) | [optional] **enumQueryDouble** | **double?**| Query parameter enum test (double) | [optional] - **enumFormStringArray** | **List<string>**| Form parameter enum test (string array) | [optional] [default to $] + **enumFormStringArray** | [**List<string>**](string.md)| Form parameter enum test (string array) | [optional] [default to $] **enumFormString** | **string**| Form parameter enum test (string) | [optional] [default to -efg] ### Return type @@ -535,20 +790,115 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid request | - | +| **404** | Not found | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## TestGroupParameters + +> void TestGroupParameters (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null) + +Fake endpoint to test group parameters (optional) + +Fake endpoint to test group parameters (optional) + +### Example + +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestGroupParametersExample + { + public static void Main() + { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); + var requiredStringGroup = 56; // int? | Required String in group parameters + var requiredBooleanGroup = true; // bool? | Required Boolean in group parameters + var requiredInt64Group = 789; // long? | Required Integer in group parameters + var stringGroup = 56; // int? | String in group parameters (optional) + var booleanGroup = true; // bool? | Boolean in group parameters (optional) + var int64Group = 789; // long? | Integer in group parameters (optional) + + try + { + // Fake endpoint to test group parameters (optional) + apiInstance.TestGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestGroupParameters: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **requiredStringGroup** | **int?**| Required String in group parameters | + **requiredBooleanGroup** | **bool?**| Required Boolean in group parameters | + **requiredInt64Group** | **long?**| Required Integer in group parameters | + **stringGroup** | **int?**| String in group parameters | [optional] + **booleanGroup** | **bool?**| Boolean in group parameters | [optional] + **int64Group** | **long?**| Integer in group parameters | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Someting wrong | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **TestInlineAdditionalProperties** -> void TestInlineAdditionalProperties (Dictionary requestBody) +## TestInlineAdditionalProperties + +> void TestInlineAdditionalProperties (Dictionary param) test inline additionalProperties ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -558,19 +908,22 @@ namespace Example { public class TestInlineAdditionalPropertiesExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); - var requestBody = new Dictionary(); // Dictionary | request body + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); + var param = new Dictionary(); // Dictionary | request body try { // test inline additionalProperties - apiInstance.TestInlineAdditionalProperties(requestBody); + apiInstance.TestInlineAdditionalProperties(param); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestInlineAdditionalProperties: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -579,9 +932,10 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **requestBody** | [**Dictionary<string, string>**](string.md)| request body | + **param** | [**Dictionary<string, string>**](string.md)| request body | ### Return type @@ -593,20 +947,30 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: Not defined +- **Content-Type**: application/json +- **Accept**: Not defined -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## TestJsonFormData - -# **TestJsonFormData** > void TestJsonFormData (string param, string param2) test json serialization of form data ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -616,9 +980,10 @@ namespace Example { public class TestJsonFormDataExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var param = param_example; // string | field1 var param2 = param2_example; // string | field2 @@ -627,9 +992,11 @@ namespace Example // test json serialization of form data apiInstance.TestJsonFormData(param, param2); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestJsonFormData: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -638,6 +1005,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **param** | **string**| field1 | @@ -653,8 +1021,16 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/FakeClassnameTags123Api.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/FakeClassnameTags123Api.md index f069b0983997..deb97a27697f 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/FakeClassnameTags123Api.md @@ -7,17 +7,19 @@ Method | HTTP request | Description [**TestClassname**](FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case - -# **TestClassname** -> ModelClient TestClassname (ModelClient modelClient) + +## TestClassname + +> ModelClient TestClassname (ModelClient body) To test class name in snake case To test class name in snake case ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -27,25 +29,28 @@ namespace Example { public class TestClassnameExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure API key authorization: api_key_query Configuration.Default.AddApiKey("api_key_query", "YOUR_API_KEY"); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Configuration.Default.AddApiKeyPrefix("api_key_query", "Bearer"); - var apiInstance = new FakeClassnameTags123Api(); - var modelClient = new ModelClient(); // ModelClient | client model + var apiInstance = new FakeClassnameTags123Api(Configuration.Default); + var body = new ModelClient(); // ModelClient | client model try { // To test class name in snake case - ModelClient result = apiInstance.TestClassname(modelClient); + ModelClient result = apiInstance.TestClassname(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeClassnameTags123Api.TestClassname: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -54,9 +59,10 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **modelClient** | [**ModelClient**](ModelClient.md)| client model | + **body** | [**ModelClient**](ModelClient.md)| client model | ### Return type @@ -68,8 +74,16 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/File.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/File.md new file mode 100644 index 000000000000..b71051025797 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/File.md @@ -0,0 +1,13 @@ + +# Org.OpenAPITools.Model.File + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SourceURI** | **string** | Test capitalization | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/FileSchemaTestClass.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/FileSchemaTestClass.md new file mode 100644 index 000000000000..df1453f686bd --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/FileSchemaTestClass.md @@ -0,0 +1,14 @@ + +# Org.OpenAPITools.Model.FileSchemaTestClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**File** | [**File**](File.md) | | [optional] +**Files** | [**List<File>**](File.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/FormatTest.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/FormatTest.md index f82c08bd75bd..519e940a7c86 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/FormatTest.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/FormatTest.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.FormatTest + ## Properties Name | Type | Description | Notes @@ -17,5 +19,7 @@ Name | Type | Description | Notes **Uuid** | **Guid?** | | [optional] **Password** | **string** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/HasOnlyReadOnly.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/HasOnlyReadOnly.md index 95f49de194c1..4a2624f11182 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/HasOnlyReadOnly.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/HasOnlyReadOnly.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.HasOnlyReadOnly + ## Properties Name | Type | Description | Notes @@ -6,5 +8,7 @@ Name | Type | Description | Notes **Bar** | **string** | | [optional] **Foo** | **string** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/List.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/List.md index 484c2a0992c6..cb41193b43eb 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/List.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/List.md @@ -1,9 +1,13 @@ + # Org.OpenAPITools.Model.List + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **_123List** | **string** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/MapTest.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/MapTest.md index 2baba08d8552..89be5aa12cfd 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/MapTest.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/MapTest.md @@ -1,10 +1,16 @@ + # Org.OpenAPITools.Model.MapTest + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **MapMapOfString** | **Dictionary<string, Dictionary<string, string>>** | | [optional] **MapOfEnumString** | **Dictionary<string, string>** | | [optional] +**DirectMap** | **Dictionary<string, bool?>** | | [optional] +**IndirectMap** | **Dictionary<string, bool?>** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/MixedPropertiesAndAdditionalPropertiesClass.md index 9b8e2e3434c1..323933588de3 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.MixedPropertiesAndAdditionalPropertiesClass + ## Properties Name | Type | Description | Notes @@ -7,5 +9,7 @@ Name | Type | Description | Notes **DateTime** | **DateTime?** | | [optional] **Map** | [**Dictionary<string, Animal>**](Animal.md) | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Model200Response.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Model200Response.md index 16337f9b6b2d..59918913107c 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Model200Response.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Model200Response.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.Model200Response + ## Properties Name | Type | Description | Notes @@ -6,5 +8,7 @@ Name | Type | Description | Notes **Name** | **int?** | | [optional] **Class** | **string** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/ModelClient.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/ModelClient.md index ecc7b60ce558..e36e1fad802f 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/ModelClient.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/ModelClient.md @@ -1,9 +1,13 @@ + # Org.OpenAPITools.Model.ModelClient + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **__Client** | **string** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Name.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Name.md index e22fef95673d..80d0a9f31f3f 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Name.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Name.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.Name + ## Properties Name | Type | Description | Notes @@ -8,5 +10,7 @@ Name | Type | Description | Notes **Property** | **string** | | [optional] **_123Number** | **int?** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/NumberOnly.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/NumberOnly.md index 5f00dedf1c39..8fd05997a931 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/NumberOnly.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/NumberOnly.md @@ -1,9 +1,13 @@ + # Org.OpenAPITools.Model.NumberOnly + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **JustNumber** | **decimal?** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Order.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Order.md index 984bd5ca063e..f28ee2ad0064 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Order.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Order.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.Order + ## Properties Name | Type | Description | Notes @@ -10,5 +12,7 @@ Name | Type | Description | Notes **Status** | **string** | Order Status | [optional] **Complete** | **bool?** | | [optional] [default to false] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/OuterComposite.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/OuterComposite.md index 4091cd23f2e1..e371f712633e 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/OuterComposite.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/OuterComposite.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.OuterComposite + ## Properties Name | Type | Description | Notes @@ -7,5 +9,7 @@ Name | Type | Description | Notes **MyString** | **string** | | [optional] **MyBoolean** | **bool?** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/OuterEnum.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/OuterEnum.md index 22713352ca08..edc2300684d9 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/OuterEnum.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/OuterEnum.md @@ -1,8 +1,12 @@ + # Org.OpenAPITools.Model.OuterEnum + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Pet.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Pet.md index 0ac711337aa8..51022249270f 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Pet.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Pet.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.Pet + ## Properties Name | Type | Description | Notes @@ -10,5 +12,7 @@ Name | Type | Description | Notes **Tags** | [**List<Tag>**](Tag.md) | | [optional] **Status** | **string** | pet status in the store | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/PetApi.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/PetApi.md index 244ece53a318..c45dd7854a73 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/PetApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/PetApi.md @@ -12,17 +12,20 @@ Method | HTTP request | Description [**UpdatePet**](PetApi.md#updatepet) | **PUT** /pet | Update an existing pet [**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 +[**UploadFileWithRequiredFile**](PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) - -# **AddPet** -> void AddPet (Pet pet) + +## AddPet + +> void AddPet (Pet body) Add a new pet to the store ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -32,22 +35,25 @@ namespace Example { public class AddPetExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); - var pet = new Pet(); // Pet | Pet object that needs to be added to the store + var apiInstance = new PetApi(Configuration.Default); + var body = new Pet(); // Pet | Pet object that needs to be added to the store try { // Add a new pet to the store - apiInstance.AddPet(pet); + apiInstance.AddPet(body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.AddPet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -56,9 +62,10 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -70,20 +77,31 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **405** | Invalid input | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **DeletePet** +## DeletePet + > void DeletePet (long? petId, string apiKey = null) Deletes a pet ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -93,12 +111,13 @@ namespace Example { public class DeletePetExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var petId = 789; // long? | Pet id to delete var apiKey = apiKey_example; // string | (optional) @@ -107,9 +126,11 @@ namespace Example // Deletes a pet apiInstance.DeletePet(petId, apiKey); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.DeletePet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -118,6 +139,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **long?**| Pet id to delete | @@ -133,22 +155,33 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid pet value | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +## FindPetsByStatus - -# **FindPetsByStatus** -> List FindPetsByStatus (List status) +> List<Pet> FindPetsByStatus (List status) Finds Pets by status Multiple status values can be provided with comma separated strings ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -158,23 +191,26 @@ namespace Example { public class FindPetsByStatusExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var status = status_example; // List | Status values that need to be considered for filter try { // Finds Pets by status - List<Pet> result = apiInstance.FindPetsByStatus(status); + List result = apiInstance.FindPetsByStatus(status); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.FindPetsByStatus: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -183,13 +219,14 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **status** | **List<string>**| Status values that need to be considered for filter | ### Return type -[**List**](Pet.md) +[**List<Pet>**](Pet.md) ### Authorization @@ -197,22 +234,33 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid status value | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) - -# **FindPetsByTags** -> List FindPetsByTags (List tags) + +## FindPetsByTags + +> List<Pet> FindPetsByTags (List tags) Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -222,23 +270,26 @@ namespace Example { public class FindPetsByTagsExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var tags = new List(); // List | Tags to filter by try { // Finds Pets by tags - List<Pet> result = apiInstance.FindPetsByTags(tags); + List result = apiInstance.FindPetsByTags(tags); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.FindPetsByTags: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -247,13 +298,14 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **tags** | [**List<string>**](string.md)| Tags to filter by | ### Return type -[**List**](Pet.md) +[**List<Pet>**](Pet.md) ### Authorization @@ -261,13 +313,23 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid tag value | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GetPetById** +## GetPetById + > Pet GetPetById (long? petId) Find pet by ID @@ -275,8 +337,9 @@ Find pet by ID Returns a single pet ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -286,14 +349,15 @@ namespace Example { public class GetPetByIdExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure API key authorization: api_key Configuration.Default.AddApiKey("api_key", "YOUR_API_KEY"); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Configuration.Default.AddApiKeyPrefix("api_key", "Bearer"); - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var petId = 789; // long? | ID of pet to return try @@ -302,9 +366,11 @@ namespace Example Pet result = apiInstance.GetPetById(petId); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.GetPetById: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -313,6 +379,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **long?**| ID of pet to return | @@ -327,20 +394,32 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | - -# **UpdatePet** -> void UpdatePet (Pet pet) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## UpdatePet + +> void UpdatePet (Pet body) Update an existing pet ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -350,22 +429,25 @@ namespace Example { public class UpdatePetExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); - var pet = new Pet(); // Pet | Pet object that needs to be added to the store + var apiInstance = new PetApi(Configuration.Default); + var body = new Pet(); // Pet | Pet object that needs to be added to the store try { // Update an existing pet - apiInstance.UpdatePet(pet); + apiInstance.UpdatePet(body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.UpdatePet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -374,9 +456,10 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -388,20 +471,33 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | +| **405** | Validation exception | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## UpdatePetWithForm - -# **UpdatePetWithForm** > void UpdatePetWithForm (long? petId, string name = null, string status = null) Updates a pet in the store with form data ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -411,12 +507,13 @@ namespace Example { public class UpdatePetWithFormExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var petId = 789; // long? | ID of pet that needs to be updated var name = name_example; // string | Updated name of the pet (optional) var status = status_example; // string | Updated status of the pet (optional) @@ -426,9 +523,11 @@ namespace Example // Updates a pet in the store with form data apiInstance.UpdatePetWithForm(petId, name, status); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.UpdatePetWithForm: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -437,6 +536,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **long?**| ID of pet that needs to be updated | @@ -453,20 +553,30 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **405** | Invalid input | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **UploadFile** +## UploadFile + > ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream file = null) uploads an image ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -476,12 +586,13 @@ namespace Example { public class UploadFileExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var petId = 789; // long? | ID of pet to update var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional) var file = BINARY_DATA_HERE; // System.IO.Stream | file to upload (optional) @@ -492,9 +603,11 @@ namespace Example ApiResponse result = apiInstance.UploadFile(petId, additionalMetadata, file); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.UploadFile: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -503,6 +616,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **long?**| ID of pet to update | @@ -519,8 +633,96 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: multipart/form-data - - **Accept**: application/json +- **Content-Type**: multipart/form-data +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## UploadFileWithRequiredFile + +> ApiResponse UploadFileWithRequiredFile (long? petId, System.IO.Stream requiredFile, string additionalMetadata = null) + +uploads an image (required) + +### Example + +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class UploadFileWithRequiredFileExample + { + public static void Main() + { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(Configuration.Default); + var petId = 789; // long? | ID of pet to update + var requiredFile = BINARY_DATA_HERE; // System.IO.Stream | file to upload + var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional) + + try + { + // uploads an image (required) + ApiResponse result = apiInstance.UploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.UploadFileWithRequiredFile: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **long?**| ID of pet to update | + **requiredFile** | **System.IO.Stream**| file to upload | + **additionalMetadata** | **string**| Additional data to pass to server | [optional] + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/ReadOnlyFirst.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/ReadOnlyFirst.md index 6c2571cb48f5..f4581ec10515 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/ReadOnlyFirst.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/ReadOnlyFirst.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.ReadOnlyFirst + ## Properties Name | Type | Description | Notes @@ -6,5 +8,7 @@ Name | Type | Description | Notes **Bar** | **string** | | [optional] **Baz** | **string** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Return.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Return.md index 21a269c63f4b..65481f45cf21 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Return.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Return.md @@ -1,9 +1,13 @@ + # Org.OpenAPITools.Model.Return + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **_Return** | **int?** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/SpecialModelName.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/SpecialModelName.md index 306e65392a2e..c1154219ccc8 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/SpecialModelName.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/SpecialModelName.md @@ -1,9 +1,13 @@ + # Org.OpenAPITools.Model.SpecialModelName + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **SpecialPropertyName** | **long?** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/StoreApi.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/StoreApi.md index ff7608854f84..b4dc72258a05 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/StoreApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/StoreApi.md @@ -10,8 +10,9 @@ Method | HTTP request | Description [**PlaceOrder**](StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet - -# **DeleteOrder** + +## DeleteOrder + > void DeleteOrder (string orderId) Delete purchase order by ID @@ -19,8 +20,9 @@ Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -30,9 +32,10 @@ namespace Example { public class DeleteOrderExample { - public void main() + public static void Main() { - var apiInstance = new StoreApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(Configuration.Default); var orderId = orderId_example; // string | ID of the order that needs to be deleted try @@ -40,9 +43,11 @@ namespace Example // Delete purchase order by ID apiInstance.DeleteOrder(orderId); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling StoreApi.DeleteOrder: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -51,6 +56,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **orderId** | **string**| ID of the order that needs to be deleted | @@ -65,22 +71,33 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) - -# **GetInventory** -> Dictionary GetInventory () + +## GetInventory + +> Dictionary<string, int?> GetInventory () Returns pet inventories by status Returns a map of status codes to quantities ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -90,24 +107,27 @@ namespace Example { public class GetInventoryExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure API key authorization: api_key Configuration.Default.AddApiKey("api_key", "YOUR_API_KEY"); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Configuration.Default.AddApiKeyPrefix("api_key", "Bearer"); - var apiInstance = new StoreApi(); + var apiInstance = new StoreApi(Configuration.Default); try { // Returns pet inventories by status - Dictionary<string, int?> result = apiInstance.GetInventory(); + Dictionary result = apiInstance.GetInventory(); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling StoreApi.GetInventory: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -115,6 +135,7 @@ namespace Example ``` ### Parameters + This endpoint does not need any parameter. ### Return type @@ -127,13 +148,22 @@ This endpoint does not need any parameter. ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetOrderById - -# **GetOrderById** > Order GetOrderById (long? orderId) Find purchase order by ID @@ -141,8 +171,9 @@ Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -152,9 +183,10 @@ namespace Example { public class GetOrderByIdExample { - public void main() + public static void Main() { - var apiInstance = new StoreApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(Configuration.Default); var orderId = 789; // long? | ID of pet that needs to be fetched try @@ -163,9 +195,11 @@ namespace Example Order result = apiInstance.GetOrderById(orderId); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling StoreApi.GetOrderById: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -174,6 +208,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **orderId** | **long?**| ID of pet that needs to be fetched | @@ -188,20 +223,32 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) - -# **PlaceOrder** -> Order PlaceOrder (Order order) + +## PlaceOrder + +> Order PlaceOrder (Order body) Place an order for a pet ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -211,20 +258,23 @@ namespace Example { public class PlaceOrderExample { - public void main() + public static void Main() { - var apiInstance = new StoreApi(); - var order = new Order(); // Order | order placed for purchasing the pet + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(Configuration.Default); + var body = new Order(); // Order | order placed for purchasing the pet try { // Place an order for a pet - Order result = apiInstance.PlaceOrder(order); + Order result = apiInstance.PlaceOrder(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling StoreApi.PlaceOrder: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -233,9 +283,10 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **order** | [**Order**](Order.md)| order placed for purchasing the pet | + **body** | [**Order**](Order.md)| order placed for purchasing the pet | ### Return type @@ -247,8 +298,17 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid Order | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Tag.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Tag.md index 6a76c28595f7..864cac0c8d34 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Tag.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Tag.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.Tag + ## Properties Name | Type | Description | Notes @@ -6,5 +8,7 @@ Name | Type | Description | Notes **Id** | **long?** | | [optional] **Name** | **string** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/TypeHolderDefault.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/TypeHolderDefault.md new file mode 100644 index 000000000000..d336f567ab2a --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/TypeHolderDefault.md @@ -0,0 +1,17 @@ + +# Org.OpenAPITools.Model.TypeHolderDefault + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**StringItem** | **string** | | [default to "what"] +**NumberItem** | **decimal?** | | +**IntegerItem** | **int?** | | +**BoolItem** | **bool?** | | [default to true] +**ArrayItem** | **List<int?>** | | + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/TypeHolderExample.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/TypeHolderExample.md new file mode 100644 index 000000000000..8f9ec66939ef --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/TypeHolderExample.md @@ -0,0 +1,17 @@ + +# Org.OpenAPITools.Model.TypeHolderExample + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**StringItem** | **string** | | +**NumberItem** | **decimal?** | | +**IntegerItem** | **int?** | | +**BoolItem** | **bool?** | | +**ArrayItem** | **List<int?>** | | + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/User.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/User.md index 04dd24a3423c..6faa1df688d7 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/User.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/User.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.User + ## Properties Name | Type | Description | Notes @@ -12,5 +14,7 @@ Name | Type | Description | Notes **Phone** | **string** | | [optional] **UserStatus** | **int?** | User Status | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/UserApi.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/UserApi.md index 857ab27084c6..1385d840413c 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/UserApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/UserApi.md @@ -14,17 +14,19 @@ Method | HTTP request | Description [**UpdateUser**](UserApi.md#updateuser) | **PUT** /user/{username} | Updated user - -# **CreateUser** -> void CreateUser (User user) + +## CreateUser + +> void CreateUser (User body) Create user This can only be done by the logged in user. ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -34,19 +36,22 @@ namespace Example { public class CreateUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); - var user = new User(); // User | Created user object + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); + var body = new User(); // User | Created user object try { // Create user - apiInstance.CreateUser(user); + apiInstance.CreateUser(body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.CreateUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -55,9 +60,10 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**User**](User.md)| Created user object | + **body** | [**User**](User.md)| Created user object | ### Return type @@ -69,20 +75,30 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) - -# **CreateUsersWithArrayInput** -> void CreateUsersWithArrayInput (List user) + +## CreateUsersWithArrayInput + +> void CreateUsersWithArrayInput (List body) Creates list of users with given input array ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -92,19 +108,22 @@ namespace Example { public class CreateUsersWithArrayInputExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); - var user = new List(); // List | List of user object + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); + var body = new List(); // List | List of user object try { // Creates list of users with given input array - apiInstance.CreateUsersWithArrayInput(user); + apiInstance.CreateUsersWithArrayInput(body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.CreateUsersWithArrayInput: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -113,9 +132,10 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type @@ -127,20 +147,30 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) - -# **CreateUsersWithListInput** -> void CreateUsersWithListInput (List user) + +## CreateUsersWithListInput + +> void CreateUsersWithListInput (List body) Creates list of users with given input array ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -150,19 +180,22 @@ namespace Example { public class CreateUsersWithListInputExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); - var user = new List(); // List | List of user object + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); + var body = new List(); // List | List of user object try { // Creates list of users with given input array - apiInstance.CreateUsersWithListInput(user); + apiInstance.CreateUsersWithListInput(body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.CreateUsersWithListInput: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -171,9 +204,10 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type @@ -185,13 +219,22 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DeleteUser - -# **DeleteUser** > void DeleteUser (string username) Delete user @@ -199,8 +242,9 @@ Delete user This can only be done by the logged in user. ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -210,9 +254,10 @@ namespace Example { public class DeleteUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var username = username_example; // string | The name that needs to be deleted try @@ -220,9 +265,11 @@ namespace Example // Delete user apiInstance.DeleteUser(username); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.DeleteUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -231,6 +278,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **string**| The name that needs to be deleted | @@ -245,20 +293,31 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetUserByName - -# **GetUserByName** > User GetUserByName (string username) Get user by user name ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -268,9 +327,10 @@ namespace Example { public class GetUserByNameExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var username = username_example; // string | The name that needs to be fetched. Use user1 for testing. try @@ -279,9 +339,11 @@ namespace Example User result = apiInstance.GetUserByName(username); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.GetUserByName: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -290,6 +352,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **string**| The name that needs to be fetched. Use user1 for testing. | @@ -304,20 +367,32 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid username supplied | - | +| **404** | User not found | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## LoginUser - -# **LoginUser** > string LoginUser (string username, string password) Logs user into the system ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -327,9 +402,10 @@ namespace Example { public class LoginUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var username = username_example; // string | The user name for login var password = password_example; // string | The password for login in clear text @@ -339,9 +415,11 @@ namespace Example string result = apiInstance.LoginUser(username, password); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.LoginUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -350,6 +428,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **string**| The user name for login | @@ -365,20 +444,31 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
| +| **400** | Invalid username/password supplied | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## LogoutUser - -# **LogoutUser** > void LogoutUser () Logs out current logged in user session ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -388,18 +478,21 @@ namespace Example { public class LogoutUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); try { // Logs out current logged in user session apiInstance.LogoutUser(); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.LogoutUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -407,6 +500,7 @@ namespace Example ``` ### Parameters + This endpoint does not need any parameter. ### Return type @@ -419,22 +513,32 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) - -# **UpdateUser** -> void UpdateUser (string username, User user) + +## UpdateUser + +> void UpdateUser (string username, User body) Updated user This can only be done by the logged in user. ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -444,20 +548,23 @@ namespace Example { public class UpdateUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var username = username_example; // string | name that need to be deleted - var user = new User(); // User | Updated user object + var body = new User(); // User | Updated user object try { // Updated user - apiInstance.UpdateUser(username, user); + apiInstance.UpdateUser(username, body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.UpdateUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -466,10 +573,11 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **string**| name that need to be deleted | - **user** | [**User**](User.md)| Updated user object | + **body** | [**User**](User.md)| Updated user object | ### Return type @@ -481,8 +589,17 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid user supplied | - | +| **404** | User not found | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/XmlItem.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/XmlItem.md new file mode 100644 index 000000000000..e96ea4b0de6d --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/XmlItem.md @@ -0,0 +1,41 @@ + +# Org.OpenAPITools.Model.XmlItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AttributeString** | **string** | | [optional] +**AttributeNumber** | **decimal?** | | [optional] +**AttributeInteger** | **int?** | | [optional] +**AttributeBoolean** | **bool?** | | [optional] +**WrappedArray** | **List<int?>** | | [optional] +**NameString** | **string** | | [optional] +**NameNumber** | **decimal?** | | [optional] +**NameInteger** | **int?** | | [optional] +**NameBoolean** | **bool?** | | [optional] +**NameArray** | **List<int?>** | | [optional] +**NameWrappedArray** | **List<int?>** | | [optional] +**PrefixString** | **string** | | [optional] +**PrefixNumber** | **decimal?** | | [optional] +**PrefixInteger** | **int?** | | [optional] +**PrefixBoolean** | **bool?** | | [optional] +**PrefixArray** | **List<int?>** | | [optional] +**PrefixWrappedArray** | **List<int?>** | | [optional] +**NamespaceString** | **string** | | [optional] +**NamespaceNumber** | **decimal?** | | [optional] +**NamespaceInteger** | **int?** | | [optional] +**NamespaceBoolean** | **bool?** | | [optional] +**NamespaceArray** | **List<int?>** | | [optional] +**NamespaceWrappedArray** | **List<int?>** | | [optional] +**PrefixNsString** | **string** | | [optional] +**PrefixNsNumber** | **decimal?** | | [optional] +**PrefixNsInteger** | **int?** | | [optional] +**PrefixNsBoolean** | **bool?** | | [optional] +**PrefixNsArray** | **List<int?>** | | [optional] +**PrefixNsWrappedArray** | **List<int?>** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index 586ead5d2004..76d5194e5a16 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -28,46 +28,46 @@ public interface IAnotherFakeApi : IApiAccessor /// To test special tags /// /// - /// To test special tags + /// To test special tags and operation ID starting with number /// /// Thrown when fails to make API call - /// client model + /// client model /// ModelClient - ModelClient TestSpecialTags (ModelClient modelClient); + ModelClient Call123TestSpecialTags (ModelClient body); /// /// To test special tags /// /// - /// To test special tags + /// To test special tags and operation ID starting with number /// /// Thrown when fails to make API call - /// client model + /// client model /// ApiResponse of ModelClient - ApiResponse TestSpecialTagsWithHttpInfo (ModelClient modelClient); + ApiResponse Call123TestSpecialTagsWithHttpInfo (ModelClient body); #endregion Synchronous Operations #region Asynchronous Operations /// /// To test special tags /// /// - /// To test special tags + /// To test special tags and operation ID starting with number /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ModelClient - System.Threading.Tasks.Task TestSpecialTagsAsync (ModelClient modelClient); + System.Threading.Tasks.Task Call123TestSpecialTagsAsync (ModelClient body); /// /// To test special tags /// /// - /// To test special tags + /// To test special tags and operation ID starting with number /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ApiResponse (ModelClient) - System.Threading.Tasks.Task> TestSpecialTagsAsyncWithHttpInfo (ModelClient modelClient); + System.Threading.Tasks.Task> Call123TestSpecialTagsAsyncWithHttpInfo (ModelClient body); #endregion Asynchronous Operations } @@ -89,6 +89,17 @@ public AnotherFakeApi(String basePath) ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; } + /// + /// Initializes a new instance of the class + /// + /// + public AnotherFakeApi() + { + this.Configuration = Org.OpenAPITools.Client.Configuration.Default; + + ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; + } + /// /// Initializes a new instance of the class /// using Configuration object @@ -169,28 +180,28 @@ public void AddDefaultHeader(string key, string value) } /// - /// To test special tags To test special tags + /// To test special tags To test special tags and operation ID starting with number /// /// Thrown when fails to make API call - /// client model + /// client model /// ModelClient - public ModelClient TestSpecialTags (ModelClient modelClient) + public ModelClient Call123TestSpecialTags (ModelClient body) { - ApiResponse localVarResponse = TestSpecialTagsWithHttpInfo(modelClient); + ApiResponse localVarResponse = Call123TestSpecialTagsWithHttpInfo(body); return localVarResponse.Data; } /// - /// To test special tags To test special tags + /// To test special tags To test special tags and operation ID starting with number /// /// Thrown when fails to make API call - /// client model + /// client model /// ApiResponse of ModelClient - public ApiResponse< ModelClient > TestSpecialTagsWithHttpInfo (ModelClient modelClient) + public ApiResponse< ModelClient > Call123TestSpecialTagsWithHttpInfo (ModelClient body) { - // verify the required parameter 'modelClient' is set - if (modelClient == null) - throw new ApiException(400, "Missing required parameter 'modelClient' when calling AnotherFakeApi->TestSpecialTags"); + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling AnotherFakeApi->Call123TestSpecialTags"); var localVarPath = "./another-fake/dummy"; var localVarPathParams = new Dictionary(); @@ -214,13 +225,13 @@ public ApiResponse< ModelClient > TestSpecialTagsWithHttpInfo (ModelClient model if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (modelClient != null && modelClient.GetType() != typeof(byte[])) + if (body != null && body.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(modelClient); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { - localVarPostBody = modelClient; // byte array + localVarPostBody = body; // byte array } @@ -233,39 +244,39 @@ public ApiResponse< ModelClient > TestSpecialTagsWithHttpInfo (ModelClient model if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("TestSpecialTags", localVarResponse); + Exception exception = ExceptionFactory("Call123TestSpecialTags", localVarResponse); if (exception != null) throw exception; } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (ModelClient) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(ModelClient))); } /// - /// To test special tags To test special tags + /// To test special tags To test special tags and operation ID starting with number /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ModelClient - public async System.Threading.Tasks.Task TestSpecialTagsAsync (ModelClient modelClient) + public async System.Threading.Tasks.Task Call123TestSpecialTagsAsync (ModelClient body) { - ApiResponse localVarResponse = await TestSpecialTagsAsyncWithHttpInfo(modelClient); + ApiResponse localVarResponse = await Call123TestSpecialTagsAsyncWithHttpInfo(body); return localVarResponse.Data; } /// - /// To test special tags To test special tags + /// To test special tags To test special tags and operation ID starting with number /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ApiResponse (ModelClient) - public async System.Threading.Tasks.Task> TestSpecialTagsAsyncWithHttpInfo (ModelClient modelClient) + public async System.Threading.Tasks.Task> Call123TestSpecialTagsAsyncWithHttpInfo (ModelClient body) { - // verify the required parameter 'modelClient' is set - if (modelClient == null) - throw new ApiException(400, "Missing required parameter 'modelClient' when calling AnotherFakeApi->TestSpecialTags"); + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling AnotherFakeApi->Call123TestSpecialTags"); var localVarPath = "./another-fake/dummy"; var localVarPathParams = new Dictionary(); @@ -289,13 +300,13 @@ public async System.Threading.Tasks.Task> TestSpecialTa if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (modelClient != null && modelClient.GetType() != typeof(byte[])) + if (body != null && body.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(modelClient); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { - localVarPostBody = modelClient; // byte array + localVarPostBody = body; // byte array } @@ -308,12 +319,12 @@ public async System.Threading.Tasks.Task> TestSpecialTa if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("TestSpecialTags", localVarResponse); + Exception exception = ExceptionFactory("Call123TestSpecialTags", localVarResponse); if (exception != null) throw exception; } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (ModelClient) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(ModelClient))); } diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/FakeApi.cs index 234c794dd412..7f0b649598ca 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/FakeApi.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -25,6 +25,27 @@ public interface IFakeApi : IApiAccessor { #region Synchronous Operations /// + /// creates an XmlItem + /// + /// + /// this route creates an XmlItem + /// + /// Thrown when fails to make API call + /// XmlItem Body + /// + void CreateXmlItem (XmlItem xmlItem); + + /// + /// creates an XmlItem + /// + /// + /// this route creates an XmlItem + /// + /// Thrown when fails to make API call + /// XmlItem Body + /// ApiResponse of Object(void) + ApiResponse CreateXmlItemWithHttpInfo (XmlItem xmlItem); + /// /// /// /// @@ -52,9 +73,9 @@ public interface IFakeApi : IApiAccessor /// Test serialization of object with outer number type /// /// Thrown when fails to make API call - /// Input composite as post body (optional) + /// Input composite as post body (optional) /// OuterComposite - OuterComposite FakeOuterCompositeSerialize (OuterComposite outerComposite = null); + OuterComposite FakeOuterCompositeSerialize (OuterComposite body = null); /// /// @@ -63,9 +84,9 @@ public interface IFakeApi : IApiAccessor /// Test serialization of object with outer number type /// /// Thrown when fails to make API call - /// Input composite as post body (optional) + /// Input composite as post body (optional) /// ApiResponse of OuterComposite - ApiResponse FakeOuterCompositeSerializeWithHttpInfo (OuterComposite outerComposite = null); + ApiResponse FakeOuterCompositeSerializeWithHttpInfo (OuterComposite body = null); /// /// /// @@ -112,13 +133,34 @@ public interface IFakeApi : IApiAccessor /// /// /// + /// For this test, the body for this request much reference a schema named `File`. + /// + /// Thrown when fails to make API call + /// + /// + void TestBodyWithFileSchema (FileSchemaTestClass body); + + /// + /// + /// + /// + /// For this test, the body for this request much reference a schema named `File`. + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object(void) + ApiResponse TestBodyWithFileSchemaWithHttpInfo (FileSchemaTestClass body); + /// + /// + /// + /// /// /// /// Thrown when fails to make API call /// - /// + /// /// - void TestBodyWithQueryParams (string query, User user); + void TestBodyWithQueryParams (string query, User body); /// /// @@ -128,9 +170,9 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// - /// + /// /// ApiResponse of Object(void) - ApiResponse TestBodyWithQueryParamsWithHttpInfo (string query, User user); + ApiResponse TestBodyWithQueryParamsWithHttpInfo (string query, User body); /// /// To test \"client\" model /// @@ -138,9 +180,9 @@ public interface IFakeApi : IApiAccessor /// To test \"client\" model /// /// Thrown when fails to make API call - /// client model + /// client model /// ModelClient - ModelClient TestClientModel (ModelClient modelClient); + ModelClient TestClientModel (ModelClient body); /// /// To test \"client\" model @@ -149,9 +191,9 @@ public interface IFakeApi : IApiAccessor /// To test \"client\" model /// /// Thrown when fails to make API call - /// client model + /// client model /// ApiResponse of ModelClient - ApiResponse TestClientModelWithHttpInfo (ModelClient modelClient); + ApiResponse TestClientModelWithHttpInfo (ModelClient body); /// /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// @@ -235,15 +277,46 @@ public interface IFakeApi : IApiAccessor /// ApiResponse of Object(void) ApiResponse TestEnumParametersWithHttpInfo (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null); /// + /// Fake endpoint to test group parameters (optional) + /// + /// + /// Fake endpoint to test group parameters (optional) + /// + /// Thrown when fails to make API call + /// Required String in group parameters + /// Required Boolean in group parameters + /// Required Integer in group parameters + /// String in group parameters (optional) + /// Boolean in group parameters (optional) + /// Integer in group parameters (optional) + /// + void TestGroupParameters (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null); + + /// + /// Fake endpoint to test group parameters (optional) + /// + /// + /// Fake endpoint to test group parameters (optional) + /// + /// Thrown when fails to make API call + /// Required String in group parameters + /// Required Boolean in group parameters + /// Required Integer in group parameters + /// String in group parameters (optional) + /// Boolean in group parameters (optional) + /// Integer in group parameters (optional) + /// ApiResponse of Object(void) + ApiResponse TestGroupParametersWithHttpInfo (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null); + /// /// test inline additionalProperties /// /// /// /// /// Thrown when fails to make API call - /// request body + /// request body /// - void TestInlineAdditionalProperties (Dictionary requestBody); + void TestInlineAdditionalProperties (Dictionary param); /// /// test inline additionalProperties @@ -252,9 +325,9 @@ public interface IFakeApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// request body + /// request body /// ApiResponse of Object(void) - ApiResponse TestInlineAdditionalPropertiesWithHttpInfo (Dictionary requestBody); + ApiResponse TestInlineAdditionalPropertiesWithHttpInfo (Dictionary param); /// /// test json serialization of form data /// @@ -281,6 +354,27 @@ public interface IFakeApi : IApiAccessor #endregion Synchronous Operations #region Asynchronous Operations /// + /// creates an XmlItem + /// + /// + /// this route creates an XmlItem + /// + /// Thrown when fails to make API call + /// XmlItem Body + /// Task of void + System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem); + + /// + /// creates an XmlItem + /// + /// + /// this route creates an XmlItem + /// + /// Thrown when fails to make API call + /// XmlItem Body + /// Task of ApiResponse + System.Threading.Tasks.Task> CreateXmlItemAsyncWithHttpInfo (XmlItem xmlItem); + /// /// /// /// @@ -308,9 +402,9 @@ public interface IFakeApi : IApiAccessor /// Test serialization of object with outer number type /// /// Thrown when fails to make API call - /// Input composite as post body (optional) + /// Input composite as post body (optional) /// Task of OuterComposite - System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite outerComposite = null); + System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite body = null); /// /// @@ -319,9 +413,9 @@ public interface IFakeApi : IApiAccessor /// Test serialization of object with outer number type /// /// Thrown when fails to make API call - /// Input composite as post body (optional) + /// Input composite as post body (optional) /// Task of ApiResponse (OuterComposite) - System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite outerComposite = null); + System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite body = null); /// /// /// @@ -368,13 +462,34 @@ public interface IFakeApi : IApiAccessor /// /// /// + /// For this test, the body for this request much reference a schema named `File`. + /// + /// Thrown when fails to make API call + /// + /// Task of void + System.Threading.Tasks.Task TestBodyWithFileSchemaAsync (FileSchemaTestClass body); + + /// + /// + /// + /// + /// For this test, the body for this request much reference a schema named `File`. + /// + /// Thrown when fails to make API call + /// + /// Task of ApiResponse + System.Threading.Tasks.Task> TestBodyWithFileSchemaAsyncWithHttpInfo (FileSchemaTestClass body); + /// + /// + /// + /// /// /// /// Thrown when fails to make API call /// - /// + /// /// Task of void - System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (string query, User user); + System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (string query, User body); /// /// @@ -384,9 +499,9 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// - /// + /// /// Task of ApiResponse - System.Threading.Tasks.Task> TestBodyWithQueryParamsAsyncWithHttpInfo (string query, User user); + System.Threading.Tasks.Task> TestBodyWithQueryParamsAsyncWithHttpInfo (string query, User body); /// /// To test \"client\" model /// @@ -394,9 +509,9 @@ public interface IFakeApi : IApiAccessor /// To test \"client\" model /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ModelClient - System.Threading.Tasks.Task TestClientModelAsync (ModelClient modelClient); + System.Threading.Tasks.Task TestClientModelAsync (ModelClient body); /// /// To test \"client\" model @@ -405,9 +520,9 @@ public interface IFakeApi : IApiAccessor /// To test \"client\" model /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ApiResponse (ModelClient) - System.Threading.Tasks.Task> TestClientModelAsyncWithHttpInfo (ModelClient modelClient); + System.Threading.Tasks.Task> TestClientModelAsyncWithHttpInfo (ModelClient body); /// /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// @@ -491,15 +606,46 @@ public interface IFakeApi : IApiAccessor /// Task of ApiResponse System.Threading.Tasks.Task> TestEnumParametersAsyncWithHttpInfo (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null); /// + /// Fake endpoint to test group parameters (optional) + /// + /// + /// Fake endpoint to test group parameters (optional) + /// + /// Thrown when fails to make API call + /// Required String in group parameters + /// Required Boolean in group parameters + /// Required Integer in group parameters + /// String in group parameters (optional) + /// Boolean in group parameters (optional) + /// Integer in group parameters (optional) + /// Task of void + System.Threading.Tasks.Task TestGroupParametersAsync (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null); + + /// + /// Fake endpoint to test group parameters (optional) + /// + /// + /// Fake endpoint to test group parameters (optional) + /// + /// Thrown when fails to make API call + /// Required String in group parameters + /// Required Boolean in group parameters + /// Required Integer in group parameters + /// String in group parameters (optional) + /// Boolean in group parameters (optional) + /// Integer in group parameters (optional) + /// Task of ApiResponse + System.Threading.Tasks.Task> TestGroupParametersAsyncWithHttpInfo (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null); + /// /// test inline additionalProperties /// /// /// /// /// Thrown when fails to make API call - /// request body + /// request body /// Task of void - System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Dictionary requestBody); + System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Dictionary param); /// /// test inline additionalProperties @@ -508,9 +654,9 @@ public interface IFakeApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// request body + /// request body /// Task of ApiResponse - System.Threading.Tasks.Task> TestInlineAdditionalPropertiesAsyncWithHttpInfo (Dictionary requestBody); + System.Threading.Tasks.Task> TestInlineAdditionalPropertiesAsyncWithHttpInfo (Dictionary param); /// /// test json serialization of form data /// @@ -555,6 +701,17 @@ public FakeApi(String basePath) ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; } + /// + /// Initializes a new instance of the class + /// + /// + public FakeApi() + { + this.Configuration = Org.OpenAPITools.Client.Configuration.Default; + + ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; + } + /// /// Initializes a new instance of the class /// using Configuration object @@ -634,6 +791,161 @@ public void AddDefaultHeader(string key, string value) this.Configuration.AddDefaultHeader(key, value); } + /// + /// creates an XmlItem this route creates an XmlItem + /// + /// Thrown when fails to make API call + /// XmlItem Body + /// + public void CreateXmlItem (XmlItem xmlItem) + { + CreateXmlItemWithHttpInfo(xmlItem); + } + + /// + /// creates an XmlItem this route creates an XmlItem + /// + /// Thrown when fails to make API call + /// XmlItem Body + /// ApiResponse of Object(void) + public ApiResponse CreateXmlItemWithHttpInfo (XmlItem xmlItem) + { + // verify the required parameter 'xmlItem' is set + if (xmlItem == null) + throw new ApiException(400, "Missing required parameter 'xmlItem' when calling FakeApi->CreateXmlItem"); + + var localVarPath = "./fake/create_xml_item"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/xml", + "application/xml; charset=utf-8", + "application/xml; charset=utf-16", + "text/xml", + "text/xml; charset=utf-8", + "text/xml; charset=utf-16" + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (xmlItem != null && xmlItem.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(xmlItem); // http body (model) parameter + } + else + { + localVarPostBody = xmlItem; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("CreateXmlItem", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), + null); + } + + /// + /// creates an XmlItem this route creates an XmlItem + /// + /// Thrown when fails to make API call + /// XmlItem Body + /// Task of void + public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) + { + await CreateXmlItemAsyncWithHttpInfo(xmlItem); + + } + + /// + /// creates an XmlItem this route creates an XmlItem + /// + /// Thrown when fails to make API call + /// XmlItem Body + /// Task of ApiResponse + public async System.Threading.Tasks.Task> CreateXmlItemAsyncWithHttpInfo (XmlItem xmlItem) + { + // verify the required parameter 'xmlItem' is set + if (xmlItem == null) + throw new ApiException(400, "Missing required parameter 'xmlItem' when calling FakeApi->CreateXmlItem"); + + var localVarPath = "./fake/create_xml_item"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/xml", + "application/xml; charset=utf-8", + "application/xml; charset=utf-16", + "text/xml", + "text/xml; charset=utf-8", + "text/xml; charset=utf-16" + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (xmlItem != null && xmlItem.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(xmlItem); // http body (model) parameter + } + else + { + localVarPostBody = xmlItem; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("CreateXmlItem", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), + null); + } + /// /// Test serialization of outer boolean types /// @@ -700,7 +1012,7 @@ public void AddDefaultHeader(string key, string value) } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (bool?) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(bool?))); } @@ -771,7 +1083,7 @@ public void AddDefaultHeader(string key, string value) } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (bool?) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(bool?))); } @@ -779,11 +1091,11 @@ public void AddDefaultHeader(string key, string value) /// Test serialization of object with outer number type /// /// Thrown when fails to make API call - /// Input composite as post body (optional) + /// Input composite as post body (optional) /// OuterComposite - public OuterComposite FakeOuterCompositeSerialize (OuterComposite outerComposite = null) + public OuterComposite FakeOuterCompositeSerialize (OuterComposite body = null) { - ApiResponse localVarResponse = FakeOuterCompositeSerializeWithHttpInfo(outerComposite); + ApiResponse localVarResponse = FakeOuterCompositeSerializeWithHttpInfo(body); return localVarResponse.Data; } @@ -791,9 +1103,9 @@ public OuterComposite FakeOuterCompositeSerialize (OuterComposite outerComposite /// Test serialization of object with outer number type /// /// Thrown when fails to make API call - /// Input composite as post body (optional) + /// Input composite as post body (optional) /// ApiResponse of OuterComposite - public ApiResponse< OuterComposite > FakeOuterCompositeSerializeWithHttpInfo (OuterComposite outerComposite = null) + public ApiResponse< OuterComposite > FakeOuterCompositeSerializeWithHttpInfo (OuterComposite body = null) { var localVarPath = "./fake/outer/composite"; @@ -817,13 +1129,13 @@ public ApiResponse< OuterComposite > FakeOuterCompositeSerializeWithHttpInfo (Ou if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (outerComposite != null && outerComposite.GetType() != typeof(byte[])) + if (body != null && body.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(outerComposite); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { - localVarPostBody = outerComposite; // byte array + localVarPostBody = body; // byte array } @@ -841,7 +1153,7 @@ public ApiResponse< OuterComposite > FakeOuterCompositeSerializeWithHttpInfo (Ou } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (OuterComposite) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterComposite))); } @@ -849,11 +1161,11 @@ public ApiResponse< OuterComposite > FakeOuterCompositeSerializeWithHttpInfo (Ou /// Test serialization of object with outer number type /// /// Thrown when fails to make API call - /// Input composite as post body (optional) + /// Input composite as post body (optional) /// Task of OuterComposite - public async System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite outerComposite = null) + public async System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite body = null) { - ApiResponse localVarResponse = await FakeOuterCompositeSerializeAsyncWithHttpInfo(outerComposite); + ApiResponse localVarResponse = await FakeOuterCompositeSerializeAsyncWithHttpInfo(body); return localVarResponse.Data; } @@ -862,9 +1174,9 @@ public async System.Threading.Tasks.Task FakeOuterCompositeSeria /// Test serialization of object with outer number type /// /// Thrown when fails to make API call - /// Input composite as post body (optional) + /// Input composite as post body (optional) /// Task of ApiResponse (OuterComposite) - public async System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite outerComposite = null) + public async System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite body = null) { var localVarPath = "./fake/outer/composite"; @@ -888,13 +1200,13 @@ public async System.Threading.Tasks.Task> FakeOuterC if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (outerComposite != null && outerComposite.GetType() != typeof(byte[])) + if (body != null && body.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(outerComposite); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { - localVarPostBody = outerComposite; // byte array + localVarPostBody = body; // byte array } @@ -912,7 +1224,7 @@ public async System.Threading.Tasks.Task> FakeOuterC } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (OuterComposite) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterComposite))); } @@ -982,7 +1294,7 @@ public async System.Threading.Tasks.Task> FakeOuterC } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (decimal?) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(decimal?))); } @@ -1053,7 +1365,7 @@ public async System.Threading.Tasks.Task> FakeOuterC } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (decimal?) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(decimal?))); } @@ -1123,7 +1435,7 @@ public ApiResponse< string > FakeOuterStringSerializeWithHttpInfo (string body = } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (string) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(string))); } @@ -1194,20 +1506,165 @@ public async System.Threading.Tasks.Task> FakeOuterStringSer } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (string) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(string))); } + /// + /// For this test, the body for this request much reference a schema named `File`. + /// + /// Thrown when fails to make API call + /// + /// + public void TestBodyWithFileSchema (FileSchemaTestClass body) + { + TestBodyWithFileSchemaWithHttpInfo(body); + } + + /// + /// For this test, the body for this request much reference a schema named `File`. + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object(void) + public ApiResponse TestBodyWithFileSchemaWithHttpInfo (FileSchemaTestClass body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling FakeApi->TestBodyWithFileSchema"); + + var localVarPath = "./fake/body-with-file-schema"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json" + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, + Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestBodyWithFileSchema", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), + null); + } + + /// + /// For this test, the body for this request much reference a schema named `File`. + /// + /// Thrown when fails to make API call + /// + /// Task of void + public async System.Threading.Tasks.Task TestBodyWithFileSchemaAsync (FileSchemaTestClass body) + { + await TestBodyWithFileSchemaAsyncWithHttpInfo(body); + + } + + /// + /// For this test, the body for this request much reference a schema named `File`. + /// + /// Thrown when fails to make API call + /// + /// Task of ApiResponse + public async System.Threading.Tasks.Task> TestBodyWithFileSchemaAsyncWithHttpInfo (FileSchemaTestClass body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling FakeApi->TestBodyWithFileSchema"); + + var localVarPath = "./fake/body-with-file-schema"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json" + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestBodyWithFileSchema", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), + null); + } + /// /// /// /// Thrown when fails to make API call /// - /// + /// /// - public void TestBodyWithQueryParams (string query, User user) + public void TestBodyWithQueryParams (string query, User body) { - TestBodyWithQueryParamsWithHttpInfo(query, user); + TestBodyWithQueryParamsWithHttpInfo(query, body); } /// @@ -1215,16 +1672,16 @@ public void TestBodyWithQueryParams (string query, User user) /// /// Thrown when fails to make API call /// - /// + /// /// ApiResponse of Object(void) - public ApiResponse TestBodyWithQueryParamsWithHttpInfo (string query, User user) + public ApiResponse TestBodyWithQueryParamsWithHttpInfo (string query, User body) { // verify the required parameter 'query' is set if (query == null) throw new ApiException(400, "Missing required parameter 'query' when calling FakeApi->TestBodyWithQueryParams"); - // verify the required parameter 'user' is set - if (user == null) - throw new ApiException(400, "Missing required parameter 'user' when calling FakeApi->TestBodyWithQueryParams"); + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling FakeApi->TestBodyWithQueryParams"); var localVarPath = "./fake/body-with-query-params"; var localVarPathParams = new Dictionary(); @@ -1248,13 +1705,13 @@ public ApiResponse TestBodyWithQueryParamsWithHttpInfo (string query, Us localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); if (query != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "query", query)); // query parameter - if (user != null && user.GetType() != typeof(byte[])) + if (body != null && body.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(user); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { - localVarPostBody = user; // byte array + localVarPostBody = body; // byte array } @@ -1272,7 +1729,7 @@ public ApiResponse TestBodyWithQueryParamsWithHttpInfo (string query, Us } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -1281,11 +1738,11 @@ public ApiResponse TestBodyWithQueryParamsWithHttpInfo (string query, Us /// /// Thrown when fails to make API call /// - /// + /// /// Task of void - public async System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (string query, User user) + public async System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (string query, User body) { - await TestBodyWithQueryParamsAsyncWithHttpInfo(query, user); + await TestBodyWithQueryParamsAsyncWithHttpInfo(query, body); } @@ -1294,16 +1751,16 @@ public async System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (string qu /// /// Thrown when fails to make API call /// - /// + /// /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestBodyWithQueryParamsAsyncWithHttpInfo (string query, User user) + public async System.Threading.Tasks.Task> TestBodyWithQueryParamsAsyncWithHttpInfo (string query, User body) { // verify the required parameter 'query' is set if (query == null) throw new ApiException(400, "Missing required parameter 'query' when calling FakeApi->TestBodyWithQueryParams"); - // verify the required parameter 'user' is set - if (user == null) - throw new ApiException(400, "Missing required parameter 'user' when calling FakeApi->TestBodyWithQueryParams"); + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling FakeApi->TestBodyWithQueryParams"); var localVarPath = "./fake/body-with-query-params"; var localVarPathParams = new Dictionary(); @@ -1327,13 +1784,13 @@ public async System.Threading.Tasks.Task> TestBodyWithQueryP localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); if (query != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "query", query)); // query parameter - if (user != null && user.GetType() != typeof(byte[])) + if (body != null && body.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(user); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { - localVarPostBody = user; // byte array + localVarPostBody = body; // byte array } @@ -1351,7 +1808,7 @@ public async System.Threading.Tasks.Task> TestBodyWithQueryP } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -1359,11 +1816,11 @@ public async System.Threading.Tasks.Task> TestBodyWithQueryP /// To test \"client\" model To test \"client\" model /// /// Thrown when fails to make API call - /// client model + /// client model /// ModelClient - public ModelClient TestClientModel (ModelClient modelClient) + public ModelClient TestClientModel (ModelClient body) { - ApiResponse localVarResponse = TestClientModelWithHttpInfo(modelClient); + ApiResponse localVarResponse = TestClientModelWithHttpInfo(body); return localVarResponse.Data; } @@ -1371,13 +1828,13 @@ public ModelClient TestClientModel (ModelClient modelClient) /// To test \"client\" model To test \"client\" model /// /// Thrown when fails to make API call - /// client model + /// client model /// ApiResponse of ModelClient - public ApiResponse< ModelClient > TestClientModelWithHttpInfo (ModelClient modelClient) + public ApiResponse< ModelClient > TestClientModelWithHttpInfo (ModelClient body) { - // verify the required parameter 'modelClient' is set - if (modelClient == null) - throw new ApiException(400, "Missing required parameter 'modelClient' when calling FakeApi->TestClientModel"); + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling FakeApi->TestClientModel"); var localVarPath = "./fake"; var localVarPathParams = new Dictionary(); @@ -1401,13 +1858,13 @@ public ApiResponse< ModelClient > TestClientModelWithHttpInfo (ModelClient model if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (modelClient != null && modelClient.GetType() != typeof(byte[])) + if (body != null && body.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(modelClient); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { - localVarPostBody = modelClient; // byte array + localVarPostBody = body; // byte array } @@ -1425,7 +1882,7 @@ public ApiResponse< ModelClient > TestClientModelWithHttpInfo (ModelClient model } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (ModelClient) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(ModelClient))); } @@ -1433,11 +1890,11 @@ public ApiResponse< ModelClient > TestClientModelWithHttpInfo (ModelClient model /// To test \"client\" model To test \"client\" model /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ModelClient - public async System.Threading.Tasks.Task TestClientModelAsync (ModelClient modelClient) + public async System.Threading.Tasks.Task TestClientModelAsync (ModelClient body) { - ApiResponse localVarResponse = await TestClientModelAsyncWithHttpInfo(modelClient); + ApiResponse localVarResponse = await TestClientModelAsyncWithHttpInfo(body); return localVarResponse.Data; } @@ -1446,13 +1903,13 @@ public async System.Threading.Tasks.Task TestClientModelAsync (Mode /// To test \"client\" model To test \"client\" model /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ApiResponse (ModelClient) - public async System.Threading.Tasks.Task> TestClientModelAsyncWithHttpInfo (ModelClient modelClient) + public async System.Threading.Tasks.Task> TestClientModelAsyncWithHttpInfo (ModelClient body) { - // verify the required parameter 'modelClient' is set - if (modelClient == null) - throw new ApiException(400, "Missing required parameter 'modelClient' when calling FakeApi->TestClientModel"); + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling FakeApi->TestClientModel"); var localVarPath = "./fake"; var localVarPathParams = new Dictionary(); @@ -1476,13 +1933,13 @@ public async System.Threading.Tasks.Task> TestClientMod if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (modelClient != null && modelClient.GetType() != typeof(byte[])) + if (body != null && body.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(modelClient); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { - localVarPostBody = modelClient; // byte array + localVarPostBody = body; // byte array } @@ -1500,7 +1957,7 @@ public async System.Threading.Tasks.Task> TestClientMod } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (ModelClient) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(ModelClient))); } @@ -1619,7 +2076,7 @@ public ApiResponse TestEndpointParametersWithHttpInfo (decimal? number, } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -1739,7 +2196,7 @@ public async System.Threading.Tasks.Task> TestEndpointParame } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -1822,7 +2279,7 @@ public ApiResponse TestEnumParametersWithHttpInfo (List enumHead } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -1906,7 +2363,178 @@ public async System.Threading.Tasks.Task> TestEnumParameters } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), + null); + } + + /// + /// Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters (optional) + /// + /// Thrown when fails to make API call + /// Required String in group parameters + /// Required Boolean in group parameters + /// Required Integer in group parameters + /// String in group parameters (optional) + /// Boolean in group parameters (optional) + /// Integer in group parameters (optional) + /// + public void TestGroupParameters (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null) + { + TestGroupParametersWithHttpInfo(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + } + + /// + /// Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters (optional) + /// + /// Thrown when fails to make API call + /// Required String in group parameters + /// Required Boolean in group parameters + /// Required Integer in group parameters + /// String in group parameters (optional) + /// Boolean in group parameters (optional) + /// Integer in group parameters (optional) + /// ApiResponse of Object(void) + public ApiResponse TestGroupParametersWithHttpInfo (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null) + { + // verify the required parameter 'requiredStringGroup' is set + if (requiredStringGroup == null) + throw new ApiException(400, "Missing required parameter 'requiredStringGroup' when calling FakeApi->TestGroupParameters"); + // verify the required parameter 'requiredBooleanGroup' is set + if (requiredBooleanGroup == null) + throw new ApiException(400, "Missing required parameter 'requiredBooleanGroup' when calling FakeApi->TestGroupParameters"); + // verify the required parameter 'requiredInt64Group' is set + if (requiredInt64Group == null) + throw new ApiException(400, "Missing required parameter 'requiredInt64Group' when calling FakeApi->TestGroupParameters"); + + var localVarPath = "./fake"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (requiredStringGroup != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "required_string_group", requiredStringGroup)); // query parameter + if (requiredInt64Group != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "required_int64_group", requiredInt64Group)); // query parameter + if (stringGroup != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "string_group", stringGroup)); // query parameter + if (int64Group != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "int64_group", int64Group)); // query parameter + if (requiredBooleanGroup != null) localVarHeaderParams.Add("required_boolean_group", this.Configuration.ApiClient.ParameterToString(requiredBooleanGroup)); // header parameter + if (booleanGroup != null) localVarHeaderParams.Add("boolean_group", this.Configuration.ApiClient.ParameterToString(booleanGroup)); // header parameter + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, + Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestGroupParameters", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), + null); + } + + /// + /// Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters (optional) + /// + /// Thrown when fails to make API call + /// Required String in group parameters + /// Required Boolean in group parameters + /// Required Integer in group parameters + /// String in group parameters (optional) + /// Boolean in group parameters (optional) + /// Integer in group parameters (optional) + /// Task of void + public async System.Threading.Tasks.Task TestGroupParametersAsync (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null) + { + await TestGroupParametersAsyncWithHttpInfo(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + + } + + /// + /// Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters (optional) + /// + /// Thrown when fails to make API call + /// Required String in group parameters + /// Required Boolean in group parameters + /// Required Integer in group parameters + /// String in group parameters (optional) + /// Boolean in group parameters (optional) + /// Integer in group parameters (optional) + /// Task of ApiResponse + public async System.Threading.Tasks.Task> TestGroupParametersAsyncWithHttpInfo (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null) + { + // verify the required parameter 'requiredStringGroup' is set + if (requiredStringGroup == null) + throw new ApiException(400, "Missing required parameter 'requiredStringGroup' when calling FakeApi->TestGroupParameters"); + // verify the required parameter 'requiredBooleanGroup' is set + if (requiredBooleanGroup == null) + throw new ApiException(400, "Missing required parameter 'requiredBooleanGroup' when calling FakeApi->TestGroupParameters"); + // verify the required parameter 'requiredInt64Group' is set + if (requiredInt64Group == null) + throw new ApiException(400, "Missing required parameter 'requiredInt64Group' when calling FakeApi->TestGroupParameters"); + + var localVarPath = "./fake"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (requiredStringGroup != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "required_string_group", requiredStringGroup)); // query parameter + if (requiredInt64Group != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "required_int64_group", requiredInt64Group)); // query parameter + if (stringGroup != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "string_group", stringGroup)); // query parameter + if (int64Group != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "int64_group", int64Group)); // query parameter + if (requiredBooleanGroup != null) localVarHeaderParams.Add("required_boolean_group", this.Configuration.ApiClient.ParameterToString(requiredBooleanGroup)); // header parameter + if (booleanGroup != null) localVarHeaderParams.Add("boolean_group", this.Configuration.ApiClient.ParameterToString(booleanGroup)); // header parameter + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestGroupParameters", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -1914,24 +2542,24 @@ public async System.Threading.Tasks.Task> TestEnumParameters /// test inline additionalProperties /// /// Thrown when fails to make API call - /// request body + /// request body /// - public void TestInlineAdditionalProperties (Dictionary requestBody) + public void TestInlineAdditionalProperties (Dictionary param) { - TestInlineAdditionalPropertiesWithHttpInfo(requestBody); + TestInlineAdditionalPropertiesWithHttpInfo(param); } /// /// test inline additionalProperties /// /// Thrown when fails to make API call - /// request body + /// request body /// ApiResponse of Object(void) - public ApiResponse TestInlineAdditionalPropertiesWithHttpInfo (Dictionary requestBody) + public ApiResponse TestInlineAdditionalPropertiesWithHttpInfo (Dictionary param) { - // verify the required parameter 'requestBody' is set - if (requestBody == null) - throw new ApiException(400, "Missing required parameter 'requestBody' when calling FakeApi->TestInlineAdditionalProperties"); + // verify the required parameter 'param' is set + if (param == null) + throw new ApiException(400, "Missing required parameter 'param' when calling FakeApi->TestInlineAdditionalProperties"); var localVarPath = "./fake/inline-additionalProperties"; var localVarPathParams = new Dictionary(); @@ -1954,13 +2582,13 @@ public ApiResponse TestInlineAdditionalPropertiesWithHttpInfo (Dictionar if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (requestBody != null && requestBody.GetType() != typeof(byte[])) + if (param != null && param.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(requestBody); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(param); // http body (model) parameter } else { - localVarPostBody = requestBody; // byte array + localVarPostBody = param; // byte array } @@ -1978,7 +2606,7 @@ public ApiResponse TestInlineAdditionalPropertiesWithHttpInfo (Dictionar } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -1986,11 +2614,11 @@ public ApiResponse TestInlineAdditionalPropertiesWithHttpInfo (Dictionar /// test inline additionalProperties /// /// Thrown when fails to make API call - /// request body + /// request body /// Task of void - public async System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Dictionary requestBody) + public async System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Dictionary param) { - await TestInlineAdditionalPropertiesAsyncWithHttpInfo(requestBody); + await TestInlineAdditionalPropertiesAsyncWithHttpInfo(param); } @@ -1998,13 +2626,13 @@ public async System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Di /// test inline additionalProperties /// /// Thrown when fails to make API call - /// request body + /// request body /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestInlineAdditionalPropertiesAsyncWithHttpInfo (Dictionary requestBody) + public async System.Threading.Tasks.Task> TestInlineAdditionalPropertiesAsyncWithHttpInfo (Dictionary param) { - // verify the required parameter 'requestBody' is set - if (requestBody == null) - throw new ApiException(400, "Missing required parameter 'requestBody' when calling FakeApi->TestInlineAdditionalProperties"); + // verify the required parameter 'param' is set + if (param == null) + throw new ApiException(400, "Missing required parameter 'param' when calling FakeApi->TestInlineAdditionalProperties"); var localVarPath = "./fake/inline-additionalProperties"; var localVarPathParams = new Dictionary(); @@ -2027,13 +2655,13 @@ public async System.Threading.Tasks.Task> TestInlineAddition if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (requestBody != null && requestBody.GetType() != typeof(byte[])) + if (param != null && param.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(requestBody); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(param); // http body (model) parameter } else { - localVarPostBody = requestBody; // byte array + localVarPostBody = param; // byte array } @@ -2051,7 +2679,7 @@ public async System.Threading.Tasks.Task> TestInlineAddition } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -2122,7 +2750,7 @@ public ApiResponse TestJsonFormDataWithHttpInfo (string param, string pa } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -2194,7 +2822,7 @@ public async System.Threading.Tasks.Task> TestJsonFormDataAs } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index 56e8adf19336..15a124d69b36 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -31,9 +31,9 @@ public interface IFakeClassnameTags123Api : IApiAccessor /// To test class name in snake case /// /// Thrown when fails to make API call - /// client model + /// client model /// ModelClient - ModelClient TestClassname (ModelClient modelClient); + ModelClient TestClassname (ModelClient body); /// /// To test class name in snake case @@ -42,9 +42,9 @@ public interface IFakeClassnameTags123Api : IApiAccessor /// To test class name in snake case /// /// Thrown when fails to make API call - /// client model + /// client model /// ApiResponse of ModelClient - ApiResponse TestClassnameWithHttpInfo (ModelClient modelClient); + ApiResponse TestClassnameWithHttpInfo (ModelClient body); #endregion Synchronous Operations #region Asynchronous Operations /// @@ -54,9 +54,9 @@ public interface IFakeClassnameTags123Api : IApiAccessor /// To test class name in snake case /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ModelClient - System.Threading.Tasks.Task TestClassnameAsync (ModelClient modelClient); + System.Threading.Tasks.Task TestClassnameAsync (ModelClient body); /// /// To test class name in snake case @@ -65,9 +65,9 @@ public interface IFakeClassnameTags123Api : IApiAccessor /// To test class name in snake case /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ApiResponse (ModelClient) - System.Threading.Tasks.Task> TestClassnameAsyncWithHttpInfo (ModelClient modelClient); + System.Threading.Tasks.Task> TestClassnameAsyncWithHttpInfo (ModelClient body); #endregion Asynchronous Operations } @@ -89,6 +89,17 @@ public FakeClassnameTags123Api(String basePath) ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; } + /// + /// Initializes a new instance of the class + /// + /// + public FakeClassnameTags123Api() + { + this.Configuration = Org.OpenAPITools.Client.Configuration.Default; + + ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; + } + /// /// Initializes a new instance of the class /// using Configuration object @@ -172,11 +183,11 @@ public void AddDefaultHeader(string key, string value) /// To test class name in snake case To test class name in snake case /// /// Thrown when fails to make API call - /// client model + /// client model /// ModelClient - public ModelClient TestClassname (ModelClient modelClient) + public ModelClient TestClassname (ModelClient body) { - ApiResponse localVarResponse = TestClassnameWithHttpInfo(modelClient); + ApiResponse localVarResponse = TestClassnameWithHttpInfo(body); return localVarResponse.Data; } @@ -184,13 +195,13 @@ public ModelClient TestClassname (ModelClient modelClient) /// To test class name in snake case To test class name in snake case /// /// Thrown when fails to make API call - /// client model + /// client model /// ApiResponse of ModelClient - public ApiResponse< ModelClient > TestClassnameWithHttpInfo (ModelClient modelClient) + public ApiResponse< ModelClient > TestClassnameWithHttpInfo (ModelClient body) { - // verify the required parameter 'modelClient' is set - if (modelClient == null) - throw new ApiException(400, "Missing required parameter 'modelClient' when calling FakeClassnameTags123Api->TestClassname"); + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling FakeClassnameTags123Api->TestClassname"); var localVarPath = "./fake_classname_test"; var localVarPathParams = new Dictionary(); @@ -214,13 +225,13 @@ public ApiResponse< ModelClient > TestClassnameWithHttpInfo (ModelClient modelCl if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (modelClient != null && modelClient.GetType() != typeof(byte[])) + if (body != null && body.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(modelClient); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { - localVarPostBody = modelClient; // byte array + localVarPostBody = body; // byte array } // authentication (api_key_query) required @@ -243,7 +254,7 @@ public ApiResponse< ModelClient > TestClassnameWithHttpInfo (ModelClient modelCl } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (ModelClient) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(ModelClient))); } @@ -251,11 +262,11 @@ public ApiResponse< ModelClient > TestClassnameWithHttpInfo (ModelClient modelCl /// To test class name in snake case To test class name in snake case /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ModelClient - public async System.Threading.Tasks.Task TestClassnameAsync (ModelClient modelClient) + public async System.Threading.Tasks.Task TestClassnameAsync (ModelClient body) { - ApiResponse localVarResponse = await TestClassnameAsyncWithHttpInfo(modelClient); + ApiResponse localVarResponse = await TestClassnameAsyncWithHttpInfo(body); return localVarResponse.Data; } @@ -264,13 +275,13 @@ public async System.Threading.Tasks.Task TestClassnameAsync (ModelC /// To test class name in snake case To test class name in snake case /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ApiResponse (ModelClient) - public async System.Threading.Tasks.Task> TestClassnameAsyncWithHttpInfo (ModelClient modelClient) + public async System.Threading.Tasks.Task> TestClassnameAsyncWithHttpInfo (ModelClient body) { - // verify the required parameter 'modelClient' is set - if (modelClient == null) - throw new ApiException(400, "Missing required parameter 'modelClient' when calling FakeClassnameTags123Api->TestClassname"); + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling FakeClassnameTags123Api->TestClassname"); var localVarPath = "./fake_classname_test"; var localVarPathParams = new Dictionary(); @@ -294,13 +305,13 @@ public async System.Threading.Tasks.Task> TestClassname if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (modelClient != null && modelClient.GetType() != typeof(byte[])) + if (body != null && body.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(modelClient); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { - localVarPostBody = modelClient; // byte array + localVarPostBody = body; // byte array } // authentication (api_key_query) required @@ -323,7 +334,7 @@ public async System.Threading.Tasks.Task> TestClassname } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (ModelClient) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(ModelClient))); } diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/PetApi.cs index f34cfb4d6a36..9cf187dae40e 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/PetApi.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -31,9 +31,9 @@ public interface IPetApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// - void AddPet (Pet pet); + void AddPet (Pet body); /// /// Add a new pet to the store @@ -42,9 +42,9 @@ public interface IPetApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// ApiResponse of Object(void) - ApiResponse AddPetWithHttpInfo (Pet pet); + ApiResponse AddPetWithHttpInfo (Pet body); /// /// Deletes a pet /// @@ -138,9 +138,9 @@ public interface IPetApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// - void UpdatePet (Pet pet); + void UpdatePet (Pet body); /// /// Update an existing pet @@ -149,9 +149,9 @@ public interface IPetApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// ApiResponse of Object(void) - ApiResponse UpdatePetWithHttpInfo (Pet pet); + ApiResponse UpdatePetWithHttpInfo (Pet body); /// /// Updates a pet in the store with form data /// @@ -202,6 +202,31 @@ public interface IPetApi : IApiAccessor /// file to upload (optional) /// ApiResponse of ApiResponse ApiResponse UploadFileWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream file = null); + /// + /// uploads an image (required) + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// file to upload + /// Additional data to pass to server (optional) + /// ApiResponse + ApiResponse UploadFileWithRequiredFile (long? petId, System.IO.Stream requiredFile, string additionalMetadata = null); + + /// + /// uploads an image (required) + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// file to upload + /// Additional data to pass to server (optional) + /// ApiResponse of ApiResponse + ApiResponse UploadFileWithRequiredFileWithHttpInfo (long? petId, System.IO.Stream requiredFile, string additionalMetadata = null); #endregion Synchronous Operations #region Asynchronous Operations /// @@ -211,9 +236,9 @@ public interface IPetApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// Task of void - System.Threading.Tasks.Task AddPetAsync (Pet pet); + System.Threading.Tasks.Task AddPetAsync (Pet body); /// /// Add a new pet to the store @@ -222,9 +247,9 @@ public interface IPetApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// Task of ApiResponse - System.Threading.Tasks.Task> AddPetAsyncWithHttpInfo (Pet pet); + System.Threading.Tasks.Task> AddPetAsyncWithHttpInfo (Pet body); /// /// Deletes a pet /// @@ -318,9 +343,9 @@ public interface IPetApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// Task of void - System.Threading.Tasks.Task UpdatePetAsync (Pet pet); + System.Threading.Tasks.Task UpdatePetAsync (Pet body); /// /// Update an existing pet @@ -329,9 +354,9 @@ public interface IPetApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// Task of ApiResponse - System.Threading.Tasks.Task> UpdatePetAsyncWithHttpInfo (Pet pet); + System.Threading.Tasks.Task> UpdatePetAsyncWithHttpInfo (Pet body); /// /// Updates a pet in the store with form data /// @@ -382,6 +407,31 @@ public interface IPetApi : IApiAccessor /// file to upload (optional) /// Task of ApiResponse (ApiResponse) System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream file = null); + /// + /// uploads an image (required) + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// file to upload + /// Additional data to pass to server (optional) + /// Task of ApiResponse + System.Threading.Tasks.Task UploadFileWithRequiredFileAsync (long? petId, System.IO.Stream requiredFile, string additionalMetadata = null); + + /// + /// uploads an image (required) + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// file to upload + /// Additional data to pass to server (optional) + /// Task of ApiResponse (ApiResponse) + System.Threading.Tasks.Task> UploadFileWithRequiredFileAsyncWithHttpInfo (long? petId, System.IO.Stream requiredFile, string additionalMetadata = null); #endregion Asynchronous Operations } @@ -403,6 +453,17 @@ public PetApi(String basePath) ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; } + /// + /// Initializes a new instance of the class + /// + /// + public PetApi() + { + this.Configuration = Org.OpenAPITools.Client.Configuration.Default; + + ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; + } + /// /// Initializes a new instance of the class /// using Configuration object @@ -486,24 +547,24 @@ public void AddDefaultHeader(string key, string value) /// Add a new pet to the store /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// - public void AddPet (Pet pet) + public void AddPet (Pet body) { - AddPetWithHttpInfo(pet); + AddPetWithHttpInfo(body); } /// /// Add a new pet to the store /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// ApiResponse of Object(void) - public ApiResponse AddPetWithHttpInfo (Pet pet) + public ApiResponse AddPetWithHttpInfo (Pet body) { - // verify the required parameter 'pet' is set - if (pet == null) - throw new ApiException(400, "Missing required parameter 'pet' when calling PetApi->AddPet"); + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling PetApi->AddPet"); var localVarPath = "./pet"; var localVarPathParams = new Dictionary(); @@ -527,13 +588,13 @@ public ApiResponse AddPetWithHttpInfo (Pet pet) if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (pet != null && pet.GetType() != typeof(byte[])) + if (body != null && body.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(pet); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { - localVarPostBody = pet; // byte array + localVarPostBody = body; // byte array } // authentication (petstore_auth) required @@ -557,7 +618,7 @@ public ApiResponse AddPetWithHttpInfo (Pet pet) } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -565,11 +626,11 @@ public ApiResponse AddPetWithHttpInfo (Pet pet) /// Add a new pet to the store /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// Task of void - public async System.Threading.Tasks.Task AddPetAsync (Pet pet) + public async System.Threading.Tasks.Task AddPetAsync (Pet body) { - await AddPetAsyncWithHttpInfo(pet); + await AddPetAsyncWithHttpInfo(body); } @@ -577,13 +638,13 @@ public async System.Threading.Tasks.Task AddPetAsync (Pet pet) /// Add a new pet to the store /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// Task of ApiResponse - public async System.Threading.Tasks.Task> AddPetAsyncWithHttpInfo (Pet pet) + public async System.Threading.Tasks.Task> AddPetAsyncWithHttpInfo (Pet body) { - // verify the required parameter 'pet' is set - if (pet == null) - throw new ApiException(400, "Missing required parameter 'pet' when calling PetApi->AddPet"); + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling PetApi->AddPet"); var localVarPath = "./pet"; var localVarPathParams = new Dictionary(); @@ -607,13 +668,13 @@ public async System.Threading.Tasks.Task> AddPetAsyncWithHtt if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (pet != null && pet.GetType() != typeof(byte[])) + if (body != null && body.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(pet); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { - localVarPostBody = pet; // byte array + localVarPostBody = body; // byte array } // authentication (petstore_auth) required @@ -637,7 +698,7 @@ public async System.Threading.Tasks.Task> AddPetAsyncWithHtt } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -710,7 +771,7 @@ public ApiResponse DeletePetWithHttpInfo (long? petId, string apiKey = n } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -784,7 +845,7 @@ public async System.Threading.Tasks.Task> DeletePetAsyncWith } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -857,7 +918,7 @@ public ApiResponse< List > FindPetsByStatusWithHttpInfo (List statu } return new ApiResponse>(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (List) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); } @@ -931,7 +992,7 @@ public async System.Threading.Tasks.Task>> FindPetsByStatu } return new ApiResponse>(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (List) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); } @@ -1004,7 +1065,7 @@ public ApiResponse< List > FindPetsByTagsWithHttpInfo (List tags) } return new ApiResponse>(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (List) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); } @@ -1078,7 +1139,7 @@ public async System.Threading.Tasks.Task>> FindPetsByTagsA } return new ApiResponse>(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (List) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); } @@ -1150,7 +1211,7 @@ public ApiResponse< Pet > GetPetByIdWithHttpInfo (long? petId) } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (Pet) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Pet))); } @@ -1223,7 +1284,7 @@ public async System.Threading.Tasks.Task> GetPetByIdAsyncWithHt } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (Pet) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Pet))); } @@ -1231,24 +1292,24 @@ public async System.Threading.Tasks.Task> GetPetByIdAsyncWithHt /// Update an existing pet /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// - public void UpdatePet (Pet pet) + public void UpdatePet (Pet body) { - UpdatePetWithHttpInfo(pet); + UpdatePetWithHttpInfo(body); } /// /// Update an existing pet /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// ApiResponse of Object(void) - public ApiResponse UpdatePetWithHttpInfo (Pet pet) + public ApiResponse UpdatePetWithHttpInfo (Pet body) { - // verify the required parameter 'pet' is set - if (pet == null) - throw new ApiException(400, "Missing required parameter 'pet' when calling PetApi->UpdatePet"); + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling PetApi->UpdatePet"); var localVarPath = "./pet"; var localVarPathParams = new Dictionary(); @@ -1272,13 +1333,13 @@ public ApiResponse UpdatePetWithHttpInfo (Pet pet) if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (pet != null && pet.GetType() != typeof(byte[])) + if (body != null && body.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(pet); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { - localVarPostBody = pet; // byte array + localVarPostBody = body; // byte array } // authentication (petstore_auth) required @@ -1302,7 +1363,7 @@ public ApiResponse UpdatePetWithHttpInfo (Pet pet) } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -1310,11 +1371,11 @@ public ApiResponse UpdatePetWithHttpInfo (Pet pet) /// Update an existing pet /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// Task of void - public async System.Threading.Tasks.Task UpdatePetAsync (Pet pet) + public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) { - await UpdatePetAsyncWithHttpInfo(pet); + await UpdatePetAsyncWithHttpInfo(body); } @@ -1322,13 +1383,13 @@ public async System.Threading.Tasks.Task UpdatePetAsync (Pet pet) /// Update an existing pet /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// Task of ApiResponse - public async System.Threading.Tasks.Task> UpdatePetAsyncWithHttpInfo (Pet pet) + public async System.Threading.Tasks.Task> UpdatePetAsyncWithHttpInfo (Pet body) { - // verify the required parameter 'pet' is set - if (pet == null) - throw new ApiException(400, "Missing required parameter 'pet' when calling PetApi->UpdatePet"); + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling PetApi->UpdatePet"); var localVarPath = "./pet"; var localVarPathParams = new Dictionary(); @@ -1352,13 +1413,13 @@ public async System.Threading.Tasks.Task> UpdatePetAsyncWith if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (pet != null && pet.GetType() != typeof(byte[])) + if (body != null && body.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(pet); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { - localVarPostBody = pet; // byte array + localVarPostBody = body; // byte array } // authentication (petstore_auth) required @@ -1382,7 +1443,7 @@ public async System.Threading.Tasks.Task> UpdatePetAsyncWith } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -1459,7 +1520,7 @@ public ApiResponse UpdatePetWithFormWithHttpInfo (long? petId, string na } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -1537,7 +1598,7 @@ public async System.Threading.Tasks.Task> UpdatePetWithFormA } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -1616,7 +1677,7 @@ public ApiResponse< ApiResponse > UploadFileWithHttpInfo (long? petId, string ad } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (ApiResponse) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(ApiResponse))); } @@ -1696,7 +1757,172 @@ public async System.Threading.Tasks.Task> UploadFileAsy } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), + (ApiResponse) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(ApiResponse))); + } + + /// + /// uploads an image (required) + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// file to upload + /// Additional data to pass to server (optional) + /// ApiResponse + public ApiResponse UploadFileWithRequiredFile (long? petId, System.IO.Stream requiredFile, string additionalMetadata = null) + { + ApiResponse localVarResponse = UploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, additionalMetadata); + return localVarResponse.Data; + } + + /// + /// uploads an image (required) + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// file to upload + /// Additional data to pass to server (optional) + /// ApiResponse of ApiResponse + public ApiResponse< ApiResponse > UploadFileWithRequiredFileWithHttpInfo (long? petId, System.IO.Stream requiredFile, string additionalMetadata = null) + { + // verify the required parameter 'petId' is set + if (petId == null) + throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->UploadFileWithRequiredFile"); + // verify the required parameter 'requiredFile' is set + if (requiredFile == null) + throw new ApiException(400, "Missing required parameter 'requiredFile' when calling PetApi->UploadFileWithRequiredFile"); + + var localVarPath = "./fake/{petId}/uploadImageWithRequiredFile"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "multipart/form-data" + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/json" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (petId != null) localVarPathParams.Add("petId", this.Configuration.ApiClient.ParameterToString(petId)); // path parameter + if (additionalMetadata != null) localVarFormParams.Add("additionalMetadata", this.Configuration.ApiClient.ParameterToString(additionalMetadata)); // form parameter + if (requiredFile != null) localVarFileParams.Add("requiredFile", this.Configuration.ApiClient.ParameterToFile("requiredFile", requiredFile)); + + // authentication (petstore_auth) required + // oauth required + if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["Authorization"] = "Bearer " + this.Configuration.AccessToken; + } + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("UploadFileWithRequiredFile", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), + (ApiResponse) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(ApiResponse))); + } + + /// + /// uploads an image (required) + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// file to upload + /// Additional data to pass to server (optional) + /// Task of ApiResponse + public async System.Threading.Tasks.Task UploadFileWithRequiredFileAsync (long? petId, System.IO.Stream requiredFile, string additionalMetadata = null) + { + ApiResponse localVarResponse = await UploadFileWithRequiredFileAsyncWithHttpInfo(petId, requiredFile, additionalMetadata); + return localVarResponse.Data; + + } + + /// + /// uploads an image (required) + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// file to upload + /// Additional data to pass to server (optional) + /// Task of ApiResponse (ApiResponse) + public async System.Threading.Tasks.Task> UploadFileWithRequiredFileAsyncWithHttpInfo (long? petId, System.IO.Stream requiredFile, string additionalMetadata = null) + { + // verify the required parameter 'petId' is set + if (petId == null) + throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->UploadFileWithRequiredFile"); + // verify the required parameter 'requiredFile' is set + if (requiredFile == null) + throw new ApiException(400, "Missing required parameter 'requiredFile' when calling PetApi->UploadFileWithRequiredFile"); + + var localVarPath = "./fake/{petId}/uploadImageWithRequiredFile"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "multipart/form-data" + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/json" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (petId != null) localVarPathParams.Add("petId", this.Configuration.ApiClient.ParameterToString(petId)); // path parameter + if (additionalMetadata != null) localVarFormParams.Add("additionalMetadata", this.Configuration.ApiClient.ParameterToString(additionalMetadata)); // form parameter + if (requiredFile != null) localVarFileParams.Add("requiredFile", this.Configuration.ApiClient.ParameterToFile("requiredFile", requiredFile)); + + // authentication (petstore_auth) required + // oauth required + if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["Authorization"] = "Bearer " + this.Configuration.AccessToken; + } + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("UploadFileWithRequiredFile", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (ApiResponse) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(ApiResponse))); } diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/StoreApi.cs index d8184086b8d2..2823afda29c8 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/StoreApi.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -92,9 +92,9 @@ public interface IStoreApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// order placed for purchasing the pet + /// order placed for purchasing the pet /// Order - Order PlaceOrder (Order order); + Order PlaceOrder (Order body); /// /// Place an order for a pet @@ -103,9 +103,9 @@ public interface IStoreApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// order placed for purchasing the pet + /// order placed for purchasing the pet /// ApiResponse of Order - ApiResponse PlaceOrderWithHttpInfo (Order order); + ApiResponse PlaceOrderWithHttpInfo (Order body); #endregion Synchronous Operations #region Asynchronous Operations /// @@ -176,9 +176,9 @@ public interface IStoreApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// order placed for purchasing the pet + /// order placed for purchasing the pet /// Task of Order - System.Threading.Tasks.Task PlaceOrderAsync (Order order); + System.Threading.Tasks.Task PlaceOrderAsync (Order body); /// /// Place an order for a pet @@ -187,9 +187,9 @@ public interface IStoreApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// order placed for purchasing the pet + /// order placed for purchasing the pet /// Task of ApiResponse (Order) - System.Threading.Tasks.Task> PlaceOrderAsyncWithHttpInfo (Order order); + System.Threading.Tasks.Task> PlaceOrderAsyncWithHttpInfo (Order body); #endregion Asynchronous Operations } @@ -211,6 +211,17 @@ public StoreApi(String basePath) ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; } + /// + /// Initializes a new instance of the class + /// + /// + public StoreApi() + { + this.Configuration = Org.OpenAPITools.Client.Configuration.Default; + + ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; + } + /// /// Initializes a new instance of the class /// using Configuration object @@ -350,7 +361,7 @@ public ApiResponse DeleteOrderWithHttpInfo (string orderId) } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -415,7 +426,7 @@ public async System.Threading.Tasks.Task> DeleteOrderAsyncWi } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -480,7 +491,7 @@ public async System.Threading.Tasks.Task> DeleteOrderAsyncWi } return new ApiResponse>(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (Dictionary) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Dictionary))); } @@ -546,7 +557,7 @@ public async System.Threading.Tasks.Task> DeleteOrderAsyncWi } return new ApiResponse>(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (Dictionary) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Dictionary))); } @@ -613,7 +624,7 @@ public ApiResponse< Order > GetOrderByIdWithHttpInfo (long? orderId) } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (Order) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Order))); } @@ -681,7 +692,7 @@ public async System.Threading.Tasks.Task> GetOrderByIdAsyncWi } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (Order) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Order))); } @@ -689,11 +700,11 @@ public async System.Threading.Tasks.Task> GetOrderByIdAsyncWi /// Place an order for a pet /// /// Thrown when fails to make API call - /// order placed for purchasing the pet + /// order placed for purchasing the pet /// Order - public Order PlaceOrder (Order order) + public Order PlaceOrder (Order body) { - ApiResponse localVarResponse = PlaceOrderWithHttpInfo(order); + ApiResponse localVarResponse = PlaceOrderWithHttpInfo(body); return localVarResponse.Data; } @@ -701,13 +712,13 @@ public Order PlaceOrder (Order order) /// Place an order for a pet /// /// Thrown when fails to make API call - /// order placed for purchasing the pet + /// order placed for purchasing the pet /// ApiResponse of Order - public ApiResponse< Order > PlaceOrderWithHttpInfo (Order order) + public ApiResponse< Order > PlaceOrderWithHttpInfo (Order body) { - // verify the required parameter 'order' is set - if (order == null) - throw new ApiException(400, "Missing required parameter 'order' when calling StoreApi->PlaceOrder"); + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling StoreApi->PlaceOrder"); var localVarPath = "./store/order"; var localVarPathParams = new Dictionary(); @@ -731,13 +742,13 @@ public ApiResponse< Order > PlaceOrderWithHttpInfo (Order order) if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (order != null && order.GetType() != typeof(byte[])) + if (body != null && body.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(order); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { - localVarPostBody = order; // byte array + localVarPostBody = body; // byte array } @@ -755,7 +766,7 @@ public ApiResponse< Order > PlaceOrderWithHttpInfo (Order order) } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (Order) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Order))); } @@ -763,11 +774,11 @@ public ApiResponse< Order > PlaceOrderWithHttpInfo (Order order) /// Place an order for a pet /// /// Thrown when fails to make API call - /// order placed for purchasing the pet + /// order placed for purchasing the pet /// Task of Order - public async System.Threading.Tasks.Task PlaceOrderAsync (Order order) + public async System.Threading.Tasks.Task PlaceOrderAsync (Order body) { - ApiResponse localVarResponse = await PlaceOrderAsyncWithHttpInfo(order); + ApiResponse localVarResponse = await PlaceOrderAsyncWithHttpInfo(body); return localVarResponse.Data; } @@ -776,13 +787,13 @@ public async System.Threading.Tasks.Task PlaceOrderAsync (Order order) /// Place an order for a pet /// /// Thrown when fails to make API call - /// order placed for purchasing the pet + /// order placed for purchasing the pet /// Task of ApiResponse (Order) - public async System.Threading.Tasks.Task> PlaceOrderAsyncWithHttpInfo (Order order) + public async System.Threading.Tasks.Task> PlaceOrderAsyncWithHttpInfo (Order body) { - // verify the required parameter 'order' is set - if (order == null) - throw new ApiException(400, "Missing required parameter 'order' when calling StoreApi->PlaceOrder"); + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling StoreApi->PlaceOrder"); var localVarPath = "./store/order"; var localVarPathParams = new Dictionary(); @@ -806,13 +817,13 @@ public async System.Threading.Tasks.Task> PlaceOrderAsyncWith if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (order != null && order.GetType() != typeof(byte[])) + if (body != null && body.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(order); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { - localVarPostBody = order; // byte array + localVarPostBody = body; // byte array } @@ -830,7 +841,7 @@ public async System.Threading.Tasks.Task> PlaceOrderAsyncWith } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (Order) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Order))); } diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/UserApi.cs index 3d32cf792a2e..27a34b44a5c1 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/UserApi.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -31,9 +31,9 @@ public interface IUserApi : IApiAccessor /// This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object + /// Created user object /// - void CreateUser (User user); + void CreateUser (User body); /// /// Create user @@ -42,9 +42,9 @@ public interface IUserApi : IApiAccessor /// This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object + /// Created user object /// ApiResponse of Object(void) - ApiResponse CreateUserWithHttpInfo (User user); + ApiResponse CreateUserWithHttpInfo (User body); /// /// Creates list of users with given input array /// @@ -52,9 +52,9 @@ public interface IUserApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// - void CreateUsersWithArrayInput (List user); + void CreateUsersWithArrayInput (List body); /// /// Creates list of users with given input array @@ -63,9 +63,9 @@ public interface IUserApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// ApiResponse of Object(void) - ApiResponse CreateUsersWithArrayInputWithHttpInfo (List user); + ApiResponse CreateUsersWithArrayInputWithHttpInfo (List body); /// /// Creates list of users with given input array /// @@ -73,9 +73,9 @@ public interface IUserApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// - void CreateUsersWithListInput (List user); + void CreateUsersWithListInput (List body); /// /// Creates list of users with given input array @@ -84,9 +84,9 @@ public interface IUserApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// ApiResponse of Object(void) - ApiResponse CreateUsersWithListInputWithHttpInfo (List user); + ApiResponse CreateUsersWithListInputWithHttpInfo (List body); /// /// Delete user /// @@ -179,9 +179,9 @@ public interface IUserApi : IApiAccessor /// /// Thrown when fails to make API call /// name that need to be deleted - /// Updated user object + /// Updated user object /// - void UpdateUser (string username, User user); + void UpdateUser (string username, User body); /// /// Updated user @@ -191,9 +191,9 @@ public interface IUserApi : IApiAccessor /// /// Thrown when fails to make API call /// name that need to be deleted - /// Updated user object + /// Updated user object /// ApiResponse of Object(void) - ApiResponse UpdateUserWithHttpInfo (string username, User user); + ApiResponse UpdateUserWithHttpInfo (string username, User body); #endregion Synchronous Operations #region Asynchronous Operations /// @@ -203,9 +203,9 @@ public interface IUserApi : IApiAccessor /// This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object + /// Created user object /// Task of void - System.Threading.Tasks.Task CreateUserAsync (User user); + System.Threading.Tasks.Task CreateUserAsync (User body); /// /// Create user @@ -214,9 +214,9 @@ public interface IUserApi : IApiAccessor /// This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object + /// Created user object /// Task of ApiResponse - System.Threading.Tasks.Task> CreateUserAsyncWithHttpInfo (User user); + System.Threading.Tasks.Task> CreateUserAsyncWithHttpInfo (User body); /// /// Creates list of users with given input array /// @@ -224,9 +224,9 @@ public interface IUserApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// Task of void - System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List user); + System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List body); /// /// Creates list of users with given input array @@ -235,9 +235,9 @@ public interface IUserApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// Task of ApiResponse - System.Threading.Tasks.Task> CreateUsersWithArrayInputAsyncWithHttpInfo (List user); + System.Threading.Tasks.Task> CreateUsersWithArrayInputAsyncWithHttpInfo (List body); /// /// Creates list of users with given input array /// @@ -245,9 +245,9 @@ public interface IUserApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// Task of void - System.Threading.Tasks.Task CreateUsersWithListInputAsync (List user); + System.Threading.Tasks.Task CreateUsersWithListInputAsync (List body); /// /// Creates list of users with given input array @@ -256,9 +256,9 @@ public interface IUserApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// Task of ApiResponse - System.Threading.Tasks.Task> CreateUsersWithListInputAsyncWithHttpInfo (List user); + System.Threading.Tasks.Task> CreateUsersWithListInputAsyncWithHttpInfo (List body); /// /// Delete user /// @@ -351,9 +351,9 @@ public interface IUserApi : IApiAccessor /// /// Thrown when fails to make API call /// name that need to be deleted - /// Updated user object + /// Updated user object /// Task of void - System.Threading.Tasks.Task UpdateUserAsync (string username, User user); + System.Threading.Tasks.Task UpdateUserAsync (string username, User body); /// /// Updated user @@ -363,9 +363,9 @@ public interface IUserApi : IApiAccessor /// /// Thrown when fails to make API call /// name that need to be deleted - /// Updated user object + /// Updated user object /// Task of ApiResponse - System.Threading.Tasks.Task> UpdateUserAsyncWithHttpInfo (string username, User user); + System.Threading.Tasks.Task> UpdateUserAsyncWithHttpInfo (string username, User body); #endregion Asynchronous Operations } @@ -387,6 +387,17 @@ public UserApi(String basePath) ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; } + /// + /// Initializes a new instance of the class + /// + /// + public UserApi() + { + this.Configuration = Org.OpenAPITools.Client.Configuration.Default; + + ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; + } + /// /// Initializes a new instance of the class /// using Configuration object @@ -470,24 +481,24 @@ public void AddDefaultHeader(string key, string value) /// Create user This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object + /// Created user object /// - public void CreateUser (User user) + public void CreateUser (User body) { - CreateUserWithHttpInfo(user); + CreateUserWithHttpInfo(body); } /// /// Create user This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object + /// Created user object /// ApiResponse of Object(void) - public ApiResponse CreateUserWithHttpInfo (User user) + public ApiResponse CreateUserWithHttpInfo (User body) { - // verify the required parameter 'user' is set - if (user == null) - throw new ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUser"); + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUser"); var localVarPath = "./user"; var localVarPathParams = new Dictionary(); @@ -509,13 +520,13 @@ public ApiResponse CreateUserWithHttpInfo (User user) if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (user != null && user.GetType() != typeof(byte[])) + if (body != null && body.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(user); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { - localVarPostBody = user; // byte array + localVarPostBody = body; // byte array } @@ -533,7 +544,7 @@ public ApiResponse CreateUserWithHttpInfo (User user) } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -541,11 +552,11 @@ public ApiResponse CreateUserWithHttpInfo (User user) /// Create user This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object + /// Created user object /// Task of void - public async System.Threading.Tasks.Task CreateUserAsync (User user) + public async System.Threading.Tasks.Task CreateUserAsync (User body) { - await CreateUserAsyncWithHttpInfo(user); + await CreateUserAsyncWithHttpInfo(body); } @@ -553,13 +564,13 @@ public async System.Threading.Tasks.Task CreateUserAsync (User user) /// Create user This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object + /// Created user object /// Task of ApiResponse - public async System.Threading.Tasks.Task> CreateUserAsyncWithHttpInfo (User user) + public async System.Threading.Tasks.Task> CreateUserAsyncWithHttpInfo (User body) { - // verify the required parameter 'user' is set - if (user == null) - throw new ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUser"); + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUser"); var localVarPath = "./user"; var localVarPathParams = new Dictionary(); @@ -581,13 +592,13 @@ public async System.Threading.Tasks.Task> CreateUserAsyncWit if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (user != null && user.GetType() != typeof(byte[])) + if (body != null && body.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(user); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { - localVarPostBody = user; // byte array + localVarPostBody = body; // byte array } @@ -605,7 +616,7 @@ public async System.Threading.Tasks.Task> CreateUserAsyncWit } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -613,24 +624,24 @@ public async System.Threading.Tasks.Task> CreateUserAsyncWit /// Creates list of users with given input array /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// - public void CreateUsersWithArrayInput (List user) + public void CreateUsersWithArrayInput (List body) { - CreateUsersWithArrayInputWithHttpInfo(user); + CreateUsersWithArrayInputWithHttpInfo(body); } /// /// Creates list of users with given input array /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// ApiResponse of Object(void) - public ApiResponse CreateUsersWithArrayInputWithHttpInfo (List user) + public ApiResponse CreateUsersWithArrayInputWithHttpInfo (List body) { - // verify the required parameter 'user' is set - if (user == null) - throw new ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithArrayInput"); + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUsersWithArrayInput"); var localVarPath = "./user/createWithArray"; var localVarPathParams = new Dictionary(); @@ -652,13 +663,13 @@ public ApiResponse CreateUsersWithArrayInputWithHttpInfo (List use if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (user != null && user.GetType() != typeof(byte[])) + if (body != null && body.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(user); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { - localVarPostBody = user; // byte array + localVarPostBody = body; // byte array } @@ -676,7 +687,7 @@ public ApiResponse CreateUsersWithArrayInputWithHttpInfo (List use } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -684,11 +695,11 @@ public ApiResponse CreateUsersWithArrayInputWithHttpInfo (List use /// Creates list of users with given input array /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// Task of void - public async System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List user) + public async System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List body) { - await CreateUsersWithArrayInputAsyncWithHttpInfo(user); + await CreateUsersWithArrayInputAsyncWithHttpInfo(body); } @@ -696,13 +707,13 @@ public async System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List /// Thrown when fails to make API call - /// List of user object + /// List of user object /// Task of ApiResponse - public async System.Threading.Tasks.Task> CreateUsersWithArrayInputAsyncWithHttpInfo (List user) + public async System.Threading.Tasks.Task> CreateUsersWithArrayInputAsyncWithHttpInfo (List body) { - // verify the required parameter 'user' is set - if (user == null) - throw new ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithArrayInput"); + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUsersWithArrayInput"); var localVarPath = "./user/createWithArray"; var localVarPathParams = new Dictionary(); @@ -724,13 +735,13 @@ public async System.Threading.Tasks.Task> CreateUsersWithArr if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (user != null && user.GetType() != typeof(byte[])) + if (body != null && body.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(user); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { - localVarPostBody = user; // byte array + localVarPostBody = body; // byte array } @@ -748,7 +759,7 @@ public async System.Threading.Tasks.Task> CreateUsersWithArr } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -756,24 +767,24 @@ public async System.Threading.Tasks.Task> CreateUsersWithArr /// Creates list of users with given input array /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// - public void CreateUsersWithListInput (List user) + public void CreateUsersWithListInput (List body) { - CreateUsersWithListInputWithHttpInfo(user); + CreateUsersWithListInputWithHttpInfo(body); } /// /// Creates list of users with given input array /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// ApiResponse of Object(void) - public ApiResponse CreateUsersWithListInputWithHttpInfo (List user) + public ApiResponse CreateUsersWithListInputWithHttpInfo (List body) { - // verify the required parameter 'user' is set - if (user == null) - throw new ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithListInput"); + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUsersWithListInput"); var localVarPath = "./user/createWithList"; var localVarPathParams = new Dictionary(); @@ -795,13 +806,13 @@ public ApiResponse CreateUsersWithListInputWithHttpInfo (List user if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (user != null && user.GetType() != typeof(byte[])) + if (body != null && body.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(user); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { - localVarPostBody = user; // byte array + localVarPostBody = body; // byte array } @@ -819,7 +830,7 @@ public ApiResponse CreateUsersWithListInputWithHttpInfo (List user } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -827,11 +838,11 @@ public ApiResponse CreateUsersWithListInputWithHttpInfo (List user /// Creates list of users with given input array /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// Task of void - public async System.Threading.Tasks.Task CreateUsersWithListInputAsync (List user) + public async System.Threading.Tasks.Task CreateUsersWithListInputAsync (List body) { - await CreateUsersWithListInputAsyncWithHttpInfo(user); + await CreateUsersWithListInputAsyncWithHttpInfo(body); } @@ -839,13 +850,13 @@ public async System.Threading.Tasks.Task CreateUsersWithListInputAsync (List /// Thrown when fails to make API call - /// List of user object + /// List of user object /// Task of ApiResponse - public async System.Threading.Tasks.Task> CreateUsersWithListInputAsyncWithHttpInfo (List user) + public async System.Threading.Tasks.Task> CreateUsersWithListInputAsyncWithHttpInfo (List body) { - // verify the required parameter 'user' is set - if (user == null) - throw new ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithListInput"); + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUsersWithListInput"); var localVarPath = "./user/createWithList"; var localVarPathParams = new Dictionary(); @@ -867,13 +878,13 @@ public async System.Threading.Tasks.Task> CreateUsersWithLis if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (user != null && user.GetType() != typeof(byte[])) + if (body != null && body.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(user); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { - localVarPostBody = user; // byte array + localVarPostBody = body; // byte array } @@ -891,7 +902,7 @@ public async System.Threading.Tasks.Task> CreateUsersWithLis } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -955,7 +966,7 @@ public ApiResponse DeleteUserWithHttpInfo (string username) } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -1020,7 +1031,7 @@ public async System.Threading.Tasks.Task> DeleteUserAsyncWit } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -1087,7 +1098,7 @@ public ApiResponse< User > GetUserByNameWithHttpInfo (string username) } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (User) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(User))); } @@ -1155,7 +1166,7 @@ public async System.Threading.Tasks.Task> GetUserByNameAsyncWi } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (User) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(User))); } @@ -1228,7 +1239,7 @@ public ApiResponse< string > LoginUserWithHttpInfo (string username, string pass } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (string) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(string))); } @@ -1302,7 +1313,7 @@ public async System.Threading.Tasks.Task> LoginUserAsyncWith } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (string) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(string))); } @@ -1360,7 +1371,7 @@ public ApiResponse LogoutUserWithHttpInfo () } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -1419,7 +1430,7 @@ public async System.Threading.Tasks.Task> LogoutUserAsyncWit } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -1428,11 +1439,11 @@ public async System.Threading.Tasks.Task> LogoutUserAsyncWit /// /// Thrown when fails to make API call /// name that need to be deleted - /// Updated user object + /// Updated user object /// - public void UpdateUser (string username, User user) + public void UpdateUser (string username, User body) { - UpdateUserWithHttpInfo(username, user); + UpdateUserWithHttpInfo(username, body); } /// @@ -1440,16 +1451,16 @@ public void UpdateUser (string username, User user) /// /// Thrown when fails to make API call /// name that need to be deleted - /// Updated user object + /// Updated user object /// ApiResponse of Object(void) - public ApiResponse UpdateUserWithHttpInfo (string username, User user) + public ApiResponse UpdateUserWithHttpInfo (string username, User body) { // verify the required parameter 'username' is set if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->UpdateUser"); - // verify the required parameter 'user' is set - if (user == null) - throw new ApiException(400, "Missing required parameter 'user' when calling UserApi->UpdateUser"); + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->UpdateUser"); var localVarPath = "./user/{username}"; var localVarPathParams = new Dictionary(); @@ -1472,13 +1483,13 @@ public ApiResponse UpdateUserWithHttpInfo (string username, User user) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); if (username != null) localVarPathParams.Add("username", this.Configuration.ApiClient.ParameterToString(username)); // path parameter - if (user != null && user.GetType() != typeof(byte[])) + if (body != null && body.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(user); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { - localVarPostBody = user; // byte array + localVarPostBody = body; // byte array } @@ -1496,7 +1507,7 @@ public ApiResponse UpdateUserWithHttpInfo (string username, User user) } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -1505,11 +1516,11 @@ public ApiResponse UpdateUserWithHttpInfo (string username, User user) /// /// Thrown when fails to make API call /// name that need to be deleted - /// Updated user object + /// Updated user object /// Task of void - public async System.Threading.Tasks.Task UpdateUserAsync (string username, User user) + public async System.Threading.Tasks.Task UpdateUserAsync (string username, User body) { - await UpdateUserAsyncWithHttpInfo(username, user); + await UpdateUserAsyncWithHttpInfo(username, body); } @@ -1518,16 +1529,16 @@ public async System.Threading.Tasks.Task UpdateUserAsync (string username, User /// /// Thrown when fails to make API call /// name that need to be deleted - /// Updated user object + /// Updated user object /// Task of ApiResponse - public async System.Threading.Tasks.Task> UpdateUserAsyncWithHttpInfo (string username, User user) + public async System.Threading.Tasks.Task> UpdateUserAsyncWithHttpInfo (string username, User body) { // verify the required parameter 'username' is set if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->UpdateUser"); - // verify the required parameter 'user' is set - if (user == null) - throw new ApiException(400, "Missing required parameter 'user' when calling UserApi->UpdateUser"); + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->UpdateUser"); var localVarPath = "./user/{username}"; var localVarPathParams = new Dictionary(); @@ -1550,13 +1561,13 @@ public async System.Threading.Tasks.Task> UpdateUserAsyncWit localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); if (username != null) localVarPathParams.Add("username", this.Configuration.ApiClient.ParameterToString(username)); // path parameter - if (user != null && user.GetType() != typeof(byte[])) + if (body != null && body.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(user); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { - localVarPostBody = user; // byte array + localVarPostBody = body; // byte array } @@ -1574,7 +1585,7 @@ public async System.Threading.Tasks.Task> UpdateUserAsyncWit } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/ApiClient.cs index 9030e01174f7..0311cd3aef50 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/ApiClient.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/ApiException.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/ApiException.cs index 875026e65f41..e7ac15569b93 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/ApiException.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/ApiException.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/ApiResponse.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/ApiResponse.cs index 3e395de9dfbb..4b462cf5424d 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/ApiResponse.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/ApiResponse.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/Configuration.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/Configuration.cs index fb26d766182d..e10bf1c07e71 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/Configuration.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/Configuration.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -323,7 +323,7 @@ public virtual string TempFolderPath } /// - /// Gets or sets the the date time format used when serializing in the ApiClient + /// Gets or sets the date time format used when serializing in the ApiClient /// By default, it's set to ISO 8601 - "o", for others see: /// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx /// and https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/ExceptionFactory.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/ExceptionFactory.cs index d5b663b3cbdf..343ea7ae2b6d 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/ExceptionFactory.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/ExceptionFactory.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/GlobalConfiguration.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/GlobalConfiguration.cs index 309e385f25a7..a79bea966bd5 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/GlobalConfiguration.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/GlobalConfiguration.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/IApiAccessor.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/IApiAccessor.cs index bf20655ef194..df00c43800c0 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/IApiAccessor.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/IApiAccessor.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/IReadableConfiguration.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/IReadableConfiguration.cs index 76a5f5124fdf..23e1a0c2e197 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/IReadableConfiguration.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/IReadableConfiguration.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs index 4f5c219d5c6e..a1bd6b08f3b1 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/AdditionalPropertiesAnyType.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/AdditionalPropertiesAnyType.cs new file mode 100644 index 000000000000..0b66cfaa72af --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/AdditionalPropertiesAnyType.cs @@ -0,0 +1,113 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// AdditionalPropertiesAnyType + /// + [DataContract] + public partial class AdditionalPropertiesAnyType : Dictionary, IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// name. + public AdditionalPropertiesAnyType(string name = default(string)) : base() + { + this.Name = name; + } + + /// + /// Gets or Sets Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class AdditionalPropertiesAnyType {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as AdditionalPropertiesAnyType); + } + + /// + /// Returns true if AdditionalPropertiesAnyType instances are equal + /// + /// Instance of AdditionalPropertiesAnyType to be compared + /// Boolean + public bool Equals(AdditionalPropertiesAnyType input) + { + if (input == null) + return false; + + return base.Equals(input) && + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.Name != null) + hashCode = hashCode * 59 + this.Name.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/AdditionalPropertiesArray.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/AdditionalPropertiesArray.cs new file mode 100644 index 000000000000..74e73ae5e690 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/AdditionalPropertiesArray.cs @@ -0,0 +1,113 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// AdditionalPropertiesArray + /// + [DataContract] + public partial class AdditionalPropertiesArray : Dictionary, IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// name. + public AdditionalPropertiesArray(string name = default(string)) : base() + { + this.Name = name; + } + + /// + /// Gets or Sets Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class AdditionalPropertiesArray {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as AdditionalPropertiesArray); + } + + /// + /// Returns true if AdditionalPropertiesArray instances are equal + /// + /// Instance of AdditionalPropertiesArray to be compared + /// Boolean + public bool Equals(AdditionalPropertiesArray input) + { + if (input == null) + return false; + + return base.Equals(input) && + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.Name != null) + hashCode = hashCode * 59 + this.Name.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/AdditionalPropertiesBoolean.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/AdditionalPropertiesBoolean.cs new file mode 100644 index 000000000000..9cff36e9c63d --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/AdditionalPropertiesBoolean.cs @@ -0,0 +1,113 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// AdditionalPropertiesBoolean + /// + [DataContract] + public partial class AdditionalPropertiesBoolean : Dictionary, IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// name. + public AdditionalPropertiesBoolean(string name = default(string)) : base() + { + this.Name = name; + } + + /// + /// Gets or Sets Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class AdditionalPropertiesBoolean {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as AdditionalPropertiesBoolean); + } + + /// + /// Returns true if AdditionalPropertiesBoolean instances are equal + /// + /// Instance of AdditionalPropertiesBoolean to be compared + /// Boolean + public bool Equals(AdditionalPropertiesBoolean input) + { + if (input == null) + return false; + + return base.Equals(input) && + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.Name != null) + hashCode = hashCode * 59 + this.Name.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index b98ed7cef6a9..45cb4e1ec3d5 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -31,25 +31,97 @@ public partial class AdditionalPropertiesClass : IEquatable /// Initializes a new instance of the class. /// - /// mapProperty. - /// mapOfMapProperty. - public AdditionalPropertiesClass(Dictionary mapProperty = default(Dictionary), Dictionary> mapOfMapProperty = default(Dictionary>)) + /// mapString. + /// mapNumber. + /// mapInteger. + /// mapBoolean. + /// mapArrayInteger. + /// mapArrayAnytype. + /// mapMapString. + /// mapMapAnytype. + /// anytype1. + /// anytype2. + /// anytype3. + public AdditionalPropertiesClass(Dictionary mapString = default(Dictionary), Dictionary mapNumber = default(Dictionary), Dictionary mapInteger = default(Dictionary), Dictionary mapBoolean = default(Dictionary), Dictionary> mapArrayInteger = default(Dictionary>), Dictionary> mapArrayAnytype = default(Dictionary>), Dictionary> mapMapString = default(Dictionary>), Dictionary> mapMapAnytype = default(Dictionary>), Object anytype1 = default(Object), Object anytype2 = default(Object), Object anytype3 = default(Object)) { - this.MapProperty = mapProperty; - this.MapOfMapProperty = mapOfMapProperty; + this.MapString = mapString; + this.MapNumber = mapNumber; + this.MapInteger = mapInteger; + this.MapBoolean = mapBoolean; + this.MapArrayInteger = mapArrayInteger; + this.MapArrayAnytype = mapArrayAnytype; + this.MapMapString = mapMapString; + this.MapMapAnytype = mapMapAnytype; + this.Anytype1 = anytype1; + this.Anytype2 = anytype2; + this.Anytype3 = anytype3; } /// - /// Gets or Sets MapProperty + /// Gets or Sets MapString /// - [DataMember(Name="map_property", EmitDefaultValue=false)] - public Dictionary MapProperty { get; set; } + [DataMember(Name="map_string", EmitDefaultValue=false)] + public Dictionary MapString { get; set; } /// - /// Gets or Sets MapOfMapProperty + /// Gets or Sets MapNumber /// - [DataMember(Name="map_of_map_property", EmitDefaultValue=false)] - public Dictionary> MapOfMapProperty { get; set; } + [DataMember(Name="map_number", EmitDefaultValue=false)] + public Dictionary MapNumber { get; set; } + + /// + /// Gets or Sets MapInteger + /// + [DataMember(Name="map_integer", EmitDefaultValue=false)] + public Dictionary MapInteger { get; set; } + + /// + /// Gets or Sets MapBoolean + /// + [DataMember(Name="map_boolean", EmitDefaultValue=false)] + public Dictionary MapBoolean { get; set; } + + /// + /// Gets or Sets MapArrayInteger + /// + [DataMember(Name="map_array_integer", EmitDefaultValue=false)] + public Dictionary> MapArrayInteger { get; set; } + + /// + /// Gets or Sets MapArrayAnytype + /// + [DataMember(Name="map_array_anytype", EmitDefaultValue=false)] + public Dictionary> MapArrayAnytype { get; set; } + + /// + /// Gets or Sets MapMapString + /// + [DataMember(Name="map_map_string", EmitDefaultValue=false)] + public Dictionary> MapMapString { get; set; } + + /// + /// Gets or Sets MapMapAnytype + /// + [DataMember(Name="map_map_anytype", EmitDefaultValue=false)] + public Dictionary> MapMapAnytype { get; set; } + + /// + /// Gets or Sets Anytype1 + /// + [DataMember(Name="anytype_1", EmitDefaultValue=false)] + public Object Anytype1 { get; set; } + + /// + /// Gets or Sets Anytype2 + /// + [DataMember(Name="anytype_2", EmitDefaultValue=false)] + public Object Anytype2 { get; set; } + + /// + /// Gets or Sets Anytype3 + /// + [DataMember(Name="anytype_3", EmitDefaultValue=false)] + public Object Anytype3 { get; set; } /// /// Returns the string presentation of the object @@ -59,8 +131,17 @@ public override string ToString() { var sb = new StringBuilder(); sb.Append("class AdditionalPropertiesClass {\n"); - sb.Append(" MapProperty: ").Append(MapProperty).Append("\n"); - sb.Append(" MapOfMapProperty: ").Append(MapOfMapProperty).Append("\n"); + sb.Append(" MapString: ").Append(MapString).Append("\n"); + sb.Append(" MapNumber: ").Append(MapNumber).Append("\n"); + sb.Append(" MapInteger: ").Append(MapInteger).Append("\n"); + sb.Append(" MapBoolean: ").Append(MapBoolean).Append("\n"); + sb.Append(" MapArrayInteger: ").Append(MapArrayInteger).Append("\n"); + sb.Append(" MapArrayAnytype: ").Append(MapArrayAnytype).Append("\n"); + sb.Append(" MapMapString: ").Append(MapMapString).Append("\n"); + sb.Append(" MapMapAnytype: ").Append(MapMapAnytype).Append("\n"); + sb.Append(" Anytype1: ").Append(Anytype1).Append("\n"); + sb.Append(" Anytype2: ").Append(Anytype2).Append("\n"); + sb.Append(" Anytype3: ").Append(Anytype3).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -96,14 +177,67 @@ public bool Equals(AdditionalPropertiesClass input) return ( - this.MapProperty == input.MapProperty || - this.MapProperty != null && - this.MapProperty.SequenceEqual(input.MapProperty) + this.MapString == input.MapString || + this.MapString != null && + input.MapString != null && + this.MapString.SequenceEqual(input.MapString) + ) && + ( + this.MapNumber == input.MapNumber || + this.MapNumber != null && + input.MapNumber != null && + this.MapNumber.SequenceEqual(input.MapNumber) + ) && + ( + this.MapInteger == input.MapInteger || + this.MapInteger != null && + input.MapInteger != null && + this.MapInteger.SequenceEqual(input.MapInteger) + ) && + ( + this.MapBoolean == input.MapBoolean || + this.MapBoolean != null && + input.MapBoolean != null && + this.MapBoolean.SequenceEqual(input.MapBoolean) + ) && + ( + this.MapArrayInteger == input.MapArrayInteger || + this.MapArrayInteger != null && + input.MapArrayInteger != null && + this.MapArrayInteger.SequenceEqual(input.MapArrayInteger) + ) && + ( + this.MapArrayAnytype == input.MapArrayAnytype || + this.MapArrayAnytype != null && + input.MapArrayAnytype != null && + this.MapArrayAnytype.SequenceEqual(input.MapArrayAnytype) + ) && + ( + this.MapMapString == input.MapMapString || + this.MapMapString != null && + input.MapMapString != null && + this.MapMapString.SequenceEqual(input.MapMapString) + ) && + ( + this.MapMapAnytype == input.MapMapAnytype || + this.MapMapAnytype != null && + input.MapMapAnytype != null && + this.MapMapAnytype.SequenceEqual(input.MapMapAnytype) + ) && + ( + this.Anytype1 == input.Anytype1 || + (this.Anytype1 != null && + this.Anytype1.Equals(input.Anytype1)) + ) && + ( + this.Anytype2 == input.Anytype2 || + (this.Anytype2 != null && + this.Anytype2.Equals(input.Anytype2)) ) && ( - this.MapOfMapProperty == input.MapOfMapProperty || - this.MapOfMapProperty != null && - this.MapOfMapProperty.SequenceEqual(input.MapOfMapProperty) + this.Anytype3 == input.Anytype3 || + (this.Anytype3 != null && + this.Anytype3.Equals(input.Anytype3)) ); } @@ -116,10 +250,28 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this.MapProperty != null) - hashCode = hashCode * 59 + this.MapProperty.GetHashCode(); - if (this.MapOfMapProperty != null) - hashCode = hashCode * 59 + this.MapOfMapProperty.GetHashCode(); + if (this.MapString != null) + hashCode = hashCode * 59 + this.MapString.GetHashCode(); + if (this.MapNumber != null) + hashCode = hashCode * 59 + this.MapNumber.GetHashCode(); + if (this.MapInteger != null) + hashCode = hashCode * 59 + this.MapInteger.GetHashCode(); + if (this.MapBoolean != null) + hashCode = hashCode * 59 + this.MapBoolean.GetHashCode(); + if (this.MapArrayInteger != null) + hashCode = hashCode * 59 + this.MapArrayInteger.GetHashCode(); + if (this.MapArrayAnytype != null) + hashCode = hashCode * 59 + this.MapArrayAnytype.GetHashCode(); + if (this.MapMapString != null) + hashCode = hashCode * 59 + this.MapMapString.GetHashCode(); + if (this.MapMapAnytype != null) + hashCode = hashCode * 59 + this.MapMapAnytype.GetHashCode(); + if (this.Anytype1 != null) + hashCode = hashCode * 59 + this.Anytype1.GetHashCode(); + if (this.Anytype2 != null) + hashCode = hashCode * 59 + this.Anytype2.GetHashCode(); + if (this.Anytype3 != null) + hashCode = hashCode * 59 + this.Anytype3.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/AdditionalPropertiesInteger.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/AdditionalPropertiesInteger.cs new file mode 100644 index 000000000000..bf955fdfa3c1 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/AdditionalPropertiesInteger.cs @@ -0,0 +1,113 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// AdditionalPropertiesInteger + /// + [DataContract] + public partial class AdditionalPropertiesInteger : Dictionary, IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// name. + public AdditionalPropertiesInteger(string name = default(string)) : base() + { + this.Name = name; + } + + /// + /// Gets or Sets Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class AdditionalPropertiesInteger {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as AdditionalPropertiesInteger); + } + + /// + /// Returns true if AdditionalPropertiesInteger instances are equal + /// + /// Instance of AdditionalPropertiesInteger to be compared + /// Boolean + public bool Equals(AdditionalPropertiesInteger input) + { + if (input == null) + return false; + + return base.Equals(input) && + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.Name != null) + hashCode = hashCode * 59 + this.Name.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/AdditionalPropertiesNumber.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/AdditionalPropertiesNumber.cs new file mode 100644 index 000000000000..884374ab2772 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/AdditionalPropertiesNumber.cs @@ -0,0 +1,113 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// AdditionalPropertiesNumber + /// + [DataContract] + public partial class AdditionalPropertiesNumber : Dictionary, IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// name. + public AdditionalPropertiesNumber(string name = default(string)) : base() + { + this.Name = name; + } + + /// + /// Gets or Sets Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class AdditionalPropertiesNumber {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as AdditionalPropertiesNumber); + } + + /// + /// Returns true if AdditionalPropertiesNumber instances are equal + /// + /// Instance of AdditionalPropertiesNumber to be compared + /// Boolean + public bool Equals(AdditionalPropertiesNumber input) + { + if (input == null) + return false; + + return base.Equals(input) && + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.Name != null) + hashCode = hashCode * 59 + this.Name.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/AdditionalPropertiesObject.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/AdditionalPropertiesObject.cs new file mode 100644 index 000000000000..d5e694f3fdcd --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/AdditionalPropertiesObject.cs @@ -0,0 +1,113 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// AdditionalPropertiesObject + /// + [DataContract] + public partial class AdditionalPropertiesObject : Dictionary>, IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// name. + public AdditionalPropertiesObject(string name = default(string)) : base() + { + this.Name = name; + } + + /// + /// Gets or Sets Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class AdditionalPropertiesObject {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as AdditionalPropertiesObject); + } + + /// + /// Returns true if AdditionalPropertiesObject instances are equal + /// + /// Instance of AdditionalPropertiesObject to be compared + /// Boolean + public bool Equals(AdditionalPropertiesObject input) + { + if (input == null) + return false; + + return base.Equals(input) && + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.Name != null) + hashCode = hashCode * 59 + this.Name.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/AdditionalPropertiesString.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/AdditionalPropertiesString.cs new file mode 100644 index 000000000000..0c211e824d15 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/AdditionalPropertiesString.cs @@ -0,0 +1,113 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// AdditionalPropertiesString + /// + [DataContract] + public partial class AdditionalPropertiesString : Dictionary, IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// name. + public AdditionalPropertiesString(string name = default(string)) : base() + { + this.Name = name; + } + + /// + /// Gets or Sets Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class AdditionalPropertiesString {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as AdditionalPropertiesString); + } + + /// + /// Returns true if AdditionalPropertiesString instances are equal + /// + /// Instance of AdditionalPropertiesString to be compared + /// Boolean + public bool Equals(AdditionalPropertiesString input) + { + if (input == null) + return false; + + return base.Equals(input) && + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.Name != null) + hashCode = hashCode * 59 + this.Name.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Animal.cs index 4dac740d2408..7f63524790a4 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Animal.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -27,7 +27,7 @@ namespace Org.OpenAPITools.Model /// Animal /// [DataContract] - [JsonConverter(typeof(JsonSubtypes), "className")] + [JsonConverter(typeof(JsonSubtypes), "ClassName")] [JsonSubtypes.KnownSubType(typeof(Dog), "Dog")] [JsonSubtypes.KnownSubType(typeof(Cat), "Cat")] public partial class Animal : IEquatable @@ -53,6 +53,7 @@ protected Animal() { } { this.ClassName = className; } + // use default value if no "color" provided if (color == null) { diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/ApiResponse.cs index d50d06721234..ac9b07f03ed2 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs index 5473bd7b9b13..3fc75a443739 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -89,6 +89,7 @@ public bool Equals(ArrayOfArrayOfNumberOnly input) ( this.ArrayArrayNumber == input.ArrayArrayNumber || this.ArrayArrayNumber != null && + input.ArrayArrayNumber != null && this.ArrayArrayNumber.SequenceEqual(input.ArrayArrayNumber) ); } diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs index 22a5449658b8..b9f18a8f2756 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -89,6 +89,7 @@ public bool Equals(ArrayOfNumberOnly input) ( this.ArrayNumber == input.ArrayNumber || this.ArrayNumber != null && + input.ArrayNumber != null && this.ArrayNumber.SequenceEqual(input.ArrayNumber) ); } diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/ArrayTest.cs index 9d7d5e9800b4..8ae85144836b 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/ArrayTest.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -107,16 +107,19 @@ public bool Equals(ArrayTest input) ( this.ArrayOfString == input.ArrayOfString || this.ArrayOfString != null && + input.ArrayOfString != null && this.ArrayOfString.SequenceEqual(input.ArrayOfString) ) && ( this.ArrayArrayOfInteger == input.ArrayArrayOfInteger || this.ArrayArrayOfInteger != null && + input.ArrayArrayOfInteger != null && this.ArrayArrayOfInteger.SequenceEqual(input.ArrayArrayOfInteger) ) && ( this.ArrayArrayOfModel == input.ArrayArrayOfModel || this.ArrayArrayOfModel != null && + input.ArrayArrayOfModel != null && this.ArrayArrayOfModel.SequenceEqual(input.ArrayArrayOfModel) ); } diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Capitalization.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Capitalization.cs index bdb5ed77da30..ca01a9ea1ddf 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Capitalization.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Capitalization.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Cat.cs index c4a1704371d0..57ff36b41d9d 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Cat.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/CatAllOf.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/CatAllOf.cs new file mode 100644 index 000000000000..f8cd1ab68db2 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/CatAllOf.cs @@ -0,0 +1,112 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// CatAllOf + /// + [DataContract] + public partial class CatAllOf : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// declawed. + public CatAllOf(bool? declawed = default(bool?)) + { + this.Declawed = declawed; + } + + /// + /// Gets or Sets Declawed + /// + [DataMember(Name="declawed", EmitDefaultValue=false)] + public bool? Declawed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class CatAllOf {\n"); + sb.Append(" Declawed: ").Append(Declawed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as CatAllOf); + } + + /// + /// Returns true if CatAllOf instances are equal + /// + /// Instance of CatAllOf to be compared + /// Boolean + public bool Equals(CatAllOf input) + { + if (input == null) + return false; + + return + ( + this.Declawed == input.Declawed || + (this.Declawed != null && + this.Declawed.Equals(input.Declawed)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Declawed != null) + hashCode = hashCode * 59 + this.Declawed.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Category.cs index 22b8d54d9dc3..a53ef65cbf68 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Category.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -28,15 +28,29 @@ namespace Org.OpenAPITools.Model [DataContract] public partial class Category : IEquatable { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Category() { } /// /// Initializes a new instance of the class. /// /// id. - /// name. - public Category(long? id = default(long?), string name = default(string)) + /// name (required) (default to "default-name"). + public Category(long? id = default(long?), string name = "default-name") { + // to ensure "name" is required (not null) + if (name == null) + { + throw new InvalidDataException("name is a required property for Category and cannot be null"); + } + else + { + this.Name = name; + } + this.Id = id; - this.Name = name; } /// diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/ClassModel.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/ClassModel.cs index 6ef81a1f05f0..bf180e2fd3d6 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/ClassModel.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/ClassModel.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Dog.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Dog.cs index 902c5ed92c34..503fe9a20ac2 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Dog.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Dog.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/DogAllOf.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/DogAllOf.cs new file mode 100644 index 000000000000..d4d0ee3f470e --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/DogAllOf.cs @@ -0,0 +1,112 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// DogAllOf + /// + [DataContract] + public partial class DogAllOf : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// breed. + public DogAllOf(string breed = default(string)) + { + this.Breed = breed; + } + + /// + /// Gets or Sets Breed + /// + [DataMember(Name="breed", EmitDefaultValue=false)] + public string Breed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class DogAllOf {\n"); + sb.Append(" Breed: ").Append(Breed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as DogAllOf); + } + + /// + /// Returns true if DogAllOf instances are equal + /// + /// Instance of DogAllOf to be compared + /// Boolean + public bool Equals(DogAllOf input) + { + if (input == null) + return false; + + return + ( + this.Breed == input.Breed || + (this.Breed != null && + this.Breed.Equals(input.Breed)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Breed != null) + hashCode = hashCode * 59 + this.Breed.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/EnumArrays.cs index 26c4194396d8..4c0e96fd213a 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/EnumArrays.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -34,18 +34,18 @@ public partial class EnumArrays : IEquatable [JsonConverter(typeof(StringEnumConverter))] public enum JustSymbolEnum { - /// /// Enum GreaterThanOrEqualTo for value: >= /// [EnumMember(Value = ">=")] GreaterThanOrEqualTo = 1, - + /// /// Enum Dollar for value: $ /// [EnumMember(Value = "$")] Dollar = 2 + } /// @@ -59,18 +59,18 @@ public enum JustSymbolEnum [JsonConverter(typeof(StringEnumConverter))] public enum ArrayEnumEnum { - /// /// Enum Fish for value: fish /// [EnumMember(Value = "fish")] Fish = 1, - + /// /// Enum Crab for value: crab /// [EnumMember(Value = "crab")] Crab = 2 + } @@ -144,6 +144,7 @@ public bool Equals(EnumArrays input) ( this.ArrayEnum == input.ArrayEnum || this.ArrayEnum != null && + input.ArrayEnum != null && this.ArrayEnum.SequenceEqual(input.ArrayEnum) ); } diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/EnumClass.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/EnumClass.cs index 8065505fd747..3f26d6323788 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/EnumClass.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/EnumClass.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -30,24 +30,24 @@ namespace Org.OpenAPITools.Model public enum EnumClass { - /// /// Enum Abc for value: _abc /// [EnumMember(Value = "_abc")] Abc = 1, - + /// /// Enum Efg for value: -efg /// [EnumMember(Value = "-efg")] Efg = 2, - + /// /// Enum Xyz for value: (xyz) /// [EnumMember(Value = "(xyz)")] Xyz = 3 + } } diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/EnumTest.cs index d148da13222a..8854d4e9610c 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/EnumTest.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/EnumTest.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -34,24 +34,24 @@ public partial class EnumTest : IEquatable [JsonConverter(typeof(StringEnumConverter))] public enum EnumStringEnum { - /// /// Enum UPPER for value: UPPER /// [EnumMember(Value = "UPPER")] UPPER = 1, - + /// /// Enum Lower for value: lower /// [EnumMember(Value = "lower")] Lower = 2, - + /// /// Enum Empty for value: /// [EnumMember(Value = "")] Empty = 3 + } /// @@ -65,24 +65,24 @@ public enum EnumStringEnum [JsonConverter(typeof(StringEnumConverter))] public enum EnumStringRequiredEnum { - /// /// Enum UPPER for value: UPPER /// [EnumMember(Value = "UPPER")] UPPER = 1, - + /// /// Enum Lower for value: lower /// [EnumMember(Value = "lower")] Lower = 2, - + /// /// Enum Empty for value: /// [EnumMember(Value = "")] Empty = 3 + } /// @@ -95,18 +95,16 @@ public enum EnumStringRequiredEnum /// public enum EnumIntegerEnum { - /// /// Enum NUMBER_1 for value: 1 /// - NUMBER_1 = 1, - + /// /// Enum NUMBER_MINUS_1 for value: -1 /// - NUMBER_MINUS_1 = -1 + } /// @@ -120,18 +118,18 @@ public enum EnumIntegerEnum [JsonConverter(typeof(StringEnumConverter))] public enum EnumNumberEnum { - /// /// Enum NUMBER_1_DOT_1 for value: 1.1 /// [EnumMember(Value = "1.1")] NUMBER_1_DOT_1 = 1, - + /// /// Enum NUMBER_MINUS_1_DOT_2 for value: -1.2 /// [EnumMember(Value = "-1.2")] NUMBER_MINUS_1_DOT_2 = 2 + } /// @@ -157,7 +155,7 @@ protected EnumTest() { } /// enumInteger. /// enumNumber. /// outerEnum. - public EnumTest(EnumStringEnum? enumString = default(EnumStringEnum?), EnumStringRequiredEnum enumStringRequired = default(EnumStringRequiredEnum), EnumIntegerEnum? enumInteger = default(EnumIntegerEnum?), EnumNumberEnum? enumNumber = default(EnumNumberEnum?), OuterEnum? outerEnum = default(OuterEnum?)) + public EnumTest(EnumStringEnum? enumString = default(EnumStringEnum?), EnumStringRequiredEnum enumStringRequired = default(EnumStringRequiredEnum), EnumIntegerEnum? enumInteger = default(EnumIntegerEnum?), EnumNumberEnum? enumNumber = default(EnumNumberEnum?), OuterEnum outerEnum = default(OuterEnum)) { // to ensure "enumStringRequired" is required (not null) if (enumStringRequired == null) @@ -168,6 +166,7 @@ protected EnumTest() { } { this.EnumStringRequired = enumStringRequired; } + this.EnumString = enumString; this.EnumInteger = enumInteger; this.EnumNumber = enumNumber; diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/File.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/File.cs new file mode 100644 index 000000000000..8d182f792e8f --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/File.cs @@ -0,0 +1,113 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// Must be named `File` for test. + /// + [DataContract] + public partial class File : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// Test capitalization. + public File(string sourceURI = default(string)) + { + this.SourceURI = sourceURI; + } + + /// + /// Test capitalization + /// + /// Test capitalization + [DataMember(Name="sourceURI", EmitDefaultValue=false)] + public string SourceURI { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class File {\n"); + sb.Append(" SourceURI: ").Append(SourceURI).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as File); + } + + /// + /// Returns true if File instances are equal + /// + /// Instance of File to be compared + /// Boolean + public bool Equals(File input) + { + if (input == null) + return false; + + return + ( + this.SourceURI == input.SourceURI || + (this.SourceURI != null && + this.SourceURI.Equals(input.SourceURI)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.SourceURI != null) + hashCode = hashCode * 59 + this.SourceURI.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs new file mode 100644 index 000000000000..06713e9cd8e1 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -0,0 +1,129 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// FileSchemaTestClass + /// + [DataContract] + public partial class FileSchemaTestClass : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// file. + /// files. + public FileSchemaTestClass(File file = default(File), List files = default(List)) + { + this.File = file; + this.Files = files; + } + + /// + /// Gets or Sets File + /// + [DataMember(Name="file", EmitDefaultValue=false)] + public File File { get; set; } + + /// + /// Gets or Sets Files + /// + [DataMember(Name="files", EmitDefaultValue=false)] + public List Files { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class FileSchemaTestClass {\n"); + sb.Append(" File: ").Append(File).Append("\n"); + sb.Append(" Files: ").Append(Files).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as FileSchemaTestClass); + } + + /// + /// Returns true if FileSchemaTestClass instances are equal + /// + /// Instance of FileSchemaTestClass to be compared + /// Boolean + public bool Equals(FileSchemaTestClass input) + { + if (input == null) + return false; + + return + ( + this.File == input.File || + (this.File != null && + this.File.Equals(input.File)) + ) && + ( + this.Files == input.Files || + this.Files != null && + input.Files != null && + this.Files.SequenceEqual(input.Files) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.File != null) + hashCode = hashCode * 59 + this.File.GetHashCode(); + if (this.Files != null) + hashCode = hashCode * 59 + this.Files.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/FormatTest.cs index 2122233225cc..9ac79674298e 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/FormatTest.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -60,6 +60,7 @@ protected FormatTest() { } { this.Number = number; } + // to ensure "_byte" is required (not null) if (_byte == null) { @@ -69,6 +70,7 @@ protected FormatTest() { } { this.Byte = _byte; } + // to ensure "date" is required (not null) if (date == null) { @@ -78,6 +80,7 @@ protected FormatTest() { } { this.Date = date; } + // to ensure "password" is required (not null) if (password == null) { @@ -87,6 +90,7 @@ protected FormatTest() { } { this.Password = password; } + this.Integer = integer; this.Int32 = int32; this.Int64 = int64; diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs index 90add779814a..d5afdb16cc7d 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/List.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/List.cs index e1c67fa88e45..fd3153ee90b5 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/List.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/List.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/MapTest.cs index 1ccbdba8adf8..68cde151bfdf 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/MapTest.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -34,18 +34,18 @@ public partial class MapTest : IEquatable [JsonConverter(typeof(StringEnumConverter))] public enum InnerEnum { - /// /// Enum UPPER for value: UPPER /// [EnumMember(Value = "UPPER")] UPPER = 1, - + /// /// Enum Lower for value: lower /// [EnumMember(Value = "lower")] Lower = 2 + } @@ -59,10 +59,14 @@ public enum InnerEnum /// /// mapMapOfString. /// mapOfEnumString. - public MapTest(Dictionary> mapMapOfString = default(Dictionary>), Dictionary mapOfEnumString = default(Dictionary)) + /// directMap. + /// indirectMap. + public MapTest(Dictionary> mapMapOfString = default(Dictionary>), Dictionary mapOfEnumString = default(Dictionary), Dictionary directMap = default(Dictionary), Dictionary indirectMap = default(Dictionary)) { this.MapMapOfString = mapMapOfString; this.MapOfEnumString = mapOfEnumString; + this.DirectMap = directMap; + this.IndirectMap = indirectMap; } /// @@ -72,6 +76,18 @@ public enum InnerEnum public Dictionary> MapMapOfString { get; set; } + /// + /// Gets or Sets DirectMap + /// + [DataMember(Name="direct_map", EmitDefaultValue=false)] + public Dictionary DirectMap { get; set; } + + /// + /// Gets or Sets IndirectMap + /// + [DataMember(Name="indirect_map", EmitDefaultValue=false)] + public Dictionary IndirectMap { get; set; } + /// /// Returns the string presentation of the object /// @@ -82,6 +98,8 @@ public override string ToString() sb.Append("class MapTest {\n"); sb.Append(" MapMapOfString: ").Append(MapMapOfString).Append("\n"); sb.Append(" MapOfEnumString: ").Append(MapOfEnumString).Append("\n"); + sb.Append(" DirectMap: ").Append(DirectMap).Append("\n"); + sb.Append(" IndirectMap: ").Append(IndirectMap).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -119,12 +137,26 @@ public bool Equals(MapTest input) ( this.MapMapOfString == input.MapMapOfString || this.MapMapOfString != null && + input.MapMapOfString != null && this.MapMapOfString.SequenceEqual(input.MapMapOfString) ) && ( this.MapOfEnumString == input.MapOfEnumString || this.MapOfEnumString != null && + input.MapOfEnumString != null && this.MapOfEnumString.SequenceEqual(input.MapOfEnumString) + ) && + ( + this.DirectMap == input.DirectMap || + this.DirectMap != null && + input.DirectMap != null && + this.DirectMap.SequenceEqual(input.DirectMap) + ) && + ( + this.IndirectMap == input.IndirectMap || + this.IndirectMap != null && + input.IndirectMap != null && + this.IndirectMap.SequenceEqual(input.IndirectMap) ); } @@ -141,6 +173,10 @@ public override int GetHashCode() hashCode = hashCode * 59 + this.MapMapOfString.GetHashCode(); if (this.MapOfEnumString != null) hashCode = hashCode * 59 + this.MapOfEnumString.GetHashCode(); + if (this.DirectMap != null) + hashCode = hashCode * 59 + this.DirectMap.GetHashCode(); + if (this.IndirectMap != null) + hashCode = hashCode * 59 + this.IndirectMap.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 4293c876ecd7..6215ed4a003b 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -117,6 +117,7 @@ public bool Equals(MixedPropertiesAndAdditionalPropertiesClass input) ( this.Map == input.Map || this.Map != null && + input.Map != null && this.Map.SequenceEqual(input.Map) ); } diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Model200Response.cs index 97ab9e3a9e56..c29e2a2924f8 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Model200Response.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Model200Response.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/ModelClient.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/ModelClient.cs index e08521dd8e97..8636e753b29b 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/ModelClient.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/ModelClient.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Name.cs index 3b304b8db0e3..c1c01fd3692c 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Name.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -49,6 +49,7 @@ protected Name() { } { this._Name = name; } + this.Property = property; } diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/NumberOnly.cs index 4890d031a32a..af8ca238a50d 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/NumberOnly.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Order.cs index ef1160318b26..2b42e6adbd80 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Order.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -35,24 +35,24 @@ public partial class Order : IEquatable [JsonConverter(typeof(StringEnumConverter))] public enum StatusEnum { - /// /// Enum Placed for value: placed /// [EnumMember(Value = "placed")] Placed = 1, - + /// /// Enum Approved for value: approved /// [EnumMember(Value = "approved")] Approved = 2, - + /// /// Enum Delivered for value: delivered /// [EnumMember(Value = "delivered")] Delivered = 3 + } /// diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/OuterComposite.cs index 794408b87ddf..5c8fa1b44016 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/OuterEnum.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/OuterEnum.cs index e465b750cab6..38f979216b73 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/OuterEnum.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/OuterEnum.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -30,24 +30,24 @@ namespace Org.OpenAPITools.Model public enum OuterEnum { - /// /// Enum Placed for value: placed /// [EnumMember(Value = "placed")] Placed = 1, - + /// /// Enum Approved for value: approved /// [EnumMember(Value = "approved")] Approved = 2, - + /// /// Enum Delivered for value: delivered /// [EnumMember(Value = "delivered")] Delivered = 3 + } } diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Pet.cs index 446d6e7971b7..15811f900165 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Pet.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -35,24 +35,24 @@ public partial class Pet : IEquatable [JsonConverter(typeof(StringEnumConverter))] public enum StatusEnum { - /// /// Enum Available for value: available /// [EnumMember(Value = "available")] Available = 1, - + /// /// Enum Pending for value: pending /// [EnumMember(Value = "pending")] Pending = 2, - + /// /// Enum Sold for value: sold /// [EnumMember(Value = "sold")] Sold = 3 + } /// @@ -86,6 +86,7 @@ protected Pet() { } { this.Name = name; } + // to ensure "photoUrls" is required (not null) if (photoUrls == null) { @@ -95,6 +96,7 @@ protected Pet() { } { this.PhotoUrls = photoUrls; } + this.Id = id; this.Category = category; this.Tags = tags; @@ -198,11 +200,13 @@ public bool Equals(Pet input) ( this.PhotoUrls == input.PhotoUrls || this.PhotoUrls != null && + input.PhotoUrls != null && this.PhotoUrls.SequenceEqual(input.PhotoUrls) ) && ( this.Tags == input.Tags || this.Tags != null && + input.Tags != null && this.Tags.SequenceEqual(input.Tags) ) && ( diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs index a3b2f783aab3..8b66e4f7dd2b 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Return.cs index f40725403f2e..96b60164ffd8 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Return.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Return.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/SpecialModelName.cs index b105ce35938c..92d0bf77567d 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Tag.cs index 8de8009d394d..1ad145982c4d 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Tag.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/TypeHolderDefault.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/TypeHolderDefault.cs new file mode 100644 index 000000000000..b5507bbf2562 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/TypeHolderDefault.cs @@ -0,0 +1,227 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// TypeHolderDefault + /// + [DataContract] + public partial class TypeHolderDefault : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected TypeHolderDefault() { } + /// + /// Initializes a new instance of the class. + /// + /// stringItem (required) (default to "what"). + /// numberItem (required). + /// integerItem (required). + /// boolItem (required) (default to true). + /// arrayItem (required). + public TypeHolderDefault(string stringItem = "what", decimal? numberItem = default(decimal?), int? integerItem = default(int?), bool? boolItem = true, List arrayItem = default(List)) + { + // to ensure "stringItem" is required (not null) + if (stringItem == null) + { + throw new InvalidDataException("stringItem is a required property for TypeHolderDefault and cannot be null"); + } + else + { + this.StringItem = stringItem; + } + + // to ensure "numberItem" is required (not null) + if (numberItem == null) + { + throw new InvalidDataException("numberItem is a required property for TypeHolderDefault and cannot be null"); + } + else + { + this.NumberItem = numberItem; + } + + // to ensure "integerItem" is required (not null) + if (integerItem == null) + { + throw new InvalidDataException("integerItem is a required property for TypeHolderDefault and cannot be null"); + } + else + { + this.IntegerItem = integerItem; + } + + // to ensure "boolItem" is required (not null) + if (boolItem == null) + { + throw new InvalidDataException("boolItem is a required property for TypeHolderDefault and cannot be null"); + } + else + { + this.BoolItem = boolItem; + } + + // to ensure "arrayItem" is required (not null) + if (arrayItem == null) + { + throw new InvalidDataException("arrayItem is a required property for TypeHolderDefault and cannot be null"); + } + else + { + this.ArrayItem = arrayItem; + } + + } + + /// + /// Gets or Sets StringItem + /// + [DataMember(Name="string_item", EmitDefaultValue=false)] + public string StringItem { get; set; } + + /// + /// Gets or Sets NumberItem + /// + [DataMember(Name="number_item", EmitDefaultValue=false)] + public decimal? NumberItem { get; set; } + + /// + /// Gets or Sets IntegerItem + /// + [DataMember(Name="integer_item", EmitDefaultValue=false)] + public int? IntegerItem { get; set; } + + /// + /// Gets or Sets BoolItem + /// + [DataMember(Name="bool_item", EmitDefaultValue=false)] + public bool? BoolItem { get; set; } + + /// + /// Gets or Sets ArrayItem + /// + [DataMember(Name="array_item", EmitDefaultValue=false)] + public List ArrayItem { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class TypeHolderDefault {\n"); + sb.Append(" StringItem: ").Append(StringItem).Append("\n"); + sb.Append(" NumberItem: ").Append(NumberItem).Append("\n"); + sb.Append(" IntegerItem: ").Append(IntegerItem).Append("\n"); + sb.Append(" BoolItem: ").Append(BoolItem).Append("\n"); + sb.Append(" ArrayItem: ").Append(ArrayItem).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as TypeHolderDefault); + } + + /// + /// Returns true if TypeHolderDefault instances are equal + /// + /// Instance of TypeHolderDefault to be compared + /// Boolean + public bool Equals(TypeHolderDefault input) + { + if (input == null) + return false; + + return + ( + this.StringItem == input.StringItem || + (this.StringItem != null && + this.StringItem.Equals(input.StringItem)) + ) && + ( + this.NumberItem == input.NumberItem || + (this.NumberItem != null && + this.NumberItem.Equals(input.NumberItem)) + ) && + ( + this.IntegerItem == input.IntegerItem || + (this.IntegerItem != null && + this.IntegerItem.Equals(input.IntegerItem)) + ) && + ( + this.BoolItem == input.BoolItem || + (this.BoolItem != null && + this.BoolItem.Equals(input.BoolItem)) + ) && + ( + this.ArrayItem == input.ArrayItem || + this.ArrayItem != null && + input.ArrayItem != null && + this.ArrayItem.SequenceEqual(input.ArrayItem) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.StringItem != null) + hashCode = hashCode * 59 + this.StringItem.GetHashCode(); + if (this.NumberItem != null) + hashCode = hashCode * 59 + this.NumberItem.GetHashCode(); + if (this.IntegerItem != null) + hashCode = hashCode * 59 + this.IntegerItem.GetHashCode(); + if (this.BoolItem != null) + hashCode = hashCode * 59 + this.BoolItem.GetHashCode(); + if (this.ArrayItem != null) + hashCode = hashCode * 59 + this.ArrayItem.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/TypeHolderExample.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/TypeHolderExample.cs new file mode 100644 index 000000000000..7603fe142df0 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/TypeHolderExample.cs @@ -0,0 +1,227 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// TypeHolderExample + /// + [DataContract] + public partial class TypeHolderExample : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected TypeHolderExample() { } + /// + /// Initializes a new instance of the class. + /// + /// stringItem (required). + /// numberItem (required). + /// integerItem (required). + /// boolItem (required). + /// arrayItem (required). + public TypeHolderExample(string stringItem = default(string), decimal? numberItem = default(decimal?), int? integerItem = default(int?), bool? boolItem = default(bool?), List arrayItem = default(List)) + { + // to ensure "stringItem" is required (not null) + if (stringItem == null) + { + throw new InvalidDataException("stringItem is a required property for TypeHolderExample and cannot be null"); + } + else + { + this.StringItem = stringItem; + } + + // to ensure "numberItem" is required (not null) + if (numberItem == null) + { + throw new InvalidDataException("numberItem is a required property for TypeHolderExample and cannot be null"); + } + else + { + this.NumberItem = numberItem; + } + + // to ensure "integerItem" is required (not null) + if (integerItem == null) + { + throw new InvalidDataException("integerItem is a required property for TypeHolderExample and cannot be null"); + } + else + { + this.IntegerItem = integerItem; + } + + // to ensure "boolItem" is required (not null) + if (boolItem == null) + { + throw new InvalidDataException("boolItem is a required property for TypeHolderExample and cannot be null"); + } + else + { + this.BoolItem = boolItem; + } + + // to ensure "arrayItem" is required (not null) + if (arrayItem == null) + { + throw new InvalidDataException("arrayItem is a required property for TypeHolderExample and cannot be null"); + } + else + { + this.ArrayItem = arrayItem; + } + + } + + /// + /// Gets or Sets StringItem + /// + [DataMember(Name="string_item", EmitDefaultValue=false)] + public string StringItem { get; set; } + + /// + /// Gets or Sets NumberItem + /// + [DataMember(Name="number_item", EmitDefaultValue=false)] + public decimal? NumberItem { get; set; } + + /// + /// Gets or Sets IntegerItem + /// + [DataMember(Name="integer_item", EmitDefaultValue=false)] + public int? IntegerItem { get; set; } + + /// + /// Gets or Sets BoolItem + /// + [DataMember(Name="bool_item", EmitDefaultValue=false)] + public bool? BoolItem { get; set; } + + /// + /// Gets or Sets ArrayItem + /// + [DataMember(Name="array_item", EmitDefaultValue=false)] + public List ArrayItem { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class TypeHolderExample {\n"); + sb.Append(" StringItem: ").Append(StringItem).Append("\n"); + sb.Append(" NumberItem: ").Append(NumberItem).Append("\n"); + sb.Append(" IntegerItem: ").Append(IntegerItem).Append("\n"); + sb.Append(" BoolItem: ").Append(BoolItem).Append("\n"); + sb.Append(" ArrayItem: ").Append(ArrayItem).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as TypeHolderExample); + } + + /// + /// Returns true if TypeHolderExample instances are equal + /// + /// Instance of TypeHolderExample to be compared + /// Boolean + public bool Equals(TypeHolderExample input) + { + if (input == null) + return false; + + return + ( + this.StringItem == input.StringItem || + (this.StringItem != null && + this.StringItem.Equals(input.StringItem)) + ) && + ( + this.NumberItem == input.NumberItem || + (this.NumberItem != null && + this.NumberItem.Equals(input.NumberItem)) + ) && + ( + this.IntegerItem == input.IntegerItem || + (this.IntegerItem != null && + this.IntegerItem.Equals(input.IntegerItem)) + ) && + ( + this.BoolItem == input.BoolItem || + (this.BoolItem != null && + this.BoolItem.Equals(input.BoolItem)) + ) && + ( + this.ArrayItem == input.ArrayItem || + this.ArrayItem != null && + input.ArrayItem != null && + this.ArrayItem.SequenceEqual(input.ArrayItem) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.StringItem != null) + hashCode = hashCode * 59 + this.StringItem.GetHashCode(); + if (this.NumberItem != null) + hashCode = hashCode * 59 + this.NumberItem.GetHashCode(); + if (this.IntegerItem != null) + hashCode = hashCode * 59 + this.IntegerItem.GetHashCode(); + if (this.BoolItem != null) + hashCode = hashCode * 59 + this.BoolItem.GetHashCode(); + if (this.ArrayItem != null) + hashCode = hashCode * 59 + this.ArrayItem.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/User.cs index 3e680bc8642e..9933c347cbfb 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/User.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/XmlItem.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/XmlItem.cs new file mode 100644 index 000000000000..e80b6bac4b39 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/XmlItem.cs @@ -0,0 +1,569 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// XmlItem + /// + [DataContract] + public partial class XmlItem : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// attributeString. + /// attributeNumber. + /// attributeInteger. + /// attributeBoolean. + /// wrappedArray. + /// nameString. + /// nameNumber. + /// nameInteger. + /// nameBoolean. + /// nameArray. + /// nameWrappedArray. + /// prefixString. + /// prefixNumber. + /// prefixInteger. + /// prefixBoolean. + /// prefixArray. + /// prefixWrappedArray. + /// namespaceString. + /// namespaceNumber. + /// namespaceInteger. + /// namespaceBoolean. + /// namespaceArray. + /// namespaceWrappedArray. + /// prefixNsString. + /// prefixNsNumber. + /// prefixNsInteger. + /// prefixNsBoolean. + /// prefixNsArray. + /// prefixNsWrappedArray. + public XmlItem(string attributeString = default(string), decimal? attributeNumber = default(decimal?), int? attributeInteger = default(int?), bool? attributeBoolean = default(bool?), List wrappedArray = default(List), string nameString = default(string), decimal? nameNumber = default(decimal?), int? nameInteger = default(int?), bool? nameBoolean = default(bool?), List nameArray = default(List), List nameWrappedArray = default(List), string prefixString = default(string), decimal? prefixNumber = default(decimal?), int? prefixInteger = default(int?), bool? prefixBoolean = default(bool?), List prefixArray = default(List), List prefixWrappedArray = default(List), string namespaceString = default(string), decimal? namespaceNumber = default(decimal?), int? namespaceInteger = default(int?), bool? namespaceBoolean = default(bool?), List namespaceArray = default(List), List namespaceWrappedArray = default(List), string prefixNsString = default(string), decimal? prefixNsNumber = default(decimal?), int? prefixNsInteger = default(int?), bool? prefixNsBoolean = default(bool?), List prefixNsArray = default(List), List prefixNsWrappedArray = default(List)) + { + this.AttributeString = attributeString; + this.AttributeNumber = attributeNumber; + this.AttributeInteger = attributeInteger; + this.AttributeBoolean = attributeBoolean; + this.WrappedArray = wrappedArray; + this.NameString = nameString; + this.NameNumber = nameNumber; + this.NameInteger = nameInteger; + this.NameBoolean = nameBoolean; + this.NameArray = nameArray; + this.NameWrappedArray = nameWrappedArray; + this.PrefixString = prefixString; + this.PrefixNumber = prefixNumber; + this.PrefixInteger = prefixInteger; + this.PrefixBoolean = prefixBoolean; + this.PrefixArray = prefixArray; + this.PrefixWrappedArray = prefixWrappedArray; + this.NamespaceString = namespaceString; + this.NamespaceNumber = namespaceNumber; + this.NamespaceInteger = namespaceInteger; + this.NamespaceBoolean = namespaceBoolean; + this.NamespaceArray = namespaceArray; + this.NamespaceWrappedArray = namespaceWrappedArray; + this.PrefixNsString = prefixNsString; + this.PrefixNsNumber = prefixNsNumber; + this.PrefixNsInteger = prefixNsInteger; + this.PrefixNsBoolean = prefixNsBoolean; + this.PrefixNsArray = prefixNsArray; + this.PrefixNsWrappedArray = prefixNsWrappedArray; + } + + /// + /// Gets or Sets AttributeString + /// + [DataMember(Name="attribute_string", EmitDefaultValue=false)] + public string AttributeString { get; set; } + + /// + /// Gets or Sets AttributeNumber + /// + [DataMember(Name="attribute_number", EmitDefaultValue=false)] + public decimal? AttributeNumber { get; set; } + + /// + /// Gets or Sets AttributeInteger + /// + [DataMember(Name="attribute_integer", EmitDefaultValue=false)] + public int? AttributeInteger { get; set; } + + /// + /// Gets or Sets AttributeBoolean + /// + [DataMember(Name="attribute_boolean", EmitDefaultValue=false)] + public bool? AttributeBoolean { get; set; } + + /// + /// Gets or Sets WrappedArray + /// + [DataMember(Name="wrapped_array", EmitDefaultValue=false)] + public List WrappedArray { get; set; } + + /// + /// Gets or Sets NameString + /// + [DataMember(Name="name_string", EmitDefaultValue=false)] + public string NameString { get; set; } + + /// + /// Gets or Sets NameNumber + /// + [DataMember(Name="name_number", EmitDefaultValue=false)] + public decimal? NameNumber { get; set; } + + /// + /// Gets or Sets NameInteger + /// + [DataMember(Name="name_integer", EmitDefaultValue=false)] + public int? NameInteger { get; set; } + + /// + /// Gets or Sets NameBoolean + /// + [DataMember(Name="name_boolean", EmitDefaultValue=false)] + public bool? NameBoolean { get; set; } + + /// + /// Gets or Sets NameArray + /// + [DataMember(Name="name_array", EmitDefaultValue=false)] + public List NameArray { get; set; } + + /// + /// Gets or Sets NameWrappedArray + /// + [DataMember(Name="name_wrapped_array", EmitDefaultValue=false)] + public List NameWrappedArray { get; set; } + + /// + /// Gets or Sets PrefixString + /// + [DataMember(Name="prefix_string", EmitDefaultValue=false)] + public string PrefixString { get; set; } + + /// + /// Gets or Sets PrefixNumber + /// + [DataMember(Name="prefix_number", EmitDefaultValue=false)] + public decimal? PrefixNumber { get; set; } + + /// + /// Gets or Sets PrefixInteger + /// + [DataMember(Name="prefix_integer", EmitDefaultValue=false)] + public int? PrefixInteger { get; set; } + + /// + /// Gets or Sets PrefixBoolean + /// + [DataMember(Name="prefix_boolean", EmitDefaultValue=false)] + public bool? PrefixBoolean { get; set; } + + /// + /// Gets or Sets PrefixArray + /// + [DataMember(Name="prefix_array", EmitDefaultValue=false)] + public List PrefixArray { get; set; } + + /// + /// Gets or Sets PrefixWrappedArray + /// + [DataMember(Name="prefix_wrapped_array", EmitDefaultValue=false)] + public List PrefixWrappedArray { get; set; } + + /// + /// Gets or Sets NamespaceString + /// + [DataMember(Name="namespace_string", EmitDefaultValue=false)] + public string NamespaceString { get; set; } + + /// + /// Gets or Sets NamespaceNumber + /// + [DataMember(Name="namespace_number", EmitDefaultValue=false)] + public decimal? NamespaceNumber { get; set; } + + /// + /// Gets or Sets NamespaceInteger + /// + [DataMember(Name="namespace_integer", EmitDefaultValue=false)] + public int? NamespaceInteger { get; set; } + + /// + /// Gets or Sets NamespaceBoolean + /// + [DataMember(Name="namespace_boolean", EmitDefaultValue=false)] + public bool? NamespaceBoolean { get; set; } + + /// + /// Gets or Sets NamespaceArray + /// + [DataMember(Name="namespace_array", EmitDefaultValue=false)] + public List NamespaceArray { get; set; } + + /// + /// Gets or Sets NamespaceWrappedArray + /// + [DataMember(Name="namespace_wrapped_array", EmitDefaultValue=false)] + public List NamespaceWrappedArray { get; set; } + + /// + /// Gets or Sets PrefixNsString + /// + [DataMember(Name="prefix_ns_string", EmitDefaultValue=false)] + public string PrefixNsString { get; set; } + + /// + /// Gets or Sets PrefixNsNumber + /// + [DataMember(Name="prefix_ns_number", EmitDefaultValue=false)] + public decimal? PrefixNsNumber { get; set; } + + /// + /// Gets or Sets PrefixNsInteger + /// + [DataMember(Name="prefix_ns_integer", EmitDefaultValue=false)] + public int? PrefixNsInteger { get; set; } + + /// + /// Gets or Sets PrefixNsBoolean + /// + [DataMember(Name="prefix_ns_boolean", EmitDefaultValue=false)] + public bool? PrefixNsBoolean { get; set; } + + /// + /// Gets or Sets PrefixNsArray + /// + [DataMember(Name="prefix_ns_array", EmitDefaultValue=false)] + public List PrefixNsArray { get; set; } + + /// + /// Gets or Sets PrefixNsWrappedArray + /// + [DataMember(Name="prefix_ns_wrapped_array", EmitDefaultValue=false)] + public List PrefixNsWrappedArray { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class XmlItem {\n"); + sb.Append(" AttributeString: ").Append(AttributeString).Append("\n"); + sb.Append(" AttributeNumber: ").Append(AttributeNumber).Append("\n"); + sb.Append(" AttributeInteger: ").Append(AttributeInteger).Append("\n"); + sb.Append(" AttributeBoolean: ").Append(AttributeBoolean).Append("\n"); + sb.Append(" WrappedArray: ").Append(WrappedArray).Append("\n"); + sb.Append(" NameString: ").Append(NameString).Append("\n"); + sb.Append(" NameNumber: ").Append(NameNumber).Append("\n"); + sb.Append(" NameInteger: ").Append(NameInteger).Append("\n"); + sb.Append(" NameBoolean: ").Append(NameBoolean).Append("\n"); + sb.Append(" NameArray: ").Append(NameArray).Append("\n"); + sb.Append(" NameWrappedArray: ").Append(NameWrappedArray).Append("\n"); + sb.Append(" PrefixString: ").Append(PrefixString).Append("\n"); + sb.Append(" PrefixNumber: ").Append(PrefixNumber).Append("\n"); + sb.Append(" PrefixInteger: ").Append(PrefixInteger).Append("\n"); + sb.Append(" PrefixBoolean: ").Append(PrefixBoolean).Append("\n"); + sb.Append(" PrefixArray: ").Append(PrefixArray).Append("\n"); + sb.Append(" PrefixWrappedArray: ").Append(PrefixWrappedArray).Append("\n"); + sb.Append(" NamespaceString: ").Append(NamespaceString).Append("\n"); + sb.Append(" NamespaceNumber: ").Append(NamespaceNumber).Append("\n"); + sb.Append(" NamespaceInteger: ").Append(NamespaceInteger).Append("\n"); + sb.Append(" NamespaceBoolean: ").Append(NamespaceBoolean).Append("\n"); + sb.Append(" NamespaceArray: ").Append(NamespaceArray).Append("\n"); + sb.Append(" NamespaceWrappedArray: ").Append(NamespaceWrappedArray).Append("\n"); + sb.Append(" PrefixNsString: ").Append(PrefixNsString).Append("\n"); + sb.Append(" PrefixNsNumber: ").Append(PrefixNsNumber).Append("\n"); + sb.Append(" PrefixNsInteger: ").Append(PrefixNsInteger).Append("\n"); + sb.Append(" PrefixNsBoolean: ").Append(PrefixNsBoolean).Append("\n"); + sb.Append(" PrefixNsArray: ").Append(PrefixNsArray).Append("\n"); + sb.Append(" PrefixNsWrappedArray: ").Append(PrefixNsWrappedArray).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as XmlItem); + } + + /// + /// Returns true if XmlItem instances are equal + /// + /// Instance of XmlItem to be compared + /// Boolean + public bool Equals(XmlItem input) + { + if (input == null) + return false; + + return + ( + this.AttributeString == input.AttributeString || + (this.AttributeString != null && + this.AttributeString.Equals(input.AttributeString)) + ) && + ( + this.AttributeNumber == input.AttributeNumber || + (this.AttributeNumber != null && + this.AttributeNumber.Equals(input.AttributeNumber)) + ) && + ( + this.AttributeInteger == input.AttributeInteger || + (this.AttributeInteger != null && + this.AttributeInteger.Equals(input.AttributeInteger)) + ) && + ( + this.AttributeBoolean == input.AttributeBoolean || + (this.AttributeBoolean != null && + this.AttributeBoolean.Equals(input.AttributeBoolean)) + ) && + ( + this.WrappedArray == input.WrappedArray || + this.WrappedArray != null && + input.WrappedArray != null && + this.WrappedArray.SequenceEqual(input.WrappedArray) + ) && + ( + this.NameString == input.NameString || + (this.NameString != null && + this.NameString.Equals(input.NameString)) + ) && + ( + this.NameNumber == input.NameNumber || + (this.NameNumber != null && + this.NameNumber.Equals(input.NameNumber)) + ) && + ( + this.NameInteger == input.NameInteger || + (this.NameInteger != null && + this.NameInteger.Equals(input.NameInteger)) + ) && + ( + this.NameBoolean == input.NameBoolean || + (this.NameBoolean != null && + this.NameBoolean.Equals(input.NameBoolean)) + ) && + ( + this.NameArray == input.NameArray || + this.NameArray != null && + input.NameArray != null && + this.NameArray.SequenceEqual(input.NameArray) + ) && + ( + this.NameWrappedArray == input.NameWrappedArray || + this.NameWrappedArray != null && + input.NameWrappedArray != null && + this.NameWrappedArray.SequenceEqual(input.NameWrappedArray) + ) && + ( + this.PrefixString == input.PrefixString || + (this.PrefixString != null && + this.PrefixString.Equals(input.PrefixString)) + ) && + ( + this.PrefixNumber == input.PrefixNumber || + (this.PrefixNumber != null && + this.PrefixNumber.Equals(input.PrefixNumber)) + ) && + ( + this.PrefixInteger == input.PrefixInteger || + (this.PrefixInteger != null && + this.PrefixInteger.Equals(input.PrefixInteger)) + ) && + ( + this.PrefixBoolean == input.PrefixBoolean || + (this.PrefixBoolean != null && + this.PrefixBoolean.Equals(input.PrefixBoolean)) + ) && + ( + this.PrefixArray == input.PrefixArray || + this.PrefixArray != null && + input.PrefixArray != null && + this.PrefixArray.SequenceEqual(input.PrefixArray) + ) && + ( + this.PrefixWrappedArray == input.PrefixWrappedArray || + this.PrefixWrappedArray != null && + input.PrefixWrappedArray != null && + this.PrefixWrappedArray.SequenceEqual(input.PrefixWrappedArray) + ) && + ( + this.NamespaceString == input.NamespaceString || + (this.NamespaceString != null && + this.NamespaceString.Equals(input.NamespaceString)) + ) && + ( + this.NamespaceNumber == input.NamespaceNumber || + (this.NamespaceNumber != null && + this.NamespaceNumber.Equals(input.NamespaceNumber)) + ) && + ( + this.NamespaceInteger == input.NamespaceInteger || + (this.NamespaceInteger != null && + this.NamespaceInteger.Equals(input.NamespaceInteger)) + ) && + ( + this.NamespaceBoolean == input.NamespaceBoolean || + (this.NamespaceBoolean != null && + this.NamespaceBoolean.Equals(input.NamespaceBoolean)) + ) && + ( + this.NamespaceArray == input.NamespaceArray || + this.NamespaceArray != null && + input.NamespaceArray != null && + this.NamespaceArray.SequenceEqual(input.NamespaceArray) + ) && + ( + this.NamespaceWrappedArray == input.NamespaceWrappedArray || + this.NamespaceWrappedArray != null && + input.NamespaceWrappedArray != null && + this.NamespaceWrappedArray.SequenceEqual(input.NamespaceWrappedArray) + ) && + ( + this.PrefixNsString == input.PrefixNsString || + (this.PrefixNsString != null && + this.PrefixNsString.Equals(input.PrefixNsString)) + ) && + ( + this.PrefixNsNumber == input.PrefixNsNumber || + (this.PrefixNsNumber != null && + this.PrefixNsNumber.Equals(input.PrefixNsNumber)) + ) && + ( + this.PrefixNsInteger == input.PrefixNsInteger || + (this.PrefixNsInteger != null && + this.PrefixNsInteger.Equals(input.PrefixNsInteger)) + ) && + ( + this.PrefixNsBoolean == input.PrefixNsBoolean || + (this.PrefixNsBoolean != null && + this.PrefixNsBoolean.Equals(input.PrefixNsBoolean)) + ) && + ( + this.PrefixNsArray == input.PrefixNsArray || + this.PrefixNsArray != null && + input.PrefixNsArray != null && + this.PrefixNsArray.SequenceEqual(input.PrefixNsArray) + ) && + ( + this.PrefixNsWrappedArray == input.PrefixNsWrappedArray || + this.PrefixNsWrappedArray != null && + input.PrefixNsWrappedArray != null && + this.PrefixNsWrappedArray.SequenceEqual(input.PrefixNsWrappedArray) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.AttributeString != null) + hashCode = hashCode * 59 + this.AttributeString.GetHashCode(); + if (this.AttributeNumber != null) + hashCode = hashCode * 59 + this.AttributeNumber.GetHashCode(); + if (this.AttributeInteger != null) + hashCode = hashCode * 59 + this.AttributeInteger.GetHashCode(); + if (this.AttributeBoolean != null) + hashCode = hashCode * 59 + this.AttributeBoolean.GetHashCode(); + if (this.WrappedArray != null) + hashCode = hashCode * 59 + this.WrappedArray.GetHashCode(); + if (this.NameString != null) + hashCode = hashCode * 59 + this.NameString.GetHashCode(); + if (this.NameNumber != null) + hashCode = hashCode * 59 + this.NameNumber.GetHashCode(); + if (this.NameInteger != null) + hashCode = hashCode * 59 + this.NameInteger.GetHashCode(); + if (this.NameBoolean != null) + hashCode = hashCode * 59 + this.NameBoolean.GetHashCode(); + if (this.NameArray != null) + hashCode = hashCode * 59 + this.NameArray.GetHashCode(); + if (this.NameWrappedArray != null) + hashCode = hashCode * 59 + this.NameWrappedArray.GetHashCode(); + if (this.PrefixString != null) + hashCode = hashCode * 59 + this.PrefixString.GetHashCode(); + if (this.PrefixNumber != null) + hashCode = hashCode * 59 + this.PrefixNumber.GetHashCode(); + if (this.PrefixInteger != null) + hashCode = hashCode * 59 + this.PrefixInteger.GetHashCode(); + if (this.PrefixBoolean != null) + hashCode = hashCode * 59 + this.PrefixBoolean.GetHashCode(); + if (this.PrefixArray != null) + hashCode = hashCode * 59 + this.PrefixArray.GetHashCode(); + if (this.PrefixWrappedArray != null) + hashCode = hashCode * 59 + this.PrefixWrappedArray.GetHashCode(); + if (this.NamespaceString != null) + hashCode = hashCode * 59 + this.NamespaceString.GetHashCode(); + if (this.NamespaceNumber != null) + hashCode = hashCode * 59 + this.NamespaceNumber.GetHashCode(); + if (this.NamespaceInteger != null) + hashCode = hashCode * 59 + this.NamespaceInteger.GetHashCode(); + if (this.NamespaceBoolean != null) + hashCode = hashCode * 59 + this.NamespaceBoolean.GetHashCode(); + if (this.NamespaceArray != null) + hashCode = hashCode * 59 + this.NamespaceArray.GetHashCode(); + if (this.NamespaceWrappedArray != null) + hashCode = hashCode * 59 + this.NamespaceWrappedArray.GetHashCode(); + if (this.PrefixNsString != null) + hashCode = hashCode * 59 + this.PrefixNsString.GetHashCode(); + if (this.PrefixNsNumber != null) + hashCode = hashCode * 59 + this.PrefixNsNumber.GetHashCode(); + if (this.PrefixNsInteger != null) + hashCode = hashCode * 59 + this.PrefixNsInteger.GetHashCode(); + if (this.PrefixNsBoolean != null) + hashCode = hashCode * 59 + this.PrefixNsBoolean.GetHashCode(); + if (this.PrefixNsArray != null) + hashCode = hashCode * 59 + this.PrefixNsArray.GetHashCode(); + if (this.PrefixNsWrappedArray != null) + hashCode = hashCode * 59 + this.PrefixNsWrappedArray.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/.openapi-generator/VERSION b/samples/client/petstore/csharp/OpenAPIClientNetStandard/.openapi-generator/VERSION index 06b5019af3f4..83a328a9227e 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.1-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/README.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/README.md index b61a5400367c..42689d1c0af6 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/README.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/README.md @@ -40,7 +40,7 @@ using Org.OpenAPITools.Model; ## Getting Started ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -50,21 +50,24 @@ namespace Example { public class Example { - public void main() + public static void Main() { - var apiInstance = new AnotherFakeApi(); - var body = new ModelClient(); // ModelClient | client model + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new AnotherFakeApi(Configuration.Default); + var modelClient = new ModelClient(); // ModelClient | client model try { // To test special tags - ModelClient result = apiInstance.Call123TestSpecialTags(body); + ModelClient result = apiInstance.Call123TestSpecialTags(modelClient); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling AnotherFakeApi.Call123TestSpecialTags: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } @@ -79,7 +82,8 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *AnotherFakeApi* | [**Call123TestSpecialTags**](docs/AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags -*FakeApi* | [**CreateXmlItem**](docs/FakeApi.md#createxmlitem) | **POST** /fake/create_xml_item | creates an XmlItem +*DefaultApi* | [**FooGet**](docs/DefaultApi.md#fooget) | **GET** /foo | +*FakeApi* | [**FakeHealthGet**](docs/FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint *FakeApi* | [**FakeOuterBooleanSerialize**](docs/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | *FakeApi* | [**FakeOuterCompositeSerialize**](docs/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | *FakeApi* | [**FakeOuterNumberSerialize**](docs/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | @@ -118,14 +122,7 @@ Class | Method | HTTP request | Description ## Documentation for Models - - [Model.AdditionalPropertiesAnyType](docs/AdditionalPropertiesAnyType.md) - - [Model.AdditionalPropertiesArray](docs/AdditionalPropertiesArray.md) - - [Model.AdditionalPropertiesBoolean](docs/AdditionalPropertiesBoolean.md) - [Model.AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) - - [Model.AdditionalPropertiesInteger](docs/AdditionalPropertiesInteger.md) - - [Model.AdditionalPropertiesNumber](docs/AdditionalPropertiesNumber.md) - - [Model.AdditionalPropertiesObject](docs/AdditionalPropertiesObject.md) - - [Model.AdditionalPropertiesString](docs/AdditionalPropertiesString.md) - [Model.Animal](docs/Animal.md) - [Model.ApiResponse](docs/ApiResponse.md) - [Model.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) @@ -143,27 +140,37 @@ Class | Method | HTTP request | Description - [Model.EnumTest](docs/EnumTest.md) - [Model.File](docs/File.md) - [Model.FileSchemaTestClass](docs/FileSchemaTestClass.md) + - [Model.Foo](docs/Foo.md) - [Model.FormatTest](docs/FormatTest.md) - [Model.HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [Model.HealthCheckResult](docs/HealthCheckResult.md) + - [Model.InlineObject](docs/InlineObject.md) + - [Model.InlineObject1](docs/InlineObject1.md) + - [Model.InlineObject2](docs/InlineObject2.md) + - [Model.InlineObject3](docs/InlineObject3.md) + - [Model.InlineObject4](docs/InlineObject4.md) + - [Model.InlineObject5](docs/InlineObject5.md) + - [Model.InlineResponseDefault](docs/InlineResponseDefault.md) - [Model.List](docs/List.md) - [Model.MapTest](docs/MapTest.md) - [Model.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - [Model.Model200Response](docs/Model200Response.md) - [Model.ModelClient](docs/ModelClient.md) - [Model.Name](docs/Name.md) + - [Model.NullableClass](docs/NullableClass.md) - [Model.NumberOnly](docs/NumberOnly.md) - [Model.Order](docs/Order.md) - [Model.OuterComposite](docs/OuterComposite.md) - [Model.OuterEnum](docs/OuterEnum.md) + - [Model.OuterEnumDefaultValue](docs/OuterEnumDefaultValue.md) + - [Model.OuterEnumInteger](docs/OuterEnumInteger.md) + - [Model.OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md) - [Model.Pet](docs/Pet.md) - [Model.ReadOnlyFirst](docs/ReadOnlyFirst.md) - [Model.Return](docs/Return.md) - [Model.SpecialModelName](docs/SpecialModelName.md) - [Model.Tag](docs/Tag.md) - - [Model.TypeHolderDefault](docs/TypeHolderDefault.md) - - [Model.TypeHolderExample](docs/TypeHolderExample.md) - [Model.User](docs/User.md) - - [Model.XmlItem](docs/XmlItem.md) ## Documentation for Authorization @@ -185,6 +192,12 @@ Class | Method | HTTP request | Description - **Location**: URL query string +### bearer_test + + +- **Type**: HTTP basic authentication + + ### http_basic_test diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/AdditionalPropertiesClass.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/AdditionalPropertiesClass.md index 32d7ffc76537..847bf120968f 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/AdditionalPropertiesClass.md @@ -5,17 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**MapString** | **Dictionary<string, string>** | | [optional] -**MapNumber** | **Dictionary<string, decimal?>** | | [optional] -**MapInteger** | **Dictionary<string, int?>** | | [optional] -**MapBoolean** | **Dictionary<string, bool?>** | | [optional] -**MapArrayInteger** | **Dictionary<string, List<int?>>** | | [optional] -**MapArrayAnytype** | **Dictionary<string, List<Object>>** | | [optional] -**MapMapString** | **Dictionary<string, Dictionary<string, string>>** | | [optional] -**MapMapAnytype** | **Dictionary<string, Dictionary<string, Object>>** | | [optional] -**Anytype1** | [**Object**](.md) | | [optional] -**Anytype2** | [**Object**](.md) | | [optional] -**Anytype3** | [**Object**](.md) | | [optional] +**MapProperty** | **Dictionary<string, string>** | | [optional] +**MapOfMapProperty** | **Dictionary<string, Dictionary<string, string>>** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/AnotherFakeApi.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/AnotherFakeApi.md index d13566caf343..c7cb3d05138b 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/AnotherFakeApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/AnotherFakeApi.md @@ -10,7 +10,7 @@ Method | HTTP request | Description ## Call123TestSpecialTags -> ModelClient Call123TestSpecialTags (ModelClient body) +> ModelClient Call123TestSpecialTags (ModelClient modelClient) To test special tags @@ -19,7 +19,7 @@ To test special tags and operation ID starting with number ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -29,20 +29,23 @@ namespace Example { public class Call123TestSpecialTagsExample { - public void main() + public static void Main() { - var apiInstance = new AnotherFakeApi(); - var body = new ModelClient(); // ModelClient | client model + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new AnotherFakeApi(Configuration.Default); + var modelClient = new ModelClient(); // ModelClient | client model try { // To test special tags - ModelClient result = apiInstance.Call123TestSpecialTags(body); + ModelClient result = apiInstance.Call123TestSpecialTags(modelClient); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling AnotherFakeApi.Call123TestSpecialTags: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -54,7 +57,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**ModelClient**](ModelClient.md)| client model | + **modelClient** | [**ModelClient**](ModelClient.md)| client model | ### Return type @@ -69,6 +72,11 @@ No authorization required - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/DefaultApi.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/DefaultApi.md index 92f2dc125c04..7ee074eba27c 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/DefaultApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/DefaultApi.md @@ -7,15 +7,17 @@ Method | HTTP request | Description [**FooGet**](DefaultApi.md#fooget) | **GET** /foo | - -# **FooGet** + +## FooGet + > InlineResponseDefault FooGet () ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -25,18 +27,21 @@ namespace Example { public class FooGetExample { - public void main() + public static void Main() { - var apiInstance = new DefaultApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new DefaultApi(Configuration.Default); try { InlineResponseDefault result = apiInstance.FooGet(); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling DefaultApi.FooGet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -44,6 +49,7 @@ namespace Example ``` ### Parameters + This endpoint does not need any parameter. ### Return type @@ -56,8 +62,16 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | response | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/EnumTest.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/EnumTest.md index 8e213c3335f9..3e6bde560845 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/EnumTest.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/EnumTest.md @@ -10,6 +10,9 @@ Name | Type | Description | Notes **EnumInteger** | **int?** | | [optional] **EnumNumber** | **double?** | | [optional] **OuterEnum** | **OuterEnum** | | [optional] +**OuterEnumInteger** | **OuterEnumInteger** | | [optional] +**OuterEnumDefaultValue** | **OuterEnumDefaultValue** | | [optional] +**OuterEnumIntegerDefaultValue** | **OuterEnumIntegerDefaultValue** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/FakeApi.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/FakeApi.md index a2284ba8f3e7..eb0c8650dc49 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/FakeApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/FakeApi.md @@ -4,7 +4,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**CreateXmlItem**](FakeApi.md#createxmlitem) | **POST** /fake/create_xml_item | creates an XmlItem +[**FakeHealthGet**](FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint [**FakeOuterBooleanSerialize**](FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | [**FakeOuterCompositeSerialize**](FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | [**FakeOuterNumberSerialize**](FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | @@ -20,18 +20,16 @@ Method | HTTP request | Description -## CreateXmlItem +## FakeHealthGet -> void CreateXmlItem (XmlItem xmlItem) +> HealthCheckResult FakeHealthGet () -creates an XmlItem - -this route creates an XmlItem +Health check endpoint ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -39,21 +37,24 @@ using Org.OpenAPITools.Model; namespace Example { - public class CreateXmlItemExample + public class FakeHealthGetExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); - var xmlItem = new XmlItem(); // XmlItem | XmlItem Body + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); try { - // creates an XmlItem - apiInstance.CreateXmlItem(xmlItem); + // Health check endpoint + HealthCheckResult result = apiInstance.FakeHealthGet(); + Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { - Debug.Print("Exception when calling FakeApi.CreateXmlItem: " + e.Message ); + Debug.Print("Exception when calling FakeApi.FakeHealthGet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -62,14 +63,11 @@ namespace Example ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xmlItem** | [**XmlItem**](XmlItem.md)| XmlItem Body | +This endpoint does not need any parameter. ### Return type -void (empty response body) +[**HealthCheckResult**](HealthCheckResult.md) ### Authorization @@ -77,8 +75,13 @@ No authorization required ### HTTP request headers -- **Content-Type**: application/xml, application/xml; charset=utf-8, application/xml; charset=utf-16, text/xml, text/xml; charset=utf-8, text/xml; charset=utf-16 -- **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The instance started successfully | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) @@ -97,7 +100,7 @@ Test serialization of outer boolean types ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -107,9 +110,10 @@ namespace Example { public class FakeOuterBooleanSerializeExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var body = true; // bool? | Input boolean as post body (optional) try @@ -117,9 +121,11 @@ namespace Example bool? result = apiInstance.FakeOuterBooleanSerialize(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.FakeOuterBooleanSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -143,9 +149,14 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: */* +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output boolean | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -154,7 +165,7 @@ No authorization required ## FakeOuterCompositeSerialize -> OuterComposite FakeOuterCompositeSerialize (OuterComposite body = null) +> OuterComposite FakeOuterCompositeSerialize (OuterComposite outerComposite = null) @@ -163,7 +174,7 @@ Test serialization of object with outer number type ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -173,19 +184,22 @@ namespace Example { public class FakeOuterCompositeSerializeExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); - var body = new OuterComposite(); // OuterComposite | Input composite as post body (optional) + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); + var outerComposite = new OuterComposite(); // OuterComposite | Input composite as post body (optional) try { - OuterComposite result = apiInstance.FakeOuterCompositeSerialize(body); + OuterComposite result = apiInstance.FakeOuterCompositeSerialize(outerComposite); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.FakeOuterCompositeSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -197,7 +211,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + **outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] ### Return type @@ -209,9 +223,14 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: */* +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output composite | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -229,7 +248,7 @@ Test serialization of outer number types ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -239,9 +258,10 @@ namespace Example { public class FakeOuterNumberSerializeExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var body = 8.14; // decimal? | Input number as post body (optional) try @@ -249,9 +269,11 @@ namespace Example decimal? result = apiInstance.FakeOuterNumberSerialize(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.FakeOuterNumberSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -275,9 +297,14 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: */* +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output number | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -295,7 +322,7 @@ Test serialization of outer string types ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -305,9 +332,10 @@ namespace Example { public class FakeOuterStringSerializeExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var body = body_example; // string | Input string as post body (optional) try @@ -315,9 +343,11 @@ namespace Example string result = apiInstance.FakeOuterStringSerialize(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.FakeOuterStringSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -341,9 +371,14 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: */* +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output string | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -352,7 +387,7 @@ No authorization required ## TestBodyWithFileSchema -> void TestBodyWithFileSchema (FileSchemaTestClass body) +> void TestBodyWithFileSchema (FileSchemaTestClass fileSchemaTestClass) @@ -361,7 +396,7 @@ For this test, the body for this request much reference a schema named `File`. ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -371,18 +406,21 @@ namespace Example { public class TestBodyWithFileSchemaExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); - var body = new FileSchemaTestClass(); // FileSchemaTestClass | + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); + var fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass | try { - apiInstance.TestBodyWithFileSchema(body); + apiInstance.TestBodyWithFileSchema(fileSchemaTestClass); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestBodyWithFileSchema: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -394,7 +432,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | + **fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | ### Return type @@ -409,6 +447,11 @@ No authorization required - **Content-Type**: application/json - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -417,14 +460,14 @@ No authorization required ## TestBodyWithQueryParams -> void TestBodyWithQueryParams (string query, User body) +> void TestBodyWithQueryParams (string query, User user) ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -434,19 +477,22 @@ namespace Example { public class TestBodyWithQueryParamsExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var query = query_example; // string | - var body = new User(); // User | + var user = new User(); // User | try { - apiInstance.TestBodyWithQueryParams(query, body); + apiInstance.TestBodyWithQueryParams(query, user); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestBodyWithQueryParams: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -459,7 +505,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **query** | **string**| | - **body** | [**User**](User.md)| | + **user** | [**User**](User.md)| | ### Return type @@ -474,6 +520,11 @@ No authorization required - **Content-Type**: application/json - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -482,7 +533,7 @@ No authorization required ## TestClientModel -> ModelClient TestClientModel (ModelClient body) +> ModelClient TestClientModel (ModelClient modelClient) To test \"client\" model @@ -491,7 +542,7 @@ To test \"client\" model ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -501,20 +552,23 @@ namespace Example { public class TestClientModelExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); - var body = new ModelClient(); // ModelClient | client model + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); + var modelClient = new ModelClient(); // ModelClient | client model try { // To test \"client\" model - ModelClient result = apiInstance.TestClientModel(body); + ModelClient result = apiInstance.TestClientModel(modelClient); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestClientModel: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -526,7 +580,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**ModelClient**](ModelClient.md)| client model | + **modelClient** | [**ModelClient**](ModelClient.md)| client model | ### Return type @@ -541,6 +595,11 @@ No authorization required - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -558,7 +617,7 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -568,13 +627,14 @@ namespace Example { public class TestEndpointParametersExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure HTTP basic authorization: http_basic_test Configuration.Default.Username = "YOUR_USERNAME"; Configuration.Default.Password = "YOUR_PASSWORD"; - var apiInstance = new FakeApi(); + var apiInstance = new FakeApi(Configuration.Default); var number = 8.14; // decimal? | None var _double = 1.2D; // double? | None var patternWithoutDelimiter = patternWithoutDelimiter_example; // string | None @@ -595,9 +655,11 @@ namespace Example // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 apiInstance.TestEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestEndpointParameters: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -637,6 +699,12 @@ void (empty response body) - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -654,7 +722,7 @@ To test enum parameters ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -664,9 +732,10 @@ namespace Example { public class TestEnumParametersExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var enumHeaderStringArray = enumHeaderStringArray_example; // List | Header parameter enum test (string array) (optional) var enumHeaderString = enumHeaderString_example; // string | Header parameter enum test (string) (optional) (default to -efg) var enumQueryStringArray = enumQueryStringArray_example; // List | Query parameter enum test (string array) (optional) @@ -681,9 +750,11 @@ namespace Example // To test enum parameters apiInstance.TestEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestEnumParameters: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -717,6 +788,12 @@ No authorization required - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid request | - | +| **404** | Not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -734,7 +811,7 @@ Fake endpoint to test group parameters (optional) ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -744,9 +821,14 @@ namespace Example { public class TestGroupParametersExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure HTTP basic authorization: bearer_test + Configuration.Default.Username = "YOUR_USERNAME"; + Configuration.Default.Password = "YOUR_PASSWORD"; + + var apiInstance = new FakeApi(Configuration.Default); var requiredStringGroup = 56; // int? | Required String in group parameters var requiredBooleanGroup = true; // bool? | Required Boolean in group parameters var requiredInt64Group = 789; // long? | Required Integer in group parameters @@ -759,9 +841,11 @@ namespace Example // Fake endpoint to test group parameters (optional) apiInstance.TestGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestGroupParameters: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -786,13 +870,18 @@ void (empty response body) ### Authorization -No authorization required +[bearer_test](../README.md#bearer_test) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Someting wrong | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -801,14 +890,14 @@ No authorization required ## TestInlineAdditionalProperties -> void TestInlineAdditionalProperties (Dictionary param) +> void TestInlineAdditionalProperties (Dictionary requestBody) test inline additionalProperties ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -818,19 +907,22 @@ namespace Example { public class TestInlineAdditionalPropertiesExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); - var param = new Dictionary(); // Dictionary | request body + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); + var requestBody = new Dictionary(); // Dictionary | request body try { // test inline additionalProperties - apiInstance.TestInlineAdditionalProperties(param); + apiInstance.TestInlineAdditionalProperties(requestBody); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestInlineAdditionalProperties: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -842,7 +934,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **param** | [**Dictionary<string, string>**](string.md)| request body | + **requestBody** | [**Dictionary<string, string>**](string.md)| request body | ### Return type @@ -857,6 +949,11 @@ No authorization required - **Content-Type**: application/json - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -872,7 +969,7 @@ test json serialization of form data ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -882,9 +979,10 @@ namespace Example { public class TestJsonFormDataExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var param = param_example; // string | field1 var param2 = param2_example; // string | field2 @@ -893,9 +991,11 @@ namespace Example // test json serialization of form data apiInstance.TestJsonFormData(param, param2); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestJsonFormData: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -923,6 +1023,11 @@ No authorization required - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/FakeClassnameTags123Api.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/FakeClassnameTags123Api.md index cc0cd83d12ca..93eb8b274552 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/FakeClassnameTags123Api.md @@ -10,7 +10,7 @@ Method | HTTP request | Description ## TestClassname -> ModelClient TestClassname (ModelClient body) +> ModelClient TestClassname (ModelClient modelClient) To test class name in snake case @@ -19,7 +19,7 @@ To test class name in snake case ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -29,25 +29,28 @@ namespace Example { public class TestClassnameExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure API key authorization: api_key_query Configuration.Default.AddApiKey("api_key_query", "YOUR_API_KEY"); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Configuration.Default.AddApiKeyPrefix("api_key_query", "Bearer"); - var apiInstance = new FakeClassnameTags123Api(); - var body = new ModelClient(); // ModelClient | client model + var apiInstance = new FakeClassnameTags123Api(Configuration.Default); + var modelClient = new ModelClient(); // ModelClient | client model try { // To test class name in snake case - ModelClient result = apiInstance.TestClassname(body); + ModelClient result = apiInstance.TestClassname(modelClient); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeClassnameTags123Api.TestClassname: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -59,7 +62,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**ModelClient**](ModelClient.md)| client model | + **modelClient** | [**ModelClient**](ModelClient.md)| client model | ### Return type @@ -74,6 +77,11 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/Foo.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/Foo.md index fd84dc2038c9..ea6f4245da6e 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/Foo.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/Foo.md @@ -1,9 +1,13 @@ + # Org.OpenAPITools.Model.Foo + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Bar** | **string** | | [optional] [default to "bar"] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/FormatTest.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/FormatTest.md index 519e940a7c86..a1bdd78699de 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/FormatTest.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/FormatTest.md @@ -18,6 +18,8 @@ Name | Type | Description | Notes **DateTime** | **DateTime?** | | [optional] **Uuid** | **Guid?** | | [optional] **Password** | **string** | | +**PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [optional] +**PatternWithDigitsAndDelimiter** | **string** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/HealthCheckResult.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/HealthCheckResult.md new file mode 100644 index 000000000000..08e5992d20cb --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/HealthCheckResult.md @@ -0,0 +1,13 @@ + +# Org.OpenAPITools.Model.HealthCheckResult + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**NullableMessage** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/InlineObject.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/InlineObject.md index 40e16da1bb7d..12ec90a8c699 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/InlineObject.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/InlineObject.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.InlineObject + ## Properties Name | Type | Description | Notes @@ -6,5 +8,7 @@ Name | Type | Description | Notes **Name** | **string** | Updated name of the pet | [optional] **Status** | **string** | Updated status of the pet | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/InlineObject1.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/InlineObject1.md index 2e6d226754e4..581fe20b1e21 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/InlineObject1.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/InlineObject1.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.InlineObject1 + ## Properties Name | Type | Description | Notes @@ -6,5 +8,7 @@ Name | Type | Description | Notes **AdditionalMetadata** | **string** | Additional data to pass to server | [optional] **File** | **System.IO.Stream** | file to upload | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/InlineObject2.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/InlineObject2.md index c02c78f9b2d0..79abb7a467c4 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/InlineObject2.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/InlineObject2.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.InlineObject2 + ## Properties Name | Type | Description | Notes @@ -6,5 +8,7 @@ Name | Type | Description | Notes **EnumFormStringArray** | **List<string>** | Form parameter enum test (string array) | [optional] **EnumFormString** | **string** | Form parameter enum test (string) | [optional] [default to EnumFormStringEnum.Efg] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/InlineObject3.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/InlineObject3.md index 192926bbe927..eb70006e29bd 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/InlineObject3.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/InlineObject3.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.InlineObject3 + ## Properties Name | Type | Description | Notes @@ -18,5 +20,7 @@ Name | Type | Description | Notes **Password** | **string** | None | [optional] **Callback** | **string** | None | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/InlineObject4.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/InlineObject4.md index c8e00663ee88..18e4a1f3ce50 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/InlineObject4.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/InlineObject4.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.InlineObject4 + ## Properties Name | Type | Description | Notes @@ -6,5 +8,7 @@ Name | Type | Description | Notes **Param** | **string** | field1 | **Param2** | **string** | field2 | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/InlineObject5.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/InlineObject5.md index a28ff47f2ec0..291c88623eea 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/InlineObject5.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/InlineObject5.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.InlineObject5 + ## Properties Name | Type | Description | Notes @@ -6,5 +8,7 @@ Name | Type | Description | Notes **AdditionalMetadata** | **string** | Additional data to pass to server | [optional] **RequiredFile** | **System.IO.Stream** | file to upload | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/InlineResponseDefault.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/InlineResponseDefault.md index 8c96fb62ac88..ecfb254001a2 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/InlineResponseDefault.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/InlineResponseDefault.md @@ -1,9 +1,13 @@ + # Org.OpenAPITools.Model.InlineResponseDefault + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **String** | [**Foo**](Foo.md) | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/NullableClass.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/NullableClass.md new file mode 100644 index 000000000000..84dd092d8a38 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/NullableClass.md @@ -0,0 +1,24 @@ + +# Org.OpenAPITools.Model.NullableClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**IntegerProp** | **int?** | | [optional] +**NumberProp** | **decimal?** | | [optional] +**BooleanProp** | **bool?** | | [optional] +**StringProp** | **string** | | [optional] +**DateProp** | **DateTime?** | | [optional] +**DatetimeProp** | **DateTime?** | | [optional] +**ArrayNullableProp** | **List<Object>** | | [optional] +**ArrayAndItemsNullableProp** | **List<Object>** | | [optional] +**ArrayItemsNullable** | **List<Object>** | | [optional] +**ObjectNullableProp** | **Dictionary<string, Object>** | | [optional] +**ObjectAndItemsNullableProp** | **Dictionary<string, Object>** | | [optional] +**ObjectItemsNullable** | **Dictionary<string, Object>** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/OuterEnumDefaultValue.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/OuterEnumDefaultValue.md new file mode 100644 index 000000000000..41474099f2ee --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/OuterEnumDefaultValue.md @@ -0,0 +1,12 @@ + +# Org.OpenAPITools.Model.OuterEnumDefaultValue + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/OuterEnumInteger.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/OuterEnumInteger.md new file mode 100644 index 000000000000..b82abc3adac4 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/OuterEnumInteger.md @@ -0,0 +1,12 @@ + +# Org.OpenAPITools.Model.OuterEnumInteger + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/OuterEnumIntegerDefaultValue.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/OuterEnumIntegerDefaultValue.md new file mode 100644 index 000000000000..46939d01522e --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/OuterEnumIntegerDefaultValue.md @@ -0,0 +1,12 @@ + +# Org.OpenAPITools.Model.OuterEnumIntegerDefaultValue + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/PetApi.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/PetApi.md index d2e2075bfd7b..a1e139d83e48 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/PetApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/PetApi.md @@ -18,14 +18,14 @@ Method | HTTP request | Description ## AddPet -> void AddPet (Pet body) +> void AddPet (Pet pet) Add a new pet to the store ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -35,22 +35,25 @@ namespace Example { public class AddPetExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); - var body = new Pet(); // Pet | Pet object that needs to be added to the store + var apiInstance = new PetApi(Configuration.Default); + var pet = new Pet(); // Pet | Pet object that needs to be added to the store try { // Add a new pet to the store - apiInstance.AddPet(body); + apiInstance.AddPet(pet); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.AddPet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -62,7 +65,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -77,6 +80,11 @@ void (empty response body) - **Content-Type**: application/json, application/xml - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **405** | Invalid input | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -92,7 +100,7 @@ Deletes a pet ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -102,12 +110,13 @@ namespace Example { public class DeletePetExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var petId = 789; // long? | Pet id to delete var apiKey = apiKey_example; // string | (optional) @@ -116,9 +125,11 @@ namespace Example // Deletes a pet apiInstance.DeletePet(petId, apiKey); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.DeletePet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -146,6 +157,11 @@ void (empty response body) - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid pet value | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -154,7 +170,7 @@ void (empty response body) ## FindPetsByStatus -> List FindPetsByStatus (List status) +> List<Pet> FindPetsByStatus (List status) Finds Pets by status @@ -163,7 +179,7 @@ Multiple status values can be provided with comma separated strings ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -173,23 +189,26 @@ namespace Example { public class FindPetsByStatusExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var status = status_example; // List | Status values that need to be considered for filter try { // Finds Pets by status - List<Pet> result = apiInstance.FindPetsByStatus(status); + List result = apiInstance.FindPetsByStatus(status); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.FindPetsByStatus: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -205,7 +224,7 @@ Name | Type | Description | Notes ### Return type -[**List**](Pet.md) +[**List<Pet>**](Pet.md) ### Authorization @@ -216,6 +235,12 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid status value | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -224,7 +249,7 @@ Name | Type | Description | Notes ## FindPetsByTags -> List FindPetsByTags (List tags) +> List<Pet> FindPetsByTags (List tags) Finds Pets by tags @@ -233,7 +258,7 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -243,23 +268,26 @@ namespace Example { public class FindPetsByTagsExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var tags = new List(); // List | Tags to filter by try { // Finds Pets by tags - List<Pet> result = apiInstance.FindPetsByTags(tags); + List result = apiInstance.FindPetsByTags(tags); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.FindPetsByTags: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -275,7 +303,7 @@ Name | Type | Description | Notes ### Return type -[**List**](Pet.md) +[**List<Pet>**](Pet.md) ### Authorization @@ -286,6 +314,12 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid tag value | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -303,7 +337,7 @@ Returns a single pet ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -313,14 +347,15 @@ namespace Example { public class GetPetByIdExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure API key authorization: api_key Configuration.Default.AddApiKey("api_key", "YOUR_API_KEY"); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Configuration.Default.AddApiKeyPrefix("api_key", "Bearer"); - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var petId = 789; // long? | ID of pet to return try @@ -329,9 +364,11 @@ namespace Example Pet result = apiInstance.GetPetById(petId); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.GetPetById: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -358,6 +395,13 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -366,14 +410,14 @@ Name | Type | Description | Notes ## UpdatePet -> void UpdatePet (Pet body) +> void UpdatePet (Pet pet) Update an existing pet ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -383,22 +427,25 @@ namespace Example { public class UpdatePetExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); - var body = new Pet(); // Pet | Pet object that needs to be added to the store + var apiInstance = new PetApi(Configuration.Default); + var pet = new Pet(); // Pet | Pet object that needs to be added to the store try { // Update an existing pet - apiInstance.UpdatePet(body); + apiInstance.UpdatePet(pet); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.UpdatePet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -410,7 +457,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -425,6 +472,13 @@ void (empty response body) - **Content-Type**: application/json, application/xml - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | +| **405** | Validation exception | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -440,7 +494,7 @@ Updates a pet in the store with form data ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -450,12 +504,13 @@ namespace Example { public class UpdatePetWithFormExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var petId = 789; // long? | ID of pet that needs to be updated var name = name_example; // string | Updated name of the pet (optional) var status = status_example; // string | Updated status of the pet (optional) @@ -465,9 +520,11 @@ namespace Example // Updates a pet in the store with form data apiInstance.UpdatePetWithForm(petId, name, status); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.UpdatePetWithForm: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -496,6 +553,11 @@ void (empty response body) - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **405** | Invalid input | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -511,7 +573,7 @@ uploads an image ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -521,12 +583,13 @@ namespace Example { public class UploadFileExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var petId = 789; // long? | ID of pet to update var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional) var file = BINARY_DATA_HERE; // System.IO.Stream | file to upload (optional) @@ -537,9 +600,11 @@ namespace Example ApiResponse result = apiInstance.UploadFile(petId, additionalMetadata, file); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.UploadFile: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -568,6 +633,11 @@ Name | Type | Description | Notes - **Content-Type**: multipart/form-data - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -583,7 +653,7 @@ uploads an image (required) ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -593,12 +663,13 @@ namespace Example { public class UploadFileWithRequiredFileExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var petId = 789; // long? | ID of pet to update var requiredFile = BINARY_DATA_HERE; // System.IO.Stream | file to upload var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional) @@ -609,9 +680,11 @@ namespace Example ApiResponse result = apiInstance.UploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.UploadFileWithRequiredFile: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -640,6 +713,11 @@ Name | Type | Description | Notes - **Content-Type**: multipart/form-data - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/StoreApi.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/StoreApi.md index 0f6d9e4e3dc2..cb61a7c619ec 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/StoreApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/StoreApi.md @@ -22,7 +22,7 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -32,9 +32,10 @@ namespace Example { public class DeleteOrderExample { - public void main() + public static void Main() { - var apiInstance = new StoreApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(Configuration.Default); var orderId = orderId_example; // string | ID of the order that needs to be deleted try @@ -42,9 +43,11 @@ namespace Example // Delete purchase order by ID apiInstance.DeleteOrder(orderId); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling StoreApi.DeleteOrder: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -71,6 +74,12 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -79,7 +88,7 @@ No authorization required ## GetInventory -> Dictionary GetInventory () +> Dictionary<string, int?> GetInventory () Returns pet inventories by status @@ -88,7 +97,7 @@ Returns a map of status codes to quantities ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -98,24 +107,27 @@ namespace Example { public class GetInventoryExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure API key authorization: api_key Configuration.Default.AddApiKey("api_key", "YOUR_API_KEY"); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Configuration.Default.AddApiKeyPrefix("api_key", "Bearer"); - var apiInstance = new StoreApi(); + var apiInstance = new StoreApi(Configuration.Default); try { // Returns pet inventories by status - Dictionary<string, int?> result = apiInstance.GetInventory(); + Dictionary result = apiInstance.GetInventory(); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling StoreApi.GetInventory: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -139,6 +151,11 @@ This endpoint does not need any parameter. - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -156,7 +173,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -166,9 +183,10 @@ namespace Example { public class GetOrderByIdExample { - public void main() + public static void Main() { - var apiInstance = new StoreApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(Configuration.Default); var orderId = 789; // long? | ID of pet that needs to be fetched try @@ -177,9 +195,11 @@ namespace Example Order result = apiInstance.GetOrderById(orderId); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling StoreApi.GetOrderById: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -206,6 +226,13 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -214,14 +241,14 @@ No authorization required ## PlaceOrder -> Order PlaceOrder (Order body) +> Order PlaceOrder (Order order) Place an order for a pet ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -231,20 +258,23 @@ namespace Example { public class PlaceOrderExample { - public void main() + public static void Main() { - var apiInstance = new StoreApi(); - var body = new Order(); // Order | order placed for purchasing the pet + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(Configuration.Default); + var order = new Order(); // Order | order placed for purchasing the pet try { // Place an order for a pet - Order result = apiInstance.PlaceOrder(body); + Order result = apiInstance.PlaceOrder(order); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling StoreApi.PlaceOrder: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -256,7 +286,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | + **order** | [**Order**](Order.md)| order placed for purchasing the pet | ### Return type @@ -268,9 +298,15 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: application/xml, application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid Order | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/UserApi.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/UserApi.md index b9f592bdd710..7c37179a9102 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/UserApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/UserApi.md @@ -17,7 +17,7 @@ Method | HTTP request | Description ## CreateUser -> void CreateUser (User body) +> void CreateUser (User user) Create user @@ -26,7 +26,7 @@ This can only be done by the logged in user. ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -36,19 +36,22 @@ namespace Example { public class CreateUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); - var body = new User(); // User | Created user object + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); + var user = new User(); // User | Created user object try { // Create user - apiInstance.CreateUser(body); + apiInstance.CreateUser(user); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.CreateUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -60,7 +63,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | + **user** | [**User**](User.md)| Created user object | ### Return type @@ -72,9 +75,14 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -83,14 +91,14 @@ No authorization required ## CreateUsersWithArrayInput -> void CreateUsersWithArrayInput (List body) +> void CreateUsersWithArrayInput (List user) Creates list of users with given input array ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -100,19 +108,22 @@ namespace Example { public class CreateUsersWithArrayInputExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); - var body = new List(); // List | List of user object + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); + var user = new List(); // List | List of user object try { // Creates list of users with given input array - apiInstance.CreateUsersWithArrayInput(body); + apiInstance.CreateUsersWithArrayInput(user); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.CreateUsersWithArrayInput: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -124,7 +135,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **user** | [**List<User>**](User.md)| List of user object | ### Return type @@ -136,9 +147,14 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -147,14 +163,14 @@ No authorization required ## CreateUsersWithListInput -> void CreateUsersWithListInput (List body) +> void CreateUsersWithListInput (List user) Creates list of users with given input array ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -164,19 +180,22 @@ namespace Example { public class CreateUsersWithListInputExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); - var body = new List(); // List | List of user object + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); + var user = new List(); // List | List of user object try { // Creates list of users with given input array - apiInstance.CreateUsersWithListInput(body); + apiInstance.CreateUsersWithListInput(user); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.CreateUsersWithListInput: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -188,7 +207,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **user** | [**List<User>**](User.md)| List of user object | ### Return type @@ -200,9 +219,14 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -220,7 +244,7 @@ This can only be done by the logged in user. ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -230,9 +254,10 @@ namespace Example { public class DeleteUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var username = username_example; // string | The name that needs to be deleted try @@ -240,9 +265,11 @@ namespace Example // Delete user apiInstance.DeleteUser(username); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.DeleteUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -269,6 +296,12 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -284,7 +317,7 @@ Get user by user name ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -294,9 +327,10 @@ namespace Example { public class GetUserByNameExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var username = username_example; // string | The name that needs to be fetched. Use user1 for testing. try @@ -305,9 +339,11 @@ namespace Example User result = apiInstance.GetUserByName(username); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.GetUserByName: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -334,6 +370,13 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -349,7 +392,7 @@ Logs user into the system ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -359,9 +402,10 @@ namespace Example { public class LoginUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var username = username_example; // string | The user name for login var password = password_example; // string | The password for login in clear text @@ -371,9 +415,11 @@ namespace Example string result = apiInstance.LoginUser(username, password); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.LoginUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -401,6 +447,12 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
| +| **400** | Invalid username/password supplied | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -416,7 +468,7 @@ Logs out current logged in user session ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -426,18 +478,21 @@ namespace Example { public class LogoutUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); try { // Logs out current logged in user session apiInstance.LogoutUser(); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.LogoutUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -461,6 +516,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -469,7 +529,7 @@ No authorization required ## UpdateUser -> void UpdateUser (string username, User body) +> void UpdateUser (string username, User user) Updated user @@ -478,7 +538,7 @@ This can only be done by the logged in user. ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -488,20 +548,23 @@ namespace Example { public class UpdateUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var username = username_example; // string | name that need to be deleted - var body = new User(); // User | Updated user object + var user = new User(); // User | Updated user object try { // Updated user - apiInstance.UpdateUser(username, body); + apiInstance.UpdateUser(username, user); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.UpdateUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -514,7 +577,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **string**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | + **user** | [**User**](User.md)| Updated user object | ### Return type @@ -526,9 +589,15 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid user supplied | - | +| **404** | User not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index 76d5194e5a16..c79bbb8a0c23 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -31,9 +31,9 @@ public interface IAnotherFakeApi : IApiAccessor /// To test special tags and operation ID starting with number /// /// Thrown when fails to make API call - /// client model + /// client model /// ModelClient - ModelClient Call123TestSpecialTags (ModelClient body); + ModelClient Call123TestSpecialTags (ModelClient modelClient); /// /// To test special tags @@ -42,9 +42,9 @@ public interface IAnotherFakeApi : IApiAccessor /// To test special tags and operation ID starting with number /// /// Thrown when fails to make API call - /// client model + /// client model /// ApiResponse of ModelClient - ApiResponse Call123TestSpecialTagsWithHttpInfo (ModelClient body); + ApiResponse Call123TestSpecialTagsWithHttpInfo (ModelClient modelClient); #endregion Synchronous Operations #region Asynchronous Operations /// @@ -54,9 +54,9 @@ public interface IAnotherFakeApi : IApiAccessor /// To test special tags and operation ID starting with number /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ModelClient - System.Threading.Tasks.Task Call123TestSpecialTagsAsync (ModelClient body); + System.Threading.Tasks.Task Call123TestSpecialTagsAsync (ModelClient modelClient); /// /// To test special tags @@ -65,9 +65,9 @@ public interface IAnotherFakeApi : IApiAccessor /// To test special tags and operation ID starting with number /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ApiResponse (ModelClient) - System.Threading.Tasks.Task> Call123TestSpecialTagsAsyncWithHttpInfo (ModelClient body); + System.Threading.Tasks.Task> Call123TestSpecialTagsAsyncWithHttpInfo (ModelClient modelClient); #endregion Asynchronous Operations } @@ -183,11 +183,11 @@ public void AddDefaultHeader(string key, string value) /// To test special tags To test special tags and operation ID starting with number /// /// Thrown when fails to make API call - /// client model + /// client model /// ModelClient - public ModelClient Call123TestSpecialTags (ModelClient body) + public ModelClient Call123TestSpecialTags (ModelClient modelClient) { - ApiResponse localVarResponse = Call123TestSpecialTagsWithHttpInfo(body); + ApiResponse localVarResponse = Call123TestSpecialTagsWithHttpInfo(modelClient); return localVarResponse.Data; } @@ -195,13 +195,13 @@ public ModelClient Call123TestSpecialTags (ModelClient body) /// To test special tags To test special tags and operation ID starting with number /// /// Thrown when fails to make API call - /// client model + /// client model /// ApiResponse of ModelClient - public ApiResponse< ModelClient > Call123TestSpecialTagsWithHttpInfo (ModelClient body) + public ApiResponse< ModelClient > Call123TestSpecialTagsWithHttpInfo (ModelClient modelClient) { - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling AnotherFakeApi->Call123TestSpecialTags"); + // verify the required parameter 'modelClient' is set + if (modelClient == null) + throw new ApiException(400, "Missing required parameter 'modelClient' when calling AnotherFakeApi->Call123TestSpecialTags"); var localVarPath = "./another-fake/dummy"; var localVarPathParams = new Dictionary(); @@ -225,13 +225,13 @@ public ApiResponse< ModelClient > Call123TestSpecialTagsWithHttpInfo (ModelClien if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (body != null && body.GetType() != typeof(byte[])) + if (modelClient != null && modelClient.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(modelClient); // http body (model) parameter } else { - localVarPostBody = body; // byte array + localVarPostBody = modelClient; // byte array } @@ -257,11 +257,11 @@ public ApiResponse< ModelClient > Call123TestSpecialTagsWithHttpInfo (ModelClien /// To test special tags To test special tags and operation ID starting with number /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ModelClient - public async System.Threading.Tasks.Task Call123TestSpecialTagsAsync (ModelClient body) + public async System.Threading.Tasks.Task Call123TestSpecialTagsAsync (ModelClient modelClient) { - ApiResponse localVarResponse = await Call123TestSpecialTagsAsyncWithHttpInfo(body); + ApiResponse localVarResponse = await Call123TestSpecialTagsAsyncWithHttpInfo(modelClient); return localVarResponse.Data; } @@ -270,13 +270,13 @@ public async System.Threading.Tasks.Task Call123TestSpecialTagsAsyn /// To test special tags To test special tags and operation ID starting with number ///
/// Thrown when fails to make API call - /// client model + /// client model /// Task of ApiResponse (ModelClient) - public async System.Threading.Tasks.Task> Call123TestSpecialTagsAsyncWithHttpInfo (ModelClient body) + public async System.Threading.Tasks.Task> Call123TestSpecialTagsAsyncWithHttpInfo (ModelClient modelClient) { - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling AnotherFakeApi->Call123TestSpecialTags"); + // verify the required parameter 'modelClient' is set + if (modelClient == null) + throw new ApiException(400, "Missing required parameter 'modelClient' when calling AnotherFakeApi->Call123TestSpecialTags"); var localVarPath = "./another-fake/dummy"; var localVarPathParams = new Dictionary(); @@ -300,13 +300,13 @@ public async System.Threading.Tasks.Task> Call123TestSp if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (body != null && body.GetType() != typeof(byte[])) + if (modelClient != null && modelClient.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(modelClient); // http body (model) parameter } else { - localVarPostBody = body; // byte array + localVarPostBody = modelClient; // byte array } diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/DefaultApi.cs index ff0cb9b0b5d8..584a6caa9bb2 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -85,6 +85,17 @@ public DefaultApi(String basePath) ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; } + /// + /// Initializes a new instance of the class + /// + /// + public DefaultApi() + { + this.Configuration = Org.OpenAPITools.Client.Configuration.Default; + + ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; + } + /// /// Initializes a new instance of the class /// using Configuration object @@ -220,7 +231,7 @@ public ApiResponse< InlineResponseDefault > FooGetWithHttpInfo () } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (InlineResponseDefault) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponseDefault))); } @@ -281,7 +292,7 @@ public async System.Threading.Tasks.Task> Foo } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (InlineResponseDefault) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponseDefault))); } diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/FakeApi.cs index 7f0b649598ca..ce29f1c6ecd4 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/FakeApi.cs @@ -25,26 +25,24 @@ public interface IFakeApi : IApiAccessor { #region Synchronous Operations /// - /// creates an XmlItem + /// Health check endpoint /// /// - /// this route creates an XmlItem + /// /// /// Thrown when fails to make API call - /// XmlItem Body - /// - void CreateXmlItem (XmlItem xmlItem); + /// HealthCheckResult + HealthCheckResult FakeHealthGet (); /// - /// creates an XmlItem + /// Health check endpoint /// /// - /// this route creates an XmlItem + /// /// /// Thrown when fails to make API call - /// XmlItem Body - /// ApiResponse of Object(void) - ApiResponse CreateXmlItemWithHttpInfo (XmlItem xmlItem); + /// ApiResponse of HealthCheckResult + ApiResponse FakeHealthGetWithHttpInfo (); /// /// /// @@ -73,9 +71,9 @@ public interface IFakeApi : IApiAccessor /// Test serialization of object with outer number type /// /// Thrown when fails to make API call - /// Input composite as post body (optional) + /// Input composite as post body (optional) /// OuterComposite - OuterComposite FakeOuterCompositeSerialize (OuterComposite body = null); + OuterComposite FakeOuterCompositeSerialize (OuterComposite outerComposite = null); /// /// @@ -84,9 +82,9 @@ public interface IFakeApi : IApiAccessor /// Test serialization of object with outer number type /// /// Thrown when fails to make API call - /// Input composite as post body (optional) + /// Input composite as post body (optional) /// ApiResponse of OuterComposite - ApiResponse FakeOuterCompositeSerializeWithHttpInfo (OuterComposite body = null); + ApiResponse FakeOuterCompositeSerializeWithHttpInfo (OuterComposite outerComposite = null); /// /// /// @@ -136,9 +134,9 @@ public interface IFakeApi : IApiAccessor /// For this test, the body for this request much reference a schema named `File`. /// /// Thrown when fails to make API call - /// + /// /// - void TestBodyWithFileSchema (FileSchemaTestClass body); + void TestBodyWithFileSchema (FileSchemaTestClass fileSchemaTestClass); /// /// @@ -147,9 +145,9 @@ public interface IFakeApi : IApiAccessor /// For this test, the body for this request much reference a schema named `File`. /// /// Thrown when fails to make API call - /// + /// /// ApiResponse of Object(void) - ApiResponse TestBodyWithFileSchemaWithHttpInfo (FileSchemaTestClass body); + ApiResponse TestBodyWithFileSchemaWithHttpInfo (FileSchemaTestClass fileSchemaTestClass); /// /// /// @@ -158,9 +156,9 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// - /// + /// /// - void TestBodyWithQueryParams (string query, User body); + void TestBodyWithQueryParams (string query, User user); /// /// @@ -170,9 +168,9 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// - /// + /// /// ApiResponse of Object(void) - ApiResponse TestBodyWithQueryParamsWithHttpInfo (string query, User body); + ApiResponse TestBodyWithQueryParamsWithHttpInfo (string query, User user); /// /// To test \"client\" model /// @@ -180,9 +178,9 @@ public interface IFakeApi : IApiAccessor /// To test \"client\" model /// /// Thrown when fails to make API call - /// client model + /// client model /// ModelClient - ModelClient TestClientModel (ModelClient body); + ModelClient TestClientModel (ModelClient modelClient); /// /// To test \"client\" model @@ -191,9 +189,9 @@ public interface IFakeApi : IApiAccessor /// To test \"client\" model /// /// Thrown when fails to make API call - /// client model + /// client model /// ApiResponse of ModelClient - ApiResponse TestClientModelWithHttpInfo (ModelClient body); + ApiResponse TestClientModelWithHttpInfo (ModelClient modelClient); /// /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// @@ -314,9 +312,9 @@ public interface IFakeApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// request body + /// request body /// - void TestInlineAdditionalProperties (Dictionary param); + void TestInlineAdditionalProperties (Dictionary requestBody); /// /// test inline additionalProperties @@ -325,9 +323,9 @@ public interface IFakeApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// request body + /// request body /// ApiResponse of Object(void) - ApiResponse TestInlineAdditionalPropertiesWithHttpInfo (Dictionary param); + ApiResponse TestInlineAdditionalPropertiesWithHttpInfo (Dictionary requestBody); /// /// test json serialization of form data /// @@ -354,26 +352,24 @@ public interface IFakeApi : IApiAccessor #endregion Synchronous Operations #region Asynchronous Operations /// - /// creates an XmlItem + /// Health check endpoint /// /// - /// this route creates an XmlItem + /// /// /// Thrown when fails to make API call - /// XmlItem Body - /// Task of void - System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem); + /// Task of HealthCheckResult + System.Threading.Tasks.Task FakeHealthGetAsync (); /// - /// creates an XmlItem + /// Health check endpoint /// /// - /// this route creates an XmlItem + /// /// /// Thrown when fails to make API call - /// XmlItem Body - /// Task of ApiResponse - System.Threading.Tasks.Task> CreateXmlItemAsyncWithHttpInfo (XmlItem xmlItem); + /// Task of ApiResponse (HealthCheckResult) + System.Threading.Tasks.Task> FakeHealthGetAsyncWithHttpInfo (); /// /// /// @@ -402,9 +398,9 @@ public interface IFakeApi : IApiAccessor /// Test serialization of object with outer number type /// /// Thrown when fails to make API call - /// Input composite as post body (optional) + /// Input composite as post body (optional) /// Task of OuterComposite - System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite body = null); + System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite outerComposite = null); /// /// @@ -413,9 +409,9 @@ public interface IFakeApi : IApiAccessor /// Test serialization of object with outer number type /// /// Thrown when fails to make API call - /// Input composite as post body (optional) + /// Input composite as post body (optional) /// Task of ApiResponse (OuterComposite) - System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite body = null); + System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite outerComposite = null); /// /// /// @@ -465,9 +461,9 @@ public interface IFakeApi : IApiAccessor /// For this test, the body for this request much reference a schema named `File`. /// /// Thrown when fails to make API call - /// + /// /// Task of void - System.Threading.Tasks.Task TestBodyWithFileSchemaAsync (FileSchemaTestClass body); + System.Threading.Tasks.Task TestBodyWithFileSchemaAsync (FileSchemaTestClass fileSchemaTestClass); /// /// @@ -476,9 +472,9 @@ public interface IFakeApi : IApiAccessor /// For this test, the body for this request much reference a schema named `File`. /// /// Thrown when fails to make API call - /// + /// /// Task of ApiResponse - System.Threading.Tasks.Task> TestBodyWithFileSchemaAsyncWithHttpInfo (FileSchemaTestClass body); + System.Threading.Tasks.Task> TestBodyWithFileSchemaAsyncWithHttpInfo (FileSchemaTestClass fileSchemaTestClass); /// /// /// @@ -487,9 +483,9 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// - /// + /// /// Task of void - System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (string query, User body); + System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (string query, User user); /// /// @@ -499,9 +495,9 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// - /// + /// /// Task of ApiResponse - System.Threading.Tasks.Task> TestBodyWithQueryParamsAsyncWithHttpInfo (string query, User body); + System.Threading.Tasks.Task> TestBodyWithQueryParamsAsyncWithHttpInfo (string query, User user); /// /// To test \"client\" model /// @@ -509,9 +505,9 @@ public interface IFakeApi : IApiAccessor /// To test \"client\" model /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ModelClient - System.Threading.Tasks.Task TestClientModelAsync (ModelClient body); + System.Threading.Tasks.Task TestClientModelAsync (ModelClient modelClient); /// /// To test \"client\" model @@ -520,9 +516,9 @@ public interface IFakeApi : IApiAccessor /// To test \"client\" model /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ApiResponse (ModelClient) - System.Threading.Tasks.Task> TestClientModelAsyncWithHttpInfo (ModelClient body); + System.Threading.Tasks.Task> TestClientModelAsyncWithHttpInfo (ModelClient modelClient); /// /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// @@ -643,9 +639,9 @@ public interface IFakeApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// request body + /// request body /// Task of void - System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Dictionary param); + System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Dictionary requestBody); /// /// test inline additionalProperties @@ -654,9 +650,9 @@ public interface IFakeApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// request body + /// request body /// Task of ApiResponse - System.Threading.Tasks.Task> TestInlineAdditionalPropertiesAsyncWithHttpInfo (Dictionary param); + System.Threading.Tasks.Task> TestInlineAdditionalPropertiesAsyncWithHttpInfo (Dictionary requestBody); /// /// test json serialization of form data /// @@ -792,29 +788,25 @@ public void AddDefaultHeader(string key, string value) } /// - /// creates an XmlItem this route creates an XmlItem + /// Health check endpoint /// /// Thrown when fails to make API call - /// XmlItem Body - /// - public void CreateXmlItem (XmlItem xmlItem) + /// HealthCheckResult + public HealthCheckResult FakeHealthGet () { - CreateXmlItemWithHttpInfo(xmlItem); + ApiResponse localVarResponse = FakeHealthGetWithHttpInfo(); + return localVarResponse.Data; } /// - /// creates an XmlItem this route creates an XmlItem + /// Health check endpoint /// /// Thrown when fails to make API call - /// XmlItem Body - /// ApiResponse of Object(void) - public ApiResponse CreateXmlItemWithHttpInfo (XmlItem xmlItem) + /// ApiResponse of HealthCheckResult + public ApiResponse< HealthCheckResult > FakeHealthGetWithHttpInfo () { - // verify the required parameter 'xmlItem' is set - if (xmlItem == null) - throw new ApiException(400, "Missing required parameter 'xmlItem' when calling FakeApi->CreateXmlItem"); - var localVarPath = "./fake/create_xml_item"; + var localVarPath = "./fake/health"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); @@ -824,75 +816,58 @@ public ApiResponse CreateXmlItemWithHttpInfo (XmlItem xmlItem) // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { - "application/xml", - "application/xml; charset=utf-8", - "application/xml; charset=utf-16", - "text/xml", - "text/xml; charset=utf-8", - "text/xml; charset=utf-16" }; String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { + "application/json" }; String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (xmlItem != null && xmlItem.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(xmlItem); // http body (model) parameter - } - else - { - localVarPostBody = xmlItem; // byte array - } // make the HTTP request IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int) localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("CreateXmlItem", localVarResponse); + Exception exception = ExceptionFactory("FakeHealthGet", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), - null); + (HealthCheckResult) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(HealthCheckResult))); } /// - /// creates an XmlItem this route creates an XmlItem + /// Health check endpoint /// /// Thrown when fails to make API call - /// XmlItem Body - /// Task of void - public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) + /// Task of HealthCheckResult + public async System.Threading.Tasks.Task FakeHealthGetAsync () { - await CreateXmlItemAsyncWithHttpInfo(xmlItem); + ApiResponse localVarResponse = await FakeHealthGetAsyncWithHttpInfo(); + return localVarResponse.Data; } /// - /// creates an XmlItem this route creates an XmlItem + /// Health check endpoint /// /// Thrown when fails to make API call - /// XmlItem Body - /// Task of ApiResponse - public async System.Threading.Tasks.Task> CreateXmlItemAsyncWithHttpInfo (XmlItem xmlItem) + /// Task of ApiResponse (HealthCheckResult) + public async System.Threading.Tasks.Task> FakeHealthGetAsyncWithHttpInfo () { - // verify the required parameter 'xmlItem' is set - if (xmlItem == null) - throw new ApiException(400, "Missing required parameter 'xmlItem' when calling FakeApi->CreateXmlItem"); - var localVarPath = "./fake/create_xml_item"; + var localVarPath = "./fake/health"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); @@ -902,48 +877,35 @@ public async System.Threading.Tasks.Task> CreateXmlItemAsync // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { - "application/xml", - "application/xml; charset=utf-8", - "application/xml; charset=utf-16", - "text/xml", - "text/xml; charset=utf-8", - "text/xml; charset=utf-16" }; String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { + "application/json" }; String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (xmlItem != null && xmlItem.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(xmlItem); // http body (model) parameter - } - else - { - localVarPostBody = xmlItem; // byte array - } // make the HTTP request IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int) localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("CreateXmlItem", localVarResponse); + Exception exception = ExceptionFactory("FakeHealthGet", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), - null); + (HealthCheckResult) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(HealthCheckResult))); } /// @@ -977,6 +939,7 @@ public async System.Threading.Tasks.Task> CreateXmlItemAsync // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { + "application/json" }; String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); @@ -1048,6 +1011,7 @@ public async System.Threading.Tasks.Task> CreateXmlItemAsync // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { + "application/json" }; String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); @@ -1091,11 +1055,11 @@ public async System.Threading.Tasks.Task> CreateXmlItemAsync /// Test serialization of object with outer number type /// /// Thrown when fails to make API call - /// Input composite as post body (optional) + /// Input composite as post body (optional) /// OuterComposite - public OuterComposite FakeOuterCompositeSerialize (OuterComposite body = null) + public OuterComposite FakeOuterCompositeSerialize (OuterComposite outerComposite = null) { - ApiResponse localVarResponse = FakeOuterCompositeSerializeWithHttpInfo(body); + ApiResponse localVarResponse = FakeOuterCompositeSerializeWithHttpInfo(outerComposite); return localVarResponse.Data; } @@ -1103,9 +1067,9 @@ public OuterComposite FakeOuterCompositeSerialize (OuterComposite body = null) /// Test serialization of object with outer number type /// /// Thrown when fails to make API call - /// Input composite as post body (optional) + /// Input composite as post body (optional) /// ApiResponse of OuterComposite - public ApiResponse< OuterComposite > FakeOuterCompositeSerializeWithHttpInfo (OuterComposite body = null) + public ApiResponse< OuterComposite > FakeOuterCompositeSerializeWithHttpInfo (OuterComposite outerComposite = null) { var localVarPath = "./fake/outer/composite"; @@ -1118,6 +1082,7 @@ public ApiResponse< OuterComposite > FakeOuterCompositeSerializeWithHttpInfo (Ou // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { + "application/json" }; String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); @@ -1129,13 +1094,13 @@ public ApiResponse< OuterComposite > FakeOuterCompositeSerializeWithHttpInfo (Ou if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (body != null && body.GetType() != typeof(byte[])) + if (outerComposite != null && outerComposite.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(outerComposite); // http body (model) parameter } else { - localVarPostBody = body; // byte array + localVarPostBody = outerComposite; // byte array } @@ -1161,11 +1126,11 @@ public ApiResponse< OuterComposite > FakeOuterCompositeSerializeWithHttpInfo (Ou /// Test serialization of object with outer number type /// /// Thrown when fails to make API call - /// Input composite as post body (optional) + /// Input composite as post body (optional) /// Task of OuterComposite - public async System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite body = null) + public async System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite outerComposite = null) { - ApiResponse localVarResponse = await FakeOuterCompositeSerializeAsyncWithHttpInfo(body); + ApiResponse localVarResponse = await FakeOuterCompositeSerializeAsyncWithHttpInfo(outerComposite); return localVarResponse.Data; } @@ -1174,9 +1139,9 @@ public async System.Threading.Tasks.Task FakeOuterCompositeSeria /// Test serialization of object with outer number type /// /// Thrown when fails to make API call - /// Input composite as post body (optional) + /// Input composite as post body (optional) /// Task of ApiResponse (OuterComposite) - public async System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite body = null) + public async System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite outerComposite = null) { var localVarPath = "./fake/outer/composite"; @@ -1189,6 +1154,7 @@ public async System.Threading.Tasks.Task> FakeOuterC // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { + "application/json" }; String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); @@ -1200,13 +1166,13 @@ public async System.Threading.Tasks.Task> FakeOuterC if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (body != null && body.GetType() != typeof(byte[])) + if (outerComposite != null && outerComposite.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(outerComposite); // http body (model) parameter } else { - localVarPostBody = body; // byte array + localVarPostBody = outerComposite; // byte array } @@ -1259,6 +1225,7 @@ public async System.Threading.Tasks.Task> FakeOuterC // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { + "application/json" }; String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); @@ -1330,6 +1297,7 @@ public async System.Threading.Tasks.Task> FakeOuterC // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { + "application/json" }; String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); @@ -1400,6 +1368,7 @@ public ApiResponse< string > FakeOuterStringSerializeWithHttpInfo (string body = // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { + "application/json" }; String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); @@ -1471,6 +1440,7 @@ public async System.Threading.Tasks.Task> FakeOuterStringSer // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { + "application/json" }; String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); @@ -1514,24 +1484,24 @@ public async System.Threading.Tasks.Task> FakeOuterStringSer /// For this test, the body for this request much reference a schema named `File`. /// /// Thrown when fails to make API call - /// + /// /// - public void TestBodyWithFileSchema (FileSchemaTestClass body) + public void TestBodyWithFileSchema (FileSchemaTestClass fileSchemaTestClass) { - TestBodyWithFileSchemaWithHttpInfo(body); + TestBodyWithFileSchemaWithHttpInfo(fileSchemaTestClass); } /// /// For this test, the body for this request much reference a schema named `File`. /// /// Thrown when fails to make API call - /// + /// /// ApiResponse of Object(void) - public ApiResponse TestBodyWithFileSchemaWithHttpInfo (FileSchemaTestClass body) + public ApiResponse TestBodyWithFileSchemaWithHttpInfo (FileSchemaTestClass fileSchemaTestClass) { - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling FakeApi->TestBodyWithFileSchema"); + // verify the required parameter 'fileSchemaTestClass' is set + if (fileSchemaTestClass == null) + throw new ApiException(400, "Missing required parameter 'fileSchemaTestClass' when calling FakeApi->TestBodyWithFileSchema"); var localVarPath = "./fake/body-with-file-schema"; var localVarPathParams = new Dictionary(); @@ -1554,13 +1524,13 @@ public ApiResponse TestBodyWithFileSchemaWithHttpInfo (FileSchemaTestCla if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (body != null && body.GetType() != typeof(byte[])) + if (fileSchemaTestClass != null && fileSchemaTestClass.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(fileSchemaTestClass); // http body (model) parameter } else { - localVarPostBody = body; // byte array + localVarPostBody = fileSchemaTestClass; // byte array } @@ -1586,11 +1556,11 @@ public ApiResponse TestBodyWithFileSchemaWithHttpInfo (FileSchemaTestCla /// For this test, the body for this request much reference a schema named `File`. /// /// Thrown when fails to make API call - /// + /// /// Task of void - public async System.Threading.Tasks.Task TestBodyWithFileSchemaAsync (FileSchemaTestClass body) + public async System.Threading.Tasks.Task TestBodyWithFileSchemaAsync (FileSchemaTestClass fileSchemaTestClass) { - await TestBodyWithFileSchemaAsyncWithHttpInfo(body); + await TestBodyWithFileSchemaAsyncWithHttpInfo(fileSchemaTestClass); } @@ -1598,13 +1568,13 @@ public async System.Threading.Tasks.Task TestBodyWithFileSchemaAsync (FileSchema /// For this test, the body for this request much reference a schema named `File`. /// /// Thrown when fails to make API call - /// + /// /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestBodyWithFileSchemaAsyncWithHttpInfo (FileSchemaTestClass body) + public async System.Threading.Tasks.Task> TestBodyWithFileSchemaAsyncWithHttpInfo (FileSchemaTestClass fileSchemaTestClass) { - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling FakeApi->TestBodyWithFileSchema"); + // verify the required parameter 'fileSchemaTestClass' is set + if (fileSchemaTestClass == null) + throw new ApiException(400, "Missing required parameter 'fileSchemaTestClass' when calling FakeApi->TestBodyWithFileSchema"); var localVarPath = "./fake/body-with-file-schema"; var localVarPathParams = new Dictionary(); @@ -1627,13 +1597,13 @@ public async System.Threading.Tasks.Task> TestBodyWithFileSc if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (body != null && body.GetType() != typeof(byte[])) + if (fileSchemaTestClass != null && fileSchemaTestClass.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(fileSchemaTestClass); // http body (model) parameter } else { - localVarPostBody = body; // byte array + localVarPostBody = fileSchemaTestClass; // byte array } @@ -1660,11 +1630,11 @@ public async System.Threading.Tasks.Task> TestBodyWithFileSc /// /// Thrown when fails to make API call /// - /// + /// /// - public void TestBodyWithQueryParams (string query, User body) + public void TestBodyWithQueryParams (string query, User user) { - TestBodyWithQueryParamsWithHttpInfo(query, body); + TestBodyWithQueryParamsWithHttpInfo(query, user); } /// @@ -1672,16 +1642,16 @@ public void TestBodyWithQueryParams (string query, User body) /// /// Thrown when fails to make API call /// - /// + /// /// ApiResponse of Object(void) - public ApiResponse TestBodyWithQueryParamsWithHttpInfo (string query, User body) + public ApiResponse TestBodyWithQueryParamsWithHttpInfo (string query, User user) { // verify the required parameter 'query' is set if (query == null) throw new ApiException(400, "Missing required parameter 'query' when calling FakeApi->TestBodyWithQueryParams"); - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling FakeApi->TestBodyWithQueryParams"); + // verify the required parameter 'user' is set + if (user == null) + throw new ApiException(400, "Missing required parameter 'user' when calling FakeApi->TestBodyWithQueryParams"); var localVarPath = "./fake/body-with-query-params"; var localVarPathParams = new Dictionary(); @@ -1705,13 +1675,13 @@ public ApiResponse TestBodyWithQueryParamsWithHttpInfo (string query, Us localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); if (query != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "query", query)); // query parameter - if (body != null && body.GetType() != typeof(byte[])) + if (user != null && user.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(user); // http body (model) parameter } else { - localVarPostBody = body; // byte array + localVarPostBody = user; // byte array } @@ -1738,11 +1708,11 @@ public ApiResponse TestBodyWithQueryParamsWithHttpInfo (string query, Us /// /// Thrown when fails to make API call /// - /// + /// /// Task of void - public async System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (string query, User body) + public async System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (string query, User user) { - await TestBodyWithQueryParamsAsyncWithHttpInfo(query, body); + await TestBodyWithQueryParamsAsyncWithHttpInfo(query, user); } @@ -1751,16 +1721,16 @@ public async System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (string qu /// /// Thrown when fails to make API call /// - /// + /// /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestBodyWithQueryParamsAsyncWithHttpInfo (string query, User body) + public async System.Threading.Tasks.Task> TestBodyWithQueryParamsAsyncWithHttpInfo (string query, User user) { // verify the required parameter 'query' is set if (query == null) throw new ApiException(400, "Missing required parameter 'query' when calling FakeApi->TestBodyWithQueryParams"); - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling FakeApi->TestBodyWithQueryParams"); + // verify the required parameter 'user' is set + if (user == null) + throw new ApiException(400, "Missing required parameter 'user' when calling FakeApi->TestBodyWithQueryParams"); var localVarPath = "./fake/body-with-query-params"; var localVarPathParams = new Dictionary(); @@ -1784,13 +1754,13 @@ public async System.Threading.Tasks.Task> TestBodyWithQueryP localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); if (query != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "query", query)); // query parameter - if (body != null && body.GetType() != typeof(byte[])) + if (user != null && user.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(user); // http body (model) parameter } else { - localVarPostBody = body; // byte array + localVarPostBody = user; // byte array } @@ -1816,11 +1786,11 @@ public async System.Threading.Tasks.Task> TestBodyWithQueryP /// To test \"client\" model To test \"client\" model /// /// Thrown when fails to make API call - /// client model + /// client model /// ModelClient - public ModelClient TestClientModel (ModelClient body) + public ModelClient TestClientModel (ModelClient modelClient) { - ApiResponse localVarResponse = TestClientModelWithHttpInfo(body); + ApiResponse localVarResponse = TestClientModelWithHttpInfo(modelClient); return localVarResponse.Data; } @@ -1828,13 +1798,13 @@ public ModelClient TestClientModel (ModelClient body) /// To test \"client\" model To test \"client\" model /// /// Thrown when fails to make API call - /// client model + /// client model /// ApiResponse of ModelClient - public ApiResponse< ModelClient > TestClientModelWithHttpInfo (ModelClient body) + public ApiResponse< ModelClient > TestClientModelWithHttpInfo (ModelClient modelClient) { - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling FakeApi->TestClientModel"); + // verify the required parameter 'modelClient' is set + if (modelClient == null) + throw new ApiException(400, "Missing required parameter 'modelClient' when calling FakeApi->TestClientModel"); var localVarPath = "./fake"; var localVarPathParams = new Dictionary(); @@ -1858,13 +1828,13 @@ public ApiResponse< ModelClient > TestClientModelWithHttpInfo (ModelClient body) if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (body != null && body.GetType() != typeof(byte[])) + if (modelClient != null && modelClient.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(modelClient); // http body (model) parameter } else { - localVarPostBody = body; // byte array + localVarPostBody = modelClient; // byte array } @@ -1890,11 +1860,11 @@ public ApiResponse< ModelClient > TestClientModelWithHttpInfo (ModelClient body) /// To test \"client\" model To test \"client\" model /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ModelClient - public async System.Threading.Tasks.Task TestClientModelAsync (ModelClient body) + public async System.Threading.Tasks.Task TestClientModelAsync (ModelClient modelClient) { - ApiResponse localVarResponse = await TestClientModelAsyncWithHttpInfo(body); + ApiResponse localVarResponse = await TestClientModelAsyncWithHttpInfo(modelClient); return localVarResponse.Data; } @@ -1903,13 +1873,13 @@ public async System.Threading.Tasks.Task TestClientModelAsync (Mode /// To test \"client\" model To test \"client\" model /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ApiResponse (ModelClient) - public async System.Threading.Tasks.Task> TestClientModelAsyncWithHttpInfo (ModelClient body) + public async System.Threading.Tasks.Task> TestClientModelAsyncWithHttpInfo (ModelClient modelClient) { - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling FakeApi->TestClientModel"); + // verify the required parameter 'modelClient' is set + if (modelClient == null) + throw new ApiException(400, "Missing required parameter 'modelClient' when calling FakeApi->TestClientModel"); var localVarPath = "./fake"; var localVarPathParams = new Dictionary(); @@ -1933,13 +1903,13 @@ public async System.Threading.Tasks.Task> TestClientMod if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (body != null && body.GetType() != typeof(byte[])) + if (modelClient != null && modelClient.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(modelClient); // http body (model) parameter } else { - localVarPostBody = body; // byte array + localVarPostBody = modelClient; // byte array } @@ -2255,7 +2225,7 @@ public ApiResponse TestEnumParametersWithHttpInfo (List enumHead if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (enumQueryStringArray != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "enum_query_string_array", enumQueryStringArray)); // query parameter + if (enumQueryStringArray != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "enum_query_string_array", enumQueryStringArray)); // query parameter if (enumQueryString != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "enum_query_string", enumQueryString)); // query parameter if (enumQueryInteger != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "enum_query_integer", enumQueryInteger)); // query parameter if (enumQueryDouble != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "enum_query_double", enumQueryDouble)); // query parameter @@ -2339,7 +2309,7 @@ public async System.Threading.Tasks.Task> TestEnumParameters if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (enumQueryStringArray != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "enum_query_string_array", enumQueryStringArray)); // query parameter + if (enumQueryStringArray != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "enum_query_string_array", enumQueryStringArray)); // query parameter if (enumQueryString != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "enum_query_string", enumQueryString)); // query parameter if (enumQueryInteger != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "enum_query_integer", enumQueryInteger)); // query parameter if (enumQueryDouble != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "enum_query_double", enumQueryDouble)); // query parameter @@ -2433,6 +2403,12 @@ public ApiResponse TestGroupParametersWithHttpInfo (int? requiredStringG if (requiredBooleanGroup != null) localVarHeaderParams.Add("required_boolean_group", this.Configuration.ApiClient.ParameterToString(requiredBooleanGroup)); // header parameter if (booleanGroup != null) localVarHeaderParams.Add("boolean_group", this.Configuration.ApiClient.ParameterToString(booleanGroup)); // header parameter + // authentication (bearer_test) required + // http basic authentication required + if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) + { + localVarHeaderParams["Authorization"] = "Basic " + ApiClient.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password); + } // make the HTTP request IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, @@ -2519,6 +2495,12 @@ public async System.Threading.Tasks.Task> TestGroupParameter if (requiredBooleanGroup != null) localVarHeaderParams.Add("required_boolean_group", this.Configuration.ApiClient.ParameterToString(requiredBooleanGroup)); // header parameter if (booleanGroup != null) localVarHeaderParams.Add("boolean_group", this.Configuration.ApiClient.ParameterToString(booleanGroup)); // header parameter + // authentication (bearer_test) required + // http basic authentication required + if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) + { + localVarHeaderParams["Authorization"] = "Basic " + ApiClient.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password); + } // make the HTTP request IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, @@ -2542,24 +2524,24 @@ public async System.Threading.Tasks.Task> TestGroupParameter /// test inline additionalProperties /// /// Thrown when fails to make API call - /// request body + /// request body /// - public void TestInlineAdditionalProperties (Dictionary param) + public void TestInlineAdditionalProperties (Dictionary requestBody) { - TestInlineAdditionalPropertiesWithHttpInfo(param); + TestInlineAdditionalPropertiesWithHttpInfo(requestBody); } /// /// test inline additionalProperties /// /// Thrown when fails to make API call - /// request body + /// request body /// ApiResponse of Object(void) - public ApiResponse TestInlineAdditionalPropertiesWithHttpInfo (Dictionary param) + public ApiResponse TestInlineAdditionalPropertiesWithHttpInfo (Dictionary requestBody) { - // verify the required parameter 'param' is set - if (param == null) - throw new ApiException(400, "Missing required parameter 'param' when calling FakeApi->TestInlineAdditionalProperties"); + // verify the required parameter 'requestBody' is set + if (requestBody == null) + throw new ApiException(400, "Missing required parameter 'requestBody' when calling FakeApi->TestInlineAdditionalProperties"); var localVarPath = "./fake/inline-additionalProperties"; var localVarPathParams = new Dictionary(); @@ -2582,13 +2564,13 @@ public ApiResponse TestInlineAdditionalPropertiesWithHttpInfo (Dictionar if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (param != null && param.GetType() != typeof(byte[])) + if (requestBody != null && requestBody.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(param); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(requestBody); // http body (model) parameter } else { - localVarPostBody = param; // byte array + localVarPostBody = requestBody; // byte array } @@ -2614,11 +2596,11 @@ public ApiResponse TestInlineAdditionalPropertiesWithHttpInfo (Dictionar /// test inline additionalProperties /// /// Thrown when fails to make API call - /// request body + /// request body /// Task of void - public async System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Dictionary param) + public async System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Dictionary requestBody) { - await TestInlineAdditionalPropertiesAsyncWithHttpInfo(param); + await TestInlineAdditionalPropertiesAsyncWithHttpInfo(requestBody); } @@ -2626,13 +2608,13 @@ public async System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Di /// test inline additionalProperties /// /// Thrown when fails to make API call - /// request body + /// request body /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestInlineAdditionalPropertiesAsyncWithHttpInfo (Dictionary param) + public async System.Threading.Tasks.Task> TestInlineAdditionalPropertiesAsyncWithHttpInfo (Dictionary requestBody) { - // verify the required parameter 'param' is set - if (param == null) - throw new ApiException(400, "Missing required parameter 'param' when calling FakeApi->TestInlineAdditionalProperties"); + // verify the required parameter 'requestBody' is set + if (requestBody == null) + throw new ApiException(400, "Missing required parameter 'requestBody' when calling FakeApi->TestInlineAdditionalProperties"); var localVarPath = "./fake/inline-additionalProperties"; var localVarPathParams = new Dictionary(); @@ -2655,13 +2637,13 @@ public async System.Threading.Tasks.Task> TestInlineAddition if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (param != null && param.GetType() != typeof(byte[])) + if (requestBody != null && requestBody.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(param); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(requestBody); // http body (model) parameter } else { - localVarPostBody = param; // byte array + localVarPostBody = requestBody; // byte array } diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index 15a124d69b36..499064115fca 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -31,9 +31,9 @@ public interface IFakeClassnameTags123Api : IApiAccessor /// To test class name in snake case /// /// Thrown when fails to make API call - /// client model + /// client model /// ModelClient - ModelClient TestClassname (ModelClient body); + ModelClient TestClassname (ModelClient modelClient); /// /// To test class name in snake case @@ -42,9 +42,9 @@ public interface IFakeClassnameTags123Api : IApiAccessor /// To test class name in snake case /// /// Thrown when fails to make API call - /// client model + /// client model /// ApiResponse of ModelClient - ApiResponse TestClassnameWithHttpInfo (ModelClient body); + ApiResponse TestClassnameWithHttpInfo (ModelClient modelClient); #endregion Synchronous Operations #region Asynchronous Operations /// @@ -54,9 +54,9 @@ public interface IFakeClassnameTags123Api : IApiAccessor /// To test class name in snake case /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ModelClient - System.Threading.Tasks.Task TestClassnameAsync (ModelClient body); + System.Threading.Tasks.Task TestClassnameAsync (ModelClient modelClient); /// /// To test class name in snake case @@ -65,9 +65,9 @@ public interface IFakeClassnameTags123Api : IApiAccessor /// To test class name in snake case /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ApiResponse (ModelClient) - System.Threading.Tasks.Task> TestClassnameAsyncWithHttpInfo (ModelClient body); + System.Threading.Tasks.Task> TestClassnameAsyncWithHttpInfo (ModelClient modelClient); #endregion Asynchronous Operations } @@ -183,11 +183,11 @@ public void AddDefaultHeader(string key, string value) /// To test class name in snake case To test class name in snake case /// /// Thrown when fails to make API call - /// client model + /// client model /// ModelClient - public ModelClient TestClassname (ModelClient body) + public ModelClient TestClassname (ModelClient modelClient) { - ApiResponse localVarResponse = TestClassnameWithHttpInfo(body); + ApiResponse localVarResponse = TestClassnameWithHttpInfo(modelClient); return localVarResponse.Data; } @@ -195,13 +195,13 @@ public ModelClient TestClassname (ModelClient body) /// To test class name in snake case To test class name in snake case /// /// Thrown when fails to make API call - /// client model + /// client model /// ApiResponse of ModelClient - public ApiResponse< ModelClient > TestClassnameWithHttpInfo (ModelClient body) + public ApiResponse< ModelClient > TestClassnameWithHttpInfo (ModelClient modelClient) { - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling FakeClassnameTags123Api->TestClassname"); + // verify the required parameter 'modelClient' is set + if (modelClient == null) + throw new ApiException(400, "Missing required parameter 'modelClient' when calling FakeClassnameTags123Api->TestClassname"); var localVarPath = "./fake_classname_test"; var localVarPathParams = new Dictionary(); @@ -225,13 +225,13 @@ public ApiResponse< ModelClient > TestClassnameWithHttpInfo (ModelClient body) if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (body != null && body.GetType() != typeof(byte[])) + if (modelClient != null && modelClient.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(modelClient); // http body (model) parameter } else { - localVarPostBody = body; // byte array + localVarPostBody = modelClient; // byte array } // authentication (api_key_query) required @@ -262,11 +262,11 @@ public ApiResponse< ModelClient > TestClassnameWithHttpInfo (ModelClient body) /// To test class name in snake case To test class name in snake case /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ModelClient - public async System.Threading.Tasks.Task TestClassnameAsync (ModelClient body) + public async System.Threading.Tasks.Task TestClassnameAsync (ModelClient modelClient) { - ApiResponse localVarResponse = await TestClassnameAsyncWithHttpInfo(body); + ApiResponse localVarResponse = await TestClassnameAsyncWithHttpInfo(modelClient); return localVarResponse.Data; } @@ -275,13 +275,13 @@ public async System.Threading.Tasks.Task TestClassnameAsync (ModelC /// To test class name in snake case To test class name in snake case /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ApiResponse (ModelClient) - public async System.Threading.Tasks.Task> TestClassnameAsyncWithHttpInfo (ModelClient body) + public async System.Threading.Tasks.Task> TestClassnameAsyncWithHttpInfo (ModelClient modelClient) { - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling FakeClassnameTags123Api->TestClassname"); + // verify the required parameter 'modelClient' is set + if (modelClient == null) + throw new ApiException(400, "Missing required parameter 'modelClient' when calling FakeClassnameTags123Api->TestClassname"); var localVarPath = "./fake_classname_test"; var localVarPathParams = new Dictionary(); @@ -305,13 +305,13 @@ public async System.Threading.Tasks.Task> TestClassname if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (body != null && body.GetType() != typeof(byte[])) + if (modelClient != null && modelClient.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(modelClient); // http body (model) parameter } else { - localVarPostBody = body; // byte array + localVarPostBody = modelClient; // byte array } // authentication (api_key_query) required diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/PetApi.cs index 9cf187dae40e..37118567d858 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/PetApi.cs @@ -31,9 +31,9 @@ public interface IPetApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// - void AddPet (Pet body); + void AddPet (Pet pet); /// /// Add a new pet to the store @@ -42,9 +42,9 @@ public interface IPetApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// ApiResponse of Object(void) - ApiResponse AddPetWithHttpInfo (Pet body); + ApiResponse AddPetWithHttpInfo (Pet pet); /// /// Deletes a pet /// @@ -138,9 +138,9 @@ public interface IPetApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// - void UpdatePet (Pet body); + void UpdatePet (Pet pet); /// /// Update an existing pet @@ -149,9 +149,9 @@ public interface IPetApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// ApiResponse of Object(void) - ApiResponse UpdatePetWithHttpInfo (Pet body); + ApiResponse UpdatePetWithHttpInfo (Pet pet); /// /// Updates a pet in the store with form data /// @@ -236,9 +236,9 @@ public interface IPetApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// Task of void - System.Threading.Tasks.Task AddPetAsync (Pet body); + System.Threading.Tasks.Task AddPetAsync (Pet pet); /// /// Add a new pet to the store @@ -247,9 +247,9 @@ public interface IPetApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// Task of ApiResponse - System.Threading.Tasks.Task> AddPetAsyncWithHttpInfo (Pet body); + System.Threading.Tasks.Task> AddPetAsyncWithHttpInfo (Pet pet); /// /// Deletes a pet /// @@ -343,9 +343,9 @@ public interface IPetApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// Task of void - System.Threading.Tasks.Task UpdatePetAsync (Pet body); + System.Threading.Tasks.Task UpdatePetAsync (Pet pet); /// /// Update an existing pet @@ -354,9 +354,9 @@ public interface IPetApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// Task of ApiResponse - System.Threading.Tasks.Task> UpdatePetAsyncWithHttpInfo (Pet body); + System.Threading.Tasks.Task> UpdatePetAsyncWithHttpInfo (Pet pet); /// /// Updates a pet in the store with form data /// @@ -547,24 +547,24 @@ public void AddDefaultHeader(string key, string value) /// Add a new pet to the store /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// - public void AddPet (Pet body) + public void AddPet (Pet pet) { - AddPetWithHttpInfo(body); + AddPetWithHttpInfo(pet); } /// /// Add a new pet to the store /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// ApiResponse of Object(void) - public ApiResponse AddPetWithHttpInfo (Pet body) + public ApiResponse AddPetWithHttpInfo (Pet pet) { - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling PetApi->AddPet"); + // verify the required parameter 'pet' is set + if (pet == null) + throw new ApiException(400, "Missing required parameter 'pet' when calling PetApi->AddPet"); var localVarPath = "./pet"; var localVarPathParams = new Dictionary(); @@ -588,13 +588,13 @@ public ApiResponse AddPetWithHttpInfo (Pet body) if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (body != null && body.GetType() != typeof(byte[])) + if (pet != null && pet.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(pet); // http body (model) parameter } else { - localVarPostBody = body; // byte array + localVarPostBody = pet; // byte array } // authentication (petstore_auth) required @@ -626,11 +626,11 @@ public ApiResponse AddPetWithHttpInfo (Pet body) /// Add a new pet to the store /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// Task of void - public async System.Threading.Tasks.Task AddPetAsync (Pet body) + public async System.Threading.Tasks.Task AddPetAsync (Pet pet) { - await AddPetAsyncWithHttpInfo(body); + await AddPetAsyncWithHttpInfo(pet); } @@ -638,13 +638,13 @@ public async System.Threading.Tasks.Task AddPetAsync (Pet body) /// Add a new pet to the store /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// Task of ApiResponse - public async System.Threading.Tasks.Task> AddPetAsyncWithHttpInfo (Pet body) + public async System.Threading.Tasks.Task> AddPetAsyncWithHttpInfo (Pet pet) { - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling PetApi->AddPet"); + // verify the required parameter 'pet' is set + if (pet == null) + throw new ApiException(400, "Missing required parameter 'pet' when calling PetApi->AddPet"); var localVarPath = "./pet"; var localVarPathParams = new Dictionary(); @@ -668,13 +668,13 @@ public async System.Threading.Tasks.Task> AddPetAsyncWithHtt if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (body != null && body.GetType() != typeof(byte[])) + if (pet != null && pet.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(pet); // http body (model) parameter } else { - localVarPostBody = body; // byte array + localVarPostBody = pet; // byte array } // authentication (petstore_auth) required @@ -1292,24 +1292,24 @@ public async System.Threading.Tasks.Task> GetPetByIdAsyncWithHt /// Update an existing pet /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// - public void UpdatePet (Pet body) + public void UpdatePet (Pet pet) { - UpdatePetWithHttpInfo(body); + UpdatePetWithHttpInfo(pet); } /// /// Update an existing pet /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// ApiResponse of Object(void) - public ApiResponse UpdatePetWithHttpInfo (Pet body) + public ApiResponse UpdatePetWithHttpInfo (Pet pet) { - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling PetApi->UpdatePet"); + // verify the required parameter 'pet' is set + if (pet == null) + throw new ApiException(400, "Missing required parameter 'pet' when calling PetApi->UpdatePet"); var localVarPath = "./pet"; var localVarPathParams = new Dictionary(); @@ -1333,13 +1333,13 @@ public ApiResponse UpdatePetWithHttpInfo (Pet body) if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (body != null && body.GetType() != typeof(byte[])) + if (pet != null && pet.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(pet); // http body (model) parameter } else { - localVarPostBody = body; // byte array + localVarPostBody = pet; // byte array } // authentication (petstore_auth) required @@ -1371,11 +1371,11 @@ public ApiResponse UpdatePetWithHttpInfo (Pet body) /// Update an existing pet /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// Task of void - public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) + public async System.Threading.Tasks.Task UpdatePetAsync (Pet pet) { - await UpdatePetAsyncWithHttpInfo(body); + await UpdatePetAsyncWithHttpInfo(pet); } @@ -1383,13 +1383,13 @@ public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) /// Update an existing pet /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// Task of ApiResponse - public async System.Threading.Tasks.Task> UpdatePetAsyncWithHttpInfo (Pet body) + public async System.Threading.Tasks.Task> UpdatePetAsyncWithHttpInfo (Pet pet) { - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling PetApi->UpdatePet"); + // verify the required parameter 'pet' is set + if (pet == null) + throw new ApiException(400, "Missing required parameter 'pet' when calling PetApi->UpdatePet"); var localVarPath = "./pet"; var localVarPathParams = new Dictionary(); @@ -1413,13 +1413,13 @@ public async System.Threading.Tasks.Task> UpdatePetAsyncWith if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (body != null && body.GetType() != typeof(byte[])) + if (pet != null && pet.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(pet); // http body (model) parameter } else { - localVarPostBody = body; // byte array + localVarPostBody = pet; // byte array } // authentication (petstore_auth) required diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/StoreApi.cs index 2823afda29c8..684a1c90ec85 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/StoreApi.cs @@ -92,9 +92,9 @@ public interface IStoreApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// order placed for purchasing the pet + /// order placed for purchasing the pet /// Order - Order PlaceOrder (Order body); + Order PlaceOrder (Order order); /// /// Place an order for a pet @@ -103,9 +103,9 @@ public interface IStoreApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// order placed for purchasing the pet + /// order placed for purchasing the pet /// ApiResponse of Order - ApiResponse PlaceOrderWithHttpInfo (Order body); + ApiResponse PlaceOrderWithHttpInfo (Order order); #endregion Synchronous Operations #region Asynchronous Operations /// @@ -176,9 +176,9 @@ public interface IStoreApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// order placed for purchasing the pet + /// order placed for purchasing the pet /// Task of Order - System.Threading.Tasks.Task PlaceOrderAsync (Order body); + System.Threading.Tasks.Task PlaceOrderAsync (Order order); /// /// Place an order for a pet @@ -187,9 +187,9 @@ public interface IStoreApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// order placed for purchasing the pet + /// order placed for purchasing the pet /// Task of ApiResponse (Order) - System.Threading.Tasks.Task> PlaceOrderAsyncWithHttpInfo (Order body); + System.Threading.Tasks.Task> PlaceOrderAsyncWithHttpInfo (Order order); #endregion Asynchronous Operations } @@ -700,11 +700,11 @@ public async System.Threading.Tasks.Task> GetOrderByIdAsyncWi /// Place an order for a pet /// /// Thrown when fails to make API call - /// order placed for purchasing the pet + /// order placed for purchasing the pet /// Order - public Order PlaceOrder (Order body) + public Order PlaceOrder (Order order) { - ApiResponse localVarResponse = PlaceOrderWithHttpInfo(body); + ApiResponse localVarResponse = PlaceOrderWithHttpInfo(order); return localVarResponse.Data; } @@ -712,13 +712,13 @@ public Order PlaceOrder (Order body) /// Place an order for a pet /// /// Thrown when fails to make API call - /// order placed for purchasing the pet + /// order placed for purchasing the pet /// ApiResponse of Order - public ApiResponse< Order > PlaceOrderWithHttpInfo (Order body) + public ApiResponse< Order > PlaceOrderWithHttpInfo (Order order) { - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling StoreApi->PlaceOrder"); + // verify the required parameter 'order' is set + if (order == null) + throw new ApiException(400, "Missing required parameter 'order' when calling StoreApi->PlaceOrder"); var localVarPath = "./store/order"; var localVarPathParams = new Dictionary(); @@ -730,6 +730,7 @@ public ApiResponse< Order > PlaceOrderWithHttpInfo (Order body) // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { + "application/json" }; String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); @@ -742,13 +743,13 @@ public ApiResponse< Order > PlaceOrderWithHttpInfo (Order body) if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (body != null && body.GetType() != typeof(byte[])) + if (order != null && order.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(order); // http body (model) parameter } else { - localVarPostBody = body; // byte array + localVarPostBody = order; // byte array } @@ -774,11 +775,11 @@ public ApiResponse< Order > PlaceOrderWithHttpInfo (Order body) /// Place an order for a pet /// /// Thrown when fails to make API call - /// order placed for purchasing the pet + /// order placed for purchasing the pet /// Task of Order - public async System.Threading.Tasks.Task PlaceOrderAsync (Order body) + public async System.Threading.Tasks.Task PlaceOrderAsync (Order order) { - ApiResponse localVarResponse = await PlaceOrderAsyncWithHttpInfo(body); + ApiResponse localVarResponse = await PlaceOrderAsyncWithHttpInfo(order); return localVarResponse.Data; } @@ -787,13 +788,13 @@ public async System.Threading.Tasks.Task PlaceOrderAsync (Order body) /// Place an order for a pet /// /// Thrown when fails to make API call - /// order placed for purchasing the pet + /// order placed for purchasing the pet /// Task of ApiResponse (Order) - public async System.Threading.Tasks.Task> PlaceOrderAsyncWithHttpInfo (Order body) + public async System.Threading.Tasks.Task> PlaceOrderAsyncWithHttpInfo (Order order) { - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling StoreApi->PlaceOrder"); + // verify the required parameter 'order' is set + if (order == null) + throw new ApiException(400, "Missing required parameter 'order' when calling StoreApi->PlaceOrder"); var localVarPath = "./store/order"; var localVarPathParams = new Dictionary(); @@ -805,6 +806,7 @@ public async System.Threading.Tasks.Task> PlaceOrderAsyncWith // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { + "application/json" }; String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); @@ -817,13 +819,13 @@ public async System.Threading.Tasks.Task> PlaceOrderAsyncWith if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (body != null && body.GetType() != typeof(byte[])) + if (order != null && order.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(order); // http body (model) parameter } else { - localVarPostBody = body; // byte array + localVarPostBody = order; // byte array } diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/UserApi.cs index 27a34b44a5c1..bb71a80d46f0 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/UserApi.cs @@ -31,9 +31,9 @@ public interface IUserApi : IApiAccessor /// This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object + /// Created user object /// - void CreateUser (User body); + void CreateUser (User user); /// /// Create user @@ -42,9 +42,9 @@ public interface IUserApi : IApiAccessor /// This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object + /// Created user object /// ApiResponse of Object(void) - ApiResponse CreateUserWithHttpInfo (User body); + ApiResponse CreateUserWithHttpInfo (User user); /// /// Creates list of users with given input array /// @@ -52,9 +52,9 @@ public interface IUserApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// - void CreateUsersWithArrayInput (List body); + void CreateUsersWithArrayInput (List user); /// /// Creates list of users with given input array @@ -63,9 +63,9 @@ public interface IUserApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// ApiResponse of Object(void) - ApiResponse CreateUsersWithArrayInputWithHttpInfo (List body); + ApiResponse CreateUsersWithArrayInputWithHttpInfo (List user); /// /// Creates list of users with given input array /// @@ -73,9 +73,9 @@ public interface IUserApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// - void CreateUsersWithListInput (List body); + void CreateUsersWithListInput (List user); /// /// Creates list of users with given input array @@ -84,9 +84,9 @@ public interface IUserApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// ApiResponse of Object(void) - ApiResponse CreateUsersWithListInputWithHttpInfo (List body); + ApiResponse CreateUsersWithListInputWithHttpInfo (List user); /// /// Delete user /// @@ -179,9 +179,9 @@ public interface IUserApi : IApiAccessor /// /// Thrown when fails to make API call /// name that need to be deleted - /// Updated user object + /// Updated user object /// - void UpdateUser (string username, User body); + void UpdateUser (string username, User user); /// /// Updated user @@ -191,9 +191,9 @@ public interface IUserApi : IApiAccessor /// /// Thrown when fails to make API call /// name that need to be deleted - /// Updated user object + /// Updated user object /// ApiResponse of Object(void) - ApiResponse UpdateUserWithHttpInfo (string username, User body); + ApiResponse UpdateUserWithHttpInfo (string username, User user); #endregion Synchronous Operations #region Asynchronous Operations /// @@ -203,9 +203,9 @@ public interface IUserApi : IApiAccessor /// This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object + /// Created user object /// Task of void - System.Threading.Tasks.Task CreateUserAsync (User body); + System.Threading.Tasks.Task CreateUserAsync (User user); /// /// Create user @@ -214,9 +214,9 @@ public interface IUserApi : IApiAccessor /// This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object + /// Created user object /// Task of ApiResponse - System.Threading.Tasks.Task> CreateUserAsyncWithHttpInfo (User body); + System.Threading.Tasks.Task> CreateUserAsyncWithHttpInfo (User user); /// /// Creates list of users with given input array /// @@ -224,9 +224,9 @@ public interface IUserApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// Task of void - System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List body); + System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List user); /// /// Creates list of users with given input array @@ -235,9 +235,9 @@ public interface IUserApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// Task of ApiResponse - System.Threading.Tasks.Task> CreateUsersWithArrayInputAsyncWithHttpInfo (List body); + System.Threading.Tasks.Task> CreateUsersWithArrayInputAsyncWithHttpInfo (List user); /// /// Creates list of users with given input array /// @@ -245,9 +245,9 @@ public interface IUserApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// Task of void - System.Threading.Tasks.Task CreateUsersWithListInputAsync (List body); + System.Threading.Tasks.Task CreateUsersWithListInputAsync (List user); /// /// Creates list of users with given input array @@ -256,9 +256,9 @@ public interface IUserApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// Task of ApiResponse - System.Threading.Tasks.Task> CreateUsersWithListInputAsyncWithHttpInfo (List body); + System.Threading.Tasks.Task> CreateUsersWithListInputAsyncWithHttpInfo (List user); /// /// Delete user /// @@ -351,9 +351,9 @@ public interface IUserApi : IApiAccessor /// /// Thrown when fails to make API call /// name that need to be deleted - /// Updated user object + /// Updated user object /// Task of void - System.Threading.Tasks.Task UpdateUserAsync (string username, User body); + System.Threading.Tasks.Task UpdateUserAsync (string username, User user); /// /// Updated user @@ -363,9 +363,9 @@ public interface IUserApi : IApiAccessor /// /// Thrown when fails to make API call /// name that need to be deleted - /// Updated user object + /// Updated user object /// Task of ApiResponse - System.Threading.Tasks.Task> UpdateUserAsyncWithHttpInfo (string username, User body); + System.Threading.Tasks.Task> UpdateUserAsyncWithHttpInfo (string username, User user); #endregion Asynchronous Operations } @@ -481,24 +481,24 @@ public void AddDefaultHeader(string key, string value) /// Create user This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object + /// Created user object /// - public void CreateUser (User body) + public void CreateUser (User user) { - CreateUserWithHttpInfo(body); + CreateUserWithHttpInfo(user); } /// /// Create user This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object + /// Created user object /// ApiResponse of Object(void) - public ApiResponse CreateUserWithHttpInfo (User body) + public ApiResponse CreateUserWithHttpInfo (User user) { - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUser"); + // verify the required parameter 'user' is set + if (user == null) + throw new ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUser"); var localVarPath = "./user"; var localVarPathParams = new Dictionary(); @@ -510,6 +510,7 @@ public ApiResponse CreateUserWithHttpInfo (User body) // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { + "application/json" }; String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); @@ -520,13 +521,13 @@ public ApiResponse CreateUserWithHttpInfo (User body) if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (body != null && body.GetType() != typeof(byte[])) + if (user != null && user.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(user); // http body (model) parameter } else { - localVarPostBody = body; // byte array + localVarPostBody = user; // byte array } @@ -552,11 +553,11 @@ public ApiResponse CreateUserWithHttpInfo (User body) /// Create user This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object + /// Created user object /// Task of void - public async System.Threading.Tasks.Task CreateUserAsync (User body) + public async System.Threading.Tasks.Task CreateUserAsync (User user) { - await CreateUserAsyncWithHttpInfo(body); + await CreateUserAsyncWithHttpInfo(user); } @@ -564,13 +565,13 @@ public async System.Threading.Tasks.Task CreateUserAsync (User body) /// Create user This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object + /// Created user object /// Task of ApiResponse - public async System.Threading.Tasks.Task> CreateUserAsyncWithHttpInfo (User body) + public async System.Threading.Tasks.Task> CreateUserAsyncWithHttpInfo (User user) { - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUser"); + // verify the required parameter 'user' is set + if (user == null) + throw new ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUser"); var localVarPath = "./user"; var localVarPathParams = new Dictionary(); @@ -582,6 +583,7 @@ public async System.Threading.Tasks.Task> CreateUserAsyncWit // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { + "application/json" }; String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); @@ -592,13 +594,13 @@ public async System.Threading.Tasks.Task> CreateUserAsyncWit if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (body != null && body.GetType() != typeof(byte[])) + if (user != null && user.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(user); // http body (model) parameter } else { - localVarPostBody = body; // byte array + localVarPostBody = user; // byte array } @@ -624,24 +626,24 @@ public async System.Threading.Tasks.Task> CreateUserAsyncWit /// Creates list of users with given input array /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// - public void CreateUsersWithArrayInput (List body) + public void CreateUsersWithArrayInput (List user) { - CreateUsersWithArrayInputWithHttpInfo(body); + CreateUsersWithArrayInputWithHttpInfo(user); } /// /// Creates list of users with given input array /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// ApiResponse of Object(void) - public ApiResponse CreateUsersWithArrayInputWithHttpInfo (List body) + public ApiResponse CreateUsersWithArrayInputWithHttpInfo (List user) { - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUsersWithArrayInput"); + // verify the required parameter 'user' is set + if (user == null) + throw new ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithArrayInput"); var localVarPath = "./user/createWithArray"; var localVarPathParams = new Dictionary(); @@ -653,6 +655,7 @@ public ApiResponse CreateUsersWithArrayInputWithHttpInfo (List bod // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { + "application/json" }; String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); @@ -663,13 +666,13 @@ public ApiResponse CreateUsersWithArrayInputWithHttpInfo (List bod if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (body != null && body.GetType() != typeof(byte[])) + if (user != null && user.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(user); // http body (model) parameter } else { - localVarPostBody = body; // byte array + localVarPostBody = user; // byte array } @@ -695,11 +698,11 @@ public ApiResponse CreateUsersWithArrayInputWithHttpInfo (List bod /// Creates list of users with given input array /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// Task of void - public async System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List body) + public async System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List user) { - await CreateUsersWithArrayInputAsyncWithHttpInfo(body); + await CreateUsersWithArrayInputAsyncWithHttpInfo(user); } @@ -707,13 +710,13 @@ public async System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List /// Thrown when fails to make API call - /// List of user object + /// List of user object /// Task of ApiResponse - public async System.Threading.Tasks.Task> CreateUsersWithArrayInputAsyncWithHttpInfo (List body) + public async System.Threading.Tasks.Task> CreateUsersWithArrayInputAsyncWithHttpInfo (List user) { - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUsersWithArrayInput"); + // verify the required parameter 'user' is set + if (user == null) + throw new ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithArrayInput"); var localVarPath = "./user/createWithArray"; var localVarPathParams = new Dictionary(); @@ -725,6 +728,7 @@ public async System.Threading.Tasks.Task> CreateUsersWithArr // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { + "application/json" }; String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); @@ -735,13 +739,13 @@ public async System.Threading.Tasks.Task> CreateUsersWithArr if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (body != null && body.GetType() != typeof(byte[])) + if (user != null && user.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(user); // http body (model) parameter } else { - localVarPostBody = body; // byte array + localVarPostBody = user; // byte array } @@ -767,24 +771,24 @@ public async System.Threading.Tasks.Task> CreateUsersWithArr /// Creates list of users with given input array /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// - public void CreateUsersWithListInput (List body) + public void CreateUsersWithListInput (List user) { - CreateUsersWithListInputWithHttpInfo(body); + CreateUsersWithListInputWithHttpInfo(user); } /// /// Creates list of users with given input array /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// ApiResponse of Object(void) - public ApiResponse CreateUsersWithListInputWithHttpInfo (List body) + public ApiResponse CreateUsersWithListInputWithHttpInfo (List user) { - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUsersWithListInput"); + // verify the required parameter 'user' is set + if (user == null) + throw new ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithListInput"); var localVarPath = "./user/createWithList"; var localVarPathParams = new Dictionary(); @@ -796,6 +800,7 @@ public ApiResponse CreateUsersWithListInputWithHttpInfo (List body // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { + "application/json" }; String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); @@ -806,13 +811,13 @@ public ApiResponse CreateUsersWithListInputWithHttpInfo (List body if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (body != null && body.GetType() != typeof(byte[])) + if (user != null && user.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(user); // http body (model) parameter } else { - localVarPostBody = body; // byte array + localVarPostBody = user; // byte array } @@ -838,11 +843,11 @@ public ApiResponse CreateUsersWithListInputWithHttpInfo (List body /// Creates list of users with given input array /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// Task of void - public async System.Threading.Tasks.Task CreateUsersWithListInputAsync (List body) + public async System.Threading.Tasks.Task CreateUsersWithListInputAsync (List user) { - await CreateUsersWithListInputAsyncWithHttpInfo(body); + await CreateUsersWithListInputAsyncWithHttpInfo(user); } @@ -850,13 +855,13 @@ public async System.Threading.Tasks.Task CreateUsersWithListInputAsync (List /// Thrown when fails to make API call - /// List of user object + /// List of user object /// Task of ApiResponse - public async System.Threading.Tasks.Task> CreateUsersWithListInputAsyncWithHttpInfo (List body) + public async System.Threading.Tasks.Task> CreateUsersWithListInputAsyncWithHttpInfo (List user) { - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUsersWithListInput"); + // verify the required parameter 'user' is set + if (user == null) + throw new ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithListInput"); var localVarPath = "./user/createWithList"; var localVarPathParams = new Dictionary(); @@ -868,6 +873,7 @@ public async System.Threading.Tasks.Task> CreateUsersWithLis // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { + "application/json" }; String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); @@ -878,13 +884,13 @@ public async System.Threading.Tasks.Task> CreateUsersWithLis if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (body != null && body.GetType() != typeof(byte[])) + if (user != null && user.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(user); // http body (model) parameter } else { - localVarPostBody = body; // byte array + localVarPostBody = user; // byte array } @@ -1439,11 +1445,11 @@ public async System.Threading.Tasks.Task> LogoutUserAsyncWit /// /// Thrown when fails to make API call /// name that need to be deleted - /// Updated user object + /// Updated user object /// - public void UpdateUser (string username, User body) + public void UpdateUser (string username, User user) { - UpdateUserWithHttpInfo(username, body); + UpdateUserWithHttpInfo(username, user); } /// @@ -1451,16 +1457,16 @@ public void UpdateUser (string username, User body) /// /// Thrown when fails to make API call /// name that need to be deleted - /// Updated user object + /// Updated user object /// ApiResponse of Object(void) - public ApiResponse UpdateUserWithHttpInfo (string username, User body) + public ApiResponse UpdateUserWithHttpInfo (string username, User user) { // verify the required parameter 'username' is set if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->UpdateUser"); - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->UpdateUser"); + // verify the required parameter 'user' is set + if (user == null) + throw new ApiException(400, "Missing required parameter 'user' when calling UserApi->UpdateUser"); var localVarPath = "./user/{username}"; var localVarPathParams = new Dictionary(); @@ -1472,6 +1478,7 @@ public ApiResponse UpdateUserWithHttpInfo (string username, User body) // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { + "application/json" }; String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); @@ -1483,13 +1490,13 @@ public ApiResponse UpdateUserWithHttpInfo (string username, User body) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); if (username != null) localVarPathParams.Add("username", this.Configuration.ApiClient.ParameterToString(username)); // path parameter - if (body != null && body.GetType() != typeof(byte[])) + if (user != null && user.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(user); // http body (model) parameter } else { - localVarPostBody = body; // byte array + localVarPostBody = user; // byte array } @@ -1516,11 +1523,11 @@ public ApiResponse UpdateUserWithHttpInfo (string username, User body) /// /// Thrown when fails to make API call /// name that need to be deleted - /// Updated user object + /// Updated user object /// Task of void - public async System.Threading.Tasks.Task UpdateUserAsync (string username, User body) + public async System.Threading.Tasks.Task UpdateUserAsync (string username, User user) { - await UpdateUserAsyncWithHttpInfo(username, body); + await UpdateUserAsyncWithHttpInfo(username, user); } @@ -1529,16 +1536,16 @@ public async System.Threading.Tasks.Task UpdateUserAsync (string username, User /// /// Thrown when fails to make API call /// name that need to be deleted - /// Updated user object + /// Updated user object /// Task of ApiResponse - public async System.Threading.Tasks.Task> UpdateUserAsyncWithHttpInfo (string username, User body) + public async System.Threading.Tasks.Task> UpdateUserAsyncWithHttpInfo (string username, User user) { // verify the required parameter 'username' is set if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->UpdateUser"); - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->UpdateUser"); + // verify the required parameter 'user' is set + if (user == null) + throw new ApiException(400, "Missing required parameter 'user' when calling UserApi->UpdateUser"); var localVarPath = "./user/{username}"; var localVarPathParams = new Dictionary(); @@ -1550,6 +1557,7 @@ public async System.Threading.Tasks.Task> UpdateUserAsyncWit // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { + "application/json" }; String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); @@ -1561,13 +1569,13 @@ public async System.Threading.Tasks.Task> UpdateUserAsyncWit localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); if (username != null) localVarPathParams.Add("username", this.Configuration.ApiClient.ParameterToString(username)); // path parameter - if (body != null && body.GetType() != typeof(byte[])) + if (user != null && user.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(user); // http body (model) parameter } else { - localVarPostBody = body; // byte array + localVarPostBody = user; // byte array } diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index 45cb4e1ec3d5..19d8c2206359 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -31,97 +31,25 @@ public partial class AdditionalPropertiesClass : IEquatable /// Initializes a new instance of the class. /// - /// mapString. - /// mapNumber. - /// mapInteger. - /// mapBoolean. - /// mapArrayInteger. - /// mapArrayAnytype. - /// mapMapString. - /// mapMapAnytype. - /// anytype1. - /// anytype2. - /// anytype3. - public AdditionalPropertiesClass(Dictionary mapString = default(Dictionary), Dictionary mapNumber = default(Dictionary), Dictionary mapInteger = default(Dictionary), Dictionary mapBoolean = default(Dictionary), Dictionary> mapArrayInteger = default(Dictionary>), Dictionary> mapArrayAnytype = default(Dictionary>), Dictionary> mapMapString = default(Dictionary>), Dictionary> mapMapAnytype = default(Dictionary>), Object anytype1 = default(Object), Object anytype2 = default(Object), Object anytype3 = default(Object)) + /// mapProperty. + /// mapOfMapProperty. + public AdditionalPropertiesClass(Dictionary mapProperty = default(Dictionary), Dictionary> mapOfMapProperty = default(Dictionary>)) { - this.MapString = mapString; - this.MapNumber = mapNumber; - this.MapInteger = mapInteger; - this.MapBoolean = mapBoolean; - this.MapArrayInteger = mapArrayInteger; - this.MapArrayAnytype = mapArrayAnytype; - this.MapMapString = mapMapString; - this.MapMapAnytype = mapMapAnytype; - this.Anytype1 = anytype1; - this.Anytype2 = anytype2; - this.Anytype3 = anytype3; + this.MapProperty = mapProperty; + this.MapOfMapProperty = mapOfMapProperty; } /// - /// Gets or Sets MapString + /// Gets or Sets MapProperty /// - [DataMember(Name="map_string", EmitDefaultValue=false)] - public Dictionary MapString { get; set; } + [DataMember(Name="map_property", EmitDefaultValue=false)] + public Dictionary MapProperty { get; set; } /// - /// Gets or Sets MapNumber + /// Gets or Sets MapOfMapProperty /// - [DataMember(Name="map_number", EmitDefaultValue=false)] - public Dictionary MapNumber { get; set; } - - /// - /// Gets or Sets MapInteger - /// - [DataMember(Name="map_integer", EmitDefaultValue=false)] - public Dictionary MapInteger { get; set; } - - /// - /// Gets or Sets MapBoolean - /// - [DataMember(Name="map_boolean", EmitDefaultValue=false)] - public Dictionary MapBoolean { get; set; } - - /// - /// Gets or Sets MapArrayInteger - /// - [DataMember(Name="map_array_integer", EmitDefaultValue=false)] - public Dictionary> MapArrayInteger { get; set; } - - /// - /// Gets or Sets MapArrayAnytype - /// - [DataMember(Name="map_array_anytype", EmitDefaultValue=false)] - public Dictionary> MapArrayAnytype { get; set; } - - /// - /// Gets or Sets MapMapString - /// - [DataMember(Name="map_map_string", EmitDefaultValue=false)] - public Dictionary> MapMapString { get; set; } - - /// - /// Gets or Sets MapMapAnytype - /// - [DataMember(Name="map_map_anytype", EmitDefaultValue=false)] - public Dictionary> MapMapAnytype { get; set; } - - /// - /// Gets or Sets Anytype1 - /// - [DataMember(Name="anytype_1", EmitDefaultValue=false)] - public Object Anytype1 { get; set; } - - /// - /// Gets or Sets Anytype2 - /// - [DataMember(Name="anytype_2", EmitDefaultValue=false)] - public Object Anytype2 { get; set; } - - /// - /// Gets or Sets Anytype3 - /// - [DataMember(Name="anytype_3", EmitDefaultValue=false)] - public Object Anytype3 { get; set; } + [DataMember(Name="map_of_map_property", EmitDefaultValue=false)] + public Dictionary> MapOfMapProperty { get; set; } /// /// Returns the string presentation of the object @@ -131,17 +59,8 @@ public override string ToString() { var sb = new StringBuilder(); sb.Append("class AdditionalPropertiesClass {\n"); - sb.Append(" MapString: ").Append(MapString).Append("\n"); - sb.Append(" MapNumber: ").Append(MapNumber).Append("\n"); - sb.Append(" MapInteger: ").Append(MapInteger).Append("\n"); - sb.Append(" MapBoolean: ").Append(MapBoolean).Append("\n"); - sb.Append(" MapArrayInteger: ").Append(MapArrayInteger).Append("\n"); - sb.Append(" MapArrayAnytype: ").Append(MapArrayAnytype).Append("\n"); - sb.Append(" MapMapString: ").Append(MapMapString).Append("\n"); - sb.Append(" MapMapAnytype: ").Append(MapMapAnytype).Append("\n"); - sb.Append(" Anytype1: ").Append(Anytype1).Append("\n"); - sb.Append(" Anytype2: ").Append(Anytype2).Append("\n"); - sb.Append(" Anytype3: ").Append(Anytype3).Append("\n"); + sb.Append(" MapProperty: ").Append(MapProperty).Append("\n"); + sb.Append(" MapOfMapProperty: ").Append(MapOfMapProperty).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -177,67 +96,16 @@ public bool Equals(AdditionalPropertiesClass input) return ( - this.MapString == input.MapString || - this.MapString != null && - input.MapString != null && - this.MapString.SequenceEqual(input.MapString) - ) && - ( - this.MapNumber == input.MapNumber || - this.MapNumber != null && - input.MapNumber != null && - this.MapNumber.SequenceEqual(input.MapNumber) - ) && - ( - this.MapInteger == input.MapInteger || - this.MapInteger != null && - input.MapInteger != null && - this.MapInteger.SequenceEqual(input.MapInteger) - ) && - ( - this.MapBoolean == input.MapBoolean || - this.MapBoolean != null && - input.MapBoolean != null && - this.MapBoolean.SequenceEqual(input.MapBoolean) - ) && - ( - this.MapArrayInteger == input.MapArrayInteger || - this.MapArrayInteger != null && - input.MapArrayInteger != null && - this.MapArrayInteger.SequenceEqual(input.MapArrayInteger) - ) && - ( - this.MapArrayAnytype == input.MapArrayAnytype || - this.MapArrayAnytype != null && - input.MapArrayAnytype != null && - this.MapArrayAnytype.SequenceEqual(input.MapArrayAnytype) - ) && - ( - this.MapMapString == input.MapMapString || - this.MapMapString != null && - input.MapMapString != null && - this.MapMapString.SequenceEqual(input.MapMapString) - ) && - ( - this.MapMapAnytype == input.MapMapAnytype || - this.MapMapAnytype != null && - input.MapMapAnytype != null && - this.MapMapAnytype.SequenceEqual(input.MapMapAnytype) - ) && - ( - this.Anytype1 == input.Anytype1 || - (this.Anytype1 != null && - this.Anytype1.Equals(input.Anytype1)) - ) && - ( - this.Anytype2 == input.Anytype2 || - (this.Anytype2 != null && - this.Anytype2.Equals(input.Anytype2)) + this.MapProperty == input.MapProperty || + this.MapProperty != null && + input.MapProperty != null && + this.MapProperty.SequenceEqual(input.MapProperty) ) && ( - this.Anytype3 == input.Anytype3 || - (this.Anytype3 != null && - this.Anytype3.Equals(input.Anytype3)) + this.MapOfMapProperty == input.MapOfMapProperty || + this.MapOfMapProperty != null && + input.MapOfMapProperty != null && + this.MapOfMapProperty.SequenceEqual(input.MapOfMapProperty) ); } @@ -250,28 +118,10 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this.MapString != null) - hashCode = hashCode * 59 + this.MapString.GetHashCode(); - if (this.MapNumber != null) - hashCode = hashCode * 59 + this.MapNumber.GetHashCode(); - if (this.MapInteger != null) - hashCode = hashCode * 59 + this.MapInteger.GetHashCode(); - if (this.MapBoolean != null) - hashCode = hashCode * 59 + this.MapBoolean.GetHashCode(); - if (this.MapArrayInteger != null) - hashCode = hashCode * 59 + this.MapArrayInteger.GetHashCode(); - if (this.MapArrayAnytype != null) - hashCode = hashCode * 59 + this.MapArrayAnytype.GetHashCode(); - if (this.MapMapString != null) - hashCode = hashCode * 59 + this.MapMapString.GetHashCode(); - if (this.MapMapAnytype != null) - hashCode = hashCode * 59 + this.MapMapAnytype.GetHashCode(); - if (this.Anytype1 != null) - hashCode = hashCode * 59 + this.Anytype1.GetHashCode(); - if (this.Anytype2 != null) - hashCode = hashCode * 59 + this.Anytype2.GetHashCode(); - if (this.Anytype3 != null) - hashCode = hashCode * 59 + this.Anytype3.GetHashCode(); + if (this.MapProperty != null) + hashCode = hashCode * 59 + this.MapProperty.GetHashCode(); + if (this.MapOfMapProperty != null) + hashCode = hashCode * 59 + this.MapOfMapProperty.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/EnumTest.cs index 8854d4e9610c..0e8fcd9908d4 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/EnumTest.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/EnumTest.cs @@ -140,9 +140,24 @@ public enum EnumNumberEnum /// /// Gets or Sets OuterEnum /// - [DataMember(Name="outerEnum", EmitDefaultValue=false)] + [DataMember(Name="outerEnum", EmitDefaultValue=true)] public OuterEnum? OuterEnum { get; set; } /// + /// Gets or Sets OuterEnumInteger + /// + [DataMember(Name="outerEnumInteger", EmitDefaultValue=false)] + public OuterEnumInteger? OuterEnumInteger { get; set; } + /// + /// Gets or Sets OuterEnumDefaultValue + /// + [DataMember(Name="outerEnumDefaultValue", EmitDefaultValue=false)] + public OuterEnumDefaultValue? OuterEnumDefaultValue { get; set; } + /// + /// Gets or Sets OuterEnumIntegerDefaultValue + /// + [DataMember(Name="outerEnumIntegerDefaultValue", EmitDefaultValue=false)] + public OuterEnumIntegerDefaultValue? OuterEnumIntegerDefaultValue { get; set; } + /// /// Initializes a new instance of the class. /// [JsonConstructorAttribute] @@ -155,7 +170,10 @@ protected EnumTest() { } /// enumInteger. /// enumNumber. /// outerEnum. - public EnumTest(EnumStringEnum? enumString = default(EnumStringEnum?), EnumStringRequiredEnum enumStringRequired = default(EnumStringRequiredEnum), EnumIntegerEnum? enumInteger = default(EnumIntegerEnum?), EnumNumberEnum? enumNumber = default(EnumNumberEnum?), OuterEnum outerEnum = default(OuterEnum)) + /// outerEnumInteger. + /// outerEnumDefaultValue. + /// outerEnumIntegerDefaultValue. + public EnumTest(EnumStringEnum? enumString = default(EnumStringEnum?), EnumStringRequiredEnum enumStringRequired = default(EnumStringRequiredEnum), EnumIntegerEnum? enumInteger = default(EnumIntegerEnum?), EnumNumberEnum? enumNumber = default(EnumNumberEnum?), OuterEnum outerEnum = default(OuterEnum), OuterEnumInteger outerEnumInteger = default(OuterEnumInteger), OuterEnumDefaultValue outerEnumDefaultValue = default(OuterEnumDefaultValue), OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue = default(OuterEnumIntegerDefaultValue)) { // to ensure "enumStringRequired" is required (not null) if (enumStringRequired == null) @@ -167,10 +185,14 @@ protected EnumTest() { } this.EnumStringRequired = enumStringRequired; } + this.OuterEnum = outerEnum; this.EnumString = enumString; this.EnumInteger = enumInteger; this.EnumNumber = enumNumber; this.OuterEnum = outerEnum; + this.OuterEnumInteger = outerEnumInteger; + this.OuterEnumDefaultValue = outerEnumDefaultValue; + this.OuterEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; } @@ -178,6 +200,9 @@ protected EnumTest() { } + + + /// /// Returns the string presentation of the object /// @@ -191,6 +216,9 @@ public override string ToString() sb.Append(" EnumInteger: ").Append(EnumInteger).Append("\n"); sb.Append(" EnumNumber: ").Append(EnumNumber).Append("\n"); sb.Append(" OuterEnum: ").Append(OuterEnum).Append("\n"); + sb.Append(" OuterEnumInteger: ").Append(OuterEnumInteger).Append("\n"); + sb.Append(" OuterEnumDefaultValue: ").Append(OuterEnumDefaultValue).Append("\n"); + sb.Append(" OuterEnumIntegerDefaultValue: ").Append(OuterEnumIntegerDefaultValue).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -249,6 +277,21 @@ public bool Equals(EnumTest input) this.OuterEnum == input.OuterEnum || (this.OuterEnum != null && this.OuterEnum.Equals(input.OuterEnum)) + ) && + ( + this.OuterEnumInteger == input.OuterEnumInteger || + (this.OuterEnumInteger != null && + this.OuterEnumInteger.Equals(input.OuterEnumInteger)) + ) && + ( + this.OuterEnumDefaultValue == input.OuterEnumDefaultValue || + (this.OuterEnumDefaultValue != null && + this.OuterEnumDefaultValue.Equals(input.OuterEnumDefaultValue)) + ) && + ( + this.OuterEnumIntegerDefaultValue == input.OuterEnumIntegerDefaultValue || + (this.OuterEnumIntegerDefaultValue != null && + this.OuterEnumIntegerDefaultValue.Equals(input.OuterEnumIntegerDefaultValue)) ); } @@ -271,6 +314,12 @@ public override int GetHashCode() hashCode = hashCode * 59 + this.EnumNumber.GetHashCode(); if (this.OuterEnum != null) hashCode = hashCode * 59 + this.OuterEnum.GetHashCode(); + if (this.OuterEnumInteger != null) + hashCode = hashCode * 59 + this.OuterEnumInteger.GetHashCode(); + if (this.OuterEnumDefaultValue != null) + hashCode = hashCode * 59 + this.OuterEnumDefaultValue.GetHashCode(); + if (this.OuterEnumIntegerDefaultValue != null) + hashCode = hashCode * 59 + this.OuterEnumIntegerDefaultValue.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/Foo.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/Foo.cs index ddb699c34f59..312590522484 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/Foo.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/Foo.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/FormatTest.cs index 9ac79674298e..e17b21ff5bfa 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/FormatTest.cs @@ -49,7 +49,9 @@ protected FormatTest() { } /// dateTime. /// uuid. /// password (required). - public FormatTest(int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), decimal? number = default(decimal?), float? _float = default(float?), double? _double = default(double?), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), Guid? uuid = default(Guid?), string password = default(string)) + /// A string that is a 10 digit number. Can have leading zeros.. + /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.. + public FormatTest(int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), decimal? number = default(decimal?), float? _float = default(float?), double? _double = default(double?), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), Guid? uuid = default(Guid?), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string)) { // to ensure "number" is required (not null) if (number == null) @@ -100,6 +102,8 @@ protected FormatTest() { } this.Binary = binary; this.DateTime = dateTime; this.Uuid = uuid; + this.PatternWithDigits = patternWithDigits; + this.PatternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; } /// @@ -181,6 +185,20 @@ protected FormatTest() { } [DataMember(Name="password", EmitDefaultValue=false)] public string Password { get; set; } + /// + /// A string that is a 10 digit number. Can have leading zeros. + /// + /// A string that is a 10 digit number. Can have leading zeros. + [DataMember(Name="pattern_with_digits", EmitDefaultValue=false)] + public string PatternWithDigits { get; set; } + + /// + /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + /// + /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + [DataMember(Name="pattern_with_digits_and_delimiter", EmitDefaultValue=false)] + public string PatternWithDigitsAndDelimiter { get; set; } + /// /// Returns the string presentation of the object /// @@ -202,6 +220,8 @@ public override string ToString() sb.Append(" DateTime: ").Append(DateTime).Append("\n"); sb.Append(" Uuid: ").Append(Uuid).Append("\n"); sb.Append(" Password: ").Append(Password).Append("\n"); + sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n"); + sb.Append(" PatternWithDigitsAndDelimiter: ").Append(PatternWithDigitsAndDelimiter).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -300,6 +320,16 @@ public bool Equals(FormatTest input) this.Password == input.Password || (this.Password != null && this.Password.Equals(input.Password)) + ) && + ( + this.PatternWithDigits == input.PatternWithDigits || + (this.PatternWithDigits != null && + this.PatternWithDigits.Equals(input.PatternWithDigits)) + ) && + ( + this.PatternWithDigitsAndDelimiter == input.PatternWithDigitsAndDelimiter || + (this.PatternWithDigitsAndDelimiter != null && + this.PatternWithDigitsAndDelimiter.Equals(input.PatternWithDigitsAndDelimiter)) ); } @@ -338,6 +368,10 @@ public override int GetHashCode() hashCode = hashCode * 59 + this.Uuid.GetHashCode(); if (this.Password != null) hashCode = hashCode * 59 + this.Password.GetHashCode(); + if (this.PatternWithDigits != null) + hashCode = hashCode * 59 + this.PatternWithDigits.GetHashCode(); + if (this.PatternWithDigitsAndDelimiter != null) + hashCode = hashCode * 59 + this.PatternWithDigitsAndDelimiter.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/HealthCheckResult.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/HealthCheckResult.cs new file mode 100644 index 000000000000..ab1b6405fdab --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/HealthCheckResult.cs @@ -0,0 +1,113 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + /// + [DataContract] + public partial class HealthCheckResult : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// nullableMessage. + public HealthCheckResult(string nullableMessage = default(string)) + { + this.NullableMessage = nullableMessage; + this.NullableMessage = nullableMessage; + } + + /// + /// Gets or Sets NullableMessage + /// + [DataMember(Name="NullableMessage", EmitDefaultValue=true)] + public string NullableMessage { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class HealthCheckResult {\n"); + sb.Append(" NullableMessage: ").Append(NullableMessage).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as HealthCheckResult); + } + + /// + /// Returns true if HealthCheckResult instances are equal + /// + /// Instance of HealthCheckResult to be compared + /// Boolean + public bool Equals(HealthCheckResult input) + { + if (input == null) + return false; + + return + ( + this.NullableMessage == input.NullableMessage || + (this.NullableMessage != null && + this.NullableMessage.Equals(input.NullableMessage)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.NullableMessage != null) + hashCode = hashCode * 59 + this.NullableMessage.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/InlineObject.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/InlineObject.cs index 10ced6b83255..c9b5274e83bc 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/InlineObject.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/InlineObject.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/InlineObject1.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/InlineObject1.cs index 65063f5bf482..586aea86ee63 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/InlineObject1.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/InlineObject1.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/InlineObject2.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/InlineObject2.cs index cc99ca7bf970..ec1a6e1bacf5 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/InlineObject2.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/InlineObject2.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -156,6 +156,7 @@ public bool Equals(InlineObject2 input) ( this.EnumFormStringArray == input.EnumFormStringArray || this.EnumFormStringArray != null && + input.EnumFormStringArray != null && this.EnumFormStringArray.SequenceEqual(input.EnumFormStringArray) ) && ( diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/InlineObject3.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/InlineObject3.cs index 504e0b0fe6a0..09301cbfbff6 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/InlineObject3.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/InlineObject3.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -61,6 +61,7 @@ protected InlineObject3() { } { this.Number = number; } + // to ensure "_double" is required (not null) if (_double == null) { @@ -70,6 +71,7 @@ protected InlineObject3() { } { this.Double = _double; } + // to ensure "patternWithoutDelimiter" is required (not null) if (patternWithoutDelimiter == null) { @@ -79,6 +81,7 @@ protected InlineObject3() { } { this.PatternWithoutDelimiter = patternWithoutDelimiter; } + // to ensure "_byte" is required (not null) if (_byte == null) { @@ -88,6 +91,7 @@ protected InlineObject3() { } { this.Byte = _byte; } + this.Integer = integer; this.Int32 = int32; this.Int64 = int64; diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/InlineObject4.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/InlineObject4.cs index 7ad988b55f88..2ba80a4bc200 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/InlineObject4.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/InlineObject4.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -49,6 +49,7 @@ protected InlineObject4() { } { this.Param = param; } + // to ensure "param2" is required (not null) if (param2 == null) { @@ -58,6 +59,7 @@ protected InlineObject4() { } { this.Param2 = param2; } + } /// diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/InlineObject5.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/InlineObject5.cs index e80e5b733afa..6dd9262653d0 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/InlineObject5.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/InlineObject5.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -49,6 +49,7 @@ protected InlineObject5() { } { this.RequiredFile = requiredFile; } + this.AdditionalMetadata = additionalMetadata; } diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/InlineResponseDefault.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/InlineResponseDefault.cs index 42a0feba4c47..56d89df27aad 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/InlineResponseDefault.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/InlineResponseDefault.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/NullableClass.cs new file mode 100644 index 000000000000..35e9bd2ccf68 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/NullableClass.cs @@ -0,0 +1,306 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// NullableClass + /// + [DataContract] + public partial class NullableClass : Dictionary, IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// integerProp. + /// numberProp. + /// booleanProp. + /// stringProp. + /// dateProp. + /// datetimeProp. + /// arrayNullableProp. + /// arrayAndItemsNullableProp. + /// arrayItemsNullable. + /// objectNullableProp. + /// objectAndItemsNullableProp. + /// objectItemsNullable. + public NullableClass(int? integerProp = default(int?), decimal? numberProp = default(decimal?), bool? booleanProp = default(bool?), string stringProp = default(string), DateTime? dateProp = default(DateTime?), DateTime? datetimeProp = default(DateTime?), List arrayNullableProp = default(List), List arrayAndItemsNullableProp = default(List), List arrayItemsNullable = default(List), Dictionary objectNullableProp = default(Dictionary), Dictionary objectAndItemsNullableProp = default(Dictionary), Dictionary objectItemsNullable = default(Dictionary)) : base() + { + this.IntegerProp = integerProp; + this.NumberProp = numberProp; + this.BooleanProp = booleanProp; + this.StringProp = stringProp; + this.DateProp = dateProp; + this.DatetimeProp = datetimeProp; + this.ArrayNullableProp = arrayNullableProp; + this.ArrayAndItemsNullableProp = arrayAndItemsNullableProp; + this.ObjectNullableProp = objectNullableProp; + this.ObjectAndItemsNullableProp = objectAndItemsNullableProp; + this.IntegerProp = integerProp; + this.NumberProp = numberProp; + this.BooleanProp = booleanProp; + this.StringProp = stringProp; + this.DateProp = dateProp; + this.DatetimeProp = datetimeProp; + this.ArrayNullableProp = arrayNullableProp; + this.ArrayAndItemsNullableProp = arrayAndItemsNullableProp; + this.ArrayItemsNullable = arrayItemsNullable; + this.ObjectNullableProp = objectNullableProp; + this.ObjectAndItemsNullableProp = objectAndItemsNullableProp; + this.ObjectItemsNullable = objectItemsNullable; + } + + /// + /// Gets or Sets IntegerProp + /// + [DataMember(Name="integer_prop", EmitDefaultValue=true)] + public int? IntegerProp { get; set; } + + /// + /// Gets or Sets NumberProp + /// + [DataMember(Name="number_prop", EmitDefaultValue=true)] + public decimal? NumberProp { get; set; } + + /// + /// Gets or Sets BooleanProp + /// + [DataMember(Name="boolean_prop", EmitDefaultValue=true)] + public bool? BooleanProp { get; set; } + + /// + /// Gets or Sets StringProp + /// + [DataMember(Name="string_prop", EmitDefaultValue=true)] + public string StringProp { get; set; } + + /// + /// Gets or Sets DateProp + /// + [DataMember(Name="date_prop", EmitDefaultValue=true)] + [JsonConverter(typeof(OpenAPIDateConverter))] + public DateTime? DateProp { get; set; } + + /// + /// Gets or Sets DatetimeProp + /// + [DataMember(Name="datetime_prop", EmitDefaultValue=true)] + public DateTime? DatetimeProp { get; set; } + + /// + /// Gets or Sets ArrayNullableProp + /// + [DataMember(Name="array_nullable_prop", EmitDefaultValue=true)] + public List ArrayNullableProp { get; set; } + + /// + /// Gets or Sets ArrayAndItemsNullableProp + /// + [DataMember(Name="array_and_items_nullable_prop", EmitDefaultValue=true)] + public List ArrayAndItemsNullableProp { get; set; } + + /// + /// Gets or Sets ArrayItemsNullable + /// + [DataMember(Name="array_items_nullable", EmitDefaultValue=false)] + public List ArrayItemsNullable { get; set; } + + /// + /// Gets or Sets ObjectNullableProp + /// + [DataMember(Name="object_nullable_prop", EmitDefaultValue=true)] + public Dictionary ObjectNullableProp { get; set; } + + /// + /// Gets or Sets ObjectAndItemsNullableProp + /// + [DataMember(Name="object_and_items_nullable_prop", EmitDefaultValue=true)] + public Dictionary ObjectAndItemsNullableProp { get; set; } + + /// + /// Gets or Sets ObjectItemsNullable + /// + [DataMember(Name="object_items_nullable", EmitDefaultValue=false)] + public Dictionary ObjectItemsNullable { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class NullableClass {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" IntegerProp: ").Append(IntegerProp).Append("\n"); + sb.Append(" NumberProp: ").Append(NumberProp).Append("\n"); + sb.Append(" BooleanProp: ").Append(BooleanProp).Append("\n"); + sb.Append(" StringProp: ").Append(StringProp).Append("\n"); + sb.Append(" DateProp: ").Append(DateProp).Append("\n"); + sb.Append(" DatetimeProp: ").Append(DatetimeProp).Append("\n"); + sb.Append(" ArrayNullableProp: ").Append(ArrayNullableProp).Append("\n"); + sb.Append(" ArrayAndItemsNullableProp: ").Append(ArrayAndItemsNullableProp).Append("\n"); + sb.Append(" ArrayItemsNullable: ").Append(ArrayItemsNullable).Append("\n"); + sb.Append(" ObjectNullableProp: ").Append(ObjectNullableProp).Append("\n"); + sb.Append(" ObjectAndItemsNullableProp: ").Append(ObjectAndItemsNullableProp).Append("\n"); + sb.Append(" ObjectItemsNullable: ").Append(ObjectItemsNullable).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as NullableClass); + } + + /// + /// Returns true if NullableClass instances are equal + /// + /// Instance of NullableClass to be compared + /// Boolean + public bool Equals(NullableClass input) + { + if (input == null) + return false; + + return base.Equals(input) && + ( + this.IntegerProp == input.IntegerProp || + (this.IntegerProp != null && + this.IntegerProp.Equals(input.IntegerProp)) + ) && base.Equals(input) && + ( + this.NumberProp == input.NumberProp || + (this.NumberProp != null && + this.NumberProp.Equals(input.NumberProp)) + ) && base.Equals(input) && + ( + this.BooleanProp == input.BooleanProp || + (this.BooleanProp != null && + this.BooleanProp.Equals(input.BooleanProp)) + ) && base.Equals(input) && + ( + this.StringProp == input.StringProp || + (this.StringProp != null && + this.StringProp.Equals(input.StringProp)) + ) && base.Equals(input) && + ( + this.DateProp == input.DateProp || + (this.DateProp != null && + this.DateProp.Equals(input.DateProp)) + ) && base.Equals(input) && + ( + this.DatetimeProp == input.DatetimeProp || + (this.DatetimeProp != null && + this.DatetimeProp.Equals(input.DatetimeProp)) + ) && base.Equals(input) && + ( + this.ArrayNullableProp == input.ArrayNullableProp || + this.ArrayNullableProp != null && + input.ArrayNullableProp != null && + this.ArrayNullableProp.SequenceEqual(input.ArrayNullableProp) + ) && base.Equals(input) && + ( + this.ArrayAndItemsNullableProp == input.ArrayAndItemsNullableProp || + this.ArrayAndItemsNullableProp != null && + input.ArrayAndItemsNullableProp != null && + this.ArrayAndItemsNullableProp.SequenceEqual(input.ArrayAndItemsNullableProp) + ) && base.Equals(input) && + ( + this.ArrayItemsNullable == input.ArrayItemsNullable || + this.ArrayItemsNullable != null && + input.ArrayItemsNullable != null && + this.ArrayItemsNullable.SequenceEqual(input.ArrayItemsNullable) + ) && base.Equals(input) && + ( + this.ObjectNullableProp == input.ObjectNullableProp || + this.ObjectNullableProp != null && + input.ObjectNullableProp != null && + this.ObjectNullableProp.SequenceEqual(input.ObjectNullableProp) + ) && base.Equals(input) && + ( + this.ObjectAndItemsNullableProp == input.ObjectAndItemsNullableProp || + this.ObjectAndItemsNullableProp != null && + input.ObjectAndItemsNullableProp != null && + this.ObjectAndItemsNullableProp.SequenceEqual(input.ObjectAndItemsNullableProp) + ) && base.Equals(input) && + ( + this.ObjectItemsNullable == input.ObjectItemsNullable || + this.ObjectItemsNullable != null && + input.ObjectItemsNullable != null && + this.ObjectItemsNullable.SequenceEqual(input.ObjectItemsNullable) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.IntegerProp != null) + hashCode = hashCode * 59 + this.IntegerProp.GetHashCode(); + if (this.NumberProp != null) + hashCode = hashCode * 59 + this.NumberProp.GetHashCode(); + if (this.BooleanProp != null) + hashCode = hashCode * 59 + this.BooleanProp.GetHashCode(); + if (this.StringProp != null) + hashCode = hashCode * 59 + this.StringProp.GetHashCode(); + if (this.DateProp != null) + hashCode = hashCode * 59 + this.DateProp.GetHashCode(); + if (this.DatetimeProp != null) + hashCode = hashCode * 59 + this.DatetimeProp.GetHashCode(); + if (this.ArrayNullableProp != null) + hashCode = hashCode * 59 + this.ArrayNullableProp.GetHashCode(); + if (this.ArrayAndItemsNullableProp != null) + hashCode = hashCode * 59 + this.ArrayAndItemsNullableProp.GetHashCode(); + if (this.ArrayItemsNullable != null) + hashCode = hashCode * 59 + this.ArrayItemsNullable.GetHashCode(); + if (this.ObjectNullableProp != null) + hashCode = hashCode * 59 + this.ObjectNullableProp.GetHashCode(); + if (this.ObjectAndItemsNullableProp != null) + hashCode = hashCode * 59 + this.ObjectAndItemsNullableProp.GetHashCode(); + if (this.ObjectItemsNullable != null) + hashCode = hashCode * 59 + this.ObjectItemsNullable.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs new file mode 100644 index 000000000000..36a3f4322acb --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs @@ -0,0 +1,53 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// Defines OuterEnumDefaultValue + /// + + [JsonConverter(typeof(StringEnumConverter))] + + public enum OuterEnumDefaultValue + { + /// + /// Enum Placed for value: placed + /// + [EnumMember(Value = "placed")] + Placed = 1, + + /// + /// Enum Approved for value: approved + /// + [EnumMember(Value = "approved")] + Approved = 2, + + /// + /// Enum Delivered for value: delivered + /// + [EnumMember(Value = "delivered")] + Delivered = 3 + + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/OuterEnumInteger.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/OuterEnumInteger.cs new file mode 100644 index 000000000000..7908216a230c --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/OuterEnumInteger.cs @@ -0,0 +1,53 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// Defines OuterEnumInteger + /// + + [JsonConverter(typeof(StringEnumConverter))] + + public enum OuterEnumInteger + { + /// + /// Enum NUMBER_0 for value: 0 + /// + [EnumMember(Value = "0")] + NUMBER_0 = 1, + + /// + /// Enum NUMBER_1 for value: 1 + /// + [EnumMember(Value = "1")] + NUMBER_1 = 2, + + /// + /// Enum NUMBER_2 for value: 2 + /// + [EnumMember(Value = "2")] + NUMBER_2 = 3 + + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs new file mode 100644 index 000000000000..0c75ede67b32 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs @@ -0,0 +1,53 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// Defines OuterEnumIntegerDefaultValue + /// + + [JsonConverter(typeof(StringEnumConverter))] + + public enum OuterEnumIntegerDefaultValue + { + /// + /// Enum NUMBER_0 for value: 0 + /// + [EnumMember(Value = "0")] + NUMBER_0 = 1, + + /// + /// Enum NUMBER_1 for value: 1 + /// + [EnumMember(Value = "1")] + NUMBER_1 = 2, + + /// + /// Enum NUMBER_2 for value: 2 + /// + [EnumMember(Value = "2")] + NUMBER_2 = 3 + + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/.openapi-generator/VERSION b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/.openapi-generator/VERSION index 06b5019af3f4..83a328a9227e 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.1-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/README.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/README.md index 6319d9193e9a..5efb63e7cc18 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/README.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/README.md @@ -64,7 +64,7 @@ Then, publish to a [local feed](https://docs.microsoft.com/en-us/nuget/hosting-p ## Getting Started ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -74,21 +74,24 @@ namespace Example { public class Example { - public void main() + public static void Main() { - var apiInstance = new AnotherFakeApi(); - var body = new ModelClient(); // ModelClient | client model + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new AnotherFakeApi(Configuration.Default); + var modelClient = new ModelClient(); // ModelClient | client model try { // To test special tags - ModelClient result = apiInstance.Call123TestSpecialTags(body); + ModelClient result = apiInstance.Call123TestSpecialTags(modelClient); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling AnotherFakeApi.Call123TestSpecialTags: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } @@ -103,7 +106,8 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *AnotherFakeApi* | [**Call123TestSpecialTags**](docs/AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags -*FakeApi* | [**CreateXmlItem**](docs/FakeApi.md#createxmlitem) | **POST** /fake/create_xml_item | creates an XmlItem +*DefaultApi* | [**FooGet**](docs/DefaultApi.md#fooget) | **GET** /foo | +*FakeApi* | [**FakeHealthGet**](docs/FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint *FakeApi* | [**FakeOuterBooleanSerialize**](docs/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | *FakeApi* | [**FakeOuterCompositeSerialize**](docs/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | *FakeApi* | [**FakeOuterNumberSerialize**](docs/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | @@ -142,14 +146,7 @@ Class | Method | HTTP request | Description ## Documentation for Models - - [Model.AdditionalPropertiesAnyType](docs/AdditionalPropertiesAnyType.md) - - [Model.AdditionalPropertiesArray](docs/AdditionalPropertiesArray.md) - - [Model.AdditionalPropertiesBoolean](docs/AdditionalPropertiesBoolean.md) - [Model.AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) - - [Model.AdditionalPropertiesInteger](docs/AdditionalPropertiesInteger.md) - - [Model.AdditionalPropertiesNumber](docs/AdditionalPropertiesNumber.md) - - [Model.AdditionalPropertiesObject](docs/AdditionalPropertiesObject.md) - - [Model.AdditionalPropertiesString](docs/AdditionalPropertiesString.md) - [Model.Animal](docs/Animal.md) - [Model.ApiResponse](docs/ApiResponse.md) - [Model.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) @@ -167,27 +164,37 @@ Class | Method | HTTP request | Description - [Model.EnumTest](docs/EnumTest.md) - [Model.File](docs/File.md) - [Model.FileSchemaTestClass](docs/FileSchemaTestClass.md) + - [Model.Foo](docs/Foo.md) - [Model.FormatTest](docs/FormatTest.md) - [Model.HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [Model.HealthCheckResult](docs/HealthCheckResult.md) + - [Model.InlineObject](docs/InlineObject.md) + - [Model.InlineObject1](docs/InlineObject1.md) + - [Model.InlineObject2](docs/InlineObject2.md) + - [Model.InlineObject3](docs/InlineObject3.md) + - [Model.InlineObject4](docs/InlineObject4.md) + - [Model.InlineObject5](docs/InlineObject5.md) + - [Model.InlineResponseDefault](docs/InlineResponseDefault.md) - [Model.List](docs/List.md) - [Model.MapTest](docs/MapTest.md) - [Model.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - [Model.Model200Response](docs/Model200Response.md) - [Model.ModelClient](docs/ModelClient.md) - [Model.Name](docs/Name.md) + - [Model.NullableClass](docs/NullableClass.md) - [Model.NumberOnly](docs/NumberOnly.md) - [Model.Order](docs/Order.md) - [Model.OuterComposite](docs/OuterComposite.md) - [Model.OuterEnum](docs/OuterEnum.md) + - [Model.OuterEnumDefaultValue](docs/OuterEnumDefaultValue.md) + - [Model.OuterEnumInteger](docs/OuterEnumInteger.md) + - [Model.OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md) - [Model.Pet](docs/Pet.md) - [Model.ReadOnlyFirst](docs/ReadOnlyFirst.md) - [Model.Return](docs/Return.md) - [Model.SpecialModelName](docs/SpecialModelName.md) - [Model.Tag](docs/Tag.md) - - [Model.TypeHolderDefault](docs/TypeHolderDefault.md) - - [Model.TypeHolderExample](docs/TypeHolderExample.md) - [Model.User](docs/User.md) - - [Model.XmlItem](docs/XmlItem.md) ## Documentation for Authorization @@ -209,6 +216,12 @@ Class | Method | HTTP request | Description - **Location**: URL query string +### bearer_test + + +- **Type**: HTTP basic authentication + + ### http_basic_test diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/AdditionalPropertiesClass.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/AdditionalPropertiesClass.md index 32d7ffc76537..847bf120968f 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/AdditionalPropertiesClass.md @@ -5,17 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**MapString** | **Dictionary<string, string>** | | [optional] -**MapNumber** | **Dictionary<string, decimal?>** | | [optional] -**MapInteger** | **Dictionary<string, int?>** | | [optional] -**MapBoolean** | **Dictionary<string, bool?>** | | [optional] -**MapArrayInteger** | **Dictionary<string, List<int?>>** | | [optional] -**MapArrayAnytype** | **Dictionary<string, List<Object>>** | | [optional] -**MapMapString** | **Dictionary<string, Dictionary<string, string>>** | | [optional] -**MapMapAnytype** | **Dictionary<string, Dictionary<string, Object>>** | | [optional] -**Anytype1** | [**Object**](.md) | | [optional] -**Anytype2** | [**Object**](.md) | | [optional] -**Anytype3** | [**Object**](.md) | | [optional] +**MapProperty** | **Dictionary<string, string>** | | [optional] +**MapOfMapProperty** | **Dictionary<string, Dictionary<string, string>>** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/AnotherFakeApi.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/AnotherFakeApi.md index d13566caf343..c7cb3d05138b 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/AnotherFakeApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/AnotherFakeApi.md @@ -10,7 +10,7 @@ Method | HTTP request | Description ## Call123TestSpecialTags -> ModelClient Call123TestSpecialTags (ModelClient body) +> ModelClient Call123TestSpecialTags (ModelClient modelClient) To test special tags @@ -19,7 +19,7 @@ To test special tags and operation ID starting with number ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -29,20 +29,23 @@ namespace Example { public class Call123TestSpecialTagsExample { - public void main() + public static void Main() { - var apiInstance = new AnotherFakeApi(); - var body = new ModelClient(); // ModelClient | client model + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new AnotherFakeApi(Configuration.Default); + var modelClient = new ModelClient(); // ModelClient | client model try { // To test special tags - ModelClient result = apiInstance.Call123TestSpecialTags(body); + ModelClient result = apiInstance.Call123TestSpecialTags(modelClient); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling AnotherFakeApi.Call123TestSpecialTags: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -54,7 +57,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**ModelClient**](ModelClient.md)| client model | + **modelClient** | [**ModelClient**](ModelClient.md)| client model | ### Return type @@ -69,6 +72,11 @@ No authorization required - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/DefaultApi.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/DefaultApi.md index 92f2dc125c04..7ee074eba27c 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/DefaultApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/DefaultApi.md @@ -7,15 +7,17 @@ Method | HTTP request | Description [**FooGet**](DefaultApi.md#fooget) | **GET** /foo | - -# **FooGet** + +## FooGet + > InlineResponseDefault FooGet () ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -25,18 +27,21 @@ namespace Example { public class FooGetExample { - public void main() + public static void Main() { - var apiInstance = new DefaultApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new DefaultApi(Configuration.Default); try { InlineResponseDefault result = apiInstance.FooGet(); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling DefaultApi.FooGet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -44,6 +49,7 @@ namespace Example ``` ### Parameters + This endpoint does not need any parameter. ### Return type @@ -56,8 +62,16 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | response | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/EnumTest.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/EnumTest.md index 8e213c3335f9..3e6bde560845 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/EnumTest.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/EnumTest.md @@ -10,6 +10,9 @@ Name | Type | Description | Notes **EnumInteger** | **int?** | | [optional] **EnumNumber** | **double?** | | [optional] **OuterEnum** | **OuterEnum** | | [optional] +**OuterEnumInteger** | **OuterEnumInteger** | | [optional] +**OuterEnumDefaultValue** | **OuterEnumDefaultValue** | | [optional] +**OuterEnumIntegerDefaultValue** | **OuterEnumIntegerDefaultValue** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/FakeApi.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/FakeApi.md index a2284ba8f3e7..eb0c8650dc49 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/FakeApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/FakeApi.md @@ -4,7 +4,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**CreateXmlItem**](FakeApi.md#createxmlitem) | **POST** /fake/create_xml_item | creates an XmlItem +[**FakeHealthGet**](FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint [**FakeOuterBooleanSerialize**](FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | [**FakeOuterCompositeSerialize**](FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | [**FakeOuterNumberSerialize**](FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | @@ -20,18 +20,16 @@ Method | HTTP request | Description -## CreateXmlItem +## FakeHealthGet -> void CreateXmlItem (XmlItem xmlItem) +> HealthCheckResult FakeHealthGet () -creates an XmlItem - -this route creates an XmlItem +Health check endpoint ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -39,21 +37,24 @@ using Org.OpenAPITools.Model; namespace Example { - public class CreateXmlItemExample + public class FakeHealthGetExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); - var xmlItem = new XmlItem(); // XmlItem | XmlItem Body + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); try { - // creates an XmlItem - apiInstance.CreateXmlItem(xmlItem); + // Health check endpoint + HealthCheckResult result = apiInstance.FakeHealthGet(); + Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { - Debug.Print("Exception when calling FakeApi.CreateXmlItem: " + e.Message ); + Debug.Print("Exception when calling FakeApi.FakeHealthGet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -62,14 +63,11 @@ namespace Example ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xmlItem** | [**XmlItem**](XmlItem.md)| XmlItem Body | +This endpoint does not need any parameter. ### Return type -void (empty response body) +[**HealthCheckResult**](HealthCheckResult.md) ### Authorization @@ -77,8 +75,13 @@ No authorization required ### HTTP request headers -- **Content-Type**: application/xml, application/xml; charset=utf-8, application/xml; charset=utf-16, text/xml, text/xml; charset=utf-8, text/xml; charset=utf-16 -- **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The instance started successfully | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) @@ -97,7 +100,7 @@ Test serialization of outer boolean types ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -107,9 +110,10 @@ namespace Example { public class FakeOuterBooleanSerializeExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var body = true; // bool? | Input boolean as post body (optional) try @@ -117,9 +121,11 @@ namespace Example bool? result = apiInstance.FakeOuterBooleanSerialize(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.FakeOuterBooleanSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -143,9 +149,14 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: */* +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output boolean | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -154,7 +165,7 @@ No authorization required ## FakeOuterCompositeSerialize -> OuterComposite FakeOuterCompositeSerialize (OuterComposite body = null) +> OuterComposite FakeOuterCompositeSerialize (OuterComposite outerComposite = null) @@ -163,7 +174,7 @@ Test serialization of object with outer number type ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -173,19 +184,22 @@ namespace Example { public class FakeOuterCompositeSerializeExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); - var body = new OuterComposite(); // OuterComposite | Input composite as post body (optional) + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); + var outerComposite = new OuterComposite(); // OuterComposite | Input composite as post body (optional) try { - OuterComposite result = apiInstance.FakeOuterCompositeSerialize(body); + OuterComposite result = apiInstance.FakeOuterCompositeSerialize(outerComposite); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.FakeOuterCompositeSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -197,7 +211,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + **outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] ### Return type @@ -209,9 +223,14 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: */* +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output composite | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -229,7 +248,7 @@ Test serialization of outer number types ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -239,9 +258,10 @@ namespace Example { public class FakeOuterNumberSerializeExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var body = 8.14; // decimal? | Input number as post body (optional) try @@ -249,9 +269,11 @@ namespace Example decimal? result = apiInstance.FakeOuterNumberSerialize(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.FakeOuterNumberSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -275,9 +297,14 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: */* +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output number | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -295,7 +322,7 @@ Test serialization of outer string types ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -305,9 +332,10 @@ namespace Example { public class FakeOuterStringSerializeExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var body = body_example; // string | Input string as post body (optional) try @@ -315,9 +343,11 @@ namespace Example string result = apiInstance.FakeOuterStringSerialize(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.FakeOuterStringSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -341,9 +371,14 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: */* +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output string | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -352,7 +387,7 @@ No authorization required ## TestBodyWithFileSchema -> void TestBodyWithFileSchema (FileSchemaTestClass body) +> void TestBodyWithFileSchema (FileSchemaTestClass fileSchemaTestClass) @@ -361,7 +396,7 @@ For this test, the body for this request much reference a schema named `File`. ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -371,18 +406,21 @@ namespace Example { public class TestBodyWithFileSchemaExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); - var body = new FileSchemaTestClass(); // FileSchemaTestClass | + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); + var fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass | try { - apiInstance.TestBodyWithFileSchema(body); + apiInstance.TestBodyWithFileSchema(fileSchemaTestClass); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestBodyWithFileSchema: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -394,7 +432,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | + **fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | ### Return type @@ -409,6 +447,11 @@ No authorization required - **Content-Type**: application/json - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -417,14 +460,14 @@ No authorization required ## TestBodyWithQueryParams -> void TestBodyWithQueryParams (string query, User body) +> void TestBodyWithQueryParams (string query, User user) ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -434,19 +477,22 @@ namespace Example { public class TestBodyWithQueryParamsExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var query = query_example; // string | - var body = new User(); // User | + var user = new User(); // User | try { - apiInstance.TestBodyWithQueryParams(query, body); + apiInstance.TestBodyWithQueryParams(query, user); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestBodyWithQueryParams: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -459,7 +505,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **query** | **string**| | - **body** | [**User**](User.md)| | + **user** | [**User**](User.md)| | ### Return type @@ -474,6 +520,11 @@ No authorization required - **Content-Type**: application/json - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -482,7 +533,7 @@ No authorization required ## TestClientModel -> ModelClient TestClientModel (ModelClient body) +> ModelClient TestClientModel (ModelClient modelClient) To test \"client\" model @@ -491,7 +542,7 @@ To test \"client\" model ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -501,20 +552,23 @@ namespace Example { public class TestClientModelExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); - var body = new ModelClient(); // ModelClient | client model + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); + var modelClient = new ModelClient(); // ModelClient | client model try { // To test \"client\" model - ModelClient result = apiInstance.TestClientModel(body); + ModelClient result = apiInstance.TestClientModel(modelClient); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestClientModel: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -526,7 +580,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**ModelClient**](ModelClient.md)| client model | + **modelClient** | [**ModelClient**](ModelClient.md)| client model | ### Return type @@ -541,6 +595,11 @@ No authorization required - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -558,7 +617,7 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -568,13 +627,14 @@ namespace Example { public class TestEndpointParametersExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure HTTP basic authorization: http_basic_test Configuration.Default.Username = "YOUR_USERNAME"; Configuration.Default.Password = "YOUR_PASSWORD"; - var apiInstance = new FakeApi(); + var apiInstance = new FakeApi(Configuration.Default); var number = 8.14; // decimal? | None var _double = 1.2D; // double? | None var patternWithoutDelimiter = patternWithoutDelimiter_example; // string | None @@ -595,9 +655,11 @@ namespace Example // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 apiInstance.TestEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestEndpointParameters: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -637,6 +699,12 @@ void (empty response body) - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -654,7 +722,7 @@ To test enum parameters ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -664,9 +732,10 @@ namespace Example { public class TestEnumParametersExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var enumHeaderStringArray = enumHeaderStringArray_example; // List | Header parameter enum test (string array) (optional) var enumHeaderString = enumHeaderString_example; // string | Header parameter enum test (string) (optional) (default to -efg) var enumQueryStringArray = enumQueryStringArray_example; // List | Query parameter enum test (string array) (optional) @@ -681,9 +750,11 @@ namespace Example // To test enum parameters apiInstance.TestEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestEnumParameters: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -717,6 +788,12 @@ No authorization required - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid request | - | +| **404** | Not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -734,7 +811,7 @@ Fake endpoint to test group parameters (optional) ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -744,9 +821,14 @@ namespace Example { public class TestGroupParametersExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure HTTP basic authorization: bearer_test + Configuration.Default.Username = "YOUR_USERNAME"; + Configuration.Default.Password = "YOUR_PASSWORD"; + + var apiInstance = new FakeApi(Configuration.Default); var requiredStringGroup = 56; // int? | Required String in group parameters var requiredBooleanGroup = true; // bool? | Required Boolean in group parameters var requiredInt64Group = 789; // long? | Required Integer in group parameters @@ -759,9 +841,11 @@ namespace Example // Fake endpoint to test group parameters (optional) apiInstance.TestGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestGroupParameters: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -786,13 +870,18 @@ void (empty response body) ### Authorization -No authorization required +[bearer_test](../README.md#bearer_test) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Someting wrong | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -801,14 +890,14 @@ No authorization required ## TestInlineAdditionalProperties -> void TestInlineAdditionalProperties (Dictionary param) +> void TestInlineAdditionalProperties (Dictionary requestBody) test inline additionalProperties ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -818,19 +907,22 @@ namespace Example { public class TestInlineAdditionalPropertiesExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); - var param = new Dictionary(); // Dictionary | request body + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); + var requestBody = new Dictionary(); // Dictionary | request body try { // test inline additionalProperties - apiInstance.TestInlineAdditionalProperties(param); + apiInstance.TestInlineAdditionalProperties(requestBody); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestInlineAdditionalProperties: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -842,7 +934,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **param** | [**Dictionary<string, string>**](string.md)| request body | + **requestBody** | [**Dictionary<string, string>**](string.md)| request body | ### Return type @@ -857,6 +949,11 @@ No authorization required - **Content-Type**: application/json - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -872,7 +969,7 @@ test json serialization of form data ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -882,9 +979,10 @@ namespace Example { public class TestJsonFormDataExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var param = param_example; // string | field1 var param2 = param2_example; // string | field2 @@ -893,9 +991,11 @@ namespace Example // test json serialization of form data apiInstance.TestJsonFormData(param, param2); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestJsonFormData: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -923,6 +1023,11 @@ No authorization required - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/FakeClassnameTags123Api.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/FakeClassnameTags123Api.md index cc0cd83d12ca..93eb8b274552 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/FakeClassnameTags123Api.md @@ -10,7 +10,7 @@ Method | HTTP request | Description ## TestClassname -> ModelClient TestClassname (ModelClient body) +> ModelClient TestClassname (ModelClient modelClient) To test class name in snake case @@ -19,7 +19,7 @@ To test class name in snake case ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -29,25 +29,28 @@ namespace Example { public class TestClassnameExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure API key authorization: api_key_query Configuration.Default.AddApiKey("api_key_query", "YOUR_API_KEY"); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Configuration.Default.AddApiKeyPrefix("api_key_query", "Bearer"); - var apiInstance = new FakeClassnameTags123Api(); - var body = new ModelClient(); // ModelClient | client model + var apiInstance = new FakeClassnameTags123Api(Configuration.Default); + var modelClient = new ModelClient(); // ModelClient | client model try { // To test class name in snake case - ModelClient result = apiInstance.TestClassname(body); + ModelClient result = apiInstance.TestClassname(modelClient); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeClassnameTags123Api.TestClassname: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -59,7 +62,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**ModelClient**](ModelClient.md)| client model | + **modelClient** | [**ModelClient**](ModelClient.md)| client model | ### Return type @@ -74,6 +77,11 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/Foo.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/Foo.md index fd84dc2038c9..ea6f4245da6e 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/Foo.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/Foo.md @@ -1,9 +1,13 @@ + # Org.OpenAPITools.Model.Foo + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Bar** | **string** | | [optional] [default to "bar"] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/FormatTest.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/FormatTest.md index 519e940a7c86..a1bdd78699de 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/FormatTest.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/FormatTest.md @@ -18,6 +18,8 @@ Name | Type | Description | Notes **DateTime** | **DateTime?** | | [optional] **Uuid** | **Guid?** | | [optional] **Password** | **string** | | +**PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [optional] +**PatternWithDigitsAndDelimiter** | **string** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/HealthCheckResult.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/HealthCheckResult.md index c8f299aaa258..08e5992d20cb 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/HealthCheckResult.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/HealthCheckResult.md @@ -1,9 +1,13 @@ + # Org.OpenAPITools.Model.HealthCheckResult + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **NullableMessage** | **string** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/InlineObject.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/InlineObject.md index 40e16da1bb7d..12ec90a8c699 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/InlineObject.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/InlineObject.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.InlineObject + ## Properties Name | Type | Description | Notes @@ -6,5 +8,7 @@ Name | Type | Description | Notes **Name** | **string** | Updated name of the pet | [optional] **Status** | **string** | Updated status of the pet | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/InlineObject1.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/InlineObject1.md index 2e6d226754e4..581fe20b1e21 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/InlineObject1.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/InlineObject1.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.InlineObject1 + ## Properties Name | Type | Description | Notes @@ -6,5 +8,7 @@ Name | Type | Description | Notes **AdditionalMetadata** | **string** | Additional data to pass to server | [optional] **File** | **System.IO.Stream** | file to upload | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/InlineObject2.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/InlineObject2.md index c02c78f9b2d0..79abb7a467c4 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/InlineObject2.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/InlineObject2.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.InlineObject2 + ## Properties Name | Type | Description | Notes @@ -6,5 +8,7 @@ Name | Type | Description | Notes **EnumFormStringArray** | **List<string>** | Form parameter enum test (string array) | [optional] **EnumFormString** | **string** | Form parameter enum test (string) | [optional] [default to EnumFormStringEnum.Efg] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/InlineObject3.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/InlineObject3.md index 192926bbe927..eb70006e29bd 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/InlineObject3.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/InlineObject3.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.InlineObject3 + ## Properties Name | Type | Description | Notes @@ -18,5 +20,7 @@ Name | Type | Description | Notes **Password** | **string** | None | [optional] **Callback** | **string** | None | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/InlineObject4.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/InlineObject4.md index c8e00663ee88..18e4a1f3ce50 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/InlineObject4.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/InlineObject4.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.InlineObject4 + ## Properties Name | Type | Description | Notes @@ -6,5 +8,7 @@ Name | Type | Description | Notes **Param** | **string** | field1 | **Param2** | **string** | field2 | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/InlineObject5.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/InlineObject5.md index a28ff47f2ec0..291c88623eea 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/InlineObject5.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/InlineObject5.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.InlineObject5 + ## Properties Name | Type | Description | Notes @@ -6,5 +8,7 @@ Name | Type | Description | Notes **AdditionalMetadata** | **string** | Additional data to pass to server | [optional] **RequiredFile** | **System.IO.Stream** | file to upload | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/InlineResponseDefault.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/InlineResponseDefault.md index 8c96fb62ac88..ecfb254001a2 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/InlineResponseDefault.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/InlineResponseDefault.md @@ -1,9 +1,13 @@ + # Org.OpenAPITools.Model.InlineResponseDefault + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **String** | [**Foo**](Foo.md) | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/NullableClass.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/NullableClass.md index 0ca2455a4ab2..84dd092d8a38 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/NullableClass.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/NullableClass.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.NullableClass + ## Properties Name | Type | Description | Notes @@ -16,5 +18,7 @@ Name | Type | Description | Notes **ObjectAndItemsNullableProp** | **Dictionary<string, Object>** | | [optional] **ObjectItemsNullable** | **Dictionary<string, Object>** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/OuterEnumDefaultValue.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/OuterEnumDefaultValue.md index 09f6b91ee623..41474099f2ee 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/OuterEnumDefaultValue.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/OuterEnumDefaultValue.md @@ -1,8 +1,12 @@ + # Org.OpenAPITools.Model.OuterEnumDefaultValue + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/OuterEnumInteger.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/OuterEnumInteger.md index 149bb5a8dd16..b82abc3adac4 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/OuterEnumInteger.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/OuterEnumInteger.md @@ -1,8 +1,12 @@ + # Org.OpenAPITools.Model.OuterEnumInteger + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/OuterEnumIntegerDefaultValue.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/OuterEnumIntegerDefaultValue.md index 29de71509745..46939d01522e 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/OuterEnumIntegerDefaultValue.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/OuterEnumIntegerDefaultValue.md @@ -1,8 +1,12 @@ + # Org.OpenAPITools.Model.OuterEnumIntegerDefaultValue + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/PetApi.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/PetApi.md index d2e2075bfd7b..a1e139d83e48 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/PetApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/PetApi.md @@ -18,14 +18,14 @@ Method | HTTP request | Description ## AddPet -> void AddPet (Pet body) +> void AddPet (Pet pet) Add a new pet to the store ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -35,22 +35,25 @@ namespace Example { public class AddPetExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); - var body = new Pet(); // Pet | Pet object that needs to be added to the store + var apiInstance = new PetApi(Configuration.Default); + var pet = new Pet(); // Pet | Pet object that needs to be added to the store try { // Add a new pet to the store - apiInstance.AddPet(body); + apiInstance.AddPet(pet); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.AddPet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -62,7 +65,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -77,6 +80,11 @@ void (empty response body) - **Content-Type**: application/json, application/xml - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **405** | Invalid input | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -92,7 +100,7 @@ Deletes a pet ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -102,12 +110,13 @@ namespace Example { public class DeletePetExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var petId = 789; // long? | Pet id to delete var apiKey = apiKey_example; // string | (optional) @@ -116,9 +125,11 @@ namespace Example // Deletes a pet apiInstance.DeletePet(petId, apiKey); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.DeletePet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -146,6 +157,11 @@ void (empty response body) - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid pet value | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -154,7 +170,7 @@ void (empty response body) ## FindPetsByStatus -> List FindPetsByStatus (List status) +> List<Pet> FindPetsByStatus (List status) Finds Pets by status @@ -163,7 +179,7 @@ Multiple status values can be provided with comma separated strings ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -173,23 +189,26 @@ namespace Example { public class FindPetsByStatusExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var status = status_example; // List | Status values that need to be considered for filter try { // Finds Pets by status - List<Pet> result = apiInstance.FindPetsByStatus(status); + List result = apiInstance.FindPetsByStatus(status); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.FindPetsByStatus: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -205,7 +224,7 @@ Name | Type | Description | Notes ### Return type -[**List**](Pet.md) +[**List<Pet>**](Pet.md) ### Authorization @@ -216,6 +235,12 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid status value | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -224,7 +249,7 @@ Name | Type | Description | Notes ## FindPetsByTags -> List FindPetsByTags (List tags) +> List<Pet> FindPetsByTags (List tags) Finds Pets by tags @@ -233,7 +258,7 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -243,23 +268,26 @@ namespace Example { public class FindPetsByTagsExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var tags = new List(); // List | Tags to filter by try { // Finds Pets by tags - List<Pet> result = apiInstance.FindPetsByTags(tags); + List result = apiInstance.FindPetsByTags(tags); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.FindPetsByTags: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -275,7 +303,7 @@ Name | Type | Description | Notes ### Return type -[**List**](Pet.md) +[**List<Pet>**](Pet.md) ### Authorization @@ -286,6 +314,12 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid tag value | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -303,7 +337,7 @@ Returns a single pet ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -313,14 +347,15 @@ namespace Example { public class GetPetByIdExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure API key authorization: api_key Configuration.Default.AddApiKey("api_key", "YOUR_API_KEY"); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Configuration.Default.AddApiKeyPrefix("api_key", "Bearer"); - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var petId = 789; // long? | ID of pet to return try @@ -329,9 +364,11 @@ namespace Example Pet result = apiInstance.GetPetById(petId); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.GetPetById: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -358,6 +395,13 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -366,14 +410,14 @@ Name | Type | Description | Notes ## UpdatePet -> void UpdatePet (Pet body) +> void UpdatePet (Pet pet) Update an existing pet ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -383,22 +427,25 @@ namespace Example { public class UpdatePetExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); - var body = new Pet(); // Pet | Pet object that needs to be added to the store + var apiInstance = new PetApi(Configuration.Default); + var pet = new Pet(); // Pet | Pet object that needs to be added to the store try { // Update an existing pet - apiInstance.UpdatePet(body); + apiInstance.UpdatePet(pet); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.UpdatePet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -410,7 +457,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -425,6 +472,13 @@ void (empty response body) - **Content-Type**: application/json, application/xml - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | +| **405** | Validation exception | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -440,7 +494,7 @@ Updates a pet in the store with form data ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -450,12 +504,13 @@ namespace Example { public class UpdatePetWithFormExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var petId = 789; // long? | ID of pet that needs to be updated var name = name_example; // string | Updated name of the pet (optional) var status = status_example; // string | Updated status of the pet (optional) @@ -465,9 +520,11 @@ namespace Example // Updates a pet in the store with form data apiInstance.UpdatePetWithForm(petId, name, status); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.UpdatePetWithForm: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -496,6 +553,11 @@ void (empty response body) - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **405** | Invalid input | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -511,7 +573,7 @@ uploads an image ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -521,12 +583,13 @@ namespace Example { public class UploadFileExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var petId = 789; // long? | ID of pet to update var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional) var file = BINARY_DATA_HERE; // System.IO.Stream | file to upload (optional) @@ -537,9 +600,11 @@ namespace Example ApiResponse result = apiInstance.UploadFile(petId, additionalMetadata, file); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.UploadFile: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -568,6 +633,11 @@ Name | Type | Description | Notes - **Content-Type**: multipart/form-data - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -583,7 +653,7 @@ uploads an image (required) ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -593,12 +663,13 @@ namespace Example { public class UploadFileWithRequiredFileExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var petId = 789; // long? | ID of pet to update var requiredFile = BINARY_DATA_HERE; // System.IO.Stream | file to upload var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional) @@ -609,9 +680,11 @@ namespace Example ApiResponse result = apiInstance.UploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.UploadFileWithRequiredFile: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -640,6 +713,11 @@ Name | Type | Description | Notes - **Content-Type**: multipart/form-data - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/StoreApi.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/StoreApi.md index 0f6d9e4e3dc2..cb61a7c619ec 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/StoreApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/StoreApi.md @@ -22,7 +22,7 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -32,9 +32,10 @@ namespace Example { public class DeleteOrderExample { - public void main() + public static void Main() { - var apiInstance = new StoreApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(Configuration.Default); var orderId = orderId_example; // string | ID of the order that needs to be deleted try @@ -42,9 +43,11 @@ namespace Example // Delete purchase order by ID apiInstance.DeleteOrder(orderId); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling StoreApi.DeleteOrder: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -71,6 +74,12 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -79,7 +88,7 @@ No authorization required ## GetInventory -> Dictionary GetInventory () +> Dictionary<string, int?> GetInventory () Returns pet inventories by status @@ -88,7 +97,7 @@ Returns a map of status codes to quantities ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -98,24 +107,27 @@ namespace Example { public class GetInventoryExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure API key authorization: api_key Configuration.Default.AddApiKey("api_key", "YOUR_API_KEY"); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Configuration.Default.AddApiKeyPrefix("api_key", "Bearer"); - var apiInstance = new StoreApi(); + var apiInstance = new StoreApi(Configuration.Default); try { // Returns pet inventories by status - Dictionary<string, int?> result = apiInstance.GetInventory(); + Dictionary result = apiInstance.GetInventory(); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling StoreApi.GetInventory: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -139,6 +151,11 @@ This endpoint does not need any parameter. - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -156,7 +173,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -166,9 +183,10 @@ namespace Example { public class GetOrderByIdExample { - public void main() + public static void Main() { - var apiInstance = new StoreApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(Configuration.Default); var orderId = 789; // long? | ID of pet that needs to be fetched try @@ -177,9 +195,11 @@ namespace Example Order result = apiInstance.GetOrderById(orderId); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling StoreApi.GetOrderById: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -206,6 +226,13 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -214,14 +241,14 @@ No authorization required ## PlaceOrder -> Order PlaceOrder (Order body) +> Order PlaceOrder (Order order) Place an order for a pet ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -231,20 +258,23 @@ namespace Example { public class PlaceOrderExample { - public void main() + public static void Main() { - var apiInstance = new StoreApi(); - var body = new Order(); // Order | order placed for purchasing the pet + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(Configuration.Default); + var order = new Order(); // Order | order placed for purchasing the pet try { // Place an order for a pet - Order result = apiInstance.PlaceOrder(body); + Order result = apiInstance.PlaceOrder(order); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling StoreApi.PlaceOrder: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -256,7 +286,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | + **order** | [**Order**](Order.md)| order placed for purchasing the pet | ### Return type @@ -268,9 +298,15 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: application/xml, application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid Order | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/UserApi.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/UserApi.md index b9f592bdd710..7c37179a9102 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/UserApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/UserApi.md @@ -17,7 +17,7 @@ Method | HTTP request | Description ## CreateUser -> void CreateUser (User body) +> void CreateUser (User user) Create user @@ -26,7 +26,7 @@ This can only be done by the logged in user. ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -36,19 +36,22 @@ namespace Example { public class CreateUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); - var body = new User(); // User | Created user object + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); + var user = new User(); // User | Created user object try { // Create user - apiInstance.CreateUser(body); + apiInstance.CreateUser(user); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.CreateUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -60,7 +63,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | + **user** | [**User**](User.md)| Created user object | ### Return type @@ -72,9 +75,14 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -83,14 +91,14 @@ No authorization required ## CreateUsersWithArrayInput -> void CreateUsersWithArrayInput (List body) +> void CreateUsersWithArrayInput (List user) Creates list of users with given input array ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -100,19 +108,22 @@ namespace Example { public class CreateUsersWithArrayInputExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); - var body = new List(); // List | List of user object + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); + var user = new List(); // List | List of user object try { // Creates list of users with given input array - apiInstance.CreateUsersWithArrayInput(body); + apiInstance.CreateUsersWithArrayInput(user); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.CreateUsersWithArrayInput: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -124,7 +135,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **user** | [**List<User>**](User.md)| List of user object | ### Return type @@ -136,9 +147,14 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -147,14 +163,14 @@ No authorization required ## CreateUsersWithListInput -> void CreateUsersWithListInput (List body) +> void CreateUsersWithListInput (List user) Creates list of users with given input array ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -164,19 +180,22 @@ namespace Example { public class CreateUsersWithListInputExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); - var body = new List(); // List | List of user object + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); + var user = new List(); // List | List of user object try { // Creates list of users with given input array - apiInstance.CreateUsersWithListInput(body); + apiInstance.CreateUsersWithListInput(user); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.CreateUsersWithListInput: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -188,7 +207,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **user** | [**List<User>**](User.md)| List of user object | ### Return type @@ -200,9 +219,14 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -220,7 +244,7 @@ This can only be done by the logged in user. ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -230,9 +254,10 @@ namespace Example { public class DeleteUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var username = username_example; // string | The name that needs to be deleted try @@ -240,9 +265,11 @@ namespace Example // Delete user apiInstance.DeleteUser(username); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.DeleteUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -269,6 +296,12 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -284,7 +317,7 @@ Get user by user name ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -294,9 +327,10 @@ namespace Example { public class GetUserByNameExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var username = username_example; // string | The name that needs to be fetched. Use user1 for testing. try @@ -305,9 +339,11 @@ namespace Example User result = apiInstance.GetUserByName(username); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.GetUserByName: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -334,6 +370,13 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -349,7 +392,7 @@ Logs user into the system ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -359,9 +402,10 @@ namespace Example { public class LoginUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var username = username_example; // string | The user name for login var password = password_example; // string | The password for login in clear text @@ -371,9 +415,11 @@ namespace Example string result = apiInstance.LoginUser(username, password); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.LoginUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -401,6 +447,12 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
| +| **400** | Invalid username/password supplied | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -416,7 +468,7 @@ Logs out current logged in user session ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -426,18 +478,21 @@ namespace Example { public class LogoutUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); try { // Logs out current logged in user session apiInstance.LogoutUser(); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.LogoutUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -461,6 +516,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -469,7 +529,7 @@ No authorization required ## UpdateUser -> void UpdateUser (string username, User body) +> void UpdateUser (string username, User user) Updated user @@ -478,7 +538,7 @@ This can only be done by the logged in user. ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -488,20 +548,23 @@ namespace Example { public class UpdateUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var username = username_example; // string | name that need to be deleted - var body = new User(); // User | Updated user object + var user = new User(); // User | Updated user object try { // Updated user - apiInstance.UpdateUser(username, body); + apiInstance.UpdateUser(username, user); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.UpdateUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -514,7 +577,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **string**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | + **user** | [**User**](User.md)| Updated user object | ### Return type @@ -526,9 +589,15 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid user supplied | - | +| **404** | User not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index 91ad0c3c299e..5e6c79c2d42d 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -31,9 +31,9 @@ public interface IAnotherFakeApi : IApiAccessor /// To test special tags and operation ID starting with number /// /// Thrown when fails to make API call - /// client model + /// client model /// ModelClient - ModelClient Call123TestSpecialTags (ModelClient body); + ModelClient Call123TestSpecialTags (ModelClient modelClient); /// /// To test special tags @@ -42,9 +42,9 @@ public interface IAnotherFakeApi : IApiAccessor /// To test special tags and operation ID starting with number /// /// Thrown when fails to make API call - /// client model + /// client model /// ApiResponse of ModelClient - ApiResponse Call123TestSpecialTagsWithHttpInfo (ModelClient body); + ApiResponse Call123TestSpecialTagsWithHttpInfo (ModelClient modelClient); #endregion Synchronous Operations #region Asynchronous Operations /// @@ -54,9 +54,9 @@ public interface IAnotherFakeApi : IApiAccessor /// To test special tags and operation ID starting with number /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ModelClient - System.Threading.Tasks.Task Call123TestSpecialTagsAsync (ModelClient body); + System.Threading.Tasks.Task Call123TestSpecialTagsAsync (ModelClient modelClient); /// /// To test special tags @@ -65,9 +65,9 @@ public interface IAnotherFakeApi : IApiAccessor /// To test special tags and operation ID starting with number /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ApiResponse (ModelClient) - System.Threading.Tasks.Task> Call123TestSpecialTagsAsyncWithHttpInfo (ModelClient body); + System.Threading.Tasks.Task> Call123TestSpecialTagsAsyncWithHttpInfo (ModelClient modelClient); #endregion Asynchronous Operations } @@ -183,11 +183,11 @@ public void AddDefaultHeader(string key, string value) /// To test special tags To test special tags and operation ID starting with number /// /// Thrown when fails to make API call - /// client model + /// client model /// ModelClient - public ModelClient Call123TestSpecialTags (ModelClient body) + public ModelClient Call123TestSpecialTags (ModelClient modelClient) { - ApiResponse localVarResponse = Call123TestSpecialTagsWithHttpInfo(body); + ApiResponse localVarResponse = Call123TestSpecialTagsWithHttpInfo(modelClient); return localVarResponse.Data; } @@ -195,13 +195,13 @@ public ModelClient Call123TestSpecialTags (ModelClient body) /// To test special tags To test special tags and operation ID starting with number /// /// Thrown when fails to make API call - /// client model + /// client model /// ApiResponse of ModelClient - public ApiResponse< ModelClient > Call123TestSpecialTagsWithHttpInfo (ModelClient body) + public ApiResponse< ModelClient > Call123TestSpecialTagsWithHttpInfo (ModelClient modelClient) { - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling AnotherFakeApi->Call123TestSpecialTags"); + // verify the required parameter 'modelClient' is set + if (modelClient == null) + throw new ApiException(400, "Missing required parameter 'modelClient' when calling AnotherFakeApi->Call123TestSpecialTags"); var localVarPath = "/another-fake/dummy"; var localVarPathParams = new Dictionary(); @@ -225,13 +225,13 @@ public ApiResponse< ModelClient > Call123TestSpecialTagsWithHttpInfo (ModelClien if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (body != null && body.GetType() != typeof(byte[])) + if (modelClient != null && modelClient.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(modelClient); // http body (model) parameter } else { - localVarPostBody = body; // byte array + localVarPostBody = modelClient; // byte array } @@ -257,11 +257,11 @@ public ApiResponse< ModelClient > Call123TestSpecialTagsWithHttpInfo (ModelClien /// To test special tags To test special tags and operation ID starting with number /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ModelClient - public async System.Threading.Tasks.Task Call123TestSpecialTagsAsync (ModelClient body) + public async System.Threading.Tasks.Task Call123TestSpecialTagsAsync (ModelClient modelClient) { - ApiResponse localVarResponse = await Call123TestSpecialTagsAsyncWithHttpInfo(body); + ApiResponse localVarResponse = await Call123TestSpecialTagsAsyncWithHttpInfo(modelClient); return localVarResponse.Data; } @@ -270,13 +270,13 @@ public async System.Threading.Tasks.Task Call123TestSpecialTagsAsyn /// To test special tags To test special tags and operation ID starting with number /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ApiResponse (ModelClient) - public async System.Threading.Tasks.Task> Call123TestSpecialTagsAsyncWithHttpInfo (ModelClient body) + public async System.Threading.Tasks.Task> Call123TestSpecialTagsAsyncWithHttpInfo (ModelClient modelClient) { - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling AnotherFakeApi->Call123TestSpecialTags"); + // verify the required parameter 'modelClient' is set + if (modelClient == null) + throw new ApiException(400, "Missing required parameter 'modelClient' when calling AnotherFakeApi->Call123TestSpecialTags"); var localVarPath = "/another-fake/dummy"; var localVarPathParams = new Dictionary(); @@ -300,13 +300,13 @@ public async System.Threading.Tasks.Task> Call123TestSp if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (body != null && body.GetType() != typeof(byte[])) + if (modelClient != null && modelClient.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(modelClient); // http body (model) parameter } else { - localVarPostBody = body; // byte array + localVarPostBody = modelClient; // byte array } diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/DefaultApi.cs index 20e11dbf458e..5a7c8a418253 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/FakeApi.cs index e9fbcf1cca89..12804736a06a 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/FakeApi.cs @@ -25,26 +25,24 @@ public interface IFakeApi : IApiAccessor { #region Synchronous Operations /// - /// creates an XmlItem + /// Health check endpoint /// /// - /// this route creates an XmlItem + /// /// /// Thrown when fails to make API call - /// XmlItem Body - /// - void CreateXmlItem (XmlItem xmlItem); + /// HealthCheckResult + HealthCheckResult FakeHealthGet (); /// - /// creates an XmlItem + /// Health check endpoint /// /// - /// this route creates an XmlItem + /// /// /// Thrown when fails to make API call - /// XmlItem Body - /// ApiResponse of Object(void) - ApiResponse CreateXmlItemWithHttpInfo (XmlItem xmlItem); + /// ApiResponse of HealthCheckResult + ApiResponse FakeHealthGetWithHttpInfo (); /// /// /// @@ -73,9 +71,9 @@ public interface IFakeApi : IApiAccessor /// Test serialization of object with outer number type /// /// Thrown when fails to make API call - /// Input composite as post body (optional) + /// Input composite as post body (optional) /// OuterComposite - OuterComposite FakeOuterCompositeSerialize (OuterComposite body = null); + OuterComposite FakeOuterCompositeSerialize (OuterComposite outerComposite = null); /// /// @@ -84,9 +82,9 @@ public interface IFakeApi : IApiAccessor /// Test serialization of object with outer number type /// /// Thrown when fails to make API call - /// Input composite as post body (optional) + /// Input composite as post body (optional) /// ApiResponse of OuterComposite - ApiResponse FakeOuterCompositeSerializeWithHttpInfo (OuterComposite body = null); + ApiResponse FakeOuterCompositeSerializeWithHttpInfo (OuterComposite outerComposite = null); /// /// /// @@ -136,9 +134,9 @@ public interface IFakeApi : IApiAccessor /// For this test, the body for this request much reference a schema named `File`. /// /// Thrown when fails to make API call - /// + /// /// - void TestBodyWithFileSchema (FileSchemaTestClass body); + void TestBodyWithFileSchema (FileSchemaTestClass fileSchemaTestClass); /// /// @@ -147,9 +145,9 @@ public interface IFakeApi : IApiAccessor /// For this test, the body for this request much reference a schema named `File`. /// /// Thrown when fails to make API call - /// + /// /// ApiResponse of Object(void) - ApiResponse TestBodyWithFileSchemaWithHttpInfo (FileSchemaTestClass body); + ApiResponse TestBodyWithFileSchemaWithHttpInfo (FileSchemaTestClass fileSchemaTestClass); /// /// /// @@ -158,9 +156,9 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// - /// + /// /// - void TestBodyWithQueryParams (string query, User body); + void TestBodyWithQueryParams (string query, User user); /// /// @@ -170,9 +168,9 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// - /// + /// /// ApiResponse of Object(void) - ApiResponse TestBodyWithQueryParamsWithHttpInfo (string query, User body); + ApiResponse TestBodyWithQueryParamsWithHttpInfo (string query, User user); /// /// To test \"client\" model /// @@ -180,9 +178,9 @@ public interface IFakeApi : IApiAccessor /// To test \"client\" model /// /// Thrown when fails to make API call - /// client model + /// client model /// ModelClient - ModelClient TestClientModel (ModelClient body); + ModelClient TestClientModel (ModelClient modelClient); /// /// To test \"client\" model @@ -191,9 +189,9 @@ public interface IFakeApi : IApiAccessor /// To test \"client\" model /// /// Thrown when fails to make API call - /// client model + /// client model /// ApiResponse of ModelClient - ApiResponse TestClientModelWithHttpInfo (ModelClient body); + ApiResponse TestClientModelWithHttpInfo (ModelClient modelClient); /// /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// @@ -314,9 +312,9 @@ public interface IFakeApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// request body + /// request body /// - void TestInlineAdditionalProperties (Dictionary param); + void TestInlineAdditionalProperties (Dictionary requestBody); /// /// test inline additionalProperties @@ -325,9 +323,9 @@ public interface IFakeApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// request body + /// request body /// ApiResponse of Object(void) - ApiResponse TestInlineAdditionalPropertiesWithHttpInfo (Dictionary param); + ApiResponse TestInlineAdditionalPropertiesWithHttpInfo (Dictionary requestBody); /// /// test json serialization of form data /// @@ -354,26 +352,24 @@ public interface IFakeApi : IApiAccessor #endregion Synchronous Operations #region Asynchronous Operations /// - /// creates an XmlItem + /// Health check endpoint /// /// - /// this route creates an XmlItem + /// /// /// Thrown when fails to make API call - /// XmlItem Body - /// Task of void - System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem); + /// Task of HealthCheckResult + System.Threading.Tasks.Task FakeHealthGetAsync (); /// - /// creates an XmlItem + /// Health check endpoint /// /// - /// this route creates an XmlItem + /// /// /// Thrown when fails to make API call - /// XmlItem Body - /// Task of ApiResponse - System.Threading.Tasks.Task> CreateXmlItemAsyncWithHttpInfo (XmlItem xmlItem); + /// Task of ApiResponse (HealthCheckResult) + System.Threading.Tasks.Task> FakeHealthGetAsyncWithHttpInfo (); /// /// /// @@ -402,9 +398,9 @@ public interface IFakeApi : IApiAccessor /// Test serialization of object with outer number type /// /// Thrown when fails to make API call - /// Input composite as post body (optional) + /// Input composite as post body (optional) /// Task of OuterComposite - System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite body = null); + System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite outerComposite = null); /// /// @@ -413,9 +409,9 @@ public interface IFakeApi : IApiAccessor /// Test serialization of object with outer number type /// /// Thrown when fails to make API call - /// Input composite as post body (optional) + /// Input composite as post body (optional) /// Task of ApiResponse (OuterComposite) - System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite body = null); + System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite outerComposite = null); /// /// /// @@ -465,9 +461,9 @@ public interface IFakeApi : IApiAccessor /// For this test, the body for this request much reference a schema named `File`. /// /// Thrown when fails to make API call - /// + /// /// Task of void - System.Threading.Tasks.Task TestBodyWithFileSchemaAsync (FileSchemaTestClass body); + System.Threading.Tasks.Task TestBodyWithFileSchemaAsync (FileSchemaTestClass fileSchemaTestClass); /// /// @@ -476,9 +472,9 @@ public interface IFakeApi : IApiAccessor /// For this test, the body for this request much reference a schema named `File`. /// /// Thrown when fails to make API call - /// + /// /// Task of ApiResponse - System.Threading.Tasks.Task> TestBodyWithFileSchemaAsyncWithHttpInfo (FileSchemaTestClass body); + System.Threading.Tasks.Task> TestBodyWithFileSchemaAsyncWithHttpInfo (FileSchemaTestClass fileSchemaTestClass); /// /// /// @@ -487,9 +483,9 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// - /// + /// /// Task of void - System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (string query, User body); + System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (string query, User user); /// /// @@ -499,9 +495,9 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// - /// + /// /// Task of ApiResponse - System.Threading.Tasks.Task> TestBodyWithQueryParamsAsyncWithHttpInfo (string query, User body); + System.Threading.Tasks.Task> TestBodyWithQueryParamsAsyncWithHttpInfo (string query, User user); /// /// To test \"client\" model /// @@ -509,9 +505,9 @@ public interface IFakeApi : IApiAccessor /// To test \"client\" model /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ModelClient - System.Threading.Tasks.Task TestClientModelAsync (ModelClient body); + System.Threading.Tasks.Task TestClientModelAsync (ModelClient modelClient); /// /// To test \"client\" model @@ -520,9 +516,9 @@ public interface IFakeApi : IApiAccessor /// To test \"client\" model /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ApiResponse (ModelClient) - System.Threading.Tasks.Task> TestClientModelAsyncWithHttpInfo (ModelClient body); + System.Threading.Tasks.Task> TestClientModelAsyncWithHttpInfo (ModelClient modelClient); /// /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// @@ -643,9 +639,9 @@ public interface IFakeApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// request body + /// request body /// Task of void - System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Dictionary param); + System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Dictionary requestBody); /// /// test inline additionalProperties @@ -654,9 +650,9 @@ public interface IFakeApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// request body + /// request body /// Task of ApiResponse - System.Threading.Tasks.Task> TestInlineAdditionalPropertiesAsyncWithHttpInfo (Dictionary param); + System.Threading.Tasks.Task> TestInlineAdditionalPropertiesAsyncWithHttpInfo (Dictionary requestBody); /// /// test json serialization of form data /// @@ -792,29 +788,25 @@ public void AddDefaultHeader(string key, string value) } /// - /// creates an XmlItem this route creates an XmlItem + /// Health check endpoint /// /// Thrown when fails to make API call - /// XmlItem Body - /// - public void CreateXmlItem (XmlItem xmlItem) + /// HealthCheckResult + public HealthCheckResult FakeHealthGet () { - CreateXmlItemWithHttpInfo(xmlItem); + ApiResponse localVarResponse = FakeHealthGetWithHttpInfo(); + return localVarResponse.Data; } /// - /// creates an XmlItem this route creates an XmlItem + /// Health check endpoint /// /// Thrown when fails to make API call - /// XmlItem Body - /// ApiResponse of Object(void) - public ApiResponse CreateXmlItemWithHttpInfo (XmlItem xmlItem) + /// ApiResponse of HealthCheckResult + public ApiResponse< HealthCheckResult > FakeHealthGetWithHttpInfo () { - // verify the required parameter 'xmlItem' is set - if (xmlItem == null) - throw new ApiException(400, "Missing required parameter 'xmlItem' when calling FakeApi->CreateXmlItem"); - var localVarPath = "/fake/create_xml_item"; + var localVarPath = "/fake/health"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); @@ -824,75 +816,58 @@ public ApiResponse CreateXmlItemWithHttpInfo (XmlItem xmlItem) // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { - "application/xml", - "application/xml; charset=utf-8", - "application/xml; charset=utf-16", - "text/xml", - "text/xml; charset=utf-8", - "text/xml; charset=utf-16" }; String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { + "application/json" }; String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (xmlItem != null && xmlItem.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(xmlItem); // http body (model) parameter - } - else - { - localVarPostBody = xmlItem; // byte array - } // make the HTTP request IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int) localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("CreateXmlItem", localVarResponse); + Exception exception = ExceptionFactory("FakeHealthGet", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - null); + (HealthCheckResult) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(HealthCheckResult))); } /// - /// creates an XmlItem this route creates an XmlItem + /// Health check endpoint /// /// Thrown when fails to make API call - /// XmlItem Body - /// Task of void - public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) + /// Task of HealthCheckResult + public async System.Threading.Tasks.Task FakeHealthGetAsync () { - await CreateXmlItemAsyncWithHttpInfo(xmlItem); + ApiResponse localVarResponse = await FakeHealthGetAsyncWithHttpInfo(); + return localVarResponse.Data; } /// - /// creates an XmlItem this route creates an XmlItem + /// Health check endpoint /// /// Thrown when fails to make API call - /// XmlItem Body - /// Task of ApiResponse - public async System.Threading.Tasks.Task> CreateXmlItemAsyncWithHttpInfo (XmlItem xmlItem) + /// Task of ApiResponse (HealthCheckResult) + public async System.Threading.Tasks.Task> FakeHealthGetAsyncWithHttpInfo () { - // verify the required parameter 'xmlItem' is set - if (xmlItem == null) - throw new ApiException(400, "Missing required parameter 'xmlItem' when calling FakeApi->CreateXmlItem"); - var localVarPath = "/fake/create_xml_item"; + var localVarPath = "/fake/health"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); @@ -902,48 +877,35 @@ public async System.Threading.Tasks.Task> CreateXmlItemAsync // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { - "application/xml", - "application/xml; charset=utf-8", - "application/xml; charset=utf-16", - "text/xml", - "text/xml; charset=utf-8", - "text/xml; charset=utf-16" }; String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { + "application/json" }; String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (xmlItem != null && xmlItem.GetType() != typeof(byte[])) - { - localVarPostBody = this.Configuration.ApiClient.Serialize(xmlItem); // http body (model) parameter - } - else - { - localVarPostBody = xmlItem; // byte array - } // make the HTTP request IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int) localVarResponse.StatusCode; if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("CreateXmlItem", localVarResponse); + Exception exception = ExceptionFactory("FakeHealthGet", localVarResponse); if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - null); + (HealthCheckResult) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(HealthCheckResult))); } /// @@ -977,6 +939,7 @@ public async System.Threading.Tasks.Task> CreateXmlItemAsync // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { + "application/json" }; String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); @@ -1048,6 +1011,7 @@ public async System.Threading.Tasks.Task> CreateXmlItemAsync // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { + "application/json" }; String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); @@ -1091,11 +1055,11 @@ public async System.Threading.Tasks.Task> CreateXmlItemAsync /// Test serialization of object with outer number type /// /// Thrown when fails to make API call - /// Input composite as post body (optional) + /// Input composite as post body (optional) /// OuterComposite - public OuterComposite FakeOuterCompositeSerialize (OuterComposite body = null) + public OuterComposite FakeOuterCompositeSerialize (OuterComposite outerComposite = null) { - ApiResponse localVarResponse = FakeOuterCompositeSerializeWithHttpInfo(body); + ApiResponse localVarResponse = FakeOuterCompositeSerializeWithHttpInfo(outerComposite); return localVarResponse.Data; } @@ -1103,9 +1067,9 @@ public OuterComposite FakeOuterCompositeSerialize (OuterComposite body = null) /// Test serialization of object with outer number type /// /// Thrown when fails to make API call - /// Input composite as post body (optional) + /// Input composite as post body (optional) /// ApiResponse of OuterComposite - public ApiResponse< OuterComposite > FakeOuterCompositeSerializeWithHttpInfo (OuterComposite body = null) + public ApiResponse< OuterComposite > FakeOuterCompositeSerializeWithHttpInfo (OuterComposite outerComposite = null) { var localVarPath = "/fake/outer/composite"; @@ -1118,6 +1082,7 @@ public ApiResponse< OuterComposite > FakeOuterCompositeSerializeWithHttpInfo (Ou // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { + "application/json" }; String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); @@ -1129,13 +1094,13 @@ public ApiResponse< OuterComposite > FakeOuterCompositeSerializeWithHttpInfo (Ou if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (body != null && body.GetType() != typeof(byte[])) + if (outerComposite != null && outerComposite.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(outerComposite); // http body (model) parameter } else { - localVarPostBody = body; // byte array + localVarPostBody = outerComposite; // byte array } @@ -1161,11 +1126,11 @@ public ApiResponse< OuterComposite > FakeOuterCompositeSerializeWithHttpInfo (Ou /// Test serialization of object with outer number type /// /// Thrown when fails to make API call - /// Input composite as post body (optional) + /// Input composite as post body (optional) /// Task of OuterComposite - public async System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite body = null) + public async System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite outerComposite = null) { - ApiResponse localVarResponse = await FakeOuterCompositeSerializeAsyncWithHttpInfo(body); + ApiResponse localVarResponse = await FakeOuterCompositeSerializeAsyncWithHttpInfo(outerComposite); return localVarResponse.Data; } @@ -1174,9 +1139,9 @@ public async System.Threading.Tasks.Task FakeOuterCompositeSeria /// Test serialization of object with outer number type /// /// Thrown when fails to make API call - /// Input composite as post body (optional) + /// Input composite as post body (optional) /// Task of ApiResponse (OuterComposite) - public async System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite body = null) + public async System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite outerComposite = null) { var localVarPath = "/fake/outer/composite"; @@ -1189,6 +1154,7 @@ public async System.Threading.Tasks.Task> FakeOuterC // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { + "application/json" }; String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); @@ -1200,13 +1166,13 @@ public async System.Threading.Tasks.Task> FakeOuterC if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (body != null && body.GetType() != typeof(byte[])) + if (outerComposite != null && outerComposite.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(outerComposite); // http body (model) parameter } else { - localVarPostBody = body; // byte array + localVarPostBody = outerComposite; // byte array } @@ -1259,6 +1225,7 @@ public async System.Threading.Tasks.Task> FakeOuterC // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { + "application/json" }; String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); @@ -1330,6 +1297,7 @@ public async System.Threading.Tasks.Task> FakeOuterC // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { + "application/json" }; String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); @@ -1400,6 +1368,7 @@ public ApiResponse< string > FakeOuterStringSerializeWithHttpInfo (string body = // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { + "application/json" }; String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); @@ -1471,6 +1440,7 @@ public async System.Threading.Tasks.Task> FakeOuterStringSer // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { + "application/json" }; String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); @@ -1514,24 +1484,24 @@ public async System.Threading.Tasks.Task> FakeOuterStringSer /// For this test, the body for this request much reference a schema named `File`. /// /// Thrown when fails to make API call - /// + /// /// - public void TestBodyWithFileSchema (FileSchemaTestClass body) + public void TestBodyWithFileSchema (FileSchemaTestClass fileSchemaTestClass) { - TestBodyWithFileSchemaWithHttpInfo(body); + TestBodyWithFileSchemaWithHttpInfo(fileSchemaTestClass); } /// /// For this test, the body for this request much reference a schema named `File`. /// /// Thrown when fails to make API call - /// + /// /// ApiResponse of Object(void) - public ApiResponse TestBodyWithFileSchemaWithHttpInfo (FileSchemaTestClass body) + public ApiResponse TestBodyWithFileSchemaWithHttpInfo (FileSchemaTestClass fileSchemaTestClass) { - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling FakeApi->TestBodyWithFileSchema"); + // verify the required parameter 'fileSchemaTestClass' is set + if (fileSchemaTestClass == null) + throw new ApiException(400, "Missing required parameter 'fileSchemaTestClass' when calling FakeApi->TestBodyWithFileSchema"); var localVarPath = "/fake/body-with-file-schema"; var localVarPathParams = new Dictionary(); @@ -1554,13 +1524,13 @@ public ApiResponse TestBodyWithFileSchemaWithHttpInfo (FileSchemaTestCla if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (body != null && body.GetType() != typeof(byte[])) + if (fileSchemaTestClass != null && fileSchemaTestClass.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(fileSchemaTestClass); // http body (model) parameter } else { - localVarPostBody = body; // byte array + localVarPostBody = fileSchemaTestClass; // byte array } @@ -1586,11 +1556,11 @@ public ApiResponse TestBodyWithFileSchemaWithHttpInfo (FileSchemaTestCla /// For this test, the body for this request much reference a schema named `File`. /// /// Thrown when fails to make API call - /// + /// /// Task of void - public async System.Threading.Tasks.Task TestBodyWithFileSchemaAsync (FileSchemaTestClass body) + public async System.Threading.Tasks.Task TestBodyWithFileSchemaAsync (FileSchemaTestClass fileSchemaTestClass) { - await TestBodyWithFileSchemaAsyncWithHttpInfo(body); + await TestBodyWithFileSchemaAsyncWithHttpInfo(fileSchemaTestClass); } @@ -1598,13 +1568,13 @@ public async System.Threading.Tasks.Task TestBodyWithFileSchemaAsync (FileSchema /// For this test, the body for this request much reference a schema named `File`. /// /// Thrown when fails to make API call - /// + /// /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestBodyWithFileSchemaAsyncWithHttpInfo (FileSchemaTestClass body) + public async System.Threading.Tasks.Task> TestBodyWithFileSchemaAsyncWithHttpInfo (FileSchemaTestClass fileSchemaTestClass) { - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling FakeApi->TestBodyWithFileSchema"); + // verify the required parameter 'fileSchemaTestClass' is set + if (fileSchemaTestClass == null) + throw new ApiException(400, "Missing required parameter 'fileSchemaTestClass' when calling FakeApi->TestBodyWithFileSchema"); var localVarPath = "/fake/body-with-file-schema"; var localVarPathParams = new Dictionary(); @@ -1627,13 +1597,13 @@ public async System.Threading.Tasks.Task> TestBodyWithFileSc if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (body != null && body.GetType() != typeof(byte[])) + if (fileSchemaTestClass != null && fileSchemaTestClass.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(fileSchemaTestClass); // http body (model) parameter } else { - localVarPostBody = body; // byte array + localVarPostBody = fileSchemaTestClass; // byte array } @@ -1660,11 +1630,11 @@ public async System.Threading.Tasks.Task> TestBodyWithFileSc /// /// Thrown when fails to make API call /// - /// + /// /// - public void TestBodyWithQueryParams (string query, User body) + public void TestBodyWithQueryParams (string query, User user) { - TestBodyWithQueryParamsWithHttpInfo(query, body); + TestBodyWithQueryParamsWithHttpInfo(query, user); } /// @@ -1672,16 +1642,16 @@ public void TestBodyWithQueryParams (string query, User body) /// /// Thrown when fails to make API call /// - /// + /// /// ApiResponse of Object(void) - public ApiResponse TestBodyWithQueryParamsWithHttpInfo (string query, User body) + public ApiResponse TestBodyWithQueryParamsWithHttpInfo (string query, User user) { // verify the required parameter 'query' is set if (query == null) throw new ApiException(400, "Missing required parameter 'query' when calling FakeApi->TestBodyWithQueryParams"); - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling FakeApi->TestBodyWithQueryParams"); + // verify the required parameter 'user' is set + if (user == null) + throw new ApiException(400, "Missing required parameter 'user' when calling FakeApi->TestBodyWithQueryParams"); var localVarPath = "/fake/body-with-query-params"; var localVarPathParams = new Dictionary(); @@ -1705,13 +1675,13 @@ public ApiResponse TestBodyWithQueryParamsWithHttpInfo (string query, Us localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); if (query != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "query", query)); // query parameter - if (body != null && body.GetType() != typeof(byte[])) + if (user != null && user.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(user); // http body (model) parameter } else { - localVarPostBody = body; // byte array + localVarPostBody = user; // byte array } @@ -1738,11 +1708,11 @@ public ApiResponse TestBodyWithQueryParamsWithHttpInfo (string query, Us /// /// Thrown when fails to make API call /// - /// + /// /// Task of void - public async System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (string query, User body) + public async System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (string query, User user) { - await TestBodyWithQueryParamsAsyncWithHttpInfo(query, body); + await TestBodyWithQueryParamsAsyncWithHttpInfo(query, user); } @@ -1751,16 +1721,16 @@ public async System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (string qu /// /// Thrown when fails to make API call /// - /// + /// /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestBodyWithQueryParamsAsyncWithHttpInfo (string query, User body) + public async System.Threading.Tasks.Task> TestBodyWithQueryParamsAsyncWithHttpInfo (string query, User user) { // verify the required parameter 'query' is set if (query == null) throw new ApiException(400, "Missing required parameter 'query' when calling FakeApi->TestBodyWithQueryParams"); - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling FakeApi->TestBodyWithQueryParams"); + // verify the required parameter 'user' is set + if (user == null) + throw new ApiException(400, "Missing required parameter 'user' when calling FakeApi->TestBodyWithQueryParams"); var localVarPath = "/fake/body-with-query-params"; var localVarPathParams = new Dictionary(); @@ -1784,13 +1754,13 @@ public async System.Threading.Tasks.Task> TestBodyWithQueryP localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); if (query != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "query", query)); // query parameter - if (body != null && body.GetType() != typeof(byte[])) + if (user != null && user.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(user); // http body (model) parameter } else { - localVarPostBody = body; // byte array + localVarPostBody = user; // byte array } @@ -1816,11 +1786,11 @@ public async System.Threading.Tasks.Task> TestBodyWithQueryP /// To test \"client\" model To test \"client\" model /// /// Thrown when fails to make API call - /// client model + /// client model /// ModelClient - public ModelClient TestClientModel (ModelClient body) + public ModelClient TestClientModel (ModelClient modelClient) { - ApiResponse localVarResponse = TestClientModelWithHttpInfo(body); + ApiResponse localVarResponse = TestClientModelWithHttpInfo(modelClient); return localVarResponse.Data; } @@ -1828,13 +1798,13 @@ public ModelClient TestClientModel (ModelClient body) /// To test \"client\" model To test \"client\" model /// /// Thrown when fails to make API call - /// client model + /// client model /// ApiResponse of ModelClient - public ApiResponse< ModelClient > TestClientModelWithHttpInfo (ModelClient body) + public ApiResponse< ModelClient > TestClientModelWithHttpInfo (ModelClient modelClient) { - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling FakeApi->TestClientModel"); + // verify the required parameter 'modelClient' is set + if (modelClient == null) + throw new ApiException(400, "Missing required parameter 'modelClient' when calling FakeApi->TestClientModel"); var localVarPath = "/fake"; var localVarPathParams = new Dictionary(); @@ -1858,13 +1828,13 @@ public ApiResponse< ModelClient > TestClientModelWithHttpInfo (ModelClient body) if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (body != null && body.GetType() != typeof(byte[])) + if (modelClient != null && modelClient.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(modelClient); // http body (model) parameter } else { - localVarPostBody = body; // byte array + localVarPostBody = modelClient; // byte array } @@ -1890,11 +1860,11 @@ public ApiResponse< ModelClient > TestClientModelWithHttpInfo (ModelClient body) /// To test \"client\" model To test \"client\" model /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ModelClient - public async System.Threading.Tasks.Task TestClientModelAsync (ModelClient body) + public async System.Threading.Tasks.Task TestClientModelAsync (ModelClient modelClient) { - ApiResponse localVarResponse = await TestClientModelAsyncWithHttpInfo(body); + ApiResponse localVarResponse = await TestClientModelAsyncWithHttpInfo(modelClient); return localVarResponse.Data; } @@ -1903,13 +1873,13 @@ public async System.Threading.Tasks.Task TestClientModelAsync (Mode /// To test \"client\" model To test \"client\" model /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ApiResponse (ModelClient) - public async System.Threading.Tasks.Task> TestClientModelAsyncWithHttpInfo (ModelClient body) + public async System.Threading.Tasks.Task> TestClientModelAsyncWithHttpInfo (ModelClient modelClient) { - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling FakeApi->TestClientModel"); + // verify the required parameter 'modelClient' is set + if (modelClient == null) + throw new ApiException(400, "Missing required parameter 'modelClient' when calling FakeApi->TestClientModel"); var localVarPath = "/fake"; var localVarPathParams = new Dictionary(); @@ -1933,13 +1903,13 @@ public async System.Threading.Tasks.Task> TestClientMod if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (body != null && body.GetType() != typeof(byte[])) + if (modelClient != null && modelClient.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(modelClient); // http body (model) parameter } else { - localVarPostBody = body; // byte array + localVarPostBody = modelClient; // byte array } @@ -2255,7 +2225,7 @@ public ApiResponse TestEnumParametersWithHttpInfo (List enumHead if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (enumQueryStringArray != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "enum_query_string_array", enumQueryStringArray)); // query parameter + if (enumQueryStringArray != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "enum_query_string_array", enumQueryStringArray)); // query parameter if (enumQueryString != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "enum_query_string", enumQueryString)); // query parameter if (enumQueryInteger != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "enum_query_integer", enumQueryInteger)); // query parameter if (enumQueryDouble != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "enum_query_double", enumQueryDouble)); // query parameter @@ -2339,7 +2309,7 @@ public async System.Threading.Tasks.Task> TestEnumParameters if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (enumQueryStringArray != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "enum_query_string_array", enumQueryStringArray)); // query parameter + if (enumQueryStringArray != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "enum_query_string_array", enumQueryStringArray)); // query parameter if (enumQueryString != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "enum_query_string", enumQueryString)); // query parameter if (enumQueryInteger != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "enum_query_integer", enumQueryInteger)); // query parameter if (enumQueryDouble != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "enum_query_double", enumQueryDouble)); // query parameter @@ -2433,6 +2403,12 @@ public ApiResponse TestGroupParametersWithHttpInfo (int? requiredStringG if (requiredBooleanGroup != null) localVarHeaderParams.Add("required_boolean_group", this.Configuration.ApiClient.ParameterToString(requiredBooleanGroup)); // header parameter if (booleanGroup != null) localVarHeaderParams.Add("boolean_group", this.Configuration.ApiClient.ParameterToString(booleanGroup)); // header parameter + // authentication (bearer_test) required + // http basic authentication required + if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) + { + localVarHeaderParams["Authorization"] = "Basic " + ApiClient.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password); + } // make the HTTP request IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, @@ -2519,6 +2495,12 @@ public async System.Threading.Tasks.Task> TestGroupParameter if (requiredBooleanGroup != null) localVarHeaderParams.Add("required_boolean_group", this.Configuration.ApiClient.ParameterToString(requiredBooleanGroup)); // header parameter if (booleanGroup != null) localVarHeaderParams.Add("boolean_group", this.Configuration.ApiClient.ParameterToString(booleanGroup)); // header parameter + // authentication (bearer_test) required + // http basic authentication required + if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) + { + localVarHeaderParams["Authorization"] = "Basic " + ApiClient.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password); + } // make the HTTP request IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, @@ -2542,24 +2524,24 @@ public async System.Threading.Tasks.Task> TestGroupParameter /// test inline additionalProperties /// /// Thrown when fails to make API call - /// request body + /// request body /// - public void TestInlineAdditionalProperties (Dictionary param) + public void TestInlineAdditionalProperties (Dictionary requestBody) { - TestInlineAdditionalPropertiesWithHttpInfo(param); + TestInlineAdditionalPropertiesWithHttpInfo(requestBody); } /// /// test inline additionalProperties /// /// Thrown when fails to make API call - /// request body + /// request body /// ApiResponse of Object(void) - public ApiResponse TestInlineAdditionalPropertiesWithHttpInfo (Dictionary param) + public ApiResponse TestInlineAdditionalPropertiesWithHttpInfo (Dictionary requestBody) { - // verify the required parameter 'param' is set - if (param == null) - throw new ApiException(400, "Missing required parameter 'param' when calling FakeApi->TestInlineAdditionalProperties"); + // verify the required parameter 'requestBody' is set + if (requestBody == null) + throw new ApiException(400, "Missing required parameter 'requestBody' when calling FakeApi->TestInlineAdditionalProperties"); var localVarPath = "/fake/inline-additionalProperties"; var localVarPathParams = new Dictionary(); @@ -2582,13 +2564,13 @@ public ApiResponse TestInlineAdditionalPropertiesWithHttpInfo (Dictionar if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (param != null && param.GetType() != typeof(byte[])) + if (requestBody != null && requestBody.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(param); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(requestBody); // http body (model) parameter } else { - localVarPostBody = param; // byte array + localVarPostBody = requestBody; // byte array } @@ -2614,11 +2596,11 @@ public ApiResponse TestInlineAdditionalPropertiesWithHttpInfo (Dictionar /// test inline additionalProperties /// /// Thrown when fails to make API call - /// request body + /// request body /// Task of void - public async System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Dictionary param) + public async System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Dictionary requestBody) { - await TestInlineAdditionalPropertiesAsyncWithHttpInfo(param); + await TestInlineAdditionalPropertiesAsyncWithHttpInfo(requestBody); } @@ -2626,13 +2608,13 @@ public async System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Di /// test inline additionalProperties /// /// Thrown when fails to make API call - /// request body + /// request body /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestInlineAdditionalPropertiesAsyncWithHttpInfo (Dictionary param) + public async System.Threading.Tasks.Task> TestInlineAdditionalPropertiesAsyncWithHttpInfo (Dictionary requestBody) { - // verify the required parameter 'param' is set - if (param == null) - throw new ApiException(400, "Missing required parameter 'param' when calling FakeApi->TestInlineAdditionalProperties"); + // verify the required parameter 'requestBody' is set + if (requestBody == null) + throw new ApiException(400, "Missing required parameter 'requestBody' when calling FakeApi->TestInlineAdditionalProperties"); var localVarPath = "/fake/inline-additionalProperties"; var localVarPathParams = new Dictionary(); @@ -2655,13 +2637,13 @@ public async System.Threading.Tasks.Task> TestInlineAddition if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (param != null && param.GetType() != typeof(byte[])) + if (requestBody != null && requestBody.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(param); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(requestBody); // http body (model) parameter } else { - localVarPostBody = param; // byte array + localVarPostBody = requestBody; // byte array } diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index 34496dfc87d6..20021324b332 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -31,9 +31,9 @@ public interface IFakeClassnameTags123Api : IApiAccessor /// To test class name in snake case /// /// Thrown when fails to make API call - /// client model + /// client model /// ModelClient - ModelClient TestClassname (ModelClient body); + ModelClient TestClassname (ModelClient modelClient); /// /// To test class name in snake case @@ -42,9 +42,9 @@ public interface IFakeClassnameTags123Api : IApiAccessor /// To test class name in snake case /// /// Thrown when fails to make API call - /// client model + /// client model /// ApiResponse of ModelClient - ApiResponse TestClassnameWithHttpInfo (ModelClient body); + ApiResponse TestClassnameWithHttpInfo (ModelClient modelClient); #endregion Synchronous Operations #region Asynchronous Operations /// @@ -54,9 +54,9 @@ public interface IFakeClassnameTags123Api : IApiAccessor /// To test class name in snake case /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ModelClient - System.Threading.Tasks.Task TestClassnameAsync (ModelClient body); + System.Threading.Tasks.Task TestClassnameAsync (ModelClient modelClient); /// /// To test class name in snake case @@ -65,9 +65,9 @@ public interface IFakeClassnameTags123Api : IApiAccessor /// To test class name in snake case /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ApiResponse (ModelClient) - System.Threading.Tasks.Task> TestClassnameAsyncWithHttpInfo (ModelClient body); + System.Threading.Tasks.Task> TestClassnameAsyncWithHttpInfo (ModelClient modelClient); #endregion Asynchronous Operations } @@ -183,11 +183,11 @@ public void AddDefaultHeader(string key, string value) /// To test class name in snake case To test class name in snake case /// /// Thrown when fails to make API call - /// client model + /// client model /// ModelClient - public ModelClient TestClassname (ModelClient body) + public ModelClient TestClassname (ModelClient modelClient) { - ApiResponse localVarResponse = TestClassnameWithHttpInfo(body); + ApiResponse localVarResponse = TestClassnameWithHttpInfo(modelClient); return localVarResponse.Data; } @@ -195,13 +195,13 @@ public ModelClient TestClassname (ModelClient body) /// To test class name in snake case To test class name in snake case /// /// Thrown when fails to make API call - /// client model + /// client model /// ApiResponse of ModelClient - public ApiResponse< ModelClient > TestClassnameWithHttpInfo (ModelClient body) + public ApiResponse< ModelClient > TestClassnameWithHttpInfo (ModelClient modelClient) { - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling FakeClassnameTags123Api->TestClassname"); + // verify the required parameter 'modelClient' is set + if (modelClient == null) + throw new ApiException(400, "Missing required parameter 'modelClient' when calling FakeClassnameTags123Api->TestClassname"); var localVarPath = "/fake_classname_test"; var localVarPathParams = new Dictionary(); @@ -225,13 +225,13 @@ public ApiResponse< ModelClient > TestClassnameWithHttpInfo (ModelClient body) if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (body != null && body.GetType() != typeof(byte[])) + if (modelClient != null && modelClient.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(modelClient); // http body (model) parameter } else { - localVarPostBody = body; // byte array + localVarPostBody = modelClient; // byte array } // authentication (api_key_query) required @@ -262,11 +262,11 @@ public ApiResponse< ModelClient > TestClassnameWithHttpInfo (ModelClient body) /// To test class name in snake case To test class name in snake case /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ModelClient - public async System.Threading.Tasks.Task TestClassnameAsync (ModelClient body) + public async System.Threading.Tasks.Task TestClassnameAsync (ModelClient modelClient) { - ApiResponse localVarResponse = await TestClassnameAsyncWithHttpInfo(body); + ApiResponse localVarResponse = await TestClassnameAsyncWithHttpInfo(modelClient); return localVarResponse.Data; } @@ -275,13 +275,13 @@ public async System.Threading.Tasks.Task TestClassnameAsync (ModelC /// To test class name in snake case To test class name in snake case /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ApiResponse (ModelClient) - public async System.Threading.Tasks.Task> TestClassnameAsyncWithHttpInfo (ModelClient body) + public async System.Threading.Tasks.Task> TestClassnameAsyncWithHttpInfo (ModelClient modelClient) { - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling FakeClassnameTags123Api->TestClassname"); + // verify the required parameter 'modelClient' is set + if (modelClient == null) + throw new ApiException(400, "Missing required parameter 'modelClient' when calling FakeClassnameTags123Api->TestClassname"); var localVarPath = "/fake_classname_test"; var localVarPathParams = new Dictionary(); @@ -305,13 +305,13 @@ public async System.Threading.Tasks.Task> TestClassname if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (body != null && body.GetType() != typeof(byte[])) + if (modelClient != null && modelClient.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(modelClient); // http body (model) parameter } else { - localVarPostBody = body; // byte array + localVarPostBody = modelClient; // byte array } // authentication (api_key_query) required diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/PetApi.cs index e5abf7996ed8..5fd97533d827 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/PetApi.cs @@ -31,9 +31,9 @@ public interface IPetApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// - void AddPet (Pet body); + void AddPet (Pet pet); /// /// Add a new pet to the store @@ -42,9 +42,9 @@ public interface IPetApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// ApiResponse of Object(void) - ApiResponse AddPetWithHttpInfo (Pet body); + ApiResponse AddPetWithHttpInfo (Pet pet); /// /// Deletes a pet /// @@ -138,9 +138,9 @@ public interface IPetApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// - void UpdatePet (Pet body); + void UpdatePet (Pet pet); /// /// Update an existing pet @@ -149,9 +149,9 @@ public interface IPetApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// ApiResponse of Object(void) - ApiResponse UpdatePetWithHttpInfo (Pet body); + ApiResponse UpdatePetWithHttpInfo (Pet pet); /// /// Updates a pet in the store with form data /// @@ -236,9 +236,9 @@ public interface IPetApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// Task of void - System.Threading.Tasks.Task AddPetAsync (Pet body); + System.Threading.Tasks.Task AddPetAsync (Pet pet); /// /// Add a new pet to the store @@ -247,9 +247,9 @@ public interface IPetApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// Task of ApiResponse - System.Threading.Tasks.Task> AddPetAsyncWithHttpInfo (Pet body); + System.Threading.Tasks.Task> AddPetAsyncWithHttpInfo (Pet pet); /// /// Deletes a pet /// @@ -343,9 +343,9 @@ public interface IPetApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// Task of void - System.Threading.Tasks.Task UpdatePetAsync (Pet body); + System.Threading.Tasks.Task UpdatePetAsync (Pet pet); /// /// Update an existing pet @@ -354,9 +354,9 @@ public interface IPetApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// Task of ApiResponse - System.Threading.Tasks.Task> UpdatePetAsyncWithHttpInfo (Pet body); + System.Threading.Tasks.Task> UpdatePetAsyncWithHttpInfo (Pet pet); /// /// Updates a pet in the store with form data /// @@ -547,24 +547,24 @@ public void AddDefaultHeader(string key, string value) /// Add a new pet to the store /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// - public void AddPet (Pet body) + public void AddPet (Pet pet) { - AddPetWithHttpInfo(body); + AddPetWithHttpInfo(pet); } /// /// Add a new pet to the store /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// ApiResponse of Object(void) - public ApiResponse AddPetWithHttpInfo (Pet body) + public ApiResponse AddPetWithHttpInfo (Pet pet) { - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling PetApi->AddPet"); + // verify the required parameter 'pet' is set + if (pet == null) + throw new ApiException(400, "Missing required parameter 'pet' when calling PetApi->AddPet"); var localVarPath = "/pet"; var localVarPathParams = new Dictionary(); @@ -588,13 +588,13 @@ public ApiResponse AddPetWithHttpInfo (Pet body) if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (body != null && body.GetType() != typeof(byte[])) + if (pet != null && pet.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(pet); // http body (model) parameter } else { - localVarPostBody = body; // byte array + localVarPostBody = pet; // byte array } // authentication (petstore_auth) required @@ -626,11 +626,11 @@ public ApiResponse AddPetWithHttpInfo (Pet body) /// Add a new pet to the store /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// Task of void - public async System.Threading.Tasks.Task AddPetAsync (Pet body) + public async System.Threading.Tasks.Task AddPetAsync (Pet pet) { - await AddPetAsyncWithHttpInfo(body); + await AddPetAsyncWithHttpInfo(pet); } @@ -638,13 +638,13 @@ public async System.Threading.Tasks.Task AddPetAsync (Pet body) /// Add a new pet to the store /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// Task of ApiResponse - public async System.Threading.Tasks.Task> AddPetAsyncWithHttpInfo (Pet body) + public async System.Threading.Tasks.Task> AddPetAsyncWithHttpInfo (Pet pet) { - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling PetApi->AddPet"); + // verify the required parameter 'pet' is set + if (pet == null) + throw new ApiException(400, "Missing required parameter 'pet' when calling PetApi->AddPet"); var localVarPath = "/pet"; var localVarPathParams = new Dictionary(); @@ -668,13 +668,13 @@ public async System.Threading.Tasks.Task> AddPetAsyncWithHtt if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (body != null && body.GetType() != typeof(byte[])) + if (pet != null && pet.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(pet); // http body (model) parameter } else { - localVarPostBody = body; // byte array + localVarPostBody = pet; // byte array } // authentication (petstore_auth) required @@ -1292,24 +1292,24 @@ public async System.Threading.Tasks.Task> GetPetByIdAsyncWithHt /// Update an existing pet /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// - public void UpdatePet (Pet body) + public void UpdatePet (Pet pet) { - UpdatePetWithHttpInfo(body); + UpdatePetWithHttpInfo(pet); } /// /// Update an existing pet /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// ApiResponse of Object(void) - public ApiResponse UpdatePetWithHttpInfo (Pet body) + public ApiResponse UpdatePetWithHttpInfo (Pet pet) { - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling PetApi->UpdatePet"); + // verify the required parameter 'pet' is set + if (pet == null) + throw new ApiException(400, "Missing required parameter 'pet' when calling PetApi->UpdatePet"); var localVarPath = "/pet"; var localVarPathParams = new Dictionary(); @@ -1333,13 +1333,13 @@ public ApiResponse UpdatePetWithHttpInfo (Pet body) if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (body != null && body.GetType() != typeof(byte[])) + if (pet != null && pet.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(pet); // http body (model) parameter } else { - localVarPostBody = body; // byte array + localVarPostBody = pet; // byte array } // authentication (petstore_auth) required @@ -1371,11 +1371,11 @@ public ApiResponse UpdatePetWithHttpInfo (Pet body) /// Update an existing pet /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// Task of void - public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) + public async System.Threading.Tasks.Task UpdatePetAsync (Pet pet) { - await UpdatePetAsyncWithHttpInfo(body); + await UpdatePetAsyncWithHttpInfo(pet); } @@ -1383,13 +1383,13 @@ public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) /// Update an existing pet /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// Task of ApiResponse - public async System.Threading.Tasks.Task> UpdatePetAsyncWithHttpInfo (Pet body) + public async System.Threading.Tasks.Task> UpdatePetAsyncWithHttpInfo (Pet pet) { - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling PetApi->UpdatePet"); + // verify the required parameter 'pet' is set + if (pet == null) + throw new ApiException(400, "Missing required parameter 'pet' when calling PetApi->UpdatePet"); var localVarPath = "/pet"; var localVarPathParams = new Dictionary(); @@ -1413,13 +1413,13 @@ public async System.Threading.Tasks.Task> UpdatePetAsyncWith if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (body != null && body.GetType() != typeof(byte[])) + if (pet != null && pet.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(pet); // http body (model) parameter } else { - localVarPostBody = body; // byte array + localVarPostBody = pet; // byte array } // authentication (petstore_auth) required diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/StoreApi.cs index 418c57085476..5a5e25d793a2 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/StoreApi.cs @@ -92,9 +92,9 @@ public interface IStoreApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// order placed for purchasing the pet + /// order placed for purchasing the pet /// Order - Order PlaceOrder (Order body); + Order PlaceOrder (Order order); /// /// Place an order for a pet @@ -103,9 +103,9 @@ public interface IStoreApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// order placed for purchasing the pet + /// order placed for purchasing the pet /// ApiResponse of Order - ApiResponse PlaceOrderWithHttpInfo (Order body); + ApiResponse PlaceOrderWithHttpInfo (Order order); #endregion Synchronous Operations #region Asynchronous Operations /// @@ -176,9 +176,9 @@ public interface IStoreApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// order placed for purchasing the pet + /// order placed for purchasing the pet /// Task of Order - System.Threading.Tasks.Task PlaceOrderAsync (Order body); + System.Threading.Tasks.Task PlaceOrderAsync (Order order); /// /// Place an order for a pet @@ -187,9 +187,9 @@ public interface IStoreApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// order placed for purchasing the pet + /// order placed for purchasing the pet /// Task of ApiResponse (Order) - System.Threading.Tasks.Task> PlaceOrderAsyncWithHttpInfo (Order body); + System.Threading.Tasks.Task> PlaceOrderAsyncWithHttpInfo (Order order); #endregion Asynchronous Operations } @@ -700,11 +700,11 @@ public async System.Threading.Tasks.Task> GetOrderByIdAsyncWi /// Place an order for a pet /// /// Thrown when fails to make API call - /// order placed for purchasing the pet + /// order placed for purchasing the pet /// Order - public Order PlaceOrder (Order body) + public Order PlaceOrder (Order order) { - ApiResponse localVarResponse = PlaceOrderWithHttpInfo(body); + ApiResponse localVarResponse = PlaceOrderWithHttpInfo(order); return localVarResponse.Data; } @@ -712,13 +712,13 @@ public Order PlaceOrder (Order body) /// Place an order for a pet /// /// Thrown when fails to make API call - /// order placed for purchasing the pet + /// order placed for purchasing the pet /// ApiResponse of Order - public ApiResponse< Order > PlaceOrderWithHttpInfo (Order body) + public ApiResponse< Order > PlaceOrderWithHttpInfo (Order order) { - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling StoreApi->PlaceOrder"); + // verify the required parameter 'order' is set + if (order == null) + throw new ApiException(400, "Missing required parameter 'order' when calling StoreApi->PlaceOrder"); var localVarPath = "/store/order"; var localVarPathParams = new Dictionary(); @@ -730,6 +730,7 @@ public ApiResponse< Order > PlaceOrderWithHttpInfo (Order body) // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { + "application/json" }; String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); @@ -742,13 +743,13 @@ public ApiResponse< Order > PlaceOrderWithHttpInfo (Order body) if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (body != null && body.GetType() != typeof(byte[])) + if (order != null && order.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(order); // http body (model) parameter } else { - localVarPostBody = body; // byte array + localVarPostBody = order; // byte array } @@ -774,11 +775,11 @@ public ApiResponse< Order > PlaceOrderWithHttpInfo (Order body) /// Place an order for a pet /// /// Thrown when fails to make API call - /// order placed for purchasing the pet + /// order placed for purchasing the pet /// Task of Order - public async System.Threading.Tasks.Task PlaceOrderAsync (Order body) + public async System.Threading.Tasks.Task PlaceOrderAsync (Order order) { - ApiResponse localVarResponse = await PlaceOrderAsyncWithHttpInfo(body); + ApiResponse localVarResponse = await PlaceOrderAsyncWithHttpInfo(order); return localVarResponse.Data; } @@ -787,13 +788,13 @@ public async System.Threading.Tasks.Task PlaceOrderAsync (Order body) /// Place an order for a pet /// /// Thrown when fails to make API call - /// order placed for purchasing the pet + /// order placed for purchasing the pet /// Task of ApiResponse (Order) - public async System.Threading.Tasks.Task> PlaceOrderAsyncWithHttpInfo (Order body) + public async System.Threading.Tasks.Task> PlaceOrderAsyncWithHttpInfo (Order order) { - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling StoreApi->PlaceOrder"); + // verify the required parameter 'order' is set + if (order == null) + throw new ApiException(400, "Missing required parameter 'order' when calling StoreApi->PlaceOrder"); var localVarPath = "/store/order"; var localVarPathParams = new Dictionary(); @@ -805,6 +806,7 @@ public async System.Threading.Tasks.Task> PlaceOrderAsyncWith // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { + "application/json" }; String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); @@ -817,13 +819,13 @@ public async System.Threading.Tasks.Task> PlaceOrderAsyncWith if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (body != null && body.GetType() != typeof(byte[])) + if (order != null && order.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(order); // http body (model) parameter } else { - localVarPostBody = body; // byte array + localVarPostBody = order; // byte array } diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/UserApi.cs index e842bd876908..7199e8c746d5 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/UserApi.cs @@ -31,9 +31,9 @@ public interface IUserApi : IApiAccessor /// This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object + /// Created user object /// - void CreateUser (User body); + void CreateUser (User user); /// /// Create user @@ -42,9 +42,9 @@ public interface IUserApi : IApiAccessor /// This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object + /// Created user object /// ApiResponse of Object(void) - ApiResponse CreateUserWithHttpInfo (User body); + ApiResponse CreateUserWithHttpInfo (User user); /// /// Creates list of users with given input array /// @@ -52,9 +52,9 @@ public interface IUserApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// - void CreateUsersWithArrayInput (List body); + void CreateUsersWithArrayInput (List user); /// /// Creates list of users with given input array @@ -63,9 +63,9 @@ public interface IUserApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// ApiResponse of Object(void) - ApiResponse CreateUsersWithArrayInputWithHttpInfo (List body); + ApiResponse CreateUsersWithArrayInputWithHttpInfo (List user); /// /// Creates list of users with given input array /// @@ -73,9 +73,9 @@ public interface IUserApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// - void CreateUsersWithListInput (List body); + void CreateUsersWithListInput (List user); /// /// Creates list of users with given input array @@ -84,9 +84,9 @@ public interface IUserApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// ApiResponse of Object(void) - ApiResponse CreateUsersWithListInputWithHttpInfo (List body); + ApiResponse CreateUsersWithListInputWithHttpInfo (List user); /// /// Delete user /// @@ -179,9 +179,9 @@ public interface IUserApi : IApiAccessor /// /// Thrown when fails to make API call /// name that need to be deleted - /// Updated user object + /// Updated user object /// - void UpdateUser (string username, User body); + void UpdateUser (string username, User user); /// /// Updated user @@ -191,9 +191,9 @@ public interface IUserApi : IApiAccessor /// /// Thrown when fails to make API call /// name that need to be deleted - /// Updated user object + /// Updated user object /// ApiResponse of Object(void) - ApiResponse UpdateUserWithHttpInfo (string username, User body); + ApiResponse UpdateUserWithHttpInfo (string username, User user); #endregion Synchronous Operations #region Asynchronous Operations /// @@ -203,9 +203,9 @@ public interface IUserApi : IApiAccessor /// This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object + /// Created user object /// Task of void - System.Threading.Tasks.Task CreateUserAsync (User body); + System.Threading.Tasks.Task CreateUserAsync (User user); /// /// Create user @@ -214,9 +214,9 @@ public interface IUserApi : IApiAccessor /// This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object + /// Created user object /// Task of ApiResponse - System.Threading.Tasks.Task> CreateUserAsyncWithHttpInfo (User body); + System.Threading.Tasks.Task> CreateUserAsyncWithHttpInfo (User user); /// /// Creates list of users with given input array /// @@ -224,9 +224,9 @@ public interface IUserApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// Task of void - System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List body); + System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List user); /// /// Creates list of users with given input array @@ -235,9 +235,9 @@ public interface IUserApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// Task of ApiResponse - System.Threading.Tasks.Task> CreateUsersWithArrayInputAsyncWithHttpInfo (List body); + System.Threading.Tasks.Task> CreateUsersWithArrayInputAsyncWithHttpInfo (List user); /// /// Creates list of users with given input array /// @@ -245,9 +245,9 @@ public interface IUserApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// Task of void - System.Threading.Tasks.Task CreateUsersWithListInputAsync (List body); + System.Threading.Tasks.Task CreateUsersWithListInputAsync (List user); /// /// Creates list of users with given input array @@ -256,9 +256,9 @@ public interface IUserApi : IApiAccessor /// /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// Task of ApiResponse - System.Threading.Tasks.Task> CreateUsersWithListInputAsyncWithHttpInfo (List body); + System.Threading.Tasks.Task> CreateUsersWithListInputAsyncWithHttpInfo (List user); /// /// Delete user /// @@ -351,9 +351,9 @@ public interface IUserApi : IApiAccessor /// /// Thrown when fails to make API call /// name that need to be deleted - /// Updated user object + /// Updated user object /// Task of void - System.Threading.Tasks.Task UpdateUserAsync (string username, User body); + System.Threading.Tasks.Task UpdateUserAsync (string username, User user); /// /// Updated user @@ -363,9 +363,9 @@ public interface IUserApi : IApiAccessor /// /// Thrown when fails to make API call /// name that need to be deleted - /// Updated user object + /// Updated user object /// Task of ApiResponse - System.Threading.Tasks.Task> UpdateUserAsyncWithHttpInfo (string username, User body); + System.Threading.Tasks.Task> UpdateUserAsyncWithHttpInfo (string username, User user); #endregion Asynchronous Operations } @@ -481,24 +481,24 @@ public void AddDefaultHeader(string key, string value) /// Create user This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object + /// Created user object /// - public void CreateUser (User body) + public void CreateUser (User user) { - CreateUserWithHttpInfo(body); + CreateUserWithHttpInfo(user); } /// /// Create user This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object + /// Created user object /// ApiResponse of Object(void) - public ApiResponse CreateUserWithHttpInfo (User body) + public ApiResponse CreateUserWithHttpInfo (User user) { - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUser"); + // verify the required parameter 'user' is set + if (user == null) + throw new ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUser"); var localVarPath = "/user"; var localVarPathParams = new Dictionary(); @@ -510,6 +510,7 @@ public ApiResponse CreateUserWithHttpInfo (User body) // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { + "application/json" }; String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); @@ -520,13 +521,13 @@ public ApiResponse CreateUserWithHttpInfo (User body) if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (body != null && body.GetType() != typeof(byte[])) + if (user != null && user.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(user); // http body (model) parameter } else { - localVarPostBody = body; // byte array + localVarPostBody = user; // byte array } @@ -552,11 +553,11 @@ public ApiResponse CreateUserWithHttpInfo (User body) /// Create user This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object + /// Created user object /// Task of void - public async System.Threading.Tasks.Task CreateUserAsync (User body) + public async System.Threading.Tasks.Task CreateUserAsync (User user) { - await CreateUserAsyncWithHttpInfo(body); + await CreateUserAsyncWithHttpInfo(user); } @@ -564,13 +565,13 @@ public async System.Threading.Tasks.Task CreateUserAsync (User body) /// Create user This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object + /// Created user object /// Task of ApiResponse - public async System.Threading.Tasks.Task> CreateUserAsyncWithHttpInfo (User body) + public async System.Threading.Tasks.Task> CreateUserAsyncWithHttpInfo (User user) { - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUser"); + // verify the required parameter 'user' is set + if (user == null) + throw new ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUser"); var localVarPath = "/user"; var localVarPathParams = new Dictionary(); @@ -582,6 +583,7 @@ public async System.Threading.Tasks.Task> CreateUserAsyncWit // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { + "application/json" }; String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); @@ -592,13 +594,13 @@ public async System.Threading.Tasks.Task> CreateUserAsyncWit if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (body != null && body.GetType() != typeof(byte[])) + if (user != null && user.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(user); // http body (model) parameter } else { - localVarPostBody = body; // byte array + localVarPostBody = user; // byte array } @@ -624,24 +626,24 @@ public async System.Threading.Tasks.Task> CreateUserAsyncWit /// Creates list of users with given input array /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// - public void CreateUsersWithArrayInput (List body) + public void CreateUsersWithArrayInput (List user) { - CreateUsersWithArrayInputWithHttpInfo(body); + CreateUsersWithArrayInputWithHttpInfo(user); } /// /// Creates list of users with given input array /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// ApiResponse of Object(void) - public ApiResponse CreateUsersWithArrayInputWithHttpInfo (List body) + public ApiResponse CreateUsersWithArrayInputWithHttpInfo (List user) { - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUsersWithArrayInput"); + // verify the required parameter 'user' is set + if (user == null) + throw new ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithArrayInput"); var localVarPath = "/user/createWithArray"; var localVarPathParams = new Dictionary(); @@ -653,6 +655,7 @@ public ApiResponse CreateUsersWithArrayInputWithHttpInfo (List bod // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { + "application/json" }; String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); @@ -663,13 +666,13 @@ public ApiResponse CreateUsersWithArrayInputWithHttpInfo (List bod if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (body != null && body.GetType() != typeof(byte[])) + if (user != null && user.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(user); // http body (model) parameter } else { - localVarPostBody = body; // byte array + localVarPostBody = user; // byte array } @@ -695,11 +698,11 @@ public ApiResponse CreateUsersWithArrayInputWithHttpInfo (List bod /// Creates list of users with given input array /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// Task of void - public async System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List body) + public async System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List user) { - await CreateUsersWithArrayInputAsyncWithHttpInfo(body); + await CreateUsersWithArrayInputAsyncWithHttpInfo(user); } @@ -707,13 +710,13 @@ public async System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List /// Thrown when fails to make API call - /// List of user object + /// List of user object /// Task of ApiResponse - public async System.Threading.Tasks.Task> CreateUsersWithArrayInputAsyncWithHttpInfo (List body) + public async System.Threading.Tasks.Task> CreateUsersWithArrayInputAsyncWithHttpInfo (List user) { - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUsersWithArrayInput"); + // verify the required parameter 'user' is set + if (user == null) + throw new ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithArrayInput"); var localVarPath = "/user/createWithArray"; var localVarPathParams = new Dictionary(); @@ -725,6 +728,7 @@ public async System.Threading.Tasks.Task> CreateUsersWithArr // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { + "application/json" }; String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); @@ -735,13 +739,13 @@ public async System.Threading.Tasks.Task> CreateUsersWithArr if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (body != null && body.GetType() != typeof(byte[])) + if (user != null && user.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(user); // http body (model) parameter } else { - localVarPostBody = body; // byte array + localVarPostBody = user; // byte array } @@ -767,24 +771,24 @@ public async System.Threading.Tasks.Task> CreateUsersWithArr /// Creates list of users with given input array /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// - public void CreateUsersWithListInput (List body) + public void CreateUsersWithListInput (List user) { - CreateUsersWithListInputWithHttpInfo(body); + CreateUsersWithListInputWithHttpInfo(user); } /// /// Creates list of users with given input array /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// ApiResponse of Object(void) - public ApiResponse CreateUsersWithListInputWithHttpInfo (List body) + public ApiResponse CreateUsersWithListInputWithHttpInfo (List user) { - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUsersWithListInput"); + // verify the required parameter 'user' is set + if (user == null) + throw new ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithListInput"); var localVarPath = "/user/createWithList"; var localVarPathParams = new Dictionary(); @@ -796,6 +800,7 @@ public ApiResponse CreateUsersWithListInputWithHttpInfo (List body // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { + "application/json" }; String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); @@ -806,13 +811,13 @@ public ApiResponse CreateUsersWithListInputWithHttpInfo (List body if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (body != null && body.GetType() != typeof(byte[])) + if (user != null && user.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(user); // http body (model) parameter } else { - localVarPostBody = body; // byte array + localVarPostBody = user; // byte array } @@ -838,11 +843,11 @@ public ApiResponse CreateUsersWithListInputWithHttpInfo (List body /// Creates list of users with given input array /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// Task of void - public async System.Threading.Tasks.Task CreateUsersWithListInputAsync (List body) + public async System.Threading.Tasks.Task CreateUsersWithListInputAsync (List user) { - await CreateUsersWithListInputAsyncWithHttpInfo(body); + await CreateUsersWithListInputAsyncWithHttpInfo(user); } @@ -850,13 +855,13 @@ public async System.Threading.Tasks.Task CreateUsersWithListInputAsync (List /// Thrown when fails to make API call - /// List of user object + /// List of user object /// Task of ApiResponse - public async System.Threading.Tasks.Task> CreateUsersWithListInputAsyncWithHttpInfo (List body) + public async System.Threading.Tasks.Task> CreateUsersWithListInputAsyncWithHttpInfo (List user) { - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUsersWithListInput"); + // verify the required parameter 'user' is set + if (user == null) + throw new ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithListInput"); var localVarPath = "/user/createWithList"; var localVarPathParams = new Dictionary(); @@ -868,6 +873,7 @@ public async System.Threading.Tasks.Task> CreateUsersWithLis // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { + "application/json" }; String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); @@ -878,13 +884,13 @@ public async System.Threading.Tasks.Task> CreateUsersWithLis if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (body != null && body.GetType() != typeof(byte[])) + if (user != null && user.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(user); // http body (model) parameter } else { - localVarPostBody = body; // byte array + localVarPostBody = user; // byte array } @@ -1439,11 +1445,11 @@ public async System.Threading.Tasks.Task> LogoutUserAsyncWit /// /// Thrown when fails to make API call /// name that need to be deleted - /// Updated user object + /// Updated user object /// - public void UpdateUser (string username, User body) + public void UpdateUser (string username, User user) { - UpdateUserWithHttpInfo(username, body); + UpdateUserWithHttpInfo(username, user); } /// @@ -1451,16 +1457,16 @@ public void UpdateUser (string username, User body) /// /// Thrown when fails to make API call /// name that need to be deleted - /// Updated user object + /// Updated user object /// ApiResponse of Object(void) - public ApiResponse UpdateUserWithHttpInfo (string username, User body) + public ApiResponse UpdateUserWithHttpInfo (string username, User user) { // verify the required parameter 'username' is set if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->UpdateUser"); - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->UpdateUser"); + // verify the required parameter 'user' is set + if (user == null) + throw new ApiException(400, "Missing required parameter 'user' when calling UserApi->UpdateUser"); var localVarPath = "/user/{username}"; var localVarPathParams = new Dictionary(); @@ -1472,6 +1478,7 @@ public ApiResponse UpdateUserWithHttpInfo (string username, User body) // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { + "application/json" }; String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); @@ -1483,13 +1490,13 @@ public ApiResponse UpdateUserWithHttpInfo (string username, User body) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); if (username != null) localVarPathParams.Add("username", this.Configuration.ApiClient.ParameterToString(username)); // path parameter - if (body != null && body.GetType() != typeof(byte[])) + if (user != null && user.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(user); // http body (model) parameter } else { - localVarPostBody = body; // byte array + localVarPostBody = user; // byte array } @@ -1516,11 +1523,11 @@ public ApiResponse UpdateUserWithHttpInfo (string username, User body) /// /// Thrown when fails to make API call /// name that need to be deleted - /// Updated user object + /// Updated user object /// Task of void - public async System.Threading.Tasks.Task UpdateUserAsync (string username, User body) + public async System.Threading.Tasks.Task UpdateUserAsync (string username, User user) { - await UpdateUserAsyncWithHttpInfo(username, body); + await UpdateUserAsyncWithHttpInfo(username, user); } @@ -1529,16 +1536,16 @@ public async System.Threading.Tasks.Task UpdateUserAsync (string username, User /// /// Thrown when fails to make API call /// name that need to be deleted - /// Updated user object + /// Updated user object /// Task of ApiResponse - public async System.Threading.Tasks.Task> UpdateUserAsyncWithHttpInfo (string username, User body) + public async System.Threading.Tasks.Task> UpdateUserAsyncWithHttpInfo (string username, User user) { // verify the required parameter 'username' is set if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->UpdateUser"); - // verify the required parameter 'body' is set - if (body == null) - throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->UpdateUser"); + // verify the required parameter 'user' is set + if (user == null) + throw new ApiException(400, "Missing required parameter 'user' when calling UserApi->UpdateUser"); var localVarPath = "/user/{username}"; var localVarPathParams = new Dictionary(); @@ -1550,6 +1557,7 @@ public async System.Threading.Tasks.Task> UpdateUserAsyncWit // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { + "application/json" }; String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); @@ -1561,13 +1569,13 @@ public async System.Threading.Tasks.Task> UpdateUserAsyncWit localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); if (username != null) localVarPathParams.Add("username", this.Configuration.ApiClient.ParameterToString(username)); // path parameter - if (body != null && body.GetType() != typeof(byte[])) + if (user != null && user.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(user); // http body (model) parameter } else { - localVarPostBody = body; // byte array + localVarPostBody = user; // byte array } diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index 4a33ca55259c..d73bd7c8303e 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -36,97 +36,25 @@ public partial class AdditionalPropertiesClass : IEquatable /// Initializes a new instance of the class. /// - /// mapString. - /// mapNumber. - /// mapInteger. - /// mapBoolean. - /// mapArrayInteger. - /// mapArrayAnytype. - /// mapMapString. - /// mapMapAnytype. - /// anytype1. - /// anytype2. - /// anytype3. - public AdditionalPropertiesClass(Dictionary mapString = default(Dictionary), Dictionary mapNumber = default(Dictionary), Dictionary mapInteger = default(Dictionary), Dictionary mapBoolean = default(Dictionary), Dictionary> mapArrayInteger = default(Dictionary>), Dictionary> mapArrayAnytype = default(Dictionary>), Dictionary> mapMapString = default(Dictionary>), Dictionary> mapMapAnytype = default(Dictionary>), Object anytype1 = default(Object), Object anytype2 = default(Object), Object anytype3 = default(Object)) + /// mapProperty. + /// mapOfMapProperty. + public AdditionalPropertiesClass(Dictionary mapProperty = default(Dictionary), Dictionary> mapOfMapProperty = default(Dictionary>)) { - this.MapString = mapString; - this.MapNumber = mapNumber; - this.MapInteger = mapInteger; - this.MapBoolean = mapBoolean; - this.MapArrayInteger = mapArrayInteger; - this.MapArrayAnytype = mapArrayAnytype; - this.MapMapString = mapMapString; - this.MapMapAnytype = mapMapAnytype; - this.Anytype1 = anytype1; - this.Anytype2 = anytype2; - this.Anytype3 = anytype3; + this.MapProperty = mapProperty; + this.MapOfMapProperty = mapOfMapProperty; } /// - /// Gets or Sets MapString + /// Gets or Sets MapProperty /// - [DataMember(Name="map_string", EmitDefaultValue=false)] - public Dictionary MapString { get; set; } + [DataMember(Name="map_property", EmitDefaultValue=false)] + public Dictionary MapProperty { get; set; } /// - /// Gets or Sets MapNumber + /// Gets or Sets MapOfMapProperty /// - [DataMember(Name="map_number", EmitDefaultValue=false)] - public Dictionary MapNumber { get; set; } - - /// - /// Gets or Sets MapInteger - /// - [DataMember(Name="map_integer", EmitDefaultValue=false)] - public Dictionary MapInteger { get; set; } - - /// - /// Gets or Sets MapBoolean - /// - [DataMember(Name="map_boolean", EmitDefaultValue=false)] - public Dictionary MapBoolean { get; set; } - - /// - /// Gets or Sets MapArrayInteger - /// - [DataMember(Name="map_array_integer", EmitDefaultValue=false)] - public Dictionary> MapArrayInteger { get; set; } - - /// - /// Gets or Sets MapArrayAnytype - /// - [DataMember(Name="map_array_anytype", EmitDefaultValue=false)] - public Dictionary> MapArrayAnytype { get; set; } - - /// - /// Gets or Sets MapMapString - /// - [DataMember(Name="map_map_string", EmitDefaultValue=false)] - public Dictionary> MapMapString { get; set; } - - /// - /// Gets or Sets MapMapAnytype - /// - [DataMember(Name="map_map_anytype", EmitDefaultValue=false)] - public Dictionary> MapMapAnytype { get; set; } - - /// - /// Gets or Sets Anytype1 - /// - [DataMember(Name="anytype_1", EmitDefaultValue=false)] - public Object Anytype1 { get; set; } - - /// - /// Gets or Sets Anytype2 - /// - [DataMember(Name="anytype_2", EmitDefaultValue=false)] - public Object Anytype2 { get; set; } - - /// - /// Gets or Sets Anytype3 - /// - [DataMember(Name="anytype_3", EmitDefaultValue=false)] - public Object Anytype3 { get; set; } + [DataMember(Name="map_of_map_property", EmitDefaultValue=false)] + public Dictionary> MapOfMapProperty { get; set; } /// /// Returns the string presentation of the object @@ -136,17 +64,8 @@ public override string ToString() { var sb = new StringBuilder(); sb.Append("class AdditionalPropertiesClass {\n"); - sb.Append(" MapString: ").Append(MapString).Append("\n"); - sb.Append(" MapNumber: ").Append(MapNumber).Append("\n"); - sb.Append(" MapInteger: ").Append(MapInteger).Append("\n"); - sb.Append(" MapBoolean: ").Append(MapBoolean).Append("\n"); - sb.Append(" MapArrayInteger: ").Append(MapArrayInteger).Append("\n"); - sb.Append(" MapArrayAnytype: ").Append(MapArrayAnytype).Append("\n"); - sb.Append(" MapMapString: ").Append(MapMapString).Append("\n"); - sb.Append(" MapMapAnytype: ").Append(MapMapAnytype).Append("\n"); - sb.Append(" Anytype1: ").Append(Anytype1).Append("\n"); - sb.Append(" Anytype2: ").Append(Anytype2).Append("\n"); - sb.Append(" Anytype3: ").Append(Anytype3).Append("\n"); + sb.Append(" MapProperty: ").Append(MapProperty).Append("\n"); + sb.Append(" MapOfMapProperty: ").Append(MapOfMapProperty).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -182,67 +101,16 @@ public bool Equals(AdditionalPropertiesClass input) return ( - this.MapString == input.MapString || - this.MapString != null && - input.MapString != null && - this.MapString.SequenceEqual(input.MapString) - ) && - ( - this.MapNumber == input.MapNumber || - this.MapNumber != null && - input.MapNumber != null && - this.MapNumber.SequenceEqual(input.MapNumber) - ) && - ( - this.MapInteger == input.MapInteger || - this.MapInteger != null && - input.MapInteger != null && - this.MapInteger.SequenceEqual(input.MapInteger) - ) && - ( - this.MapBoolean == input.MapBoolean || - this.MapBoolean != null && - input.MapBoolean != null && - this.MapBoolean.SequenceEqual(input.MapBoolean) - ) && - ( - this.MapArrayInteger == input.MapArrayInteger || - this.MapArrayInteger != null && - input.MapArrayInteger != null && - this.MapArrayInteger.SequenceEqual(input.MapArrayInteger) - ) && - ( - this.MapArrayAnytype == input.MapArrayAnytype || - this.MapArrayAnytype != null && - input.MapArrayAnytype != null && - this.MapArrayAnytype.SequenceEqual(input.MapArrayAnytype) - ) && - ( - this.MapMapString == input.MapMapString || - this.MapMapString != null && - input.MapMapString != null && - this.MapMapString.SequenceEqual(input.MapMapString) - ) && - ( - this.MapMapAnytype == input.MapMapAnytype || - this.MapMapAnytype != null && - input.MapMapAnytype != null && - this.MapMapAnytype.SequenceEqual(input.MapMapAnytype) - ) && - ( - this.Anytype1 == input.Anytype1 || - (this.Anytype1 != null && - this.Anytype1.Equals(input.Anytype1)) - ) && - ( - this.Anytype2 == input.Anytype2 || - (this.Anytype2 != null && - this.Anytype2.Equals(input.Anytype2)) + this.MapProperty == input.MapProperty || + this.MapProperty != null && + input.MapProperty != null && + this.MapProperty.SequenceEqual(input.MapProperty) ) && ( - this.Anytype3 == input.Anytype3 || - (this.Anytype3 != null && - this.Anytype3.Equals(input.Anytype3)) + this.MapOfMapProperty == input.MapOfMapProperty || + this.MapOfMapProperty != null && + input.MapOfMapProperty != null && + this.MapOfMapProperty.SequenceEqual(input.MapOfMapProperty) ); } @@ -255,28 +123,10 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this.MapString != null) - hashCode = hashCode * 59 + this.MapString.GetHashCode(); - if (this.MapNumber != null) - hashCode = hashCode * 59 + this.MapNumber.GetHashCode(); - if (this.MapInteger != null) - hashCode = hashCode * 59 + this.MapInteger.GetHashCode(); - if (this.MapBoolean != null) - hashCode = hashCode * 59 + this.MapBoolean.GetHashCode(); - if (this.MapArrayInteger != null) - hashCode = hashCode * 59 + this.MapArrayInteger.GetHashCode(); - if (this.MapArrayAnytype != null) - hashCode = hashCode * 59 + this.MapArrayAnytype.GetHashCode(); - if (this.MapMapString != null) - hashCode = hashCode * 59 + this.MapMapString.GetHashCode(); - if (this.MapMapAnytype != null) - hashCode = hashCode * 59 + this.MapMapAnytype.GetHashCode(); - if (this.Anytype1 != null) - hashCode = hashCode * 59 + this.Anytype1.GetHashCode(); - if (this.Anytype2 != null) - hashCode = hashCode * 59 + this.Anytype2.GetHashCode(); - if (this.Anytype3 != null) - hashCode = hashCode * 59 + this.Anytype3.GetHashCode(); + if (this.MapProperty != null) + hashCode = hashCode * 59 + this.MapProperty.GetHashCode(); + if (this.MapOfMapProperty != null) + hashCode = hashCode * 59 + this.MapOfMapProperty.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/EnumTest.cs index c203d90263d1..cabf26a60aad 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/EnumTest.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/EnumTest.cs @@ -145,9 +145,24 @@ public enum EnumNumberEnum /// /// Gets or Sets OuterEnum /// - [DataMember(Name="outerEnum", EmitDefaultValue=false)] + [DataMember(Name="outerEnum", EmitDefaultValue=true)] public OuterEnum? OuterEnum { get; set; } /// + /// Gets or Sets OuterEnumInteger + /// + [DataMember(Name="outerEnumInteger", EmitDefaultValue=false)] + public OuterEnumInteger? OuterEnumInteger { get; set; } + /// + /// Gets or Sets OuterEnumDefaultValue + /// + [DataMember(Name="outerEnumDefaultValue", EmitDefaultValue=false)] + public OuterEnumDefaultValue? OuterEnumDefaultValue { get; set; } + /// + /// Gets or Sets OuterEnumIntegerDefaultValue + /// + [DataMember(Name="outerEnumIntegerDefaultValue", EmitDefaultValue=false)] + public OuterEnumIntegerDefaultValue? OuterEnumIntegerDefaultValue { get; set; } + /// /// Initializes a new instance of the class. /// [JsonConstructorAttribute] @@ -160,7 +175,10 @@ protected EnumTest() { } /// enumInteger. /// enumNumber. /// outerEnum. - public EnumTest(EnumStringEnum? enumString = default(EnumStringEnum?), EnumStringRequiredEnum enumStringRequired = default(EnumStringRequiredEnum), EnumIntegerEnum? enumInteger = default(EnumIntegerEnum?), EnumNumberEnum? enumNumber = default(EnumNumberEnum?), OuterEnum outerEnum = default(OuterEnum)) + /// outerEnumInteger. + /// outerEnumDefaultValue. + /// outerEnumIntegerDefaultValue. + public EnumTest(EnumStringEnum? enumString = default(EnumStringEnum?), EnumStringRequiredEnum enumStringRequired = default(EnumStringRequiredEnum), EnumIntegerEnum? enumInteger = default(EnumIntegerEnum?), EnumNumberEnum? enumNumber = default(EnumNumberEnum?), OuterEnum outerEnum = default(OuterEnum), OuterEnumInteger outerEnumInteger = default(OuterEnumInteger), OuterEnumDefaultValue outerEnumDefaultValue = default(OuterEnumDefaultValue), OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue = default(OuterEnumIntegerDefaultValue)) { // to ensure "enumStringRequired" is required (not null) if (enumStringRequired == null) @@ -172,10 +190,14 @@ protected EnumTest() { } this.EnumStringRequired = enumStringRequired; } + this.OuterEnum = outerEnum; this.EnumString = enumString; this.EnumInteger = enumInteger; this.EnumNumber = enumNumber; this.OuterEnum = outerEnum; + this.OuterEnumInteger = outerEnumInteger; + this.OuterEnumDefaultValue = outerEnumDefaultValue; + this.OuterEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; } @@ -183,6 +205,9 @@ protected EnumTest() { } + + + /// /// Returns the string presentation of the object /// @@ -196,6 +221,9 @@ public override string ToString() sb.Append(" EnumInteger: ").Append(EnumInteger).Append("\n"); sb.Append(" EnumNumber: ").Append(EnumNumber).Append("\n"); sb.Append(" OuterEnum: ").Append(OuterEnum).Append("\n"); + sb.Append(" OuterEnumInteger: ").Append(OuterEnumInteger).Append("\n"); + sb.Append(" OuterEnumDefaultValue: ").Append(OuterEnumDefaultValue).Append("\n"); + sb.Append(" OuterEnumIntegerDefaultValue: ").Append(OuterEnumIntegerDefaultValue).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -254,6 +282,21 @@ public bool Equals(EnumTest input) this.OuterEnum == input.OuterEnum || (this.OuterEnum != null && this.OuterEnum.Equals(input.OuterEnum)) + ) && + ( + this.OuterEnumInteger == input.OuterEnumInteger || + (this.OuterEnumInteger != null && + this.OuterEnumInteger.Equals(input.OuterEnumInteger)) + ) && + ( + this.OuterEnumDefaultValue == input.OuterEnumDefaultValue || + (this.OuterEnumDefaultValue != null && + this.OuterEnumDefaultValue.Equals(input.OuterEnumDefaultValue)) + ) && + ( + this.OuterEnumIntegerDefaultValue == input.OuterEnumIntegerDefaultValue || + (this.OuterEnumIntegerDefaultValue != null && + this.OuterEnumIntegerDefaultValue.Equals(input.OuterEnumIntegerDefaultValue)) ); } @@ -276,6 +319,12 @@ public override int GetHashCode() hashCode = hashCode * 59 + this.EnumNumber.GetHashCode(); if (this.OuterEnum != null) hashCode = hashCode * 59 + this.OuterEnum.GetHashCode(); + if (this.OuterEnumInteger != null) + hashCode = hashCode * 59 + this.OuterEnumInteger.GetHashCode(); + if (this.OuterEnumDefaultValue != null) + hashCode = hashCode * 59 + this.OuterEnumDefaultValue.GetHashCode(); + if (this.OuterEnumIntegerDefaultValue != null) + hashCode = hashCode * 59 + this.OuterEnumIntegerDefaultValue.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/Foo.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/Foo.cs index c82a275a59bc..91dfc061b89e 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/Foo.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/Foo.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/FormatTest.cs index d5e62e6762b5..ac0d761e5fbd 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/FormatTest.cs @@ -54,7 +54,9 @@ protected FormatTest() { } /// dateTime. /// uuid. /// password (required). - public FormatTest(int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), decimal? number = default(decimal?), float? _float = default(float?), double? _double = default(double?), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), Guid? uuid = default(Guid?), string password = default(string)) + /// A string that is a 10 digit number. Can have leading zeros.. + /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.. + public FormatTest(int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), decimal? number = default(decimal?), float? _float = default(float?), double? _double = default(double?), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), Guid? uuid = default(Guid?), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string)) { // to ensure "number" is required (not null) if (number == null) @@ -105,6 +107,8 @@ protected FormatTest() { } this.Binary = binary; this.DateTime = dateTime; this.Uuid = uuid; + this.PatternWithDigits = patternWithDigits; + this.PatternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; } /// @@ -186,6 +190,20 @@ protected FormatTest() { } [DataMember(Name="password", EmitDefaultValue=false)] public string Password { get; set; } + /// + /// A string that is a 10 digit number. Can have leading zeros. + /// + /// A string that is a 10 digit number. Can have leading zeros. + [DataMember(Name="pattern_with_digits", EmitDefaultValue=false)] + public string PatternWithDigits { get; set; } + + /// + /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + /// + /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + [DataMember(Name="pattern_with_digits_and_delimiter", EmitDefaultValue=false)] + public string PatternWithDigitsAndDelimiter { get; set; } + /// /// Returns the string presentation of the object /// @@ -207,6 +225,8 @@ public override string ToString() sb.Append(" DateTime: ").Append(DateTime).Append("\n"); sb.Append(" Uuid: ").Append(Uuid).Append("\n"); sb.Append(" Password: ").Append(Password).Append("\n"); + sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n"); + sb.Append(" PatternWithDigitsAndDelimiter: ").Append(PatternWithDigitsAndDelimiter).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -305,6 +325,16 @@ public bool Equals(FormatTest input) this.Password == input.Password || (this.Password != null && this.Password.Equals(input.Password)) + ) && + ( + this.PatternWithDigits == input.PatternWithDigits || + (this.PatternWithDigits != null && + this.PatternWithDigits.Equals(input.PatternWithDigits)) + ) && + ( + this.PatternWithDigitsAndDelimiter == input.PatternWithDigitsAndDelimiter || + (this.PatternWithDigitsAndDelimiter != null && + this.PatternWithDigitsAndDelimiter.Equals(input.PatternWithDigitsAndDelimiter)) ); } @@ -343,6 +373,10 @@ public override int GetHashCode() hashCode = hashCode * 59 + this.Uuid.GetHashCode(); if (this.Password != null) hashCode = hashCode * 59 + this.Password.GetHashCode(); + if (this.PatternWithDigits != null) + hashCode = hashCode * 59 + this.PatternWithDigits.GetHashCode(); + if (this.PatternWithDigitsAndDelimiter != null) + hashCode = hashCode * 59 + this.PatternWithDigitsAndDelimiter.GetHashCode(); return hashCode; } } @@ -453,6 +487,20 @@ public virtual void OnPropertyChanged(string propertyName) yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" }); } + // PatternWithDigits (string) pattern + Regex regexPatternWithDigits = new Regex(@"^\\d{10}$", RegexOptions.CultureInvariant); + if (false == regexPatternWithDigits.Match(this.PatternWithDigits).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" }); + } + + // PatternWithDigitsAndDelimiter (string) pattern + Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + if (false == regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" }); + } + yield break; } } diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/HealthCheckResult.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/HealthCheckResult.cs index cd7c74be882b..46f6afb0ebdc 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/HealthCheckResult.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/HealthCheckResult.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -40,12 +40,13 @@ public partial class HealthCheckResult : IEquatable, IValida public HealthCheckResult(string nullableMessage = default(string)) { this.NullableMessage = nullableMessage; + this.NullableMessage = nullableMessage; } /// /// Gets or Sets NullableMessage /// - [DataMember(Name="NullableMessage", EmitDefaultValue=false)] + [DataMember(Name="NullableMessage", EmitDefaultValue=true)] public string NullableMessage { get; set; } /// diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/InlineObject.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/InlineObject.cs index 4dae13e897f7..2c8685567429 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/InlineObject.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/InlineObject.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/InlineObject1.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/InlineObject1.cs index 073d6102999f..54715ccbd7da 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/InlineObject1.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/InlineObject1.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/InlineObject2.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/InlineObject2.cs index e10d573f9e1a..3031f073b34f 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/InlineObject2.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/InlineObject2.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -161,6 +161,7 @@ public bool Equals(InlineObject2 input) ( this.EnumFormStringArray == input.EnumFormStringArray || this.EnumFormStringArray != null && + input.EnumFormStringArray != null && this.EnumFormStringArray.SequenceEqual(input.EnumFormStringArray) ) && ( diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/InlineObject3.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/InlineObject3.cs index aa6cdeac31b8..744c4c602112 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/InlineObject3.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/InlineObject3.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -66,6 +66,7 @@ protected InlineObject3() { } { this.Number = number; } + // to ensure "_double" is required (not null) if (_double == null) { @@ -75,6 +76,7 @@ protected InlineObject3() { } { this.Double = _double; } + // to ensure "patternWithoutDelimiter" is required (not null) if (patternWithoutDelimiter == null) { @@ -84,6 +86,7 @@ protected InlineObject3() { } { this.PatternWithoutDelimiter = patternWithoutDelimiter; } + // to ensure "_byte" is required (not null) if (_byte == null) { @@ -93,6 +96,7 @@ protected InlineObject3() { } { this.Byte = _byte; } + this.Integer = integer; this.Int32 = int32; this.Int64 = int64; diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/InlineObject4.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/InlineObject4.cs index 6d19e0c9ede5..fe31b9e593f6 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/InlineObject4.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/InlineObject4.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -54,6 +54,7 @@ protected InlineObject4() { } { this.Param = param; } + // to ensure "param2" is required (not null) if (param2 == null) { @@ -63,6 +64,7 @@ protected InlineObject4() { } { this.Param2 = param2; } + } /// diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/InlineObject5.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/InlineObject5.cs index 45346f6e4c73..8acf08260d5a 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/InlineObject5.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/InlineObject5.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -54,6 +54,7 @@ protected InlineObject5() { } { this.RequiredFile = requiredFile; } + this.AdditionalMetadata = additionalMetadata; } diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/InlineResponseDefault.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/InlineResponseDefault.cs index 39cff5c0cb14..d81deb9eb9d9 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/InlineResponseDefault.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/InlineResponseDefault.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/NullableClass.cs index 5a5488e62f7f..326fc3ba9208 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/NullableClass.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/NullableClass.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -50,6 +50,16 @@ public partial class NullableClass : Dictionary, IEquatableobjectItemsNullable. public NullableClass(int? integerProp = default(int?), decimal? numberProp = default(decimal?), bool? booleanProp = default(bool?), string stringProp = default(string), DateTime? dateProp = default(DateTime?), DateTime? datetimeProp = default(DateTime?), List arrayNullableProp = default(List), List arrayAndItemsNullableProp = default(List), List arrayItemsNullable = default(List), Dictionary objectNullableProp = default(Dictionary), Dictionary objectAndItemsNullableProp = default(Dictionary), Dictionary objectItemsNullable = default(Dictionary)) : base() { + this.IntegerProp = integerProp; + this.NumberProp = numberProp; + this.BooleanProp = booleanProp; + this.StringProp = stringProp; + this.DateProp = dateProp; + this.DatetimeProp = datetimeProp; + this.ArrayNullableProp = arrayNullableProp; + this.ArrayAndItemsNullableProp = arrayAndItemsNullableProp; + this.ObjectNullableProp = objectNullableProp; + this.ObjectAndItemsNullableProp = objectAndItemsNullableProp; this.IntegerProp = integerProp; this.NumberProp = numberProp; this.BooleanProp = booleanProp; @@ -67,50 +77,50 @@ public partial class NullableClass : Dictionary, IEquatable /// Gets or Sets IntegerProp /// - [DataMember(Name="integer_prop", EmitDefaultValue=false)] + [DataMember(Name="integer_prop", EmitDefaultValue=true)] public int? IntegerProp { get; set; } /// /// Gets or Sets NumberProp /// - [DataMember(Name="number_prop", EmitDefaultValue=false)] + [DataMember(Name="number_prop", EmitDefaultValue=true)] public decimal? NumberProp { get; set; } /// /// Gets or Sets BooleanProp /// - [DataMember(Name="boolean_prop", EmitDefaultValue=false)] + [DataMember(Name="boolean_prop", EmitDefaultValue=true)] public bool? BooleanProp { get; set; } /// /// Gets or Sets StringProp /// - [DataMember(Name="string_prop", EmitDefaultValue=false)] + [DataMember(Name="string_prop", EmitDefaultValue=true)] public string StringProp { get; set; } /// /// Gets or Sets DateProp /// - [DataMember(Name="date_prop", EmitDefaultValue=false)] + [DataMember(Name="date_prop", EmitDefaultValue=true)] [JsonConverter(typeof(OpenAPIDateConverter))] public DateTime? DateProp { get; set; } /// /// Gets or Sets DatetimeProp /// - [DataMember(Name="datetime_prop", EmitDefaultValue=false)] + [DataMember(Name="datetime_prop", EmitDefaultValue=true)] public DateTime? DatetimeProp { get; set; } /// /// Gets or Sets ArrayNullableProp /// - [DataMember(Name="array_nullable_prop", EmitDefaultValue=false)] + [DataMember(Name="array_nullable_prop", EmitDefaultValue=true)] public List ArrayNullableProp { get; set; } /// /// Gets or Sets ArrayAndItemsNullableProp /// - [DataMember(Name="array_and_items_nullable_prop", EmitDefaultValue=false)] + [DataMember(Name="array_and_items_nullable_prop", EmitDefaultValue=true)] public List ArrayAndItemsNullableProp { get; set; } /// @@ -122,13 +132,13 @@ public partial class NullableClass : Dictionary, IEquatable /// Gets or Sets ObjectNullableProp /// - [DataMember(Name="object_nullable_prop", EmitDefaultValue=false)] + [DataMember(Name="object_nullable_prop", EmitDefaultValue=true)] public Dictionary ObjectNullableProp { get; set; } /// /// Gets or Sets ObjectAndItemsNullableProp /// - [DataMember(Name="object_and_items_nullable_prop", EmitDefaultValue=false)] + [DataMember(Name="object_and_items_nullable_prop", EmitDefaultValue=true)] public Dictionary ObjectAndItemsNullableProp { get; set; } /// @@ -225,31 +235,37 @@ public bool Equals(NullableClass input) ( this.ArrayNullableProp == input.ArrayNullableProp || this.ArrayNullableProp != null && + input.ArrayNullableProp != null && this.ArrayNullableProp.SequenceEqual(input.ArrayNullableProp) ) && base.Equals(input) && ( this.ArrayAndItemsNullableProp == input.ArrayAndItemsNullableProp || this.ArrayAndItemsNullableProp != null && + input.ArrayAndItemsNullableProp != null && this.ArrayAndItemsNullableProp.SequenceEqual(input.ArrayAndItemsNullableProp) ) && base.Equals(input) && ( this.ArrayItemsNullable == input.ArrayItemsNullable || this.ArrayItemsNullable != null && + input.ArrayItemsNullable != null && this.ArrayItemsNullable.SequenceEqual(input.ArrayItemsNullable) ) && base.Equals(input) && ( this.ObjectNullableProp == input.ObjectNullableProp || this.ObjectNullableProp != null && + input.ObjectNullableProp != null && this.ObjectNullableProp.SequenceEqual(input.ObjectNullableProp) ) && base.Equals(input) && ( this.ObjectAndItemsNullableProp == input.ObjectAndItemsNullableProp || this.ObjectAndItemsNullableProp != null && + input.ObjectAndItemsNullableProp != null && this.ObjectAndItemsNullableProp.SequenceEqual(input.ObjectAndItemsNullableProp) ) && base.Equals(input) && ( this.ObjectItemsNullable == input.ObjectItemsNullable || this.ObjectItemsNullable != null && + input.ObjectItemsNullable != null && this.ObjectItemsNullable.SequenceEqual(input.ObjectItemsNullable) ); } diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs index 747888328380..929ec2f35735 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/OuterEnumInteger.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/OuterEnumInteger.cs index efda7884efb5..17167a170170 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/OuterEnumInteger.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/OuterEnumInteger.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs index b5420de878c3..7bc889406e4f 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/.openapi-generator/VERSION b/samples/client/petstore/dart/flutter_petstore/openapi/.openapi-generator/VERSION index 06b5019af3f4..83a328a9227e 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/.openapi-generator/VERSION +++ b/samples/client/petstore/dart/flutter_petstore/openapi/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.1-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/.travis.yml b/samples/client/petstore/dart/flutter_petstore/openapi/.travis.yml index 82b19541fa43..d0758bc9f0d6 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/.travis.yml +++ b/samples/client/petstore/dart/flutter_petstore/openapi/.travis.yml @@ -3,7 +3,7 @@ language: dart dart: # Install a specific stable release -- "1.24.3" +- "2.2.0" install: - pub get diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/README.md b/samples/client/petstore/dart/flutter_petstore/openapi/README.md index 8520a219f887..04d368bd8630 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/README.md +++ b/samples/client/petstore/dart/flutter_petstore/openapi/README.md @@ -44,13 +44,13 @@ Please follow the [installation procedure](#installation--usage) and then run th import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; var api_instance = new PetApi(); -var body = new Pet(); // Pet | Pet object that needs to be added to the store +var pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - api_instance.addPet(body); + api_instance.addPet(pet); } catch (e) { print("Exception when calling PetApi->addPet: $e\n"); } @@ -89,6 +89,8 @@ Class | Method | HTTP request | Description - [ApiResponse](docs//ApiResponse.md) - [Category](docs//Category.md) + - [InlineObject](docs//InlineObject.md) + - [InlineObject1](docs//InlineObject1.md) - [Order](docs//Order.md) - [Pet](docs//Pet.md) - [Tag](docs//Tag.md) @@ -104,6 +106,12 @@ Class | Method | HTTP request | Description - **API key parameter name**: api_key - **Location**: HTTP header +## auth_cookie + +- **Type**: API key +- **API key parameter name**: AUTH_KEY +- **Location**: + ## petstore_auth - **Type**: OAuth diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/docs/InlineObject.md b/samples/client/petstore/dart/flutter_petstore/openapi/docs/InlineObject.md new file mode 100644 index 000000000000..1789b30bb816 --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/openapi/docs/InlineObject.md @@ -0,0 +1,16 @@ +# openapi.model.InlineObject + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Updated name of the pet | [optional] [default to null] +**status** | **String** | Updated status of the pet | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/docs/InlineObject1.md b/samples/client/petstore/dart/flutter_petstore/openapi/docs/InlineObject1.md new file mode 100644 index 000000000000..a5c2c120129c --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/openapi/docs/InlineObject1.md @@ -0,0 +1,16 @@ +# openapi.model.InlineObject1 + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**additionalMetadata** | **String** | Additional data to pass to server | [optional] [default to null] +**file** | [**MultipartFile**](File.md) | file to upload | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/docs/PetApi.md b/samples/client/petstore/dart/flutter_petstore/openapi/docs/PetApi.md index 5780e7f38022..b4d49655d4c9 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/docs/PetApi.md +++ b/samples/client/petstore/dart/flutter_petstore/openapi/docs/PetApi.md @@ -20,7 +20,7 @@ Method | HTTP request | Description # **addPet** -> addPet(body) +> addPet(pet) Add a new pet to the store @@ -28,13 +28,13 @@ Add a new pet to the store ```dart import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; var api_instance = new PetApi(); -var body = new Pet(); // Pet | Pet object that needs to be added to the store +var pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - api_instance.addPet(body); + api_instance.addPet(pet); } catch (e) { print("Exception when calling PetApi->addPet: $e\n"); } @@ -44,7 +44,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -70,7 +70,7 @@ Deletes a pet ```dart import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; var api_instance = new PetApi(); var petId = 789; // int | Pet id to delete @@ -116,7 +116,7 @@ Multiple status values can be provided with comma separated strings ```dart import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; var api_instance = new PetApi(); var status = []; // List | Status values that need to be considered for filter @@ -151,7 +151,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **findPetsByTags** -> List findPetsByTags(tags) +> List findPetsByTags(tags, maxCount) Finds Pets by tags @@ -161,13 +161,14 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 ```dart import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; var api_instance = new PetApi(); var tags = []; // List | Tags to filter by +var maxCount = 56; // int | Maximum number of items to return try { - var result = api_instance.findPetsByTags(tags); + var result = api_instance.findPetsByTags(tags, maxCount); print(result); } catch (e) { print("Exception when calling PetApi->findPetsByTags: $e\n"); @@ -179,6 +180,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **tags** | [**List<String>**](String.md)| Tags to filter by | [default to []] + **maxCount** | **int**| Maximum number of items to return | [optional] [default to null] ### Return type @@ -206,9 +208,9 @@ Returns a single pet ```dart import 'package:openapi/api.dart'; // TODO Configure API key authorization: api_key -//openapi.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY'; +//defaultApiClient.getAuthentication('api_key').apiKey = 'YOUR_API_KEY'; // uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//openapi.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer"; +//defaultApiClient.getAuthentication('api_key').apiKeyPrefix = 'Bearer'; var api_instance = new PetApi(); var petId = 789; // int | ID of pet to return @@ -243,7 +245,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **updatePet** -> updatePet(body) +> updatePet(pet) Update an existing pet @@ -251,13 +253,13 @@ Update an existing pet ```dart import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; var api_instance = new PetApi(); -var body = new Pet(); // Pet | Pet object that needs to be added to the store +var pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - api_instance.updatePet(body); + api_instance.updatePet(pet); } catch (e) { print("Exception when calling PetApi->updatePet: $e\n"); } @@ -267,7 +269,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -293,7 +295,7 @@ Updates a pet in the store with form data ```dart import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; var api_instance = new PetApi(); var petId = 789; // int | ID of pet that needs to be updated @@ -339,7 +341,7 @@ uploads an image ```dart import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; var api_instance = new PetApi(); var petId = 789; // int | ID of pet to update diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/docs/StoreApi.md b/samples/client/petstore/dart/flutter_petstore/openapi/docs/StoreApi.md index df76647f11ae..d329ef989138 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/docs/StoreApi.md +++ b/samples/client/petstore/dart/flutter_petstore/openapi/docs/StoreApi.md @@ -68,9 +68,9 @@ Returns a map of status codes to quantities ```dart import 'package:openapi/api.dart'; // TODO Configure API key authorization: api_key -//openapi.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY'; +//defaultApiClient.getAuthentication('api_key').apiKey = 'YOUR_API_KEY'; // uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//openapi.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer"; +//defaultApiClient.getAuthentication('api_key').apiKeyPrefix = 'Bearer'; var api_instance = new StoreApi(); @@ -144,7 +144,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **placeOrder** -> Order placeOrder(body) +> Order placeOrder(order) Place an order for a pet @@ -153,10 +153,10 @@ Place an order for a pet import 'package:openapi/api.dart'; var api_instance = new StoreApi(); -var body = new Order(); // Order | order placed for purchasing the pet +var order = new Order(); // Order | order placed for purchasing the pet try { - var result = api_instance.placeOrder(body); + var result = api_instance.placeOrder(order); print(result); } catch (e) { print("Exception when calling StoreApi->placeOrder: $e\n"); @@ -167,7 +167,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | + **order** | [**Order**](Order.md)| order placed for purchasing the pet | ### Return type @@ -179,7 +179,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/xml, application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/docs/UserApi.md b/samples/client/petstore/dart/flutter_petstore/openapi/docs/UserApi.md index 5e0605c6ea08..857068d291d5 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/docs/UserApi.md +++ b/samples/client/petstore/dart/flutter_petstore/openapi/docs/UserApi.md @@ -20,7 +20,7 @@ Method | HTTP request | Description # **createUser** -> createUser(body) +> createUser(user) Create user @@ -29,12 +29,16 @@ This can only be done by the logged in user. ### Example ```dart import 'package:openapi/api.dart'; +// TODO Configure API key authorization: auth_cookie +//defaultApiClient.getAuthentication('auth_cookie').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('auth_cookie').apiKeyPrefix = 'Bearer'; var api_instance = new UserApi(); -var body = new User(); // User | Created user object +var user = new User(); // User | Created user object try { - api_instance.createUser(body); + api_instance.createUser(user); } catch (e) { print("Exception when calling UserApi->createUser: $e\n"); } @@ -44,7 +48,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | + **user** | [**User**](User.md)| Created user object | ### Return type @@ -52,29 +56,33 @@ void (empty response body) ### Authorization -No authorization required +[auth_cookie](../README.md#auth_cookie) ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **createUsersWithArrayInput** -> createUsersWithArrayInput(body) +> createUsersWithArrayInput(user) Creates list of users with given input array ### Example ```dart import 'package:openapi/api.dart'; +// TODO Configure API key authorization: auth_cookie +//defaultApiClient.getAuthentication('auth_cookie').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('auth_cookie').apiKeyPrefix = 'Bearer'; var api_instance = new UserApi(); -var body = [new List<User>()]; // List | List of user object +var user = [new List<User>()]; // List | List of user object try { - api_instance.createUsersWithArrayInput(body); + api_instance.createUsersWithArrayInput(user); } catch (e) { print("Exception when calling UserApi->createUsersWithArrayInput: $e\n"); } @@ -84,7 +92,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **user** | [**List<User>**](User.md)| List of user object | ### Return type @@ -92,29 +100,33 @@ void (empty response body) ### Authorization -No authorization required +[auth_cookie](../README.md#auth_cookie) ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **createUsersWithListInput** -> createUsersWithListInput(body) +> createUsersWithListInput(user) Creates list of users with given input array ### Example ```dart import 'package:openapi/api.dart'; +// TODO Configure API key authorization: auth_cookie +//defaultApiClient.getAuthentication('auth_cookie').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('auth_cookie').apiKeyPrefix = 'Bearer'; var api_instance = new UserApi(); -var body = [new List<User>()]; // List | List of user object +var user = [new List<User>()]; // List | List of user object try { - api_instance.createUsersWithListInput(body); + api_instance.createUsersWithListInput(user); } catch (e) { print("Exception when calling UserApi->createUsersWithListInput: $e\n"); } @@ -124,7 +136,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **user** | [**List<User>**](User.md)| List of user object | ### Return type @@ -132,11 +144,11 @@ void (empty response body) ### Authorization -No authorization required +[auth_cookie](../README.md#auth_cookie) ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -151,6 +163,10 @@ This can only be done by the logged in user. ### Example ```dart import 'package:openapi/api.dart'; +// TODO Configure API key authorization: auth_cookie +//defaultApiClient.getAuthentication('auth_cookie').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('auth_cookie').apiKeyPrefix = 'Bearer'; var api_instance = new UserApi(); var username = username_example; // String | The name that needs to be deleted @@ -174,7 +190,7 @@ void (empty response body) ### Authorization -No authorization required +[auth_cookie](../README.md#auth_cookie) ### HTTP request headers @@ -275,6 +291,10 @@ Logs out current logged in user session ### Example ```dart import 'package:openapi/api.dart'; +// TODO Configure API key authorization: auth_cookie +//defaultApiClient.getAuthentication('auth_cookie').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('auth_cookie').apiKeyPrefix = 'Bearer'; var api_instance = new UserApi(); @@ -294,7 +314,7 @@ void (empty response body) ### Authorization -No authorization required +[auth_cookie](../README.md#auth_cookie) ### HTTP request headers @@ -304,7 +324,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **updateUser** -> updateUser(username, body) +> updateUser(username, user) Updated user @@ -313,13 +333,17 @@ This can only be done by the logged in user. ### Example ```dart import 'package:openapi/api.dart'; +// TODO Configure API key authorization: auth_cookie +//defaultApiClient.getAuthentication('auth_cookie').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('auth_cookie').apiKeyPrefix = 'Bearer'; var api_instance = new UserApi(); var username = username_example; // String | name that need to be deleted -var body = new User(); // User | Updated user object +var user = new User(); // User | Updated user object try { - api_instance.updateUser(username, body); + api_instance.updateUser(username, user); } catch (e) { print("Exception when calling UserApi->updateUser: $e\n"); } @@ -330,7 +354,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| name that need to be deleted | [default to null] - **body** | [**User**](User.md)| Updated user object | + **user** | [**User**](User.md)| Updated user object | ### Return type @@ -338,11 +362,11 @@ void (empty response body) ### Authorization -No authorization required +[auth_cookie](../README.md#auth_cookie) ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api.dart index 9a64a5342b4a..675ff37a46b8 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api.dart @@ -18,10 +18,12 @@ part 'api/user_api.dart'; part 'model/api_response.dart'; part 'model/category.dart'; +part 'model/inline_object.dart'; +part 'model/inline_object1.dart'; part 'model/order.dart'; part 'model/pet.dart'; part 'model/tag.dart'; part 'model/user.dart'; -ApiClient defaultApiClient = new ApiClient(); +ApiClient defaultApiClient = ApiClient(); diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/pet_api.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/pet_api.dart index 6ffc146490b8..203fe2d81c6b 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/pet_api.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/pet_api.dart @@ -10,12 +10,12 @@ class PetApi { /// Add a new pet to the store /// /// - Future addPet(Pet body) async { - Object postBody = body; + Future addPet(Pet pet) async { + Object postBody = pet; // verify required params are set - if(body == null) { - throw new ApiException(400, "Missing required param: body"); + if(pet == null) { + throw new ApiException(400, "Missing required param: pet"); } // create path and map variables @@ -28,7 +28,7 @@ class PetApi { List contentTypes = ["application/json","application/xml"]; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { @@ -60,7 +60,7 @@ class PetApi { /// /// Future deletePet(int petId, { String apiKey }) async { - Object postBody = null; + Object postBody; // verify required params are set if(petId == null) { @@ -78,7 +78,7 @@ class PetApi { List contentTypes = []; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { @@ -110,7 +110,7 @@ class PetApi { /// /// Multiple status values can be provided with comma separated strings Future> findPetsByStatus(List status) async { - Object postBody = null; + Object postBody; // verify required params are set if(status == null) { @@ -128,7 +128,7 @@ class PetApi { List contentTypes = []; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { @@ -160,8 +160,8 @@ class PetApi { /// Finds Pets by tags /// /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - Future> findPetsByTags(List tags) async { - Object postBody = null; + Future> findPetsByTags(List tags, { int maxCount }) async { + Object postBody; // verify required params are set if(tags == null) { @@ -176,10 +176,13 @@ class PetApi { Map headerParams = {}; Map formParams = {}; queryParams.addAll(_convertParametersForCollectionFormat("csv", "tags", tags)); + if(maxCount != null) { + queryParams.addAll(_convertParametersForCollectionFormat("", "maxCount", maxCount)); + } List contentTypes = []; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { @@ -212,7 +215,7 @@ class PetApi { /// /// Returns a single pet Future getPetById(int petId) async { - Object postBody = null; + Object postBody; // verify required params are set if(petId == null) { @@ -229,7 +232,7 @@ class PetApi { List contentTypes = []; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = ["api_key"]; if(contentType.startsWith("multipart/form-data")) { @@ -261,12 +264,12 @@ class PetApi { /// Update an existing pet /// /// - Future updatePet(Pet body) async { - Object postBody = body; + Future updatePet(Pet pet) async { + Object postBody = pet; // verify required params are set - if(body == null) { - throw new ApiException(400, "Missing required param: body"); + if(pet == null) { + throw new ApiException(400, "Missing required param: pet"); } // create path and map variables @@ -279,7 +282,7 @@ class PetApi { List contentTypes = ["application/json","application/xml"]; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { @@ -311,7 +314,7 @@ class PetApi { /// /// Future updatePetWithForm(int petId, { String name, String status }) async { - Object postBody = null; + Object postBody; // verify required params are set if(petId == null) { @@ -328,7 +331,7 @@ class PetApi { List contentTypes = ["application/x-www-form-urlencoded"]; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { @@ -372,7 +375,7 @@ class PetApi { /// /// Future uploadFile(int petId, { String additionalMetadata, MultipartFile file }) async { - Object postBody = null; + Object postBody; // verify required params are set if(petId == null) { @@ -389,7 +392,7 @@ class PetApi { List contentTypes = ["multipart/form-data"]; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/store_api.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/store_api.dart index 7475aa4d9901..c23df6dc605f 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/store_api.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/store_api.dart @@ -11,7 +11,7 @@ class StoreApi { /// /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors Future deleteOrder(String orderId) async { - Object postBody = null; + Object postBody; // verify required params are set if(orderId == null) { @@ -28,7 +28,7 @@ class StoreApi { List contentTypes = []; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { @@ -60,7 +60,7 @@ class StoreApi { /// /// Returns a map of status codes to quantities Future> getInventory() async { - Object postBody = null; + Object postBody; // verify required params are set @@ -74,7 +74,7 @@ class StoreApi { List contentTypes = []; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = ["api_key"]; if(contentType.startsWith("multipart/form-data")) { @@ -108,7 +108,7 @@ class StoreApi { /// /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions Future getOrderById(int orderId) async { - Object postBody = null; + Object postBody; // verify required params are set if(orderId == null) { @@ -125,7 +125,7 @@ class StoreApi { List contentTypes = []; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { @@ -157,12 +157,12 @@ class StoreApi { /// Place an order for a pet /// /// - Future placeOrder(Order body) async { - Object postBody = body; + Future placeOrder(Order order) async { + Object postBody = order; // verify required params are set - if(body == null) { - throw new ApiException(400, "Missing required param: body"); + if(order == null) { + throw new ApiException(400, "Missing required param: order"); } // create path and map variables @@ -173,9 +173,9 @@ class StoreApi { Map headerParams = {}; Map formParams = {}; - List contentTypes = []; + List contentTypes = ["application/json"]; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/user_api.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/user_api.dart index 8f00081a8c4c..37a7ae17a6b4 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/user_api.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/user_api.dart @@ -10,12 +10,12 @@ class UserApi { /// Create user /// /// This can only be done by the logged in user. - Future createUser(User body) async { - Object postBody = body; + Future createUser(User user) async { + Object postBody = user; // verify required params are set - if(body == null) { - throw new ApiException(400, "Missing required param: body"); + if(user == null) { + throw new ApiException(400, "Missing required param: user"); } // create path and map variables @@ -26,10 +26,10 @@ class UserApi { Map headerParams = {}; Map formParams = {}; - List contentTypes = []; + List contentTypes = ["application/json"]; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - List authNames = []; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + List authNames = ["auth_cookie"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; @@ -59,12 +59,12 @@ class UserApi { /// Creates list of users with given input array /// /// - Future createUsersWithArrayInput(List body) async { - Object postBody = body; + Future createUsersWithArrayInput(List user) async { + Object postBody = user; // verify required params are set - if(body == null) { - throw new ApiException(400, "Missing required param: body"); + if(user == null) { + throw new ApiException(400, "Missing required param: user"); } // create path and map variables @@ -75,10 +75,10 @@ class UserApi { Map headerParams = {}; Map formParams = {}; - List contentTypes = []; + List contentTypes = ["application/json"]; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - List authNames = []; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + List authNames = ["auth_cookie"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; @@ -108,12 +108,12 @@ class UserApi { /// Creates list of users with given input array /// /// - Future createUsersWithListInput(List body) async { - Object postBody = body; + Future createUsersWithListInput(List user) async { + Object postBody = user; // verify required params are set - if(body == null) { - throw new ApiException(400, "Missing required param: body"); + if(user == null) { + throw new ApiException(400, "Missing required param: user"); } // create path and map variables @@ -124,10 +124,10 @@ class UserApi { Map headerParams = {}; Map formParams = {}; - List contentTypes = []; + List contentTypes = ["application/json"]; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - List authNames = []; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + List authNames = ["auth_cookie"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; @@ -158,7 +158,7 @@ class UserApi { /// /// This can only be done by the logged in user. Future deleteUser(String username) async { - Object postBody = null; + Object postBody; // verify required params are set if(username == null) { @@ -175,8 +175,8 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - List authNames = []; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + List authNames = ["auth_cookie"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; @@ -207,7 +207,7 @@ class UserApi { /// /// Future getUserByName(String username) async { - Object postBody = null; + Object postBody; // verify required params are set if(username == null) { @@ -224,7 +224,7 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { @@ -257,7 +257,7 @@ class UserApi { /// /// Future loginUser(String username, String password) async { - Object postBody = null; + Object postBody; // verify required params are set if(username == null) { @@ -279,7 +279,7 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { @@ -312,7 +312,7 @@ class UserApi { /// /// Future logoutUser() async { - Object postBody = null; + Object postBody; // verify required params are set @@ -326,8 +326,8 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - List authNames = []; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + List authNames = ["auth_cookie"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; @@ -357,15 +357,15 @@ class UserApi { /// Updated user /// /// This can only be done by the logged in user. - Future updateUser(String username, User body) async { - Object postBody = body; + Future updateUser(String username, User user) async { + Object postBody = user; // verify required params are set if(username == null) { throw new ApiException(400, "Missing required param: username"); } - if(body == null) { - throw new ApiException(400, "Missing required param: body"); + if(user == null) { + throw new ApiException(400, "Missing required param: user"); } // create path and map variables @@ -376,10 +376,10 @@ class UserApi { Map headerParams = {}; Map formParams = {}; - List contentTypes = []; + List contentTypes = ["application/json"]; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - List authNames = []; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + List authNames = ["auth_cookie"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_client.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_client.dart index b99ddeeccb19..e35c37c020c7 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_client.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_client.dart @@ -10,18 +10,19 @@ class QueryParam { class ApiClient { String basePath; - var client = new Client(); + var client = Client(); Map _defaultHeaderMap = {}; Map _authentications = {}; - final _RegList = new RegExp(r'^List<(.*)>$'); - final _RegMap = new RegExp(r'^Map$'); + final _regList = RegExp(r'^List<(.*)>$'); + final _regMap = RegExp(r'^Map$'); - ApiClient({this.basePath: "http://petstore.swagger.io/v2"}) { + ApiClient({this.basePath = "http://petstore.swagger.io/v2"}) { // Setup authentications (key: authentication name, value: authentication). - _authentications['api_key'] = new ApiKeyAuth("header", "api_key"); - _authentications['petstore_auth'] = new OAuth(); + _authentications['api_key'] = ApiKeyAuth("header", "api_key"); + _authentications['auth_cookie'] = ApiKeyAuth("query", "AUTH_KEY"); + _authentications['petstore_auth'] = OAuth(); } void addDefaultHeader(String key, String value) { @@ -40,36 +41,40 @@ class ApiClient { case 'double': return value is double ? value : double.parse('$value'); case 'ApiResponse': - return new ApiResponse.fromJson(value); + return ApiResponse.fromJson(value); case 'Category': - return new Category.fromJson(value); + return Category.fromJson(value); + case 'InlineObject': + return InlineObject.fromJson(value); + case 'InlineObject1': + return InlineObject1.fromJson(value); case 'Order': - return new Order.fromJson(value); + return Order.fromJson(value); case 'Pet': - return new Pet.fromJson(value); + return Pet.fromJson(value); case 'Tag': - return new Tag.fromJson(value); + return Tag.fromJson(value); case 'User': - return new User.fromJson(value); + return User.fromJson(value); default: { Match match; if (value is List && - (match = _RegList.firstMatch(targetType)) != null) { + (match = _regList.firstMatch(targetType)) != null) { var newTargetType = match[1]; return value.map((v) => _deserialize(v, newTargetType)).toList(); } else if (value is Map && - (match = _RegMap.firstMatch(targetType)) != null) { + (match = _regMap.firstMatch(targetType)) != null) { var newTargetType = match[1]; - return new Map.fromIterables(value.keys, + return Map.fromIterables(value.keys, value.values.map((v) => _deserialize(v, newTargetType))); } } } - } catch (e, stack) { - throw new ApiException.withInner(500, 'Exception during deserialization.', e, stack); + } on Exception catch (e, stack) { + throw ApiException.withInner(500, 'Exception during deserialization.', e, stack); } - throw new ApiException(500, 'Could not find a suitable class for deserialization'); + throw ApiException(500, 'Could not find a suitable class for deserialization'); } dynamic deserialize(String json, String targetType) { @@ -78,7 +83,7 @@ class ApiClient { if (targetType == 'String') return json; - var decodedJson = JSON.decode(json); + var decodedJson = jsonDecode(json); return _deserialize(decodedJson, targetType); } @@ -87,7 +92,7 @@ class ApiClient { if (obj == null) { serialized = ''; } else { - serialized = JSON.encode(obj); + serialized = json.encode(obj); } return serialized; } @@ -119,7 +124,7 @@ class ApiClient { headerParams['Content-Type'] = contentType; if(body is MultipartRequest) { - var request = new MultipartRequest(method, Uri.parse(url)); + var request = MultipartRequest(method, Uri.parse(url)); request.fields.addAll(body.fields); request.files.addAll(body.files); request.headers.addAll(body.headers); @@ -148,16 +153,14 @@ class ApiClient { void _updateParamsForAuth(List authNames, List queryParams, Map headerParams) { authNames.forEach((authName) { Authentication auth = _authentications[authName]; - if (auth == null) throw new ArgumentError("Authentication undefined: " + authName); + if (auth == null) throw ArgumentError("Authentication undefined: " + authName); auth.applyToParams(queryParams, headerParams); }); } - void setAccessToken(String accessToken) { - _authentications.forEach((key, auth) { - if (auth is OAuth) { - auth.setAccessToken(accessToken); - } - }); + T getAuthentication(String name) { + var authentication = _authentications[name]; + + return authentication is T ? authentication : null; } } diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_exception.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_exception.dart index f188fd125a4d..668abe2c96bc 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_exception.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_exception.dart @@ -2,9 +2,9 @@ part of openapi.api; class ApiException implements Exception { int code = 0; - String message = null; - Exception innerException = null; - StackTrace stackTrace = null; + String message; + Exception innerException; + StackTrace stackTrace; ApiException(this.code, this.message); @@ -17,7 +17,7 @@ class ApiException implements Exception { return "ApiException $code: $message"; } - return "ApiException $code: $message (Inner exception: ${innerException})\n\n" + + return "ApiException $code: $message (Inner exception: $innerException)\n\n" + stackTrace.toString(); } } diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_helper.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_helper.dart index 9c1497017e80..c57b111ca87d 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_helper.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_helper.dart @@ -11,7 +11,7 @@ Iterable _convertParametersForCollectionFormat( if (name == null || name.isEmpty || value == null) return params; if (value is! List) { - params.add(new QueryParam(name, parameterToString(value))); + params.add(QueryParam(name, parameterToString(value))); return params; } @@ -23,12 +23,12 @@ Iterable _convertParametersForCollectionFormat( : collectionFormat; // default: csv if (collectionFormat == "multi") { - return values.map((v) => new QueryParam(name, parameterToString(v))); + return values.map((v) => QueryParam(name, parameterToString(v))); } String delimiter = _delimiters[collectionFormat] ?? ","; - params.add(new QueryParam(name, values.map((v) => parameterToString(v)).join(delimiter))); + params.add(QueryParam(name, values.map((v) => parameterToString(v)).join(delimiter))); return params; } diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/api_key_auth.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/api_key_auth.dart index f9617f7ae4da..8384f0516ce2 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/api_key_auth.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/api_key_auth.dart @@ -4,22 +4,24 @@ class ApiKeyAuth implements Authentication { final String location; final String paramName; - String apiKey; + String _apiKey; String apiKeyPrefix; + set apiKey(String key) => _apiKey = key; + ApiKeyAuth(this.location, this.paramName); @override void applyToParams(List queryParams, Map headerParams) { String value; if (apiKeyPrefix != null) { - value = '$apiKeyPrefix $apiKey'; + value = '$apiKeyPrefix $_apiKey'; } else { - value = apiKey; + value = _apiKey; } if (location == 'query' && value != null) { - queryParams.add(new QueryParam(paramName, value)); + queryParams.add(QueryParam(paramName, value)); } else if (location == 'header' && value != null) { headerParams[paramName] = value; } diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/http_basic_auth.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/http_basic_auth.dart index 4e77ddcf6e68..da931fa2634c 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/http_basic_auth.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/http_basic_auth.dart @@ -2,13 +2,15 @@ part of openapi.api; class HttpBasicAuth implements Authentication { - String username; - String password; + String _username; + String _password; @override void applyToParams(List queryParams, Map headerParams) { - String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); - headerParams["Authorization"] = "Basic " + BASE64.encode(UTF8.encode(str)); + String str = (_username == null ? "" : _username) + ":" + (_password == null ? "" : _password); + headerParams["Authorization"] = "Basic " + base64.encode(utf8.encode(str)); } -} \ No newline at end of file + set username(String username) => _username = username; + set password(String password) => _password = password; +} diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/oauth.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/oauth.dart index 13bfd799743b..230471e44fc6 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/oauth.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/oauth.dart @@ -1,19 +1,16 @@ part of openapi.api; class OAuth implements Authentication { - String accessToken; + String _accessToken; - OAuth({this.accessToken}) { - } + OAuth({String accessToken}) : _accessToken = accessToken; @override void applyToParams(List queryParams, Map headerParams) { - if (accessToken != null) { - headerParams["Authorization"] = "Bearer " + accessToken; + if (_accessToken != null) { + headerParams["Authorization"] = "Bearer $_accessToken"; } } - void setAccessToken(String accessToken) { - this.accessToken = accessToken; - } + set accessToken(String accessToken) => _accessToken = accessToken; } diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/api_response.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/api_response.dart index f2fddde347ae..3d37ea215773 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/api_response.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/api_response.dart @@ -19,36 +19,39 @@ class ApiResponse { if (json['code'] == null) { code = null; } else { - code = json['code']; + code = json['code']; } if (json['type'] == null) { type = null; } else { - type = json['type']; + type = json['type']; } if (json['message'] == null) { message = null; } else { - message = json['message']; + message = json['message']; } } Map toJson() { - return { - 'code': code, - 'type': type, - 'message': message - }; + Map json = {}; + if (code != null) + json['code'] = code; + if (type != null) + json['type'] = type; + if (message != null) + json['message'] = message; + return json; } static List listFromJson(List json) { return json == null ? new List() : json.map((value) => new ApiResponse.fromJson(value)).toList(); } - static Map mapFromJson(Map> json) { + static Map mapFromJson(Map json) { var map = new Map(); - if (json != null && json.length > 0) { - json.forEach((String key, Map value) => map[key] = new ApiResponse.fromJson(value)); + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic value) => map[key] = new ApiResponse.fromJson(value)); } return map; } diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/category.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/category.dart index 1750c6a0acb1..32a7c1e81aad 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/category.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/category.dart @@ -17,30 +17,32 @@ class Category { if (json['id'] == null) { id = null; } else { - id = json['id']; + id = json['id']; } if (json['name'] == null) { name = null; } else { - name = json['name']; + name = json['name']; } } Map toJson() { - return { - 'id': id, - 'name': name - }; + Map json = {}; + if (id != null) + json['id'] = id; + if (name != null) + json['name'] = name; + return json; } static List listFromJson(List json) { return json == null ? new List() : json.map((value) => new Category.fromJson(value)).toList(); } - static Map mapFromJson(Map> json) { + static Map mapFromJson(Map json) { var map = new Map(); - if (json != null && json.length > 0) { - json.forEach((String key, Map value) => map[key] = new Category.fromJson(value)); + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic value) => map[key] = new Category.fromJson(value)); } return map; } diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/inline_object.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/inline_object.dart new file mode 100644 index 000000000000..7d26c6522443 --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/inline_object.dart @@ -0,0 +1,50 @@ +part of openapi.api; + +class InlineObject { + /* Updated name of the pet */ + String name = null; + /* Updated status of the pet */ + String status = null; + InlineObject(); + + @override + String toString() { + return 'InlineObject[name=$name, status=$status, ]'; + } + + InlineObject.fromJson(Map json) { + if (json == null) return; + if (json['name'] == null) { + name = null; + } else { + name = json['name']; + } + if (json['status'] == null) { + status = null; + } else { + status = json['status']; + } + } + + Map toJson() { + Map json = {}; + if (name != null) + json['name'] = name; + if (status != null) + json['status'] = status; + return json; + } + + static List listFromJson(List json) { + return json == null ? new List() : json.map((value) => new InlineObject.fromJson(value)).toList(); + } + + static Map mapFromJson(Map json) { + var map = new Map(); + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic value) => map[key] = new InlineObject.fromJson(value)); + } + return map; + } +} + diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/inline_object1.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/inline_object1.dart new file mode 100644 index 000000000000..5e8982c1e342 --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/inline_object1.dart @@ -0,0 +1,50 @@ +part of openapi.api; + +class InlineObject1 { + /* Additional data to pass to server */ + String additionalMetadata = null; + /* file to upload */ + MultipartFile file = null; + InlineObject1(); + + @override + String toString() { + return 'InlineObject1[additionalMetadata=$additionalMetadata, file=$file, ]'; + } + + InlineObject1.fromJson(Map json) { + if (json == null) return; + if (json['additionalMetadata'] == null) { + additionalMetadata = null; + } else { + additionalMetadata = json['additionalMetadata']; + } + if (json['file'] == null) { + file = null; + } else { + file = new File.fromJson(json['file']); + } + } + + Map toJson() { + Map json = {}; + if (additionalMetadata != null) + json['additionalMetadata'] = additionalMetadata; + if (file != null) + json['file'] = file; + return json; + } + + static List listFromJson(List json) { + return json == null ? new List() : json.map((value) => new InlineObject1.fromJson(value)).toList(); + } + + static Map mapFromJson(Map json) { + var map = new Map(); + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic value) => map[key] = new InlineObject1.fromJson(value)); + } + return map; + } +} + diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/order.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/order.dart index 51d15f730415..c3966e6f9f23 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/order.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/order.dart @@ -26,17 +26,17 @@ class Order { if (json['id'] == null) { id = null; } else { - id = json['id']; + id = json['id']; } if (json['petId'] == null) { petId = null; } else { - petId = json['petId']; + petId = json['petId']; } if (json['quantity'] == null) { quantity = null; } else { - quantity = json['quantity']; + quantity = json['quantity']; } if (json['shipDate'] == null) { shipDate = null; @@ -46,34 +46,40 @@ class Order { if (json['status'] == null) { status = null; } else { - status = json['status']; + status = json['status']; } if (json['complete'] == null) { complete = null; } else { - complete = json['complete']; + complete = json['complete']; } } Map toJson() { - return { - 'id': id, - 'petId': petId, - 'quantity': quantity, - 'shipDate': shipDate == null ? '' : shipDate.toUtc().toIso8601String(), - 'status': status, - 'complete': complete - }; + Map json = {}; + if (id != null) + json['id'] = id; + if (petId != null) + json['petId'] = petId; + if (quantity != null) + json['quantity'] = quantity; + if (shipDate != null) + json['shipDate'] = shipDate == null ? null : shipDate.toUtc().toIso8601String(); + if (status != null) + json['status'] = status; + if (complete != null) + json['complete'] = complete; + return json; } static List listFromJson(List json) { return json == null ? new List() : json.map((value) => new Order.fromJson(value)).toList(); } - static Map mapFromJson(Map> json) { + static Map mapFromJson(Map json) { var map = new Map(); - if (json != null && json.length > 0) { - json.forEach((String key, Map value) => map[key] = new Order.fromJson(value)); + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic value) => map[key] = new Order.fromJson(value)); } return map; } diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/pet.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/pet.dart index c64406368d87..d8bdd2ef4076 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/pet.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/pet.dart @@ -26,7 +26,7 @@ class Pet { if (json['id'] == null) { id = null; } else { - id = json['id']; + id = json['id']; } if (json['category'] == null) { category = null; @@ -36,12 +36,12 @@ class Pet { if (json['name'] == null) { name = null; } else { - name = json['name']; + name = json['name']; } if (json['photoUrls'] == null) { photoUrls = null; } else { - photoUrls = (json['photoUrls'] as List).map((item) => item as String).toList(); + photoUrls = (json['photoUrls'] as List).cast(); } if (json['tags'] == null) { tags = null; @@ -51,29 +51,35 @@ class Pet { if (json['status'] == null) { status = null; } else { - status = json['status']; + status = json['status']; } } Map toJson() { - return { - 'id': id, - 'category': category, - 'name': name, - 'photoUrls': photoUrls, - 'tags': tags, - 'status': status - }; + Map json = {}; + if (id != null) + json['id'] = id; + if (category != null) + json['category'] = category; + if (name != null) + json['name'] = name; + if (photoUrls != null) + json['photoUrls'] = photoUrls; + if (tags != null) + json['tags'] = tags; + if (status != null) + json['status'] = status; + return json; } static List listFromJson(List json) { return json == null ? new List() : json.map((value) => new Pet.fromJson(value)).toList(); } - static Map mapFromJson(Map> json) { + static Map mapFromJson(Map json) { var map = new Map(); - if (json != null && json.length > 0) { - json.forEach((String key, Map value) => map[key] = new Pet.fromJson(value)); + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic value) => map[key] = new Pet.fromJson(value)); } return map; } diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/tag.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/tag.dart index 980c6e016302..ca53c8ae890f 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/tag.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/tag.dart @@ -17,30 +17,32 @@ class Tag { if (json['id'] == null) { id = null; } else { - id = json['id']; + id = json['id']; } if (json['name'] == null) { name = null; } else { - name = json['name']; + name = json['name']; } } Map toJson() { - return { - 'id': id, - 'name': name - }; + Map json = {}; + if (id != null) + json['id'] = id; + if (name != null) + json['name'] = name; + return json; } static List listFromJson(List json) { return json == null ? new List() : json.map((value) => new Tag.fromJson(value)).toList(); } - static Map mapFromJson(Map> json) { + static Map mapFromJson(Map json) { var map = new Map(); - if (json != null && json.length > 0) { - json.forEach((String key, Map value) => map[key] = new Tag.fromJson(value)); + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic value) => map[key] = new Tag.fromJson(value)); } return map; } diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/user.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/user.dart index 1555eb0a3ef5..1c5ef51fbaa4 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/user.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/user.dart @@ -29,66 +29,74 @@ class User { if (json['id'] == null) { id = null; } else { - id = json['id']; + id = json['id']; } if (json['username'] == null) { username = null; } else { - username = json['username']; + username = json['username']; } if (json['firstName'] == null) { firstName = null; } else { - firstName = json['firstName']; + firstName = json['firstName']; } if (json['lastName'] == null) { lastName = null; } else { - lastName = json['lastName']; + lastName = json['lastName']; } if (json['email'] == null) { email = null; } else { - email = json['email']; + email = json['email']; } if (json['password'] == null) { password = null; } else { - password = json['password']; + password = json['password']; } if (json['phone'] == null) { phone = null; } else { - phone = json['phone']; + phone = json['phone']; } if (json['userStatus'] == null) { userStatus = null; } else { - userStatus = json['userStatus']; + userStatus = json['userStatus']; } } Map toJson() { - return { - 'id': id, - 'username': username, - 'firstName': firstName, - 'lastName': lastName, - 'email': email, - 'password': password, - 'phone': phone, - 'userStatus': userStatus - }; + Map json = {}; + if (id != null) + json['id'] = id; + if (username != null) + json['username'] = username; + if (firstName != null) + json['firstName'] = firstName; + if (lastName != null) + json['lastName'] = lastName; + if (email != null) + json['email'] = email; + if (password != null) + json['password'] = password; + if (phone != null) + json['phone'] = phone; + if (userStatus != null) + json['userStatus'] = userStatus; + return json; } static List listFromJson(List json) { return json == null ? new List() : json.map((value) => new User.fromJson(value)).toList(); } - static Map mapFromJson(Map> json) { + static Map mapFromJson(Map json) { var map = new Map(); - if (json != null && json.length > 0) { - json.forEach((String key, Map value) => map[key] = new User.fromJson(value)); + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic value) => map[key] = new User.fromJson(value)); } return map; } diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/pubspec.yaml b/samples/client/petstore/dart/flutter_petstore/openapi/pubspec.yaml index b63f835e89b3..391fa5edec02 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/pubspec.yaml +++ b/samples/client/petstore/dart/flutter_petstore/openapi/pubspec.yaml @@ -1,6 +1,8 @@ name: openapi version: 1.0.0 description: OpenAPI API client +environment: + sdk: '>=2.0.0 <3.0.0' dependencies: http: '>=0.11.1 <0.13.0' dev_dependencies: diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/test/inline_object1_test.dart b/samples/client/petstore/dart/flutter_petstore/openapi/test/inline_object1_test.dart new file mode 100644 index 000000000000..7f129db28cb0 --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/openapi/test/inline_object1_test.dart @@ -0,0 +1,24 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for InlineObject1 +void main() { + var instance = new Pet(); + + group('test InlineObject1', () { + // Additional data to pass to server + // String additionalMetadata (default value: null) + test('to test the property `additionalMetadata`', () async { + // TODO + }); + + // file to upload + // MultipartFile file (default value: null) + test('to test the property `file`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/test/inline_object_test.dart b/samples/client/petstore/dart/flutter_petstore/openapi/test/inline_object_test.dart new file mode 100644 index 000000000000..31f9afd436f7 --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/openapi/test/inline_object_test.dart @@ -0,0 +1,24 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for InlineObject +void main() { + var instance = new Pet(); + + group('test InlineObject', () { + // Updated name of the pet + // String name (default value: null) + test('to test the property `name`', () async { + // TODO + }); + + // Updated status of the pet + // String status (default value: null) + test('to test the property `status`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/.openapi-generator/VERSION b/samples/client/petstore/dart/flutter_petstore/swagger/.openapi-generator/VERSION index afa636560641..83a328a9227e 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/.openapi-generator/VERSION +++ b/samples/client/petstore/dart/flutter_petstore/swagger/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/.travis.yml b/samples/client/petstore/dart/flutter_petstore/swagger/.travis.yml new file mode 100644 index 000000000000..d0758bc9f0d6 --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/swagger/.travis.yml @@ -0,0 +1,11 @@ +# https://docs.travis-ci.com/user/languages/dart/ +# +language: dart +dart: +# Install a specific stable release +- "2.2.0" +install: +- pub get + +script: +- pub run test diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/docs/UserApi.md b/samples/client/petstore/dart/flutter_petstore/swagger/docs/UserApi.md index 5e0605c6ea08..d3bb61265e9a 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/docs/UserApi.md +++ b/samples/client/petstore/dart/flutter_petstore/swagger/docs/UserApi.md @@ -84,7 +84,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type @@ -124,7 +124,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/api_client.dart b/samples/client/petstore/dart/flutter_petstore/swagger/lib/api_client.dart index 9aed2f92dc3d..fcf60c919f81 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/api_client.dart +++ b/samples/client/petstore/dart/flutter_petstore/swagger/lib/api_client.dart @@ -18,7 +18,7 @@ class ApiClient { final _regList = RegExp(r'^List<(.*)>$'); final _regMap = RegExp(r'^Map$'); - ApiClient({this.basePath: "http://petstore.swagger.io/v2"}) { + ApiClient({this.basePath = "http://petstore.swagger.io/v2"}) { // Setup authentications (key: authentication name, value: authentication). _authentications['api_key'] = ApiKeyAuth("header", "api_key"); _authentications['petstore_auth'] = OAuth(); diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/api_response.dart b/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/api_response.dart index 4ecc4b44dc66..3d37ea215773 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/api_response.dart +++ b/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/api_response.dart @@ -34,11 +34,14 @@ class ApiResponse { } Map toJson() { - return { - 'code': code, - 'type': type, - 'message': message - }; + Map json = {}; + if (code != null) + json['code'] = code; + if (type != null) + json['type'] = type; + if (message != null) + json['message'] = message; + return json; } static List listFromJson(List json) { diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/category.dart b/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/category.dart index f91ffc9b30ef..32a7c1e81aad 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/category.dart +++ b/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/category.dart @@ -27,10 +27,12 @@ class Category { } Map toJson() { - return { - 'id': id, - 'name': name - }; + Map json = {}; + if (id != null) + json['id'] = id; + if (name != null) + json['name'] = name; + return json; } static List listFromJson(List json) { diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/order.dart b/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/order.dart index d021acb1f881..c3966e6f9f23 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/order.dart +++ b/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/order.dart @@ -56,14 +56,20 @@ class Order { } Map toJson() { - return { - 'id': id, - 'petId': petId, - 'quantity': quantity, - 'shipDate': shipDate == null ? '' : shipDate.toUtc().toIso8601String(), - 'status': status, - 'complete': complete - }; + Map json = {}; + if (id != null) + json['id'] = id; + if (petId != null) + json['petId'] = petId; + if (quantity != null) + json['quantity'] = quantity; + if (shipDate != null) + json['shipDate'] = shipDate == null ? null : shipDate.toUtc().toIso8601String(); + if (status != null) + json['status'] = status; + if (complete != null) + json['complete'] = complete; + return json; } static List listFromJson(List json) { diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/pet.dart b/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/pet.dart index 6788af011fec..d8bdd2ef4076 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/pet.dart +++ b/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/pet.dart @@ -56,14 +56,20 @@ class Pet { } Map toJson() { - return { - 'id': id, - 'category': category, - 'name': name, - 'photoUrls': photoUrls, - 'tags': tags, - 'status': status - }; + Map json = {}; + if (id != null) + json['id'] = id; + if (category != null) + json['category'] = category; + if (name != null) + json['name'] = name; + if (photoUrls != null) + json['photoUrls'] = photoUrls; + if (tags != null) + json['tags'] = tags; + if (status != null) + json['status'] = status; + return json; } static List listFromJson(List json) { diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/tag.dart b/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/tag.dart index 2fae3426b886..ca53c8ae890f 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/tag.dart +++ b/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/tag.dart @@ -27,10 +27,12 @@ class Tag { } Map toJson() { - return { - 'id': id, - 'name': name - }; + Map json = {}; + if (id != null) + json['id'] = id; + if (name != null) + json['name'] = name; + return json; } static List listFromJson(List json) { diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/user.dart b/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/user.dart index e3801f4a8f20..1c5ef51fbaa4 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/user.dart +++ b/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/user.dart @@ -69,16 +69,24 @@ class User { } Map toJson() { - return { - 'id': id, - 'username': username, - 'firstName': firstName, - 'lastName': lastName, - 'email': email, - 'password': password, - 'phone': phone, - 'userStatus': userStatus - }; + Map json = {}; + if (id != null) + json['id'] = id; + if (username != null) + json['username'] = username; + if (firstName != null) + json['firstName'] = firstName; + if (lastName != null) + json['lastName'] = lastName; + if (email != null) + json['email'] = email; + if (password != null) + json['password'] = password; + if (phone != null) + json['phone'] = phone; + if (userStatus != null) + json['userStatus'] = userStatus; + return json; } static List listFromJson(List json) { diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/pubspec.yaml b/samples/client/petstore/dart/flutter_petstore/swagger/pubspec.yaml index 9ccf0e524ad0..391fa5edec02 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/pubspec.yaml +++ b/samples/client/petstore/dart/flutter_petstore/swagger/pubspec.yaml @@ -4,4 +4,6 @@ description: OpenAPI API client environment: sdk: '>=2.0.0 <3.0.0' dependencies: - http: '>=0.11.1 <0.12.0' + http: '>=0.11.1 <0.13.0' +dev_dependencies: + test: ^1.3.0 diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/test/api_response_test.dart b/samples/client/petstore/dart/flutter_petstore/swagger/test/api_response_test.dart new file mode 100644 index 000000000000..ebf142904e9f --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/swagger/test/api_response_test.dart @@ -0,0 +1,27 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for ApiResponse +void main() { + var instance = new Pet(); + + group('test ApiResponse', () { + // int code (default value: null) + test('to test the property `code`', () async { + // TODO + }); + + // String type (default value: null) + test('to test the property `type`', () async { + // TODO + }); + + // String message (default value: null) + test('to test the property `message`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/test/category_test.dart b/samples/client/petstore/dart/flutter_petstore/swagger/test/category_test.dart new file mode 100644 index 000000000000..c5cea4b5bc3b --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/swagger/test/category_test.dart @@ -0,0 +1,22 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Category +void main() { + var instance = new Pet(); + + group('test Category', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // String name (default value: null) + test('to test the property `name`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/test/order_test.dart b/samples/client/petstore/dart/flutter_petstore/swagger/test/order_test.dart new file mode 100644 index 000000000000..9982020d8cf7 --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/swagger/test/order_test.dart @@ -0,0 +1,43 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Order +void main() { + var instance = new Pet(); + + group('test Order', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // int petId (default value: null) + test('to test the property `petId`', () async { + // TODO + }); + + // int quantity (default value: null) + test('to test the property `quantity`', () async { + // TODO + }); + + // DateTime shipDate (default value: null) + test('to test the property `shipDate`', () async { + // TODO + }); + + // Order Status + // String status (default value: null) + test('to test the property `status`', () async { + // TODO + }); + + // bool complete (default value: false) + test('to test the property `complete`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/test/pet_api_test.dart b/samples/client/petstore/dart/flutter_petstore/swagger/test/pet_api_test.dart new file mode 100644 index 000000000000..fa95dccad3cd --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/swagger/test/pet_api_test.dart @@ -0,0 +1,73 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for PetApi +void main() { + var instance = new PetApi(); + + group('tests for PetApi', () { + // Add a new pet to the store + // + //Future addPet(Pet body) async + test('test addPet', () async { + // TODO + }); + + // Deletes a pet + // + //Future deletePet(int petId, { String apiKey }) async + test('test deletePet', () async { + // TODO + }); + + // Finds Pets by status + // + // Multiple status values can be provided with comma separated strings + // + //Future> findPetsByStatus(List status) async + test('test findPetsByStatus', () async { + // TODO + }); + + // Finds Pets by tags + // + // Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + // + //Future> findPetsByTags(List tags) async + test('test findPetsByTags', () async { + // TODO + }); + + // Find pet by ID + // + // Returns a single pet + // + //Future getPetById(int petId) async + test('test getPetById', () async { + // TODO + }); + + // Update an existing pet + // + //Future updatePet(Pet body) async + test('test updatePet', () async { + // TODO + }); + + // Updates a pet in the store with form data + // + //Future updatePetWithForm(int petId, { String name, String status }) async + test('test updatePetWithForm', () async { + // TODO + }); + + // uploads an image + // + //Future uploadFile(int petId, { String additionalMetadata, MultipartFile file }) async + test('test uploadFile', () async { + // TODO + }); + + }); +} diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/test/pet_test.dart b/samples/client/petstore/dart/flutter_petstore/swagger/test/pet_test.dart new file mode 100644 index 000000000000..cfd94b9e36c3 --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/swagger/test/pet_test.dart @@ -0,0 +1,43 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Pet +void main() { + var instance = new Pet(); + + group('test Pet', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // Category category (default value: null) + test('to test the property `category`', () async { + // TODO + }); + + // String name (default value: null) + test('to test the property `name`', () async { + // TODO + }); + + // List photoUrls (default value: []) + test('to test the property `photoUrls`', () async { + // TODO + }); + + // List tags (default value: []) + test('to test the property `tags`', () async { + // TODO + }); + + // pet status in the store + // String status (default value: null) + test('to test the property `status`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/test/store_api_test.dart b/samples/client/petstore/dart/flutter_petstore/swagger/test/store_api_test.dart new file mode 100644 index 000000000000..496d051e8334 --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/swagger/test/store_api_test.dart @@ -0,0 +1,45 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for StoreApi +void main() { + var instance = new StoreApi(); + + group('tests for StoreApi', () { + // Delete purchase order by ID + // + // For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + // + //Future deleteOrder(String orderId) async + test('test deleteOrder', () async { + // TODO + }); + + // Returns pet inventories by status + // + // Returns a map of status codes to quantities + // + //Future> getInventory() async + test('test getInventory', () async { + // TODO + }); + + // Find purchase order by ID + // + // For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + // + //Future getOrderById(int orderId) async + test('test getOrderById', () async { + // TODO + }); + + // Place an order for a pet + // + //Future placeOrder(Order body) async + test('test placeOrder', () async { + // TODO + }); + + }); +} diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/test/tag_test.dart b/samples/client/petstore/dart/flutter_petstore/swagger/test/tag_test.dart new file mode 100644 index 000000000000..6ee16c51bbac --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/swagger/test/tag_test.dart @@ -0,0 +1,22 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Tag +void main() { + var instance = new Pet(); + + group('test Tag', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // String name (default value: null) + test('to test the property `name`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/test/user_api_test.dart b/samples/client/petstore/dart/flutter_petstore/swagger/test/user_api_test.dart new file mode 100644 index 000000000000..f040b01bf435 --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/swagger/test/user_api_test.dart @@ -0,0 +1,73 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for UserApi +void main() { + var instance = new UserApi(); + + group('tests for UserApi', () { + // Create user + // + // This can only be done by the logged in user. + // + //Future createUser(User body) async + test('test createUser', () async { + // TODO + }); + + // Creates list of users with given input array + // + //Future createUsersWithArrayInput(List body) async + test('test createUsersWithArrayInput', () async { + // TODO + }); + + // Creates list of users with given input array + // + //Future createUsersWithListInput(List body) async + test('test createUsersWithListInput', () async { + // TODO + }); + + // Delete user + // + // This can only be done by the logged in user. + // + //Future deleteUser(String username) async + test('test deleteUser', () async { + // TODO + }); + + // Get user by user name + // + //Future getUserByName(String username) async + test('test getUserByName', () async { + // TODO + }); + + // Logs user into the system + // + //Future loginUser(String username, String password) async + test('test loginUser', () async { + // TODO + }); + + // Logs out current logged in user session + // + //Future logoutUser() async + test('test logoutUser', () async { + // TODO + }); + + // Updated user + // + // This can only be done by the logged in user. + // + //Future updateUser(String username, User body) async + test('test updateUser', () async { + // TODO + }); + + }); +} diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/test/user_test.dart b/samples/client/petstore/dart/flutter_petstore/swagger/test/user_test.dart new file mode 100644 index 000000000000..5a6340c4f4b7 --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/swagger/test/user_test.dart @@ -0,0 +1,53 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for User +void main() { + var instance = new Pet(); + + group('test User', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // String username (default value: null) + test('to test the property `username`', () async { + // TODO + }); + + // String firstName (default value: null) + test('to test the property `firstName`', () async { + // TODO + }); + + // String lastName (default value: null) + test('to test the property `lastName`', () async { + // TODO + }); + + // String email (default value: null) + test('to test the property `email`', () async { + // TODO + }); + + // String password (default value: null) + test('to test the property `password`', () async { + // TODO + }); + + // String phone (default value: null) + test('to test the property `phone`', () async { + // TODO + }); + + // User Status + // int userStatus (default value: null) + test('to test the property `userStatus`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart/openapi-browser-client/.openapi-generator/VERSION b/samples/client/petstore/dart/openapi-browser-client/.openapi-generator/VERSION index 06b5019af3f4..83a328a9227e 100644 --- a/samples/client/petstore/dart/openapi-browser-client/.openapi-generator/VERSION +++ b/samples/client/petstore/dart/openapi-browser-client/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.1-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart/openapi-browser-client/docs/UserApi.md b/samples/client/petstore/dart/openapi-browser-client/docs/UserApi.md index 5e0605c6ea08..d3bb61265e9a 100644 --- a/samples/client/petstore/dart/openapi-browser-client/docs/UserApi.md +++ b/samples/client/petstore/dart/openapi-browser-client/docs/UserApi.md @@ -84,7 +84,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type @@ -124,7 +124,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type diff --git a/samples/client/petstore/dart/openapi/.openapi-generator/VERSION b/samples/client/petstore/dart/openapi/.openapi-generator/VERSION index 06b5019af3f4..83a328a9227e 100644 --- a/samples/client/petstore/dart/openapi/.openapi-generator/VERSION +++ b/samples/client/petstore/dart/openapi/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.1-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart/openapi/docs/UserApi.md b/samples/client/petstore/dart/openapi/docs/UserApi.md index 5e0605c6ea08..d3bb61265e9a 100644 --- a/samples/client/petstore/dart/openapi/docs/UserApi.md +++ b/samples/client/petstore/dart/openapi/docs/UserApi.md @@ -84,7 +84,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type @@ -124,7 +124,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/.openapi-generator/VERSION b/samples/client/petstore/dart2/flutter_petstore/openapi/.openapi-generator/VERSION index 06b5019af3f4..83a328a9227e 100644 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/.openapi-generator/VERSION +++ b/samples/client/petstore/dart2/flutter_petstore/openapi/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.1-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/docs/UserApi.md b/samples/client/petstore/dart2/flutter_petstore/openapi/docs/UserApi.md index 5e0605c6ea08..d3bb61265e9a 100644 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/docs/UserApi.md +++ b/samples/client/petstore/dart2/flutter_petstore/openapi/docs/UserApi.md @@ -84,7 +84,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type @@ -124,7 +124,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type diff --git a/samples/client/petstore/dart2/openapi-browser-client/.openapi-generator/VERSION b/samples/client/petstore/dart2/openapi-browser-client/.openapi-generator/VERSION index 06b5019af3f4..83a328a9227e 100644 --- a/samples/client/petstore/dart2/openapi-browser-client/.openapi-generator/VERSION +++ b/samples/client/petstore/dart2/openapi-browser-client/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.1-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart2/openapi-browser-client/docs/UserApi.md b/samples/client/petstore/dart2/openapi-browser-client/docs/UserApi.md index 5e0605c6ea08..d3bb61265e9a 100644 --- a/samples/client/petstore/dart2/openapi-browser-client/docs/UserApi.md +++ b/samples/client/petstore/dart2/openapi-browser-client/docs/UserApi.md @@ -84,7 +84,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type @@ -124,7 +124,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type diff --git a/samples/client/petstore/dart2/openapi/.openapi-generator/VERSION b/samples/client/petstore/dart2/openapi/.openapi-generator/VERSION index 06b5019af3f4..83a328a9227e 100644 --- a/samples/client/petstore/dart2/openapi/.openapi-generator/VERSION +++ b/samples/client/petstore/dart2/openapi/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.1-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart2/openapi/docs/UserApi.md b/samples/client/petstore/dart2/openapi/docs/UserApi.md index 5e0605c6ea08..d3bb61265e9a 100644 --- a/samples/client/petstore/dart2/openapi/docs/UserApi.md +++ b/samples/client/petstore/dart2/openapi/docs/UserApi.md @@ -84,7 +84,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type @@ -124,7 +124,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type diff --git a/samples/client/petstore/eiffel/.openapi-generator-ignore b/samples/client/petstore/eiffel/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/client/petstore/eiffel/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/eiffel/.openapi-generator/VERSION b/samples/client/petstore/eiffel/.openapi-generator/VERSION index 096bf47efe31..83a328a9227e 100644 --- a/samples/client/petstore/eiffel/.openapi-generator/VERSION +++ b/samples/client/petstore/eiffel/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.0-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/eiffel/README.md b/samples/client/petstore/eiffel/README.md index bb363368532d..7a342eeaf3ea 100644 --- a/samples/client/petstore/eiffel/README.md +++ b/samples/client/petstore/eiffel/README.md @@ -21,15 +21,18 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*ANOTHERFAKE_API* | [**test_special_tags**](docs/ANOTHERFAKE_API.md#test_special_tags) | **Patch** /another-fake/dummy | To test special tags +*ANOTHERFAKE_API* | [**123_test_special_tags**](docs/ANOTHERFAKE_API.md#123_test_special_tags) | **Patch** /another-fake/dummy | To test special tags +*FAKE_API* | [**create_xml_item**](docs/FAKE_API.md#create_xml_item) | **Post** /fake/create_xml_item | creates an XmlItem *FAKE_API* | [**fake_outer_boolean_serialize**](docs/FAKE_API.md#fake_outer_boolean_serialize) | **Post** /fake/outer/boolean | *FAKE_API* | [**fake_outer_composite_serialize**](docs/FAKE_API.md#fake_outer_composite_serialize) | **Post** /fake/outer/composite | *FAKE_API* | [**fake_outer_number_serialize**](docs/FAKE_API.md#fake_outer_number_serialize) | **Post** /fake/outer/number | *FAKE_API* | [**fake_outer_string_serialize**](docs/FAKE_API.md#fake_outer_string_serialize) | **Post** /fake/outer/string | +*FAKE_API* | [**test_body_with_file_schema**](docs/FAKE_API.md#test_body_with_file_schema) | **Put** /fake/body-with-file-schema | *FAKE_API* | [**test_body_with_query_params**](docs/FAKE_API.md#test_body_with_query_params) | **Put** /fake/body-with-query-params | *FAKE_API* | [**test_client_model**](docs/FAKE_API.md#test_client_model) | **Patch** /fake | To test \"client\" model *FAKE_API* | [**test_endpoint_parameters**](docs/FAKE_API.md#test_endpoint_parameters) | **Post** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FAKE_API* | [**test_enum_parameters**](docs/FAKE_API.md#test_enum_parameters) | **Get** /fake | To test enum parameters +*FAKE_API* | [**test_group_parameters**](docs/FAKE_API.md#test_group_parameters) | **Delete** /fake | Fake endpoint to test group parameters (optional) *FAKE_API* | [**test_inline_additional_properties**](docs/FAKE_API.md#test_inline_additional_properties) | **Post** /fake/inline-additionalProperties | test inline additionalProperties *FAKE_API* | [**test_json_form_data**](docs/FAKE_API.md#test_json_form_data) | **Get** /fake/jsonFormData | test json serialization of form data *FAKECLASSNAMETAGS123_API* | [**test_classname**](docs/FAKECLASSNAMETAGS123_API.md#test_classname) | **Patch** /fake_classname_test | To test class name in snake case @@ -41,6 +44,7 @@ Class | Method | HTTP request | Description *PET_API* | [**update_pet**](docs/PET_API.md#update_pet) | **Put** /pet | Update an existing pet *PET_API* | [**update_pet_with_form**](docs/PET_API.md#update_pet_with_form) | **Post** /pet/{petId} | Updates a pet in the store with form data *PET_API* | [**upload_file**](docs/PET_API.md#upload_file) | **Post** /pet/{petId}/uploadImage | uploads an image +*PET_API* | [**upload_file_with_required_file**](docs/PET_API.md#upload_file_with_required_file) | **Post** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) *STORE_API* | [**delete_order**](docs/STORE_API.md#delete_order) | **Delete** /store/order/{order_id} | Delete purchase order by ID *STORE_API* | [**inventory**](docs/STORE_API.md#inventory) | **Get** /store/inventory | Returns pet inventories by status *STORE_API* | [**order_by_id**](docs/STORE_API.md#order_by_id) | **Get** /store/order/{order_id} | Find purchase order by ID @@ -57,9 +61,15 @@ Class | Method | HTTP request | Description ## Documentation For Models + - [ADDITIONAL_PROPERTIES_ANY_TYPE](docs/ADDITIONAL_PROPERTIES_ANY_TYPE.md) + - [ADDITIONAL_PROPERTIES_ARRAY](docs/ADDITIONAL_PROPERTIES_ARRAY.md) + - [ADDITIONAL_PROPERTIES_BOOLEAN](docs/ADDITIONAL_PROPERTIES_BOOLEAN.md) - [ADDITIONAL_PROPERTIES_CLASS](docs/ADDITIONAL_PROPERTIES_CLASS.md) + - [ADDITIONAL_PROPERTIES_INTEGER](docs/ADDITIONAL_PROPERTIES_INTEGER.md) + - [ADDITIONAL_PROPERTIES_NUMBER](docs/ADDITIONAL_PROPERTIES_NUMBER.md) + - [ADDITIONAL_PROPERTIES_OBJECT](docs/ADDITIONAL_PROPERTIES_OBJECT.md) + - [ADDITIONAL_PROPERTIES_STRING](docs/ADDITIONAL_PROPERTIES_STRING.md) - [ANIMAL](docs/ANIMAL.md) - - [ANIMAL_FARM](docs/ANIMAL_FARM.md) - [API_RESPONSE](docs/API_RESPONSE.md) - [ARRAY_OF_ARRAY_OF_NUMBER_ONLY](docs/ARRAY_OF_ARRAY_OF_NUMBER_ONLY.md) - [ARRAY_OF_NUMBER_ONLY](docs/ARRAY_OF_NUMBER_ONLY.md) @@ -67,12 +77,15 @@ Class | Method | HTTP request | Description - [CAPITALIZATION](docs/CAPITALIZATION.md) - [CAT](docs/CAT.md) - [CATEGORY](docs/CATEGORY.md) + - [CAT_ALL_OF](docs/CAT_ALL_OF.md) - [CLASS_MODEL](docs/CLASS_MODEL.md) - [CLIENT](docs/CLIENT.md) - [DOG](docs/DOG.md) + - [DOG_ALL_OF](docs/DOG_ALL_OF.md) - [ENUM_ARRAYS](docs/ENUM_ARRAYS.md) - [ENUM_CLASS](docs/ENUM_CLASS.md) - [ENUM_TEST](docs/ENUM_TEST.md) + - [FILE_SCHEMA_TEST_CLASS](docs/FILE_SCHEMA_TEST_CLASS.md) - [FORMAT_TEST](docs/FORMAT_TEST.md) - [HAS_ONLY_READ_ONLY](docs/HAS_ONLY_READ_ONLY.md) - [MAP_TEST](docs/MAP_TEST.md) @@ -88,7 +101,10 @@ Class | Method | HTTP request | Description - [RETURN](docs/RETURN.md) - [SPECIAL_MODEL_NAME](docs/SPECIAL_MODEL_NAME.md) - [TAG](docs/TAG.md) + - [TYPE_HOLDER_DEFAULT](docs/TYPE_HOLDER_DEFAULT.md) + - [TYPE_HOLDER_EXAMPLE](docs/TYPE_HOLDER_EXAMPLE.md) - [USER](docs/USER.md) + - [XML_ITEM](docs/XML_ITEM.md) ## Documentation For Authorization diff --git a/samples/client/petstore/eiffel/api_client.ecf b/samples/client/petstore/eiffel/api_client.ecf index 6f0ef48e4822..340bb66acc07 100644 --- a/samples/client/petstore/eiffel/api_client.ecf +++ b/samples/client/petstore/eiffel/api_client.ecf @@ -1,5 +1,5 @@ - + diff --git a/samples/client/petstore/eiffel/docs/ADDITIONAL_PROPERTIES_ANY_TYPE.md b/samples/client/petstore/eiffel/docs/ADDITIONAL_PROPERTIES_ANY_TYPE.md new file mode 100644 index 000000000000..a1073f5a84af --- /dev/null +++ b/samples/client/petstore/eiffel/docs/ADDITIONAL_PROPERTIES_ANY_TYPE.md @@ -0,0 +1,10 @@ +# ADDITIONAL_PROPERTIES_ANY_TYPE + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | [**STRING_32**](STRING_32.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/eiffel/docs/ADDITIONAL_PROPERTIES_ARRAY.md b/samples/client/petstore/eiffel/docs/ADDITIONAL_PROPERTIES_ARRAY.md new file mode 100644 index 000000000000..d9ad820dfe71 --- /dev/null +++ b/samples/client/petstore/eiffel/docs/ADDITIONAL_PROPERTIES_ARRAY.md @@ -0,0 +1,10 @@ +# ADDITIONAL_PROPERTIES_ARRAY + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | [**STRING_32**](STRING_32.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/eiffel/docs/ADDITIONAL_PROPERTIES_BOOLEAN.md b/samples/client/petstore/eiffel/docs/ADDITIONAL_PROPERTIES_BOOLEAN.md new file mode 100644 index 000000000000..920d071fe79f --- /dev/null +++ b/samples/client/petstore/eiffel/docs/ADDITIONAL_PROPERTIES_BOOLEAN.md @@ -0,0 +1,10 @@ +# ADDITIONAL_PROPERTIES_BOOLEAN + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | [**STRING_32**](STRING_32.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/eiffel/docs/ADDITIONAL_PROPERTIES_CLASS.md b/samples/client/petstore/eiffel/docs/ADDITIONAL_PROPERTIES_CLASS.md index 6c76a177ee5b..df287ff108ab 100644 --- a/samples/client/petstore/eiffel/docs/ADDITIONAL_PROPERTIES_CLASS.md +++ b/samples/client/petstore/eiffel/docs/ADDITIONAL_PROPERTIES_CLASS.md @@ -3,8 +3,17 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**map_property** | [**STRING_TABLE[STRING_32]**](STRING_32.md) | | [optional] [default to null] -**map_of_map_property** | [**STRING_TABLE[STRING_TABLE[STRING_32]]**](STRING_TABLE.md) | | [optional] [default to null] +**map_string** | [**STRING_TABLE[STRING_32]**](STRING_32.md) | | [optional] [default to null] +**map_number** | **STRING_TABLE[REAL_32]** | | [optional] [default to null] +**map_integer** | **STRING_TABLE[INTEGER_32]** | | [optional] [default to null] +**map_boolean** | **STRING_TABLE[BOOLEAN]** | | [optional] [default to null] +**map_array_integer** | [**STRING_TABLE[LIST [INTEGER_32]]**](LIST.md) | | [optional] [default to null] +**map_array_anytype** | [**STRING_TABLE[LIST [ANY]]**](LIST.md) | | [optional] [default to null] +**map_map_string** | [**STRING_TABLE[STRING_TABLE[STRING_32]]**](STRING_TABLE.md) | | [optional] [default to null] +**map_map_anytype** | [**STRING_TABLE[STRING_TABLE[ANY]]**](STRING_TABLE.md) | | [optional] [default to null] +**anytype_1** | [**ANY**](.md) | | [optional] [default to null] +**anytype_2** | [**ANY**](.md) | | [optional] [default to null] +**anytype_3** | [**ANY**](.md) | | [optional] [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/eiffel/docs/ADDITIONAL_PROPERTIES_INTEGER.md b/samples/client/petstore/eiffel/docs/ADDITIONAL_PROPERTIES_INTEGER.md new file mode 100644 index 000000000000..dc220c414160 --- /dev/null +++ b/samples/client/petstore/eiffel/docs/ADDITIONAL_PROPERTIES_INTEGER.md @@ -0,0 +1,10 @@ +# ADDITIONAL_PROPERTIES_INTEGER + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | [**STRING_32**](STRING_32.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/eiffel/docs/ADDITIONAL_PROPERTIES_NUMBER.md b/samples/client/petstore/eiffel/docs/ADDITIONAL_PROPERTIES_NUMBER.md new file mode 100644 index 000000000000..29b07fa5f48e --- /dev/null +++ b/samples/client/petstore/eiffel/docs/ADDITIONAL_PROPERTIES_NUMBER.md @@ -0,0 +1,10 @@ +# ADDITIONAL_PROPERTIES_NUMBER + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | [**STRING_32**](STRING_32.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/eiffel/docs/ADDITIONAL_PROPERTIES_OBJECT.md b/samples/client/petstore/eiffel/docs/ADDITIONAL_PROPERTIES_OBJECT.md new file mode 100644 index 000000000000..ac73300b26b1 --- /dev/null +++ b/samples/client/petstore/eiffel/docs/ADDITIONAL_PROPERTIES_OBJECT.md @@ -0,0 +1,10 @@ +# ADDITIONAL_PROPERTIES_OBJECT + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | [**STRING_32**](STRING_32.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/eiffel/docs/ADDITIONAL_PROPERTIES_STRING.md b/samples/client/petstore/eiffel/docs/ADDITIONAL_PROPERTIES_STRING.md new file mode 100644 index 000000000000..efabc5df6a96 --- /dev/null +++ b/samples/client/petstore/eiffel/docs/ADDITIONAL_PROPERTIES_STRING.md @@ -0,0 +1,10 @@ +# ADDITIONAL_PROPERTIES_STRING + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | [**STRING_32**](STRING_32.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/eiffel/docs/ANOTHERFAKE_API.md b/samples/client/petstore/eiffel/docs/ANOTHERFAKE_API.md index fce27e0aa2f2..2c1e06ea5c31 100644 --- a/samples/client/petstore/eiffel/docs/ANOTHERFAKE_API.md +++ b/samples/client/petstore/eiffel/docs/ANOTHERFAKE_API.md @@ -4,23 +4,23 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Feature | HTTP request | Description ------------- | ------------- | ------------- -[**test_special_tags**](ANOTHERFAKE_API.md#test_special_tags) | **Patch** /another-fake/dummy | To test special tags +[**123_test_special_tags**](ANOTHERFAKE_API.md#123_test_special_tags) | **Patch** /another-fake/dummy | To test special tags -# **test_special_tags** -> test_special_tags (client: CLIENT ): detachable CLIENT +# **123_test_special_tags** +> 123_test_special_tags (body: CLIENT ): detachable CLIENT To test special tags -To test special tags +To test special tags and operation ID starting with number ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **client** | [**CLIENT**](CLIENT.md)| client model | + **body** | [**CLIENT**](CLIENT.md)| client model | ### Return type diff --git a/samples/client/petstore/eiffel/docs/CATEGORY.md b/samples/client/petstore/eiffel/docs/CATEGORY.md index de2ce34e6272..9f076ba276d0 100644 --- a/samples/client/petstore/eiffel/docs/CATEGORY.md +++ b/samples/client/petstore/eiffel/docs/CATEGORY.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **INTEGER_64** | | [optional] [default to null] -**name** | [**STRING_32**](STRING_32.md) | | [optional] [default to null] +**name** | [**STRING_32**](STRING_32.md) | | [default to default-name] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/eiffel/docs/CAT_ALL_OF.md b/samples/client/petstore/eiffel/docs/CAT_ALL_OF.md new file mode 100644 index 000000000000..5d36afc8005f --- /dev/null +++ b/samples/client/petstore/eiffel/docs/CAT_ALL_OF.md @@ -0,0 +1,10 @@ +# CAT_ALL_OF + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**declawed** | **BOOLEAN** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/eiffel/docs/DOG_ALL_OF.md b/samples/client/petstore/eiffel/docs/DOG_ALL_OF.md new file mode 100644 index 000000000000..652e5549542e --- /dev/null +++ b/samples/client/petstore/eiffel/docs/DOG_ALL_OF.md @@ -0,0 +1,10 @@ +# DOG_ALL_OF + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**breed** | [**STRING_32**](STRING_32.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/eiffel/docs/FAKECLASSNAMETAGS123_API.md b/samples/client/petstore/eiffel/docs/FAKECLASSNAMETAGS123_API.md index 26344acdb285..3ae91b654c26 100644 --- a/samples/client/petstore/eiffel/docs/FAKECLASSNAMETAGS123_API.md +++ b/samples/client/petstore/eiffel/docs/FAKECLASSNAMETAGS123_API.md @@ -8,7 +8,7 @@ Feature | HTTP request | Description # **test_classname** -> test_classname (client: CLIENT ): detachable CLIENT +> test_classname (body: CLIENT ): detachable CLIENT To test class name in snake case @@ -20,7 +20,7 @@ To test class name in snake case Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **client** | [**CLIENT**](CLIENT.md)| client model | + **body** | [**CLIENT**](CLIENT.md)| client model | ### Return type diff --git a/samples/client/petstore/eiffel/docs/FAKE_API.md b/samples/client/petstore/eiffel/docs/FAKE_API.md index 94888d077727..c0eb86786faa 100644 --- a/samples/client/petstore/eiffel/docs/FAKE_API.md +++ b/samples/client/petstore/eiffel/docs/FAKE_API.md @@ -4,18 +4,51 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Feature | HTTP request | Description ------------- | ------------- | ------------- +[**create_xml_item**](FAKE_API.md#create_xml_item) | **Post** /fake/create_xml_item | creates an XmlItem [**fake_outer_boolean_serialize**](FAKE_API.md#fake_outer_boolean_serialize) | **Post** /fake/outer/boolean | [**fake_outer_composite_serialize**](FAKE_API.md#fake_outer_composite_serialize) | **Post** /fake/outer/composite | [**fake_outer_number_serialize**](FAKE_API.md#fake_outer_number_serialize) | **Post** /fake/outer/number | [**fake_outer_string_serialize**](FAKE_API.md#fake_outer_string_serialize) | **Post** /fake/outer/string | +[**test_body_with_file_schema**](FAKE_API.md#test_body_with_file_schema) | **Put** /fake/body-with-file-schema | [**test_body_with_query_params**](FAKE_API.md#test_body_with_query_params) | **Put** /fake/body-with-query-params | [**test_client_model**](FAKE_API.md#test_client_model) | **Patch** /fake | To test \"client\" model [**test_endpoint_parameters**](FAKE_API.md#test_endpoint_parameters) | **Post** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**test_enum_parameters**](FAKE_API.md#test_enum_parameters) | **Get** /fake | To test enum parameters +[**test_group_parameters**](FAKE_API.md#test_group_parameters) | **Delete** /fake | Fake endpoint to test group parameters (optional) [**test_inline_additional_properties**](FAKE_API.md#test_inline_additional_properties) | **Post** /fake/inline-additionalProperties | test inline additionalProperties [**test_json_form_data**](FAKE_API.md#test_json_form_data) | **Get** /fake/jsonFormData | test json serialization of form data +# **create_xml_item** +> create_xml_item (xml_item: XML_ITEM ) + + +creates an XmlItem + +this route creates an XmlItem + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xml_item** | [**XML_ITEM**](XML_ITEM.md)| XmlItem Body | + +### Return type + +{empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/xml, application/xml; charset=utf-8, application/xml; charset=utf-16, text/xml, text/xml; charset=utf-8, text/xml; charset=utf-16 + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **fake_outer_boolean_serialize** > fake_outer_boolean_serialize (body: detachable BOOLEAN ): detachable BOOLEAN @@ -47,7 +80,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **fake_outer_composite_serialize** -> fake_outer_composite_serialize (outer_composite: detachable OUTER_COMPOSITE ): detachable OUTER_COMPOSITE +> fake_outer_composite_serialize (body: detachable OUTER_COMPOSITE ): detachable OUTER_COMPOSITE @@ -59,7 +92,7 @@ Test serialization of object with outer number type Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **outer_composite** | [**OUTER_COMPOSITE**](OUTER_COMPOSITE.md)| Input composite as post body | [optional] + **body** | [**OUTER_COMPOSITE**](OUTER_COMPOSITE.md)| Input composite as post body | [optional] ### Return type @@ -136,8 +169,38 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **test_body_with_file_schema** +> test_body_with_file_schema (body: FILE_SCHEMA_TEST_CLASS ) + + + + +For this test, the body for this request much reference a schema named `File`. + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**FILE_SCHEMA_TEST_CLASS**](FILE_SCHEMA_TEST_CLASS.md)| | + +### Return type + +{empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **test_body_with_query_params** -> test_body_with_query_params (query: STRING_32 ; user: USER ) +> test_body_with_query_params (query: STRING_32 ; body: USER ) @@ -147,8 +210,8 @@ No authorization required Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **query** | **STRING_32**| | - **user** | [**USER**](USER.md)| | + **query** | **STRING_32**| | [default to null] + **body** | [**USER**](USER.md)| | ### Return type @@ -166,7 +229,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **test_client_model** -> test_client_model (client: CLIENT ): detachable CLIENT +> test_client_model (body: CLIENT ): detachable CLIENT To test \"client\" model @@ -178,7 +241,7 @@ To test \"client\" model Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **client** | [**CLIENT**](CLIENT.md)| client model | + **body** | [**CLIENT**](CLIENT.md)| client model | ### Return type @@ -196,7 +259,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **test_endpoint_parameters** -> test_endpoint_parameters (number: REAL_32 ; double: REAL_64 ; pattern_without_delimiter: STRING_32 ; byte: ARRAY [NATURAL_8] ; integer: detachable INTEGER_32 ; int32: detachable INTEGER_32 ; int64: detachable INTEGER_64 ; float: detachable REAL_32 ; string: detachable STRING_32 ; binary: detachable FILE ; date: detachable DATE ; date_time: detachable DATE_TIME ; password: detachable STRING_32 ; callback: detachable STRING_32 ) +> test_endpoint_parameters (number: REAL_32 ; double: REAL_64 ; pattern_without_delimiter: STRING_32 ; byte: ARRAY [NATURAL_8] ; integer: detachable INTEGER_32 ; int32: detachable INTEGER_32 ; int64: detachable INTEGER_64 ; float: detachable REAL_32 ; string: detachable STRING_32 ; binary: detachable FILE ; date: detachable DATE ; date_time: detachable DATE_TIME ; password: detachable STRING ; callback: detachable STRING_32 ) Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -220,7 +283,7 @@ Name | Type | Description | Notes **binary** | **FILE**| None | [optional] [default to null] **date** | **DATE**| None | [optional] [default to null] **date_time** | **DATE_TIME**| None | [optional] [default to null] - **password** | **STRING_32**| None | [optional] [default to null] + **password** | **STRING**| None | [optional] [default to null] **callback** | **STRING_32**| None | [optional] [default to null] ### Return type @@ -251,13 +314,13 @@ To test enum parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **enum_header_string_array** | [**LIST [STRING_32]**](STRING_32.md)| Header parameter enum test (string array) | [optional] + **enum_header_string_array** | [**LIST [STRING_32]**](STRING_32.md)| Header parameter enum test (string array) | [optional] [default to null] **enum_header_string** | **STRING_32**| Header parameter enum test (string) | [optional] [default to -efg] - **enum_query_string_array** | [**LIST [STRING_32]**](STRING_32.md)| Query parameter enum test (string array) | [optional] + **enum_query_string_array** | [**LIST [STRING_32]**](STRING_32.md)| Query parameter enum test (string array) | [optional] [default to null] **enum_query_string** | **STRING_32**| Query parameter enum test (string) | [optional] [default to -efg] - **enum_query_integer** | **INTEGER_32**| Query parameter enum test (double) | [optional] - **enum_query_double** | **REAL_64**| Query parameter enum test (double) | [optional] - **enum_form_string_array** | **LIST [STRING_32]**| Form parameter enum test (string array) | [optional] [default to $] + **enum_query_integer** | **INTEGER_32**| Query parameter enum test (double) | [optional] [default to null] + **enum_query_double** | **REAL_64**| Query parameter enum test (double) | [optional] [default to null] + **enum_form_string_array** | [**LIST [STRING_32]**](STRING_32.md)| Form parameter enum test (string array) | [optional] [default to $] **enum_form_string** | **STRING_32**| Form parameter enum test (string) | [optional] [default to -efg] ### Return type @@ -275,8 +338,43 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **test_group_parameters** +> test_group_parameters (required_string_group: INTEGER_32 ; required_boolean_group: BOOLEAN ; required_int64_group: INTEGER_64 ; string_group: detachable INTEGER_32 ; boolean_group: detachable BOOLEAN ; int64_group: detachable INTEGER_64 ) + + +Fake endpoint to test group parameters (optional) + +Fake endpoint to test group parameters (optional) + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **required_string_group** | **INTEGER_32**| Required String in group parameters | [default to null] + **required_boolean_group** | **BOOLEAN**| Required Boolean in group parameters | [default to null] + **required_int64_group** | **INTEGER_64**| Required Integer in group parameters | [default to null] + **string_group** | **INTEGER_32**| String in group parameters | [optional] [default to null] + **boolean_group** | **BOOLEAN**| Boolean in group parameters | [optional] [default to null] + **int64_group** | **INTEGER_64**| Integer in group parameters | [optional] [default to null] + +### Return type + +{empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **test_inline_additional_properties** -> test_inline_additional_properties (request_body: STRING_TABLE[STRING_32] ) +> test_inline_additional_properties (param: STRING_TABLE[STRING_32] ) test inline additionalProperties @@ -286,7 +384,7 @@ test inline additionalProperties Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **request_body** | [**STRING_TABLE[STRING_32]**](STRING_32.md)| request body | + **param** | [**STRING_TABLE[STRING_32]**](STRING_32.md)| request body | ### Return type diff --git a/samples/client/petstore/eiffel/docs/FILE_SCHEMA_TEST_CLASS.md b/samples/client/petstore/eiffel/docs/FILE_SCHEMA_TEST_CLASS.md new file mode 100644 index 000000000000..3c703346678d --- /dev/null +++ b/samples/client/petstore/eiffel/docs/FILE_SCHEMA_TEST_CLASS.md @@ -0,0 +1,11 @@ +# FILE_SCHEMA_TEST_CLASS + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**file** | [**FILE**](FILE.md) | | [optional] [default to null] +**files** | [**LIST [FILE]**](FILE.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/eiffel/docs/FORMAT_TEST.md b/samples/client/petstore/eiffel/docs/FORMAT_TEST.md index bb634fd99bf6..24d56b4696f0 100644 --- a/samples/client/petstore/eiffel/docs/FORMAT_TEST.md +++ b/samples/client/petstore/eiffel/docs/FORMAT_TEST.md @@ -15,7 +15,7 @@ Name | Type | Description | Notes **date** | [**DATE**](DATE.md) | | [default to null] **date_time** | [**DATE_TIME**](DATE_TIME.md) | | [optional] [default to null] **uuid** | [**UUID**](UUID.md) | | [optional] [default to null] -**password** | [**STRING_32**](STRING_32.md) | | [default to null] +**password** | [**STRING**](STRING.md) | | [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/eiffel/docs/MAP_TEST.md b/samples/client/petstore/eiffel/docs/MAP_TEST.md index e55324372cbc..a4f5fbd8cc4c 100644 --- a/samples/client/petstore/eiffel/docs/MAP_TEST.md +++ b/samples/client/petstore/eiffel/docs/MAP_TEST.md @@ -5,6 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **map_map_of_string** | [**STRING_TABLE[STRING_TABLE[STRING_32]]**](STRING_TABLE.md) | | [optional] [default to null] **map_of_enum_string** | [**STRING_TABLE[STRING_32]**](STRING_32.md) | | [optional] [default to null] +**direct_map** | **STRING_TABLE[BOOLEAN]** | | [optional] [default to null] +**indirect_map** | **STRING_TABLE[BOOLEAN]** | | [optional] [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/eiffel/docs/PET_API.md b/samples/client/petstore/eiffel/docs/PET_API.md index 2bd3122ea68b..c12e549eeae3 100644 --- a/samples/client/petstore/eiffel/docs/PET_API.md +++ b/samples/client/petstore/eiffel/docs/PET_API.md @@ -12,10 +12,11 @@ Feature | HTTP request | Description [**update_pet**](PET_API.md#update_pet) | **Put** /pet | Update an existing pet [**update_pet_with_form**](PET_API.md#update_pet_with_form) | **Post** /pet/{petId} | Updates a pet in the store with form data [**upload_file**](PET_API.md#upload_file) | **Post** /pet/{petId}/uploadImage | uploads an image +[**upload_file_with_required_file**](PET_API.md#upload_file_with_required_file) | **Post** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) # **add_pet** -> add_pet (pet: PET ) +> add_pet (body: PET ) Add a new pet to the store @@ -25,7 +26,7 @@ Add a new pet to the store Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet** | [**PET**](PET.md)| Pet object that needs to be added to the store | + **body** | [**PET**](PET.md)| Pet object that needs to be added to the store | ### Return type @@ -53,8 +54,8 @@ Deletes a pet Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet_id** | **INTEGER_64**| Pet id to delete | - **api_key** | **STRING_32**| | [optional] + **pet_id** | **INTEGER_64**| Pet id to delete | [default to null] + **api_key** | **STRING_32**| | [optional] [default to null] ### Return type @@ -84,7 +85,7 @@ Multiple status values can be provided with comma separated strings Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **status** | [**LIST [STRING_32]**](STRING_32.md)| Status values that need to be considered for filter | + **status** | [**LIST [STRING_32]**](STRING_32.md)| Status values that need to be considered for filter | [default to null] ### Return type @@ -114,7 +115,7 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tags** | [**LIST [STRING_32]**](STRING_32.md)| Tags to filter by | + **tags** | [**LIST [STRING_32]**](STRING_32.md)| Tags to filter by | [default to null] ### Return type @@ -144,7 +145,7 @@ Returns a single pet Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet_id** | **INTEGER_64**| ID of pet to return | + **pet_id** | **INTEGER_64**| ID of pet to return | [default to null] ### Return type @@ -162,7 +163,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **update_pet** -> update_pet (pet: PET ) +> update_pet (body: PET ) Update an existing pet @@ -172,7 +173,7 @@ Update an existing pet Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet** | [**PET**](PET.md)| Pet object that needs to be added to the store | + **body** | [**PET**](PET.md)| Pet object that needs to be added to the store | ### Return type @@ -200,7 +201,7 @@ Updates a pet in the store with form data Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet_id** | **INTEGER_64**| ID of pet that needs to be updated | + **pet_id** | **INTEGER_64**| ID of pet that needs to be updated | [default to null] **name** | **STRING_32**| Updated name of the pet | [optional] [default to null] **status** | **STRING_32**| Updated status of the pet | [optional] [default to null] @@ -230,7 +231,7 @@ uploads an image Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet_id** | **INTEGER_64**| ID of pet to update | + **pet_id** | **INTEGER_64**| ID of pet to update | [default to null] **additional_metadata** | **STRING_32**| Additional data to pass to server | [optional] [default to null] **file** | **FILE**| file to upload | [optional] [default to null] @@ -249,3 +250,33 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **upload_file_with_required_file** +> upload_file_with_required_file (pet_id: INTEGER_64 ; required_file: FILE ; additional_metadata: detachable STRING_32 ): detachable API_RESPONSE + + +uploads an image (required) + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_id** | **INTEGER_64**| ID of pet to update | [default to null] + **required_file** | **FILE**| file to upload | [default to null] + **additional_metadata** | **STRING_32**| Additional data to pass to server | [optional] [default to null] + +### Return type + +[**API_RESPONSE**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/eiffel/docs/STORE_API.md b/samples/client/petstore/eiffel/docs/STORE_API.md index c851de646130..7c081dac4ae8 100644 --- a/samples/client/petstore/eiffel/docs/STORE_API.md +++ b/samples/client/petstore/eiffel/docs/STORE_API.md @@ -23,7 +23,7 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **order_id** | **STRING_32**| ID of the order that needs to be deleted | + **order_id** | **STRING_32**| ID of the order that needs to be deleted | [default to null] ### Return type @@ -80,7 +80,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **order_id** | **INTEGER_64**| ID of pet that needs to be fetched | + **order_id** | **INTEGER_64**| ID of pet that needs to be fetched | [default to null] ### Return type @@ -98,7 +98,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **place_order** -> place_order (order: ORDER ): detachable ORDER +> place_order (body: ORDER ): detachable ORDER Place an order for a pet @@ -108,7 +108,7 @@ Place an order for a pet Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **order** | [**ORDER**](ORDER.md)| order placed for purchasing the pet | + **body** | [**ORDER**](ORDER.md)| order placed for purchasing the pet | ### Return type diff --git a/samples/client/petstore/eiffel/docs/TYPE_HOLDER_DEFAULT.md b/samples/client/petstore/eiffel/docs/TYPE_HOLDER_DEFAULT.md new file mode 100644 index 000000000000..0b5e1336a8a2 --- /dev/null +++ b/samples/client/petstore/eiffel/docs/TYPE_HOLDER_DEFAULT.md @@ -0,0 +1,14 @@ +# TYPE_HOLDER_DEFAULT + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**string_item** | [**STRING_32**](STRING_32.md) | | [default to what] +**number_item** | **REAL_32** | | [default to null] +**integer_item** | **INTEGER_32** | | [default to null] +**bool_item** | **BOOLEAN** | | [default to true] +**array_item** | **LIST [INTEGER_32]** | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/eiffel/docs/TYPE_HOLDER_EXAMPLE.md b/samples/client/petstore/eiffel/docs/TYPE_HOLDER_EXAMPLE.md new file mode 100644 index 000000000000..5272222bcb96 --- /dev/null +++ b/samples/client/petstore/eiffel/docs/TYPE_HOLDER_EXAMPLE.md @@ -0,0 +1,14 @@ +# TYPE_HOLDER_EXAMPLE + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**string_item** | [**STRING_32**](STRING_32.md) | | [default to null] +**number_item** | **REAL_32** | | [default to null] +**integer_item** | **INTEGER_32** | | [default to null] +**bool_item** | **BOOLEAN** | | [default to null] +**array_item** | **LIST [INTEGER_32]** | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/eiffel/docs/USER_API.md b/samples/client/petstore/eiffel/docs/USER_API.md index 686b13789fdf..8c3bb38bd920 100644 --- a/samples/client/petstore/eiffel/docs/USER_API.md +++ b/samples/client/petstore/eiffel/docs/USER_API.md @@ -15,7 +15,7 @@ Feature | HTTP request | Description # **create_user** -> create_user (user: USER ) +> create_user (body: USER ) Create user @@ -27,7 +27,7 @@ This can only be done by the logged in user. Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**USER**](USER.md)| Created user object | + **body** | [**USER**](USER.md)| Created user object | ### Return type @@ -45,7 +45,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **create_users_with_array_input** -> create_users_with_array_input (user: LIST [USER] ) +> create_users_with_array_input (body: LIST [USER] ) Creates list of users with given input array @@ -55,7 +55,7 @@ Creates list of users with given input array Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**LIST [USER]**](LIST.md)| List of user object | + **body** | [**LIST [USER]**](User.md)| List of user object | ### Return type @@ -73,7 +73,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **create_users_with_list_input** -> create_users_with_list_input (user: LIST [USER] ) +> create_users_with_list_input (body: LIST [USER] ) Creates list of users with given input array @@ -83,7 +83,7 @@ Creates list of users with given input array Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**LIST [USER]**](LIST.md)| List of user object | + **body** | [**LIST [USER]**](User.md)| List of user object | ### Return type @@ -113,7 +113,7 @@ This can only be done by the logged in user. Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **STRING_32**| The name that needs to be deleted | + **username** | **STRING_32**| The name that needs to be deleted | [default to null] ### Return type @@ -141,8 +141,8 @@ Logs user into the system Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **STRING_32**| The user name for login | - **password** | **STRING_32**| The password for login in clear text | + **username** | **STRING_32**| The user name for login | [default to null] + **password** | **STRING_32**| The password for login in clear text | [default to null] ### Return type @@ -185,7 +185,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **update_user** -> update_user (username: STRING_32 ; user: USER ) +> update_user (username: STRING_32 ; body: USER ) Updated user @@ -197,8 +197,8 @@ This can only be done by the logged in user. Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **STRING_32**| name that need to be deleted | - **user** | [**USER**](USER.md)| Updated user object | + **username** | **STRING_32**| name that need to be deleted | [default to null] + **body** | [**USER**](USER.md)| Updated user object | ### Return type @@ -226,7 +226,7 @@ Get user by user name Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **STRING_32**| The name that needs to be fetched. Use user1 for testing. | + **username** | **STRING_32**| The name that needs to be fetched. Use user1 for testing. | [default to null] ### Return type diff --git a/samples/client/petstore/eiffel/docs/XML_ITEM.md b/samples/client/petstore/eiffel/docs/XML_ITEM.md new file mode 100644 index 000000000000..fd1de63137e5 --- /dev/null +++ b/samples/client/petstore/eiffel/docs/XML_ITEM.md @@ -0,0 +1,38 @@ +# XML_ITEM + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**attribute_string** | [**STRING_32**](STRING_32.md) | | [optional] [default to null] +**attribute_number** | **REAL_32** | | [optional] [default to null] +**attribute_integer** | **INTEGER_32** | | [optional] [default to null] +**attribute_boolean** | **BOOLEAN** | | [optional] [default to null] +**wrapped_array** | **LIST [INTEGER_32]** | | [optional] [default to null] +**name_string** | [**STRING_32**](STRING_32.md) | | [optional] [default to null] +**name_number** | **REAL_32** | | [optional] [default to null] +**name_integer** | **INTEGER_32** | | [optional] [default to null] +**name_boolean** | **BOOLEAN** | | [optional] [default to null] +**name_array** | **LIST [INTEGER_32]** | | [optional] [default to null] +**name_wrapped_array** | **LIST [INTEGER_32]** | | [optional] [default to null] +**prefix_string** | [**STRING_32**](STRING_32.md) | | [optional] [default to null] +**prefix_number** | **REAL_32** | | [optional] [default to null] +**prefix_integer** | **INTEGER_32** | | [optional] [default to null] +**prefix_boolean** | **BOOLEAN** | | [optional] [default to null] +**prefix_array** | **LIST [INTEGER_32]** | | [optional] [default to null] +**prefix_wrapped_array** | **LIST [INTEGER_32]** | | [optional] [default to null] +**namespace_string** | [**STRING_32**](STRING_32.md) | | [optional] [default to null] +**namespace_number** | **REAL_32** | | [optional] [default to null] +**namespace_integer** | **INTEGER_32** | | [optional] [default to null] +**namespace_boolean** | **BOOLEAN** | | [optional] [default to null] +**namespace_array** | **LIST [INTEGER_32]** | | [optional] [default to null] +**namespace_wrapped_array** | **LIST [INTEGER_32]** | | [optional] [default to null] +**prefix_ns_string** | [**STRING_32**](STRING_32.md) | | [optional] [default to null] +**prefix_ns_number** | **REAL_32** | | [optional] [default to null] +**prefix_ns_integer** | **INTEGER_32** | | [optional] [default to null] +**prefix_ns_boolean** | **BOOLEAN** | | [optional] [default to null] +**prefix_ns_array** | **LIST [INTEGER_32]** | | [optional] [default to null] +**prefix_ns_wrapped_array** | **LIST [INTEGER_32]** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/eiffel/src/api/another_fake_api.e b/samples/client/petstore/eiffel/src/api/another_fake_api.e index 0a912d7f8197..91ac69abea51 100644 --- a/samples/client/petstore/eiffel/src/api/another_fake_api.e +++ b/samples/client/petstore/eiffel/src/api/another_fake_api.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,11 +24,11 @@ inherit feature -- API Access - test_special_tags (client: CLIENT): detachable CLIENT - -- To test special tags + 123_test_special_tags (body: CLIENT): detachable CLIENT -- To test special tags + -- To test special tags and operation ID starting with number -- - -- argument: client client model (required) + -- argument: body client model (required) -- -- -- Result CLIENT @@ -40,7 +40,7 @@ feature -- API Access do reset_error create l_request - l_request.set_body(client) + l_request.set_body(body) l_path := "/another-fake/dummy" diff --git a/samples/client/petstore/eiffel/src/api/fake_api.e b/samples/client/petstore/eiffel/src/api/fake_api.e index 6e7a054c2bdc..7947678fc8a7 100644 --- a/samples/client/petstore/eiffel/src/api/fake_api.e +++ b/samples/client/petstore/eiffel/src/api/fake_api.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,6 +24,36 @@ inherit feature -- API Access + create_xml_item (xml_item: XML_ITEM) + -- creates an XmlItem + -- this route creates an XmlItem + -- + -- argument: xml_item XmlItem Body (required) + -- + -- + require + local + l_path: STRING + l_request: API_CLIENT_REQUEST + l_response: API_CLIENT_RESPONSE + do + reset_error + create l_request + l_request.set_body(xml_item) + l_path := "/fake/create_xml_item" + + + if attached {STRING} api_client.select_header_accept (<<>>) as l_accept then + l_request.add_header(l_accept,"Accept"); + end + l_request.add_header(api_client.select_header_content_type (<<"application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16">>),"Content-Type") + l_request.set_auth_names (<<>>) + l_response := api_client.call_api (l_path, "Post", l_request, agent serializer, Void) + if l_response.has_error then + last_error := l_response.error + end + end + fake_outer_boolean_serialize (body: BOOLEAN): detachable BOOLEAN -- -- Test serialization of outer boolean types @@ -59,11 +89,11 @@ feature -- API Access end end - fake_outer_composite_serialize (outer_composite: detachable OUTER_COMPOSITE): detachable OUTER_COMPOSITE + fake_outer_composite_serialize (body: detachable OUTER_COMPOSITE): detachable OUTER_COMPOSITE -- -- Test serialization of object with outer number type -- - -- argument: outer_composite Input composite as post body (optional) + -- argument: body Input composite as post body (optional) -- -- -- Result OUTER_COMPOSITE @@ -75,7 +105,7 @@ feature -- API Access do reset_error create l_request - l_request.set_body(outer_composite) + l_request.set_body(body) l_path := "/fake/outer/composite" @@ -164,13 +194,43 @@ feature -- API Access end end - test_body_with_query_params (query: STRING_32; user: USER) + test_body_with_file_schema (body: FILE_SCHEMA_TEST_CLASS) + -- + -- For this test, the body for this request much reference a schema named `File`. + -- + -- argument: body (required) + -- + -- + require + local + l_path: STRING + l_request: API_CLIENT_REQUEST + l_response: API_CLIENT_RESPONSE + do + reset_error + create l_request + l_request.set_body(body) + l_path := "/fake/body-with-file-schema" + + + if attached {STRING} api_client.select_header_accept (<<>>) as l_accept then + l_request.add_header(l_accept,"Accept"); + end + l_request.add_header(api_client.select_header_content_type (<<"application/json">>),"Content-Type") + l_request.set_auth_names (<<>>) + l_response := api_client.call_api (l_path, "Put", l_request, agent serializer, Void) + if l_response.has_error then + last_error := l_response.error + end + end + + test_body_with_query_params (query: STRING_32; body: USER) -- -- -- -- argument: query (required) -- - -- argument: user (required) + -- argument: body (required) -- -- require @@ -181,7 +241,7 @@ feature -- API Access do reset_error create l_request - l_request.set_body(user) + l_request.set_body(body) l_path := "/fake/body-with-query-params" l_request.fill_query_params(api_client.parameter_to_tuple("", "query", query)); @@ -197,11 +257,11 @@ feature -- API Access end end - test_client_model (client: CLIENT): detachable CLIENT + test_client_model (body: CLIENT): detachable CLIENT -- To test \"client\" model -- To test \"client\" model -- - -- argument: client client model (required) + -- argument: body client model (required) -- -- -- Result CLIENT @@ -213,7 +273,7 @@ feature -- API Access do reset_error create l_request - l_request.set_body(client) + l_request.set_body(body) l_path := "/fake" @@ -232,7 +292,7 @@ feature -- API Access end end - test_endpoint_parameters (number: REAL_32; double: REAL_64; pattern_without_delimiter: STRING_32; byte: ARRAY [NATURAL_8]; integer: INTEGER_32; int32: INTEGER_32; int64: INTEGER_64; float: REAL_32; string: STRING_32; binary: FILE; date: DATE; date_time: DATE_TIME; password: STRING_32; callback: STRING_32) + test_endpoint_parameters (number: REAL_32; double: REAL_64; pattern_without_delimiter: STRING_32; byte: ARRAY [NATURAL_8]; integer: INTEGER_32; int32: INTEGER_32; int64: INTEGER_64; float: REAL_32; string: STRING_32; binary: FILE; date: DATE; date_time: DATE_TIME; password: STRING; callback: STRING_32) -- Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -- Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -- @@ -339,21 +399,21 @@ feature -- API Access end end - test_enum_parameters (enum_header_string_array: detachable LIST [STRING_32]; enum_header_string: STRING_32; enum_query_string_array: detachable LIST [STRING_32]; enum_query_string: STRING_32; enum_query_integer: INTEGER_32; enum_query_double: REAL_64; enum_form_string_array: LIST [STRING_32]; enum_form_string: STRING_32) + test_enum_parameters (enum_header_string_array: detachable LIST [STRING_32]; enum_header_string: STRING_32; enum_query_string_array: detachable LIST [STRING_32]; enum_query_string: STRING_32; enum_query_integer: INTEGER_32; enum_query_double: REAL_64; enum_form_string_array: detachable LIST [STRING_32]; enum_form_string: STRING_32) -- To test enum parameters -- To test enum parameters -- - -- argument: enum_header_string_array Header parameter enum test (string array) (optional) + -- argument: enum_header_string_array Header parameter enum test (string array) (optional, default to null) -- -- argument: enum_header_string Header parameter enum test (string) (optional, default to -efg) -- - -- argument: enum_query_string_array Query parameter enum test (string array) (optional) + -- argument: enum_query_string_array Query parameter enum test (string array) (optional, default to null) -- -- argument: enum_query_string Query parameter enum test (string) (optional, default to -efg) -- - -- argument: enum_query_integer Query parameter enum test (double) (optional) + -- argument: enum_query_integer Query parameter enum test (double) (optional, default to null) -- - -- argument: enum_query_double Query parameter enum test (double) (optional) + -- argument: enum_query_double Query parameter enum test (double) (optional, default to null) -- -- argument: enum_form_string_array Form parameter enum test (string array) (optional, default to $) -- @@ -399,11 +459,61 @@ feature -- API Access end end - test_inline_additional_properties (request_body: STRING_TABLE[STRING_32]) + test_group_parameters (required_string_group: INTEGER_32; required_boolean_group: BOOLEAN; required_int64_group: INTEGER_64; string_group: INTEGER_32; boolean_group: BOOLEAN; int64_group: INTEGER_64) + -- Fake endpoint to test group parameters (optional) + -- Fake endpoint to test group parameters (optional) + -- + -- argument: required_string_group Required String in group parameters (required) + -- + -- argument: required_boolean_group Required Boolean in group parameters (required) + -- + -- argument: required_int64_group Required Integer in group parameters (required) + -- + -- argument: string_group String in group parameters (optional, default to null) + -- + -- argument: boolean_group Boolean in group parameters (optional, default to null) + -- + -- argument: int64_group Integer in group parameters (optional, default to null) + -- + -- + require + local + l_path: STRING + l_request: API_CLIENT_REQUEST + l_response: API_CLIENT_RESPONSE + do + reset_error + create l_request + + l_path := "/fake" + l_request.fill_query_params(api_client.parameter_to_tuple("", "required_string_group", required_string_group)); + l_request.fill_query_params(api_client.parameter_to_tuple("", "required_int64_group", required_int64_group)); + l_request.fill_query_params(api_client.parameter_to_tuple("", "string_group", string_group)); + l_request.fill_query_params(api_client.parameter_to_tuple("", "int64_group", int64_group)); + + if attached required_boolean_group as l_required_boolean_group then + l_request.add_header(l_required_boolean_group.out,"required_boolean_group"); + end + if attached boolean_group as l_boolean_group then + l_request.add_header(l_boolean_group.out,"boolean_group"); + end + + if attached {STRING} api_client.select_header_accept (<<>>) as l_accept then + l_request.add_header(l_accept,"Accept"); + end + l_request.add_header(api_client.select_header_content_type (<<>>),"Content-Type") + l_request.set_auth_names (<<>>) + l_response := api_client.call_api (l_path, "Delete", l_request, agent serializer, Void) + if l_response.has_error then + last_error := l_response.error + end + end + + test_inline_additional_properties (param: STRING_TABLE[STRING_32]) -- test inline additionalProperties -- -- - -- argument: request_body request body (required) + -- argument: param request body (required) -- -- require @@ -414,7 +524,7 @@ feature -- API Access do reset_error create l_request - l_request.set_body(request_body) + l_request.set_body(param) l_path := "/fake/inline-additionalProperties" diff --git a/samples/client/petstore/eiffel/src/api/fake_classname_tags123_api.e b/samples/client/petstore/eiffel/src/api/fake_classname_tags123_api.e index de7f29df8af5..51544cb912f5 100644 --- a/samples/client/petstore/eiffel/src/api/fake_classname_tags123_api.e +++ b/samples/client/petstore/eiffel/src/api/fake_classname_tags123_api.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,11 +24,11 @@ inherit feature -- API Access - test_classname (client: CLIENT): detachable CLIENT + test_classname (body: CLIENT): detachable CLIENT -- To test class name in snake case -- To test class name in snake case -- - -- argument: client client model (required) + -- argument: body client model (required) -- -- -- Result CLIENT @@ -40,7 +40,7 @@ feature -- API Access do reset_error create l_request - l_request.set_body(client) + l_request.set_body(body) l_path := "/fake_classname_test" diff --git a/samples/client/petstore/eiffel/src/api/pet_api.e b/samples/client/petstore/eiffel/src/api/pet_api.e index 17a482737ed5..9d0a9967dfd4 100644 --- a/samples/client/petstore/eiffel/src/api/pet_api.e +++ b/samples/client/petstore/eiffel/src/api/pet_api.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,11 +24,11 @@ inherit feature -- API Access - add_pet (pet: PET) + add_pet (body: PET) -- Add a new pet to the store -- -- - -- argument: pet Pet object that needs to be added to the store (required) + -- argument: body Pet object that needs to be added to the store (required) -- -- require @@ -39,7 +39,7 @@ feature -- API Access do reset_error create l_request - l_request.set_body(pet) + l_request.set_body(body) l_path := "/pet" @@ -60,7 +60,7 @@ feature -- API Access -- -- argument: pet_id Pet id to delete (required) -- - -- argument: api_key (optional) + -- argument: api_key (optional, default to null) -- -- require @@ -198,11 +198,11 @@ feature -- API Access end end - update_pet (pet: PET) + update_pet (body: PET) -- Update an existing pet -- -- - -- argument: pet Pet object that needs to be added to the store (required) + -- argument: body Pet object that needs to be added to the store (required) -- -- require @@ -213,7 +213,7 @@ feature -- API Access do reset_error create l_request - l_request.set_body(pet) + l_request.set_body(body) l_path := "/pet" @@ -315,5 +315,51 @@ feature -- API Access end end + upload_file_with_required_file (pet_id: INTEGER_64; required_file: FILE; additional_metadata: STRING_32): detachable API_RESPONSE + -- uploads an image (required) + -- + -- + -- argument: pet_id ID of pet to update (required) + -- + -- argument: required_file file to upload (required) + -- + -- argument: additional_metadata Additional data to pass to server (optional, default to null) + -- + -- + -- Result API_RESPONSE + require + local + l_path: STRING + l_request: API_CLIENT_REQUEST + l_response: API_CLIENT_RESPONSE + do + reset_error + create l_request + + l_path := "/fake/{petId}/uploadImageWithRequiredFile" + l_path.replace_substring_all ("{"+"petId"+"}", api_client.url_encode (pet_id.out)) + + if attached additional_metadata as l_additional_metadata then + l_request.add_form(l_additional_metadata,"additionalMetadata"); + end + if attached required_file as l_required_file then + l_request.add_form(l_required_file,"requiredFile"); + end + + if attached {STRING} api_client.select_header_accept (<<"application/json">>) as l_accept then + l_request.add_header(l_accept,"Accept"); + end + l_request.add_header(api_client.select_header_content_type (<<"multipart/form-data">>),"Content-Type") + l_request.set_auth_names (<<"petstore_auth">>) + l_response := api_client.call_api (l_path, "Post", l_request, Void, agent deserializer) + if l_response.has_error then + last_error := l_response.error + elseif attached { API_RESPONSE } l_response.data ({ API_RESPONSE }) as l_data then + Result := l_data + else + create last_error.make ("Unknown error: Status response [ " + l_response.status.out + "]") + end + end + end diff --git a/samples/client/petstore/eiffel/src/api/store_api.e b/samples/client/petstore/eiffel/src/api/store_api.e index 2f0854b3b391..d5d4177baae0 100644 --- a/samples/client/petstore/eiffel/src/api/store_api.e +++ b/samples/client/petstore/eiffel/src/api/store_api.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -126,11 +126,11 @@ feature -- API Access end end - place_order (order: ORDER): detachable ORDER + place_order (body: ORDER): detachable ORDER -- Place an order for a pet -- -- - -- argument: order order placed for purchasing the pet (required) + -- argument: body order placed for purchasing the pet (required) -- -- -- Result ORDER @@ -142,7 +142,7 @@ feature -- API Access do reset_error create l_request - l_request.set_body(order) + l_request.set_body(body) l_path := "/store/order" diff --git a/samples/client/petstore/eiffel/src/api/user_api.e b/samples/client/petstore/eiffel/src/api/user_api.e index 3b5703b40cfb..7e64a8fa4373 100644 --- a/samples/client/petstore/eiffel/src/api/user_api.e +++ b/samples/client/petstore/eiffel/src/api/user_api.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,11 +24,11 @@ inherit feature -- API Access - create_user (user: USER) + create_user (body: USER) -- Create user -- This can only be done by the logged in user. -- - -- argument: user Created user object (required) + -- argument: body Created user object (required) -- -- require @@ -39,7 +39,7 @@ feature -- API Access do reset_error create l_request - l_request.set_body(user) + l_request.set_body(body) l_path := "/user" @@ -54,11 +54,11 @@ feature -- API Access end end - create_users_with_array_input (user: LIST [USER]) + create_users_with_array_input (body: LIST [USER]) -- Creates list of users with given input array -- -- - -- argument: user List of user object (required) + -- argument: body List of user object (required) -- -- require @@ -69,7 +69,7 @@ feature -- API Access do reset_error create l_request - l_request.set_body(user) + l_request.set_body(body) l_path := "/user/createWithArray" @@ -84,11 +84,11 @@ feature -- API Access end end - create_users_with_list_input (user: LIST [USER]) + create_users_with_list_input (body: LIST [USER]) -- Creates list of users with given input array -- -- - -- argument: user List of user object (required) + -- argument: body List of user object (required) -- -- require @@ -99,7 +99,7 @@ feature -- API Access do reset_error create l_request - l_request.set_body(user) + l_request.set_body(body) l_path := "/user/createWithList" @@ -212,13 +212,13 @@ feature -- API Access end end - update_user (username: STRING_32; user: USER) + update_user (username: STRING_32; body: USER) -- Updated user -- This can only be done by the logged in user. -- -- argument: username name that need to be deleted (required) -- - -- argument: user Updated user object (required) + -- argument: body Updated user object (required) -- -- require @@ -229,7 +229,7 @@ feature -- API Access do reset_error create l_request - l_request.set_body(user) + l_request.set_body(body) l_path := "/user/{username}" l_path.replace_substring_all ("{"+"username"+"}", api_client.url_encode (username.out)) diff --git a/samples/client/petstore/eiffel/src/api_client.e b/samples/client/petstore/eiffel/src/api_client.e index 6397c4293d65..47b5fba938b8 100644 --- a/samples/client/petstore/eiffel/src/api_client.e +++ b/samples/client/petstore/eiffel/src/api_client.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/additional_properties_any_type.e b/samples/client/petstore/eiffel/src/domain/additional_properties_any_type.e new file mode 100644 index 000000000000..5edc1857574c --- /dev/null +++ b/samples/client/petstore/eiffel/src/domain/additional_properties_any_type.e @@ -0,0 +1,68 @@ +note + description:"[ + OpenAPI Petstore + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + The version of the OpenAPI document: 1.0.0 + + + NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + ]" + date: "$Date$" + revision: "$Revision$" + EIS:"Eiffel openapi generator", "src=https://openapi-generator.tech", "protocol=uri" +class ADDITIONAL_PROPERTIES_ANY_TYPE + +inherit + + ANY + redefine + out + select + out + end + + STRING_TABLE [ANY] + rename + out as out_, + is_equal as is_equal_, + copy as copy_ + select + is_equal_, + copy_ + end + +feature --Access + + name: detachable STRING_32 + + +feature -- Change Element + + set_name (a_name: like name) + -- Set 'name' with 'a_name'. + do + name := a_name + ensure + name_set: name = a_name + end + + + feature -- Status Report + + out: STRING + -- + do + create Result.make_empty + Result.append(out_) + Result.append("%Nclass ADDITIONAL_PROPERTIES_ANY_TYPE%N") + if attached name as l_name then + Result.append ("%Nname:") + Result.append (l_name.out) + Result.append ("%N") + end + end +end + + diff --git a/samples/client/petstore/eiffel/src/domain/additional_properties_array.e b/samples/client/petstore/eiffel/src/domain/additional_properties_array.e new file mode 100644 index 000000000000..b7ea0ec3b1b5 --- /dev/null +++ b/samples/client/petstore/eiffel/src/domain/additional_properties_array.e @@ -0,0 +1,68 @@ +note + description:"[ + OpenAPI Petstore + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + The version of the OpenAPI document: 1.0.0 + + + NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + ]" + date: "$Date$" + revision: "$Revision$" + EIS:"Eiffel openapi generator", "src=https://openapi-generator.tech", "protocol=uri" +class ADDITIONAL_PROPERTIES_ARRAY + +inherit + + ANY + redefine + out + select + out + end + + STRING_TABLE [LIST] + rename + out as out_, + is_equal as is_equal_, + copy as copy_ + select + is_equal_, + copy_ + end + +feature --Access + + name: detachable STRING_32 + + +feature -- Change Element + + set_name (a_name: like name) + -- Set 'name' with 'a_name'. + do + name := a_name + ensure + name_set: name = a_name + end + + + feature -- Status Report + + out: STRING + -- + do + create Result.make_empty + Result.append(out_) + Result.append("%Nclass ADDITIONAL_PROPERTIES_ARRAY%N") + if attached name as l_name then + Result.append ("%Nname:") + Result.append (l_name.out) + Result.append ("%N") + end + end +end + + diff --git a/samples/client/petstore/eiffel/src/domain/additional_properties_boolean.e b/samples/client/petstore/eiffel/src/domain/additional_properties_boolean.e new file mode 100644 index 000000000000..6bd64ddff15f --- /dev/null +++ b/samples/client/petstore/eiffel/src/domain/additional_properties_boolean.e @@ -0,0 +1,68 @@ +note + description:"[ + OpenAPI Petstore + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + The version of the OpenAPI document: 1.0.0 + + + NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + ]" + date: "$Date$" + revision: "$Revision$" + EIS:"Eiffel openapi generator", "src=https://openapi-generator.tech", "protocol=uri" +class ADDITIONAL_PROPERTIES_BOOLEAN + +inherit + + ANY + redefine + out + select + out + end + + STRING_TABLE [BOOLEAN] + rename + out as out_, + is_equal as is_equal_, + copy as copy_ + select + is_equal_, + copy_ + end + +feature --Access + + name: detachable STRING_32 + + +feature -- Change Element + + set_name (a_name: like name) + -- Set 'name' with 'a_name'. + do + name := a_name + ensure + name_set: name = a_name + end + + + feature -- Status Report + + out: STRING + -- + do + create Result.make_empty + Result.append(out_) + Result.append("%Nclass ADDITIONAL_PROPERTIES_BOOLEAN%N") + if attached name as l_name then + Result.append ("%Nname:") + Result.append (l_name.out) + Result.append ("%N") + end + end +end + + diff --git a/samples/client/petstore/eiffel/src/domain/additional_properties_class.e b/samples/client/petstore/eiffel/src/domain/additional_properties_class.e index f11b85fd0073..8e0af3ebc2c8 100644 --- a/samples/client/petstore/eiffel/src/domain/additional_properties_class.e +++ b/samples/client/petstore/eiffel/src/domain/additional_properties_class.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,27 +24,117 @@ inherit feature --Access - map_property: detachable STRING_TABLE[STRING_32] + map_string: detachable STRING_TABLE[STRING_32] - map_of_map_property: detachable STRING_TABLE[STRING_TABLE[STRING_32]] + map_number: STRING_TABLE[REAL_32] + + map_integer: STRING_TABLE[INTEGER_32] + + map_boolean: STRING_TABLE[BOOLEAN] + + map_array_integer: detachable STRING_TABLE[LIST [INTEGER_32]] + + map_array_anytype: detachable STRING_TABLE[LIST [ANY]] + + map_map_string: detachable STRING_TABLE[STRING_TABLE[STRING_32]] + + map_map_anytype: detachable STRING_TABLE[STRING_TABLE[ANY]] + + anytype_1: detachable ANY + + anytype_2: detachable ANY + + anytype_3: detachable ANY feature -- Change Element - set_map_property (a_name: like map_property) - -- Set 'map_property' with 'a_name'. + set_map_string (a_name: like map_string) + -- Set 'map_string' with 'a_name'. + do + map_string := a_name + ensure + map_string_set: map_string = a_name + end + + set_map_number (a_name: like map_number) + -- Set 'map_number' with 'a_name'. + do + map_number := a_name + ensure + map_number_set: map_number = a_name + end + + set_map_integer (a_name: like map_integer) + -- Set 'map_integer' with 'a_name'. + do + map_integer := a_name + ensure + map_integer_set: map_integer = a_name + end + + set_map_boolean (a_name: like map_boolean) + -- Set 'map_boolean' with 'a_name'. + do + map_boolean := a_name + ensure + map_boolean_set: map_boolean = a_name + end + + set_map_array_integer (a_name: like map_array_integer) + -- Set 'map_array_integer' with 'a_name'. do - map_property := a_name + map_array_integer := a_name ensure - map_property_set: map_property = a_name + map_array_integer_set: map_array_integer = a_name end - set_map_of_map_property (a_name: like map_of_map_property) - -- Set 'map_of_map_property' with 'a_name'. + set_map_array_anytype (a_name: like map_array_anytype) + -- Set 'map_array_anytype' with 'a_name'. do - map_of_map_property := a_name + map_array_anytype := a_name ensure - map_of_map_property_set: map_of_map_property = a_name + map_array_anytype_set: map_array_anytype = a_name + end + + set_map_map_string (a_name: like map_map_string) + -- Set 'map_map_string' with 'a_name'. + do + map_map_string := a_name + ensure + map_map_string_set: map_map_string = a_name + end + + set_map_map_anytype (a_name: like map_map_anytype) + -- Set 'map_map_anytype' with 'a_name'. + do + map_map_anytype := a_name + ensure + map_map_anytype_set: map_map_anytype = a_name + end + + set_anytype_1 (a_name: like anytype_1) + -- Set 'anytype_1' with 'a_name'. + do + anytype_1 := a_name + ensure + anytype_1_set: anytype_1 = a_name + end + + set_anytype_2 (a_name: like anytype_2) + -- Set 'anytype_2' with 'a_name'. + do + anytype_2 := a_name + ensure + anytype_2_set: anytype_2 = a_name + end + + set_anytype_3 (a_name: like anytype_3) + -- Set 'anytype_3' with 'a_name'. + do + anytype_3 := a_name + ensure + anytype_3_set: anytype_3 = a_name end @@ -55,9 +145,81 @@ feature -- Change Element do create Result.make_empty Result.append("%Nclass ADDITIONAL_PROPERTIES_CLASS%N") - if attached map_property as l_map_property then - Result.append ("%Nmap_property:") - across l_map_property as ic loop + if attached map_string as l_map_string then + Result.append ("%Nmap_string:") + across l_map_string as ic loop + Result.append ("%N") + Result.append ("key:") + Result.append (ic.key.out) + Result.append (" - ") + Result.append ("val:") + Result.append (ic.item.out) + Result.append ("%N") + end + end + if attached map_number as l_map_number then + Result.append ("%Nmap_number:") + across l_map_number as ic loop + Result.append ("%N") + Result.append ("key:") + Result.append (ic.key.out) + Result.append (" - ") + Result.append ("val:") + Result.append (ic.item.out) + Result.append ("%N") + end + end + if attached map_integer as l_map_integer then + Result.append ("%Nmap_integer:") + across l_map_integer as ic loop + Result.append ("%N") + Result.append ("key:") + Result.append (ic.key.out) + Result.append (" - ") + Result.append ("val:") + Result.append (ic.item.out) + Result.append ("%N") + end + end + if attached map_boolean as l_map_boolean then + Result.append ("%Nmap_boolean:") + across l_map_boolean as ic loop + Result.append ("%N") + Result.append ("key:") + Result.append (ic.key.out) + Result.append (" - ") + Result.append ("val:") + Result.append (ic.item.out) + Result.append ("%N") + end + end + if attached map_array_integer as l_map_array_integer then + Result.append ("%Nmap_array_integer:") + across l_map_array_integer as ic loop + Result.append ("%N") + Result.append ("key:") + Result.append (ic.key.out) + Result.append (" - ") + Result.append ("val:") + Result.append (ic.item.out) + Result.append ("%N") + end + end + if attached map_array_anytype as l_map_array_anytype then + Result.append ("%Nmap_array_anytype:") + across l_map_array_anytype as ic loop + Result.append ("%N") + Result.append ("key:") + Result.append (ic.key.out) + Result.append (" - ") + Result.append ("val:") + Result.append (ic.item.out) + Result.append ("%N") + end + end + if attached map_map_string as l_map_map_string then + Result.append ("%Nmap_map_string:") + across l_map_map_string as ic loop Result.append ("%N") Result.append ("key:") Result.append (ic.key.out) @@ -67,9 +229,9 @@ feature -- Change Element Result.append ("%N") end end - if attached map_of_map_property as l_map_of_map_property then - Result.append ("%Nmap_of_map_property:") - across l_map_of_map_property as ic loop + if attached map_map_anytype as l_map_map_anytype then + Result.append ("%Nmap_map_anytype:") + across l_map_map_anytype as ic loop Result.append ("%N") Result.append ("key:") Result.append (ic.key.out) @@ -79,6 +241,21 @@ feature -- Change Element Result.append ("%N") end end + if attached anytype_1 as l_anytype_1 then + Result.append ("%Nanytype_1:") + Result.append (l_anytype_1.out) + Result.append ("%N") + end + if attached anytype_2 as l_anytype_2 then + Result.append ("%Nanytype_2:") + Result.append (l_anytype_2.out) + Result.append ("%N") + end + if attached anytype_3 as l_anytype_3 then + Result.append ("%Nanytype_3:") + Result.append (l_anytype_3.out) + Result.append ("%N") + end end end diff --git a/samples/client/petstore/eiffel/src/domain/additional_properties_integer.e b/samples/client/petstore/eiffel/src/domain/additional_properties_integer.e new file mode 100644 index 000000000000..5264bf0e05af --- /dev/null +++ b/samples/client/petstore/eiffel/src/domain/additional_properties_integer.e @@ -0,0 +1,68 @@ +note + description:"[ + OpenAPI Petstore + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + The version of the OpenAPI document: 1.0.0 + + + NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + ]" + date: "$Date$" + revision: "$Revision$" + EIS:"Eiffel openapi generator", "src=https://openapi-generator.tech", "protocol=uri" +class ADDITIONAL_PROPERTIES_INTEGER + +inherit + + ANY + redefine + out + select + out + end + + STRING_TABLE [INTEGER_32] + rename + out as out_, + is_equal as is_equal_, + copy as copy_ + select + is_equal_, + copy_ + end + +feature --Access + + name: detachable STRING_32 + + +feature -- Change Element + + set_name (a_name: like name) + -- Set 'name' with 'a_name'. + do + name := a_name + ensure + name_set: name = a_name + end + + + feature -- Status Report + + out: STRING + -- + do + create Result.make_empty + Result.append(out_) + Result.append("%Nclass ADDITIONAL_PROPERTIES_INTEGER%N") + if attached name as l_name then + Result.append ("%Nname:") + Result.append (l_name.out) + Result.append ("%N") + end + end +end + + diff --git a/samples/client/petstore/eiffel/src/domain/additional_properties_number.e b/samples/client/petstore/eiffel/src/domain/additional_properties_number.e new file mode 100644 index 000000000000..d7c2712722c6 --- /dev/null +++ b/samples/client/petstore/eiffel/src/domain/additional_properties_number.e @@ -0,0 +1,68 @@ +note + description:"[ + OpenAPI Petstore + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + The version of the OpenAPI document: 1.0.0 + + + NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + ]" + date: "$Date$" + revision: "$Revision$" + EIS:"Eiffel openapi generator", "src=https://openapi-generator.tech", "protocol=uri" +class ADDITIONAL_PROPERTIES_NUMBER + +inherit + + ANY + redefine + out + select + out + end + + STRING_TABLE [REAL_32] + rename + out as out_, + is_equal as is_equal_, + copy as copy_ + select + is_equal_, + copy_ + end + +feature --Access + + name: detachable STRING_32 + + +feature -- Change Element + + set_name (a_name: like name) + -- Set 'name' with 'a_name'. + do + name := a_name + ensure + name_set: name = a_name + end + + + feature -- Status Report + + out: STRING + -- + do + create Result.make_empty + Result.append(out_) + Result.append("%Nclass ADDITIONAL_PROPERTIES_NUMBER%N") + if attached name as l_name then + Result.append ("%Nname:") + Result.append (l_name.out) + Result.append ("%N") + end + end +end + + diff --git a/samples/client/petstore/eiffel/src/domain/additional_properties_object.e b/samples/client/petstore/eiffel/src/domain/additional_properties_object.e new file mode 100644 index 000000000000..ef50e21fb4d8 --- /dev/null +++ b/samples/client/petstore/eiffel/src/domain/additional_properties_object.e @@ -0,0 +1,68 @@ +note + description:"[ + OpenAPI Petstore + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + The version of the OpenAPI document: 1.0.0 + + + NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + ]" + date: "$Date$" + revision: "$Revision$" + EIS:"Eiffel openapi generator", "src=https://openapi-generator.tech", "protocol=uri" +class ADDITIONAL_PROPERTIES_OBJECT + +inherit + + ANY + redefine + out + select + out + end + + STRING_TABLE [STRING_TABLE] + rename + out as out_, + is_equal as is_equal_, + copy as copy_ + select + is_equal_, + copy_ + end + +feature --Access + + name: detachable STRING_32 + + +feature -- Change Element + + set_name (a_name: like name) + -- Set 'name' with 'a_name'. + do + name := a_name + ensure + name_set: name = a_name + end + + + feature -- Status Report + + out: STRING + -- + do + create Result.make_empty + Result.append(out_) + Result.append("%Nclass ADDITIONAL_PROPERTIES_OBJECT%N") + if attached name as l_name then + Result.append ("%Nname:") + Result.append (l_name.out) + Result.append ("%N") + end + end +end + + diff --git a/samples/client/petstore/eiffel/src/domain/additional_properties_string.e b/samples/client/petstore/eiffel/src/domain/additional_properties_string.e new file mode 100644 index 000000000000..6ab6ba196885 --- /dev/null +++ b/samples/client/petstore/eiffel/src/domain/additional_properties_string.e @@ -0,0 +1,68 @@ +note + description:"[ + OpenAPI Petstore + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + The version of the OpenAPI document: 1.0.0 + + + NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + ]" + date: "$Date$" + revision: "$Revision$" + EIS:"Eiffel openapi generator", "src=https://openapi-generator.tech", "protocol=uri" +class ADDITIONAL_PROPERTIES_STRING + +inherit + + ANY + redefine + out + select + out + end + + STRING_TABLE [STRING_32] + rename + out as out_, + is_equal as is_equal_, + copy as copy_ + select + is_equal_, + copy_ + end + +feature --Access + + name: detachable STRING_32 + + +feature -- Change Element + + set_name (a_name: like name) + -- Set 'name' with 'a_name'. + do + name := a_name + ensure + name_set: name = a_name + end + + + feature -- Status Report + + out: STRING + -- + do + create Result.make_empty + Result.append(out_) + Result.append("%Nclass ADDITIONAL_PROPERTIES_STRING%N") + if attached name as l_name then + Result.append ("%Nname:") + Result.append (l_name.out) + Result.append ("%N") + end + end +end + + diff --git a/samples/client/petstore/eiffel/src/domain/animal.e b/samples/client/petstore/eiffel/src/domain/animal.e index 72fa473c5a0e..4d5f28f87198 100644 --- a/samples/client/petstore/eiffel/src/domain/animal.e +++ b/samples/client/petstore/eiffel/src/domain/animal.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/api_response.e b/samples/client/petstore/eiffel/src/domain/api_response.e index 8b3e64ff0467..a88da23e821a 100644 --- a/samples/client/petstore/eiffel/src/domain/api_response.e +++ b/samples/client/petstore/eiffel/src/domain/api_response.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/array_of_array_of_number_only.e b/samples/client/petstore/eiffel/src/domain/array_of_array_of_number_only.e index b261e583d68a..f0d431208be3 100644 --- a/samples/client/petstore/eiffel/src/domain/array_of_array_of_number_only.e +++ b/samples/client/petstore/eiffel/src/domain/array_of_array_of_number_only.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/array_of_number_only.e b/samples/client/petstore/eiffel/src/domain/array_of_number_only.e index 5a37891c5002..611adaf481e9 100644 --- a/samples/client/petstore/eiffel/src/domain/array_of_number_only.e +++ b/samples/client/petstore/eiffel/src/domain/array_of_number_only.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/array_test.e b/samples/client/petstore/eiffel/src/domain/array_test.e index a0c54fcf6feb..7a8d26ad4d40 100644 --- a/samples/client/petstore/eiffel/src/domain/array_test.e +++ b/samples/client/petstore/eiffel/src/domain/array_test.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/capitalization.e b/samples/client/petstore/eiffel/src/domain/capitalization.e index b5b4c5b238a4..04eb0f9fbe21 100644 --- a/samples/client/petstore/eiffel/src/domain/capitalization.e +++ b/samples/client/petstore/eiffel/src/domain/capitalization.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/cat.e b/samples/client/petstore/eiffel/src/domain/cat.e index c041e4d8db55..2dd7e4d5149f 100644 --- a/samples/client/petstore/eiffel/src/domain/cat.e +++ b/samples/client/petstore/eiffel/src/domain/cat.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/cat_all_of.e b/samples/client/petstore/eiffel/src/domain/cat_all_of.e new file mode 100644 index 000000000000..2c8efa716a2c --- /dev/null +++ b/samples/client/petstore/eiffel/src/domain/cat_all_of.e @@ -0,0 +1,56 @@ +note + description:"[ + OpenAPI Petstore + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + The version of the OpenAPI document: 1.0.0 + + + NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + ]" + date: "$Date$" + revision: "$Revision$" + EIS:"Eiffel openapi generator", "src=https://openapi-generator.tech", "protocol=uri" +class CAT_ALL_OF + +inherit + + ANY + redefine + out + end + + +feature --Access + + declawed: BOOLEAN + + +feature -- Change Element + + set_declawed (a_name: like declawed) + -- Set 'declawed' with 'a_name'. + do + declawed := a_name + ensure + declawed_set: declawed = a_name + end + + + feature -- Status Report + + out: STRING + -- + do + create Result.make_empty + Result.append("%Nclass CAT_ALL_OF%N") + if attached declawed as l_declawed then + Result.append ("%Ndeclawed:") + Result.append (l_declawed.out) + Result.append ("%N") + end + end +end + + diff --git a/samples/client/petstore/eiffel/src/domain/category.e b/samples/client/petstore/eiffel/src/domain/category.e index 8bd714c7261c..73b059252de8 100644 --- a/samples/client/petstore/eiffel/src/domain/category.e +++ b/samples/client/petstore/eiffel/src/domain/category.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/class_model.e b/samples/client/petstore/eiffel/src/domain/class_model.e index 711a9a568445..fb1f96792972 100644 --- a/samples/client/petstore/eiffel/src/domain/class_model.e +++ b/samples/client/petstore/eiffel/src/domain/class_model.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/client.e b/samples/client/petstore/eiffel/src/domain/client.e index 666e391e516c..dad51e110e55 100644 --- a/samples/client/petstore/eiffel/src/domain/client.e +++ b/samples/client/petstore/eiffel/src/domain/client.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/dog.e b/samples/client/petstore/eiffel/src/domain/dog.e index 120d8b86f9c3..5cd110fe11d3 100644 --- a/samples/client/petstore/eiffel/src/domain/dog.e +++ b/samples/client/petstore/eiffel/src/domain/dog.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/dog_all_of.e b/samples/client/petstore/eiffel/src/domain/dog_all_of.e new file mode 100644 index 000000000000..9e3dabd477f8 --- /dev/null +++ b/samples/client/petstore/eiffel/src/domain/dog_all_of.e @@ -0,0 +1,56 @@ +note + description:"[ + OpenAPI Petstore + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + The version of the OpenAPI document: 1.0.0 + + + NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + ]" + date: "$Date$" + revision: "$Revision$" + EIS:"Eiffel openapi generator", "src=https://openapi-generator.tech", "protocol=uri" +class DOG_ALL_OF + +inherit + + ANY + redefine + out + end + + +feature --Access + + breed: detachable STRING_32 + + +feature -- Change Element + + set_breed (a_name: like breed) + -- Set 'breed' with 'a_name'. + do + breed := a_name + ensure + breed_set: breed = a_name + end + + + feature -- Status Report + + out: STRING + -- + do + create Result.make_empty + Result.append("%Nclass DOG_ALL_OF%N") + if attached breed as l_breed then + Result.append ("%Nbreed:") + Result.append (l_breed.out) + Result.append ("%N") + end + end +end + + diff --git a/samples/client/petstore/eiffel/src/domain/enum_arrays.e b/samples/client/petstore/eiffel/src/domain/enum_arrays.e index ddb0fd5594b2..7f3348347519 100644 --- a/samples/client/petstore/eiffel/src/domain/enum_arrays.e +++ b/samples/client/petstore/eiffel/src/domain/enum_arrays.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/enum_class.e b/samples/client/petstore/eiffel/src/domain/enum_class.e index 79a0e952b2f4..2b37b2f8ff50 100644 --- a/samples/client/petstore/eiffel/src/domain/enum_class.e +++ b/samples/client/petstore/eiffel/src/domain/enum_class.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/enum_test.e b/samples/client/petstore/eiffel/src/domain/enum_test.e index 87cf363f7015..273e2eb89580 100644 --- a/samples/client/petstore/eiffel/src/domain/enum_test.e +++ b/samples/client/petstore/eiffel/src/domain/enum_test.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/file_schema_test_class.e b/samples/client/petstore/eiffel/src/domain/file_schema_test_class.e new file mode 100644 index 000000000000..f3e5672546ae --- /dev/null +++ b/samples/client/petstore/eiffel/src/domain/file_schema_test_class.e @@ -0,0 +1,73 @@ +note + description:"[ + OpenAPI Petstore + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + The version of the OpenAPI document: 1.0.0 + + + NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + ]" + date: "$Date$" + revision: "$Revision$" + EIS:"Eiffel openapi generator", "src=https://openapi-generator.tech", "protocol=uri" +class FILE_SCHEMA_TEST_CLASS + +inherit + + ANY + redefine + out + end + + +feature --Access + + file: detachable FILE + + files: detachable LIST [FILE] + + +feature -- Change Element + + set_file (a_name: like file) + -- Set 'file' with 'a_name'. + do + file := a_name + ensure + file_set: file = a_name + end + + set_files (a_name: like files) + -- Set 'files' with 'a_name'. + do + files := a_name + ensure + files_set: files = a_name + end + + + feature -- Status Report + + out: STRING + -- + do + create Result.make_empty + Result.append("%Nclass FILE_SCHEMA_TEST_CLASS%N") + if attached file as l_file then + Result.append ("%Nfile:") + Result.append (l_file.out) + Result.append ("%N") + end + if attached files as l_files then + across l_files as ic loop + Result.append ("%N files:") + Result.append (ic.item.out) + Result.append ("%N") + end + end + end +end + + diff --git a/samples/client/petstore/eiffel/src/domain/format_test.e b/samples/client/petstore/eiffel/src/domain/format_test.e index 52d9167188f3..f8f7f6608d6b 100644 --- a/samples/client/petstore/eiffel/src/domain/format_test.e +++ b/samples/client/petstore/eiffel/src/domain/format_test.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -48,7 +48,7 @@ feature --Access uuid: detachable UUID - password: detachable STRING_32 + password: detachable STRING feature -- Change Element diff --git a/samples/client/petstore/eiffel/src/domain/has_only_read_only.e b/samples/client/petstore/eiffel/src/domain/has_only_read_only.e index 27cf1ba49d0e..80a9b8a78cc5 100644 --- a/samples/client/petstore/eiffel/src/domain/has_only_read_only.e +++ b/samples/client/petstore/eiffel/src/domain/has_only_read_only.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/map_test.e b/samples/client/petstore/eiffel/src/domain/map_test.e index 0e7cf934f014..62eb65c6e0c6 100644 --- a/samples/client/petstore/eiffel/src/domain/map_test.e +++ b/samples/client/petstore/eiffel/src/domain/map_test.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -28,6 +28,10 @@ feature --Access map_of_enum_string: detachable STRING_TABLE[STRING_32] + direct_map: STRING_TABLE[BOOLEAN] + + indirect_map: STRING_TABLE[BOOLEAN] + feature -- Change Element @@ -47,6 +51,22 @@ feature -- Change Element map_of_enum_string_set: map_of_enum_string = a_name end + set_direct_map (a_name: like direct_map) + -- Set 'direct_map' with 'a_name'. + do + direct_map := a_name + ensure + direct_map_set: direct_map = a_name + end + + set_indirect_map (a_name: like indirect_map) + -- Set 'indirect_map' with 'a_name'. + do + indirect_map := a_name + ensure + indirect_map_set: indirect_map = a_name + end + feature -- Status Report @@ -79,6 +99,30 @@ feature -- Change Element Result.append ("%N") end end + if attached direct_map as l_direct_map then + Result.append ("%Ndirect_map:") + across l_direct_map as ic loop + Result.append ("%N") + Result.append ("key:") + Result.append (ic.key.out) + Result.append (" - ") + Result.append ("val:") + Result.append (ic.item.out) + Result.append ("%N") + end + end + if attached indirect_map as l_indirect_map then + Result.append ("%Nindirect_map:") + across l_indirect_map as ic loop + Result.append ("%N") + Result.append ("key:") + Result.append (ic.key.out) + Result.append (" - ") + Result.append ("val:") + Result.append (ic.item.out) + Result.append ("%N") + end + end end end diff --git a/samples/client/petstore/eiffel/src/domain/mixed_properties_and_additional_properties_class.e b/samples/client/petstore/eiffel/src/domain/mixed_properties_and_additional_properties_class.e index 2bb76decc071..0f0880fc5210 100644 --- a/samples/client/petstore/eiffel/src/domain/mixed_properties_and_additional_properties_class.e +++ b/samples/client/petstore/eiffel/src/domain/mixed_properties_and_additional_properties_class.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/model_200_response.e b/samples/client/petstore/eiffel/src/domain/model_200_response.e index a365d406b58e..3228375b48d2 100644 --- a/samples/client/petstore/eiffel/src/domain/model_200_response.e +++ b/samples/client/petstore/eiffel/src/domain/model_200_response.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/name.e b/samples/client/petstore/eiffel/src/domain/name.e index 2d1c49cc0635..7ec27b4217a4 100644 --- a/samples/client/petstore/eiffel/src/domain/name.e +++ b/samples/client/petstore/eiffel/src/domain/name.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/number_only.e b/samples/client/petstore/eiffel/src/domain/number_only.e index 270cbcbea3c3..f761185c0cff 100644 --- a/samples/client/petstore/eiffel/src/domain/number_only.e +++ b/samples/client/petstore/eiffel/src/domain/number_only.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/order.e b/samples/client/petstore/eiffel/src/domain/order.e index 0da3b9349f94..b30db500ae5c 100644 --- a/samples/client/petstore/eiffel/src/domain/order.e +++ b/samples/client/petstore/eiffel/src/domain/order.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/outer_composite.e b/samples/client/petstore/eiffel/src/domain/outer_composite.e index 845476ed1513..986125f5941b 100644 --- a/samples/client/petstore/eiffel/src/domain/outer_composite.e +++ b/samples/client/petstore/eiffel/src/domain/outer_composite.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/outer_enum.e b/samples/client/petstore/eiffel/src/domain/outer_enum.e index c88e2c561a0e..6e93a0d41dc3 100644 --- a/samples/client/petstore/eiffel/src/domain/outer_enum.e +++ b/samples/client/petstore/eiffel/src/domain/outer_enum.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/pet.e b/samples/client/petstore/eiffel/src/domain/pet.e index 86d845c22e87..71c6620625c4 100644 --- a/samples/client/petstore/eiffel/src/domain/pet.e +++ b/samples/client/petstore/eiffel/src/domain/pet.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/read_only_first.e b/samples/client/petstore/eiffel/src/domain/read_only_first.e index 65d41d07fac4..278a836905cc 100644 --- a/samples/client/petstore/eiffel/src/domain/read_only_first.e +++ b/samples/client/petstore/eiffel/src/domain/read_only_first.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/return.e b/samples/client/petstore/eiffel/src/domain/return.e index 2e08c0f53d9f..063c921c6cd0 100644 --- a/samples/client/petstore/eiffel/src/domain/return.e +++ b/samples/client/petstore/eiffel/src/domain/return.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/special_model_name.e b/samples/client/petstore/eiffel/src/domain/special_model_name.e index 90e30e783f20..15c4b7f45126 100644 --- a/samples/client/petstore/eiffel/src/domain/special_model_name.e +++ b/samples/client/petstore/eiffel/src/domain/special_model_name.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/tag.e b/samples/client/petstore/eiffel/src/domain/tag.e index f62729bed5d2..61bf5592c1c0 100644 --- a/samples/client/petstore/eiffel/src/domain/tag.e +++ b/samples/client/petstore/eiffel/src/domain/tag.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/type_holder_default.e b/samples/client/petstore/eiffel/src/domain/type_holder_default.e new file mode 100644 index 000000000000..38fbda6f837b --- /dev/null +++ b/samples/client/petstore/eiffel/src/domain/type_holder_default.e @@ -0,0 +1,118 @@ +note + description:"[ + OpenAPI Petstore + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + The version of the OpenAPI document: 1.0.0 + + + NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + ]" + date: "$Date$" + revision: "$Revision$" + EIS:"Eiffel openapi generator", "src=https://openapi-generator.tech", "protocol=uri" +class TYPE_HOLDER_DEFAULT + +inherit + + ANY + redefine + out + end + + +feature --Access + + string_item: detachable STRING_32 + + number_item: REAL_32 + + integer_item: INTEGER_32 + + bool_item: BOOLEAN + + array_item: LIST [INTEGER_32] + + +feature -- Change Element + + set_string_item (a_name: like string_item) + -- Set 'string_item' with 'a_name'. + do + string_item := a_name + ensure + string_item_set: string_item = a_name + end + + set_number_item (a_name: like number_item) + -- Set 'number_item' with 'a_name'. + do + number_item := a_name + ensure + number_item_set: number_item = a_name + end + + set_integer_item (a_name: like integer_item) + -- Set 'integer_item' with 'a_name'. + do + integer_item := a_name + ensure + integer_item_set: integer_item = a_name + end + + set_bool_item (a_name: like bool_item) + -- Set 'bool_item' with 'a_name'. + do + bool_item := a_name + ensure + bool_item_set: bool_item = a_name + end + + set_array_item (a_name: like array_item) + -- Set 'array_item' with 'a_name'. + do + array_item := a_name + ensure + array_item_set: array_item = a_name + end + + + feature -- Status Report + + out: STRING + -- + do + create Result.make_empty + Result.append("%Nclass TYPE_HOLDER_DEFAULT%N") + if attached string_item as l_string_item then + Result.append ("%Nstring_item:") + Result.append (l_string_item.out) + Result.append ("%N") + end + if attached number_item as l_number_item then + Result.append ("%Nnumber_item:") + Result.append (l_number_item.out) + Result.append ("%N") + end + if attached integer_item as l_integer_item then + Result.append ("%Ninteger_item:") + Result.append (l_integer_item.out) + Result.append ("%N") + end + if attached bool_item as l_bool_item then + Result.append ("%Nbool_item:") + Result.append (l_bool_item.out) + Result.append ("%N") + end + if attached array_item as l_array_item then + across l_array_item as ic loop + Result.append ("%N array_item:") + Result.append (ic.item.out) + Result.append ("%N") + end + end + end +end + + diff --git a/samples/client/petstore/eiffel/src/domain/type_holder_example.e b/samples/client/petstore/eiffel/src/domain/type_holder_example.e new file mode 100644 index 000000000000..99f624622cbe --- /dev/null +++ b/samples/client/petstore/eiffel/src/domain/type_holder_example.e @@ -0,0 +1,118 @@ +note + description:"[ + OpenAPI Petstore + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + The version of the OpenAPI document: 1.0.0 + + + NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + ]" + date: "$Date$" + revision: "$Revision$" + EIS:"Eiffel openapi generator", "src=https://openapi-generator.tech", "protocol=uri" +class TYPE_HOLDER_EXAMPLE + +inherit + + ANY + redefine + out + end + + +feature --Access + + string_item: detachable STRING_32 + + number_item: REAL_32 + + integer_item: INTEGER_32 + + bool_item: BOOLEAN + + array_item: LIST [INTEGER_32] + + +feature -- Change Element + + set_string_item (a_name: like string_item) + -- Set 'string_item' with 'a_name'. + do + string_item := a_name + ensure + string_item_set: string_item = a_name + end + + set_number_item (a_name: like number_item) + -- Set 'number_item' with 'a_name'. + do + number_item := a_name + ensure + number_item_set: number_item = a_name + end + + set_integer_item (a_name: like integer_item) + -- Set 'integer_item' with 'a_name'. + do + integer_item := a_name + ensure + integer_item_set: integer_item = a_name + end + + set_bool_item (a_name: like bool_item) + -- Set 'bool_item' with 'a_name'. + do + bool_item := a_name + ensure + bool_item_set: bool_item = a_name + end + + set_array_item (a_name: like array_item) + -- Set 'array_item' with 'a_name'. + do + array_item := a_name + ensure + array_item_set: array_item = a_name + end + + + feature -- Status Report + + out: STRING + -- + do + create Result.make_empty + Result.append("%Nclass TYPE_HOLDER_EXAMPLE%N") + if attached string_item as l_string_item then + Result.append ("%Nstring_item:") + Result.append (l_string_item.out) + Result.append ("%N") + end + if attached number_item as l_number_item then + Result.append ("%Nnumber_item:") + Result.append (l_number_item.out) + Result.append ("%N") + end + if attached integer_item as l_integer_item then + Result.append ("%Ninteger_item:") + Result.append (l_integer_item.out) + Result.append ("%N") + end + if attached bool_item as l_bool_item then + Result.append ("%Nbool_item:") + Result.append (l_bool_item.out) + Result.append ("%N") + end + if attached array_item as l_array_item then + across l_array_item as ic loop + Result.append ("%N array_item:") + Result.append (ic.item.out) + Result.append ("%N") + end + end + end +end + + diff --git a/samples/client/petstore/eiffel/src/domain/user.e b/samples/client/petstore/eiffel/src/domain/user.e index 07586c1b55d1..5848fc7ca2bd 100644 --- a/samples/client/petstore/eiffel/src/domain/user.e +++ b/samples/client/petstore/eiffel/src/domain/user.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/xml_item.e b/samples/client/petstore/eiffel/src/domain/xml_item.e new file mode 100644 index 000000000000..b31846ba6d17 --- /dev/null +++ b/samples/client/petstore/eiffel/src/domain/xml_item.e @@ -0,0 +1,494 @@ +note + description:"[ + OpenAPI Petstore + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + The version of the OpenAPI document: 1.0.0 + + + NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + ]" + date: "$Date$" + revision: "$Revision$" + EIS:"Eiffel openapi generator", "src=https://openapi-generator.tech", "protocol=uri" +class XML_ITEM + +inherit + + ANY + redefine + out + end + + +feature --Access + + attribute_string: detachable STRING_32 + + attribute_number: REAL_32 + + attribute_integer: INTEGER_32 + + attribute_boolean: BOOLEAN + + wrapped_array: LIST [INTEGER_32] + + name_string: detachable STRING_32 + + name_number: REAL_32 + + name_integer: INTEGER_32 + + name_boolean: BOOLEAN + + name_array: LIST [INTEGER_32] + + name_wrapped_array: LIST [INTEGER_32] + + prefix_string: detachable STRING_32 + + prefix_number: REAL_32 + + prefix_integer: INTEGER_32 + + prefix_boolean: BOOLEAN + + prefix_array: LIST [INTEGER_32] + + prefix_wrapped_array: LIST [INTEGER_32] + + namespace_string: detachable STRING_32 + + namespace_number: REAL_32 + + namespace_integer: INTEGER_32 + + namespace_boolean: BOOLEAN + + namespace_array: LIST [INTEGER_32] + + namespace_wrapped_array: LIST [INTEGER_32] + + prefix_ns_string: detachable STRING_32 + + prefix_ns_number: REAL_32 + + prefix_ns_integer: INTEGER_32 + + prefix_ns_boolean: BOOLEAN + + prefix_ns_array: LIST [INTEGER_32] + + prefix_ns_wrapped_array: LIST [INTEGER_32] + + +feature -- Change Element + + set_attribute_string (a_name: like attribute_string) + -- Set 'attribute_string' with 'a_name'. + do + attribute_string := a_name + ensure + attribute_string_set: attribute_string = a_name + end + + set_attribute_number (a_name: like attribute_number) + -- Set 'attribute_number' with 'a_name'. + do + attribute_number := a_name + ensure + attribute_number_set: attribute_number = a_name + end + + set_attribute_integer (a_name: like attribute_integer) + -- Set 'attribute_integer' with 'a_name'. + do + attribute_integer := a_name + ensure + attribute_integer_set: attribute_integer = a_name + end + + set_attribute_boolean (a_name: like attribute_boolean) + -- Set 'attribute_boolean' with 'a_name'. + do + attribute_boolean := a_name + ensure + attribute_boolean_set: attribute_boolean = a_name + end + + set_wrapped_array (a_name: like wrapped_array) + -- Set 'wrapped_array' with 'a_name'. + do + wrapped_array := a_name + ensure + wrapped_array_set: wrapped_array = a_name + end + + set_name_string (a_name: like name_string) + -- Set 'name_string' with 'a_name'. + do + name_string := a_name + ensure + name_string_set: name_string = a_name + end + + set_name_number (a_name: like name_number) + -- Set 'name_number' with 'a_name'. + do + name_number := a_name + ensure + name_number_set: name_number = a_name + end + + set_name_integer (a_name: like name_integer) + -- Set 'name_integer' with 'a_name'. + do + name_integer := a_name + ensure + name_integer_set: name_integer = a_name + end + + set_name_boolean (a_name: like name_boolean) + -- Set 'name_boolean' with 'a_name'. + do + name_boolean := a_name + ensure + name_boolean_set: name_boolean = a_name + end + + set_name_array (a_name: like name_array) + -- Set 'name_array' with 'a_name'. + do + name_array := a_name + ensure + name_array_set: name_array = a_name + end + + set_name_wrapped_array (a_name: like name_wrapped_array) + -- Set 'name_wrapped_array' with 'a_name'. + do + name_wrapped_array := a_name + ensure + name_wrapped_array_set: name_wrapped_array = a_name + end + + set_prefix_string (a_name: like prefix_string) + -- Set 'prefix_string' with 'a_name'. + do + prefix_string := a_name + ensure + prefix_string_set: prefix_string = a_name + end + + set_prefix_number (a_name: like prefix_number) + -- Set 'prefix_number' with 'a_name'. + do + prefix_number := a_name + ensure + prefix_number_set: prefix_number = a_name + end + + set_prefix_integer (a_name: like prefix_integer) + -- Set 'prefix_integer' with 'a_name'. + do + prefix_integer := a_name + ensure + prefix_integer_set: prefix_integer = a_name + end + + set_prefix_boolean (a_name: like prefix_boolean) + -- Set 'prefix_boolean' with 'a_name'. + do + prefix_boolean := a_name + ensure + prefix_boolean_set: prefix_boolean = a_name + end + + set_prefix_array (a_name: like prefix_array) + -- Set 'prefix_array' with 'a_name'. + do + prefix_array := a_name + ensure + prefix_array_set: prefix_array = a_name + end + + set_prefix_wrapped_array (a_name: like prefix_wrapped_array) + -- Set 'prefix_wrapped_array' with 'a_name'. + do + prefix_wrapped_array := a_name + ensure + prefix_wrapped_array_set: prefix_wrapped_array = a_name + end + + set_namespace_string (a_name: like namespace_string) + -- Set 'namespace_string' with 'a_name'. + do + namespace_string := a_name + ensure + namespace_string_set: namespace_string = a_name + end + + set_namespace_number (a_name: like namespace_number) + -- Set 'namespace_number' with 'a_name'. + do + namespace_number := a_name + ensure + namespace_number_set: namespace_number = a_name + end + + set_namespace_integer (a_name: like namespace_integer) + -- Set 'namespace_integer' with 'a_name'. + do + namespace_integer := a_name + ensure + namespace_integer_set: namespace_integer = a_name + end + + set_namespace_boolean (a_name: like namespace_boolean) + -- Set 'namespace_boolean' with 'a_name'. + do + namespace_boolean := a_name + ensure + namespace_boolean_set: namespace_boolean = a_name + end + + set_namespace_array (a_name: like namespace_array) + -- Set 'namespace_array' with 'a_name'. + do + namespace_array := a_name + ensure + namespace_array_set: namespace_array = a_name + end + + set_namespace_wrapped_array (a_name: like namespace_wrapped_array) + -- Set 'namespace_wrapped_array' with 'a_name'. + do + namespace_wrapped_array := a_name + ensure + namespace_wrapped_array_set: namespace_wrapped_array = a_name + end + + set_prefix_ns_string (a_name: like prefix_ns_string) + -- Set 'prefix_ns_string' with 'a_name'. + do + prefix_ns_string := a_name + ensure + prefix_ns_string_set: prefix_ns_string = a_name + end + + set_prefix_ns_number (a_name: like prefix_ns_number) + -- Set 'prefix_ns_number' with 'a_name'. + do + prefix_ns_number := a_name + ensure + prefix_ns_number_set: prefix_ns_number = a_name + end + + set_prefix_ns_integer (a_name: like prefix_ns_integer) + -- Set 'prefix_ns_integer' with 'a_name'. + do + prefix_ns_integer := a_name + ensure + prefix_ns_integer_set: prefix_ns_integer = a_name + end + + set_prefix_ns_boolean (a_name: like prefix_ns_boolean) + -- Set 'prefix_ns_boolean' with 'a_name'. + do + prefix_ns_boolean := a_name + ensure + prefix_ns_boolean_set: prefix_ns_boolean = a_name + end + + set_prefix_ns_array (a_name: like prefix_ns_array) + -- Set 'prefix_ns_array' with 'a_name'. + do + prefix_ns_array := a_name + ensure + prefix_ns_array_set: prefix_ns_array = a_name + end + + set_prefix_ns_wrapped_array (a_name: like prefix_ns_wrapped_array) + -- Set 'prefix_ns_wrapped_array' with 'a_name'. + do + prefix_ns_wrapped_array := a_name + ensure + prefix_ns_wrapped_array_set: prefix_ns_wrapped_array = a_name + end + + + feature -- Status Report + + out: STRING + -- + do + create Result.make_empty + Result.append("%Nclass XML_ITEM%N") + if attached attribute_string as l_attribute_string then + Result.append ("%Nattribute_string:") + Result.append (l_attribute_string.out) + Result.append ("%N") + end + if attached attribute_number as l_attribute_number then + Result.append ("%Nattribute_number:") + Result.append (l_attribute_number.out) + Result.append ("%N") + end + if attached attribute_integer as l_attribute_integer then + Result.append ("%Nattribute_integer:") + Result.append (l_attribute_integer.out) + Result.append ("%N") + end + if attached attribute_boolean as l_attribute_boolean then + Result.append ("%Nattribute_boolean:") + Result.append (l_attribute_boolean.out) + Result.append ("%N") + end + if attached wrapped_array as l_wrapped_array then + across l_wrapped_array as ic loop + Result.append ("%N wrapped_array:") + Result.append (ic.item.out) + Result.append ("%N") + end + end + if attached name_string as l_name_string then + Result.append ("%Nname_string:") + Result.append (l_name_string.out) + Result.append ("%N") + end + if attached name_number as l_name_number then + Result.append ("%Nname_number:") + Result.append (l_name_number.out) + Result.append ("%N") + end + if attached name_integer as l_name_integer then + Result.append ("%Nname_integer:") + Result.append (l_name_integer.out) + Result.append ("%N") + end + if attached name_boolean as l_name_boolean then + Result.append ("%Nname_boolean:") + Result.append (l_name_boolean.out) + Result.append ("%N") + end + if attached name_array as l_name_array then + across l_name_array as ic loop + Result.append ("%N name_array:") + Result.append (ic.item.out) + Result.append ("%N") + end + end + if attached name_wrapped_array as l_name_wrapped_array then + across l_name_wrapped_array as ic loop + Result.append ("%N name_wrapped_array:") + Result.append (ic.item.out) + Result.append ("%N") + end + end + if attached prefix_string as l_prefix_string then + Result.append ("%Nprefix_string:") + Result.append (l_prefix_string.out) + Result.append ("%N") + end + if attached prefix_number as l_prefix_number then + Result.append ("%Nprefix_number:") + Result.append (l_prefix_number.out) + Result.append ("%N") + end + if attached prefix_integer as l_prefix_integer then + Result.append ("%Nprefix_integer:") + Result.append (l_prefix_integer.out) + Result.append ("%N") + end + if attached prefix_boolean as l_prefix_boolean then + Result.append ("%Nprefix_boolean:") + Result.append (l_prefix_boolean.out) + Result.append ("%N") + end + if attached prefix_array as l_prefix_array then + across l_prefix_array as ic loop + Result.append ("%N prefix_array:") + Result.append (ic.item.out) + Result.append ("%N") + end + end + if attached prefix_wrapped_array as l_prefix_wrapped_array then + across l_prefix_wrapped_array as ic loop + Result.append ("%N prefix_wrapped_array:") + Result.append (ic.item.out) + Result.append ("%N") + end + end + if attached namespace_string as l_namespace_string then + Result.append ("%Nnamespace_string:") + Result.append (l_namespace_string.out) + Result.append ("%N") + end + if attached namespace_number as l_namespace_number then + Result.append ("%Nnamespace_number:") + Result.append (l_namespace_number.out) + Result.append ("%N") + end + if attached namespace_integer as l_namespace_integer then + Result.append ("%Nnamespace_integer:") + Result.append (l_namespace_integer.out) + Result.append ("%N") + end + if attached namespace_boolean as l_namespace_boolean then + Result.append ("%Nnamespace_boolean:") + Result.append (l_namespace_boolean.out) + Result.append ("%N") + end + if attached namespace_array as l_namespace_array then + across l_namespace_array as ic loop + Result.append ("%N namespace_array:") + Result.append (ic.item.out) + Result.append ("%N") + end + end + if attached namespace_wrapped_array as l_namespace_wrapped_array then + across l_namespace_wrapped_array as ic loop + Result.append ("%N namespace_wrapped_array:") + Result.append (ic.item.out) + Result.append ("%N") + end + end + if attached prefix_ns_string as l_prefix_ns_string then + Result.append ("%Nprefix_ns_string:") + Result.append (l_prefix_ns_string.out) + Result.append ("%N") + end + if attached prefix_ns_number as l_prefix_ns_number then + Result.append ("%Nprefix_ns_number:") + Result.append (l_prefix_ns_number.out) + Result.append ("%N") + end + if attached prefix_ns_integer as l_prefix_ns_integer then + Result.append ("%Nprefix_ns_integer:") + Result.append (l_prefix_ns_integer.out) + Result.append ("%N") + end + if attached prefix_ns_boolean as l_prefix_ns_boolean then + Result.append ("%Nprefix_ns_boolean:") + Result.append (l_prefix_ns_boolean.out) + Result.append ("%N") + end + if attached prefix_ns_array as l_prefix_ns_array then + across l_prefix_ns_array as ic loop + Result.append ("%N prefix_ns_array:") + Result.append (ic.item.out) + Result.append ("%N") + end + end + if attached prefix_ns_wrapped_array as l_prefix_ns_wrapped_array then + across l_prefix_ns_wrapped_array as ic loop + Result.append ("%N prefix_ns_wrapped_array:") + Result.append (ic.item.out) + Result.append ("%N") + end + end + end +end + + diff --git a/samples/client/petstore/eiffel/src/framework/api_client_request.e b/samples/client/petstore/eiffel/src/framework/api_client_request.e index fcd2a09d1411..816e717e611c 100644 --- a/samples/client/petstore/eiffel/src/framework/api_client_request.e +++ b/samples/client/petstore/eiffel/src/framework/api_client_request.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/api_client_response.e b/samples/client/petstore/eiffel/src/framework/api_client_response.e index cf0978b25797..c17c730f541a 100644 --- a/samples/client/petstore/eiffel/src/framework/api_client_response.e +++ b/samples/client/petstore/eiffel/src/framework/api_client_response.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/api_error.e b/samples/client/petstore/eiffel/src/framework/api_error.e index ca89aae7f7a7..69871d5261c8 100644 --- a/samples/client/petstore/eiffel/src/framework/api_error.e +++ b/samples/client/petstore/eiffel/src/framework/api_error.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/api_i.e b/samples/client/petstore/eiffel/src/framework/api_i.e index ca0a45cd41c4..019e0f9c89ee 100644 --- a/samples/client/petstore/eiffel/src/framework/api_i.e +++ b/samples/client/petstore/eiffel/src/framework/api_i.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/auth/api_key_auth.e b/samples/client/petstore/eiffel/src/framework/auth/api_key_auth.e index 4087386d6013..2bf9a468b0a9 100644 --- a/samples/client/petstore/eiffel/src/framework/auth/api_key_auth.e +++ b/samples/client/petstore/eiffel/src/framework/auth/api_key_auth.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/auth/authentication.e b/samples/client/petstore/eiffel/src/framework/auth/authentication.e index b53248ae6e3f..3ce3085eccfa 100644 --- a/samples/client/petstore/eiffel/src/framework/auth/authentication.e +++ b/samples/client/petstore/eiffel/src/framework/auth/authentication.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/auth/http_basic_auth.e b/samples/client/petstore/eiffel/src/framework/auth/http_basic_auth.e index 3fd7664bcec1..3c26a645cb53 100644 --- a/samples/client/petstore/eiffel/src/framework/auth/http_basic_auth.e +++ b/samples/client/petstore/eiffel/src/framework/auth/http_basic_auth.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/auth/oauth.e b/samples/client/petstore/eiffel/src/framework/auth/oauth.e index 66b4ba5c3c5f..f8898302f87b 100644 --- a/samples/client/petstore/eiffel/src/framework/auth/oauth.e +++ b/samples/client/petstore/eiffel/src/framework/auth/oauth.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/configuration.e b/samples/client/petstore/eiffel/src/framework/configuration.e index 3b9fe5e834e6..1ede7bf95840 100644 --- a/samples/client/petstore/eiffel/src/framework/configuration.e +++ b/samples/client/petstore/eiffel/src/framework/configuration.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/serialization/api_deserializer.e b/samples/client/petstore/eiffel/src/framework/serialization/api_deserializer.e index 22f065ace998..8f83f763c740 100644 --- a/samples/client/petstore/eiffel/src/framework/serialization/api_deserializer.e +++ b/samples/client/petstore/eiffel/src/framework/serialization/api_deserializer.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/serialization/api_json_deserializer.e b/samples/client/petstore/eiffel/src/framework/serialization/api_json_deserializer.e index 993decf6a2c2..dd5f91d56bfd 100644 --- a/samples/client/petstore/eiffel/src/framework/serialization/api_json_deserializer.e +++ b/samples/client/petstore/eiffel/src/framework/serialization/api_json_deserializer.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,7 +20,7 @@ expanded class feature -- Access from_json (a_val:STRING; a_type: TYPE [detachable ANY] ): detachable ANY - -- Deserialize a a json representation `a_val' to an object + -- Deserialize a json representation `a_val' to an object -- of type `a_type' local conv_from: JSON_BASIC_REFLECTOR_DESERIALIZER diff --git a/samples/client/petstore/eiffel/src/framework/serialization/api_json_serializer.e b/samples/client/petstore/eiffel/src/framework/serialization/api_json_serializer.e index b7a144f70181..3bbb064f8f80 100644 --- a/samples/client/petstore/eiffel/src/framework/serialization/api_json_serializer.e +++ b/samples/client/petstore/eiffel/src/framework/serialization/api_json_serializer.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/serialization/api_serializer.e b/samples/client/petstore/eiffel/src/framework/serialization/api_serializer.e index db5d96af069b..46326c768317 100644 --- a/samples/client/petstore/eiffel/src/framework/serialization/api_serializer.e +++ b/samples/client/petstore/eiffel/src/framework/serialization/api_serializer.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/test/api_test.ecf b/samples/client/petstore/eiffel/test/api_test.ecf index ddb5082cabec..dfb68e608257 100644 --- a/samples/client/petstore/eiffel/test/api_test.ecf +++ b/samples/client/petstore/eiffel/test/api_test.ecf @@ -1,5 +1,5 @@ - + diff --git a/samples/client/petstore/elixir/README.md b/samples/client/petstore/elixir/README.md index e268e77389ac..d878612f910e 100644 --- a/samples/client/petstore/elixir/README.md +++ b/samples/client/petstore/elixir/README.md @@ -1,4 +1,4 @@ -# OpenapiPetstore +# OpenAPIPetstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ @@ -13,14 +13,14 @@ mix do deps.get, compile ## Installation If [available in Hex](https://hex.pm/docs/publish), the package can be installed -by adding `openapi_petstore` to your list of dependencies in `mix.exs`: +by adding `open_api_petstore` to your list of dependencies in `mix.exs`: ```elixir def deps do - [{:openapi_petstore, "~> 0.1.0"}] + [{:open_api_petstore, "~> 0.1.0"}] end ``` Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc) and published on [HexDocs](https://hexdocs.pm). Once published, the docs can -be found at [https://hexdocs.pm/openapi_petstore](https://hexdocs.pm/openapi_petstore). +be found at [https://hexdocs.pm/open_api_petstore](https://hexdocs.pm/open_api_petstore). diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/api/another_fake.ex b/samples/client/petstore/elixir/lib/open_api_petstore/api/another_fake.ex new file mode 100644 index 000000000000..f968f4a9483d --- /dev/null +++ b/samples/client/petstore/elixir/lib/open_api_petstore/api/another_fake.ex @@ -0,0 +1,40 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenAPIPetstore.Api.AnotherFake do + @moduledoc """ + API calls for all endpoints tagged `AnotherFake`. + """ + + alias OpenAPIPetstore.Connection + import OpenAPIPetstore.RequestBuilder + + + @doc """ + To test special tags + To test special tags and operation ID starting with number + + ## Parameters + + - connection (OpenAPIPetstore.Connection): Connection to server + - client (Client): client model + - opts (KeywordList): [optional] Optional parameters + ## Returns + + {:ok, %OpenAPIPetstore.Model.Client{}} on success + {:error, info} on failure + """ + @spec call_123_test_special_tags(Tesla.Env.client, OpenAPIPetstore.Model.Client.t, keyword()) :: {:ok, OpenAPIPetstore.Model.Client.t} | {:error, Tesla.Env.t} + def call_123_test_special_tags(connection, client, _opts \\ []) do + %{} + |> method(:patch) + |> url("/another-fake/dummy") + |> add_param(:body, :body, client) + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> evaluate_response([ + { 200, %OpenAPIPetstore.Model.Client{}} + ]) + end +end diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/api/default.ex b/samples/client/petstore/elixir/lib/open_api_petstore/api/default.ex new file mode 100644 index 000000000000..f8fdfc702c1a --- /dev/null +++ b/samples/client/petstore/elixir/lib/open_api_petstore/api/default.ex @@ -0,0 +1,36 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenAPIPetstore.Api.Default do + @moduledoc """ + API calls for all endpoints tagged `Default`. + """ + + alias OpenAPIPetstore.Connection + import OpenAPIPetstore.RequestBuilder + + + @doc """ + + ## Parameters + + - connection (OpenAPIPetstore.Connection): Connection to server + - opts (KeywordList): [optional] Optional parameters + ## Returns + + {:ok, %OpenAPIPetstore.Model.InlineResponseDefault{}} on success + {:error, info} on failure + """ + @spec foo_get(Tesla.Env.client, keyword()) :: {:ok, OpenAPIPetstore.Model.InlineResponseDefault.t} | {:error, Tesla.Env.t} + def foo_get(connection, _opts \\ []) do + %{} + |> method(:get) + |> url("/foo") + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> evaluate_response([ + { :default, %OpenAPIPetstore.Model.InlineResponseDefault{}} + ]) + end +end diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/api/fake.ex b/samples/client/petstore/elixir/lib/open_api_petstore/api/fake.ex new file mode 100644 index 000000000000..71e4343ab38a --- /dev/null +++ b/samples/client/petstore/elixir/lib/open_api_petstore/api/fake.ex @@ -0,0 +1,429 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenAPIPetstore.Api.Fake do + @moduledoc """ + API calls for all endpoints tagged `Fake`. + """ + + alias OpenAPIPetstore.Connection + import OpenAPIPetstore.RequestBuilder + + + @doc """ + Health check endpoint + + ## Parameters + + - connection (OpenAPIPetstore.Connection): Connection to server + - opts (KeywordList): [optional] Optional parameters + ## Returns + + {:ok, %OpenAPIPetstore.Model.HealthCheckResult{}} on success + {:error, info} on failure + """ + @spec fake_health_get(Tesla.Env.client, keyword()) :: {:ok, OpenAPIPetstore.Model.HealthCheckResult.t} | {:error, Tesla.Env.t} + def fake_health_get(connection, _opts \\ []) do + %{} + |> method(:get) + |> url("/fake/health") + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> evaluate_response([ + { 200, %OpenAPIPetstore.Model.HealthCheckResult{}} + ]) + end + + @doc """ + Test serialization of outer boolean types + + ## Parameters + + - connection (OpenAPIPetstore.Connection): Connection to server + - opts (KeywordList): [optional] Optional parameters + - :body (boolean()): Input boolean as post body + ## Returns + + {:ok, %OpenAPIPetstore.Model.boolean(){}} on success + {:error, info} on failure + """ + @spec fake_outer_boolean_serialize(Tesla.Env.client, keyword()) :: {:ok, Boolean.t} | {:error, Tesla.Env.t} + def fake_outer_boolean_serialize(connection, opts \\ []) do + optional_params = %{ + :"body" => :body + } + %{} + |> method(:post) + |> url("/fake/outer/boolean") + |> add_optional_params(optional_params, opts) + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> evaluate_response([ + { 200, false} + ]) + end + + @doc """ + Test serialization of object with outer number type + + ## Parameters + + - connection (OpenAPIPetstore.Connection): Connection to server + - opts (KeywordList): [optional] Optional parameters + - :outer_composite (OuterComposite): Input composite as post body + ## Returns + + {:ok, %OpenAPIPetstore.Model.OuterComposite{}} on success + {:error, info} on failure + """ + @spec fake_outer_composite_serialize(Tesla.Env.client, keyword()) :: {:ok, OpenAPIPetstore.Model.OuterComposite.t} | {:error, Tesla.Env.t} + def fake_outer_composite_serialize(connection, opts \\ []) do + optional_params = %{ + :"OuterComposite" => :body + } + %{} + |> method(:post) + |> url("/fake/outer/composite") + |> add_optional_params(optional_params, opts) + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> evaluate_response([ + { 200, %OpenAPIPetstore.Model.OuterComposite{}} + ]) + end + + @doc """ + Test serialization of outer number types + + ## Parameters + + - connection (OpenAPIPetstore.Connection): Connection to server + - opts (KeywordList): [optional] Optional parameters + - :body (float()): Input number as post body + ## Returns + + {:ok, %OpenAPIPetstore.Model.float(){}} on success + {:error, info} on failure + """ + @spec fake_outer_number_serialize(Tesla.Env.client, keyword()) :: {:ok, Float.t} | {:error, Tesla.Env.t} + def fake_outer_number_serialize(connection, opts \\ []) do + optional_params = %{ + :"body" => :body + } + %{} + |> method(:post) + |> url("/fake/outer/number") + |> add_optional_params(optional_params, opts) + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> evaluate_response([ + { 200, false} + ]) + end + + @doc """ + Test serialization of outer string types + + ## Parameters + + - connection (OpenAPIPetstore.Connection): Connection to server + - opts (KeywordList): [optional] Optional parameters + - :body (String.t): Input string as post body + ## Returns + + {:ok, %OpenAPIPetstore.Model.String.t{}} on success + {:error, info} on failure + """ + @spec fake_outer_string_serialize(Tesla.Env.client, keyword()) :: {:ok, String.t} | {:error, Tesla.Env.t} + def fake_outer_string_serialize(connection, opts \\ []) do + optional_params = %{ + :"body" => :body + } + %{} + |> method(:post) + |> url("/fake/outer/string") + |> add_optional_params(optional_params, opts) + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> evaluate_response([ + { 200, false} + ]) + end + + @doc """ + For this test, the body for this request much reference a schema named `File`. + + ## Parameters + + - connection (OpenAPIPetstore.Connection): Connection to server + - file_schema_test_class (FileSchemaTestClass): + - opts (KeywordList): [optional] Optional parameters + ## Returns + + {:ok, %{}} on success + {:error, info} on failure + """ + @spec test_body_with_file_schema(Tesla.Env.client, OpenAPIPetstore.Model.FileSchemaTestClass.t, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} + def test_body_with_file_schema(connection, file_schema_test_class, _opts \\ []) do + %{} + |> method(:put) + |> url("/fake/body-with-file-schema") + |> add_param(:body, :body, file_schema_test_class) + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> evaluate_response([ + { 200, false} + ]) + end + + @doc """ + + ## Parameters + + - connection (OpenAPIPetstore.Connection): Connection to server + - query (String.t): + - user (User): + - opts (KeywordList): [optional] Optional parameters + ## Returns + + {:ok, %{}} on success + {:error, info} on failure + """ + @spec test_body_with_query_params(Tesla.Env.client, String.t, OpenAPIPetstore.Model.User.t, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} + def test_body_with_query_params(connection, query, user, _opts \\ []) do + %{} + |> method(:put) + |> url("/fake/body-with-query-params") + |> add_param(:query, :"query", query) + |> add_param(:body, :body, user) + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> evaluate_response([ + { 200, false} + ]) + end + + @doc """ + To test \"client\" model + To test \"client\" model + + ## Parameters + + - connection (OpenAPIPetstore.Connection): Connection to server + - client (Client): client model + - opts (KeywordList): [optional] Optional parameters + ## Returns + + {:ok, %OpenAPIPetstore.Model.Client{}} on success + {:error, info} on failure + """ + @spec test_client_model(Tesla.Env.client, OpenAPIPetstore.Model.Client.t, keyword()) :: {:ok, OpenAPIPetstore.Model.Client.t} | {:error, Tesla.Env.t} + def test_client_model(connection, client, _opts \\ []) do + %{} + |> method(:patch) + |> url("/fake") + |> add_param(:body, :body, client) + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> evaluate_response([ + { 200, %OpenAPIPetstore.Model.Client{}} + ]) + end + + @doc """ + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + + ## Parameters + + - connection (OpenAPIPetstore.Connection): Connection to server + - number (float()): None + - double (float()): None + - pattern_without_delimiter (String.t): None + - byte (binary()): None + - opts (KeywordList): [optional] Optional parameters + - :integer (integer()): None + - :int32 (integer()): None + - :int64 (integer()): None + - :float (float()): None + - :string (String.t): None + - :binary (String.t): None + - :date (Date.t): None + - :date_time (DateTime.t): None + - :password (String.t): None + - :callback (String.t): None + ## Returns + + {:ok, %{}} on success + {:error, info} on failure + """ + @spec test_endpoint_parameters(Tesla.Env.client, float(), float(), String.t, binary(), keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} + def test_endpoint_parameters(connection, number, double, pattern_without_delimiter, byte, opts \\ []) do + optional_params = %{ + :"integer" => :form, + :"int32" => :form, + :"int64" => :form, + :"float" => :form, + :"string" => :form, + :"binary" => :form, + :"date" => :form, + :"dateTime" => :form, + :"password" => :form, + :"callback" => :form + } + %{} + |> method(:post) + |> url("/fake") + |> add_param(:form, :"number", number) + |> add_param(:form, :"double", double) + |> add_param(:form, :"pattern_without_delimiter", pattern_without_delimiter) + |> add_param(:form, :"byte", byte) + |> add_optional_params(optional_params, opts) + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> evaluate_response([ + { 400, false}, + { 404, false} + ]) + end + + @doc """ + To test enum parameters + To test enum parameters + + ## Parameters + + - connection (OpenAPIPetstore.Connection): Connection to server + - opts (KeywordList): [optional] Optional parameters + - :enum_header_string_array ([String.t]): Header parameter enum test (string array) + - :enum_header_string (String.t): Header parameter enum test (string) + - :enum_query_string_array ([String.t]): Query parameter enum test (string array) + - :enum_query_string (String.t): Query parameter enum test (string) + - :enum_query_integer (integer()): Query parameter enum test (double) + - :enum_query_double (float()): Query parameter enum test (double) + - :enum_form_string_array ([String.t]): Form parameter enum test (string array) + - :enum_form_string (String.t): Form parameter enum test (string) + ## Returns + + {:ok, %{}} on success + {:error, info} on failure + """ + @spec test_enum_parameters(Tesla.Env.client, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} + def test_enum_parameters(connection, opts \\ []) do + optional_params = %{ + :"enum_header_string_array" => :headers, + :"enum_header_string" => :headers, + :"enum_query_string_array" => :query, + :"enum_query_string" => :query, + :"enum_query_integer" => :query, + :"enum_query_double" => :query, + :"enum_form_string_array" => :form, + :"enum_form_string" => :form + } + %{} + |> method(:get) + |> url("/fake") + |> add_optional_params(optional_params, opts) + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> evaluate_response([ + { 400, false}, + { 404, false} + ]) + end + + @doc """ + Fake endpoint to test group parameters (optional) + Fake endpoint to test group parameters (optional) + + ## Parameters + + - connection (OpenAPIPetstore.Connection): Connection to server + - required_string_group (integer()): Required String in group parameters + - required_boolean_group (boolean()): Required Boolean in group parameters + - required_int64_group (integer()): Required Integer in group parameters + - opts (KeywordList): [optional] Optional parameters + - :string_group (integer()): String in group parameters + - :boolean_group (boolean()): Boolean in group parameters + - :int64_group (integer()): Integer in group parameters + ## Returns + + {:ok, %{}} on success + {:error, info} on failure + """ + @spec test_group_parameters(Tesla.Env.client, integer(), boolean(), integer(), keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} + def test_group_parameters(connection, required_string_group, required_boolean_group, required_int64_group, opts \\ []) do + optional_params = %{ + :"string_group" => :query, + :"boolean_group" => :headers, + :"int64_group" => :query + } + %{} + |> method(:delete) + |> url("/fake") + |> add_param(:query, :"required_string_group", required_string_group) + |> add_param(:headers, :"required_boolean_group", required_boolean_group) + |> add_param(:query, :"required_int64_group", required_int64_group) + |> add_optional_params(optional_params, opts) + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> evaluate_response([ + { 400, false} + ]) + end + + @doc """ + test inline additionalProperties + + ## Parameters + + - connection (OpenAPIPetstore.Connection): Connection to server + - request_body (%{optional(String.t) => String.t}): request body + - opts (KeywordList): [optional] Optional parameters + ## Returns + + {:ok, %{}} on success + {:error, info} on failure + """ + @spec test_inline_additional_properties(Tesla.Env.client, %{optional(String.t) => String.t}, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} + def test_inline_additional_properties(connection, request_body, _opts \\ []) do + %{} + |> method(:post) + |> url("/fake/inline-additionalProperties") + |> add_param(:body, :body, request_body) + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> evaluate_response([ + { 200, false} + ]) + end + + @doc """ + test json serialization of form data + + ## Parameters + + - connection (OpenAPIPetstore.Connection): Connection to server + - param (String.t): field1 + - param2 (String.t): field2 + - opts (KeywordList): [optional] Optional parameters + ## Returns + + {:ok, %{}} on success + {:error, info} on failure + """ + @spec test_json_form_data(Tesla.Env.client, String.t, String.t, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} + def test_json_form_data(connection, param, param2, _opts \\ []) do + %{} + |> method(:get) + |> url("/fake/jsonFormData") + |> add_param(:form, :"param", param) + |> add_param(:form, :"param2", param2) + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> evaluate_response([ + { 200, false} + ]) + end +end diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/api/fake_classname_tags123.ex b/samples/client/petstore/elixir/lib/open_api_petstore/api/fake_classname_tags123.ex new file mode 100644 index 000000000000..342834b42804 --- /dev/null +++ b/samples/client/petstore/elixir/lib/open_api_petstore/api/fake_classname_tags123.ex @@ -0,0 +1,40 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenAPIPetstore.Api.FakeClassnameTags123 do + @moduledoc """ + API calls for all endpoints tagged `FakeClassnameTags123`. + """ + + alias OpenAPIPetstore.Connection + import OpenAPIPetstore.RequestBuilder + + + @doc """ + To test class name in snake case + To test class name in snake case + + ## Parameters + + - connection (OpenAPIPetstore.Connection): Connection to server + - client (Client): client model + - opts (KeywordList): [optional] Optional parameters + ## Returns + + {:ok, %OpenAPIPetstore.Model.Client{}} on success + {:error, info} on failure + """ + @spec test_classname(Tesla.Env.client, OpenAPIPetstore.Model.Client.t, keyword()) :: {:ok, OpenAPIPetstore.Model.Client.t} | {:error, Tesla.Env.t} + def test_classname(connection, client, _opts \\ []) do + %{} + |> method(:patch) + |> url("/fake_classname_test") + |> add_param(:body, :body, client) + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> evaluate_response([ + { 200, %OpenAPIPetstore.Model.Client{}} + ]) + end +end diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/api/pet.ex b/samples/client/petstore/elixir/lib/open_api_petstore/api/pet.ex new file mode 100644 index 000000000000..a99e7feac96d --- /dev/null +++ b/samples/client/petstore/elixir/lib/open_api_petstore/api/pet.ex @@ -0,0 +1,277 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenAPIPetstore.Api.Pet do + @moduledoc """ + API calls for all endpoints tagged `Pet`. + """ + + alias OpenAPIPetstore.Connection + import OpenAPIPetstore.RequestBuilder + + + @doc """ + Add a new pet to the store + + ## Parameters + + - connection (OpenAPIPetstore.Connection): Connection to server + - pet (Pet): Pet object that needs to be added to the store + - opts (KeywordList): [optional] Optional parameters + ## Returns + + {:ok, %{}} on success + {:error, info} on failure + """ + @spec add_pet(Tesla.Env.client, OpenAPIPetstore.Model.Pet.t, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} + def add_pet(connection, pet, _opts \\ []) do + %{} + |> method(:post) + |> url("/pet") + |> add_param(:body, :body, pet) + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> evaluate_response([ + { 405, false} + ]) + end + + @doc """ + Deletes a pet + + ## Parameters + + - connection (OpenAPIPetstore.Connection): Connection to server + - pet_id (integer()): Pet id to delete + - opts (KeywordList): [optional] Optional parameters + - :api_key (String.t): + ## Returns + + {:ok, %{}} on success + {:error, info} on failure + """ + @spec delete_pet(Tesla.Env.client, integer(), keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} + def delete_pet(connection, pet_id, opts \\ []) do + optional_params = %{ + :"api_key" => :headers + } + %{} + |> method(:delete) + |> url("/pet/#{pet_id}") + |> add_optional_params(optional_params, opts) + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> evaluate_response([ + { 400, false} + ]) + end + + @doc """ + Finds Pets by status + Multiple status values can be provided with comma separated strings + + ## Parameters + + - connection (OpenAPIPetstore.Connection): Connection to server + - status ([String.t]): Status values that need to be considered for filter + - opts (KeywordList): [optional] Optional parameters + ## Returns + + {:ok, [%Pet{}, ...]} on success + {:error, info} on failure + """ + @spec find_pets_by_status(Tesla.Env.client, list(String.t), keyword()) :: {:ok, list(OpenAPIPetstore.Model.Pet.t)} | {:error, Tesla.Env.t} + def find_pets_by_status(connection, status, _opts \\ []) do + %{} + |> method(:get) + |> url("/pet/findByStatus") + |> add_param(:query, :"status", status) + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> evaluate_response([ + { 200, [%OpenAPIPetstore.Model.Pet{}]}, + { 400, false} + ]) + end + + @doc """ + Finds Pets by tags + Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + + ## Parameters + + - connection (OpenAPIPetstore.Connection): Connection to server + - tags ([String.t]): Tags to filter by + - opts (KeywordList): [optional] Optional parameters + ## Returns + + {:ok, [%Pet{}, ...]} on success + {:error, info} on failure + """ + @spec find_pets_by_tags(Tesla.Env.client, list(String.t), keyword()) :: {:ok, list(OpenAPIPetstore.Model.Pet.t)} | {:error, Tesla.Env.t} + def find_pets_by_tags(connection, tags, _opts \\ []) do + %{} + |> method(:get) + |> url("/pet/findByTags") + |> add_param(:query, :"tags", tags) + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> evaluate_response([ + { 200, [%OpenAPIPetstore.Model.Pet{}]}, + { 400, false} + ]) + end + + @doc """ + Find pet by ID + Returns a single pet + + ## Parameters + + - connection (OpenAPIPetstore.Connection): Connection to server + - pet_id (integer()): ID of pet to return + - opts (KeywordList): [optional] Optional parameters + ## Returns + + {:ok, %OpenAPIPetstore.Model.Pet{}} on success + {:error, info} on failure + """ + @spec get_pet_by_id(Tesla.Env.client, integer(), keyword()) :: {:ok, OpenAPIPetstore.Model.Pet.t} | {:error, Tesla.Env.t} + def get_pet_by_id(connection, pet_id, _opts \\ []) do + %{} + |> method(:get) + |> url("/pet/#{pet_id}") + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> evaluate_response([ + { 200, %OpenAPIPetstore.Model.Pet{}}, + { 400, false}, + { 404, false} + ]) + end + + @doc """ + Update an existing pet + + ## Parameters + + - connection (OpenAPIPetstore.Connection): Connection to server + - pet (Pet): Pet object that needs to be added to the store + - opts (KeywordList): [optional] Optional parameters + ## Returns + + {:ok, %{}} on success + {:error, info} on failure + """ + @spec update_pet(Tesla.Env.client, OpenAPIPetstore.Model.Pet.t, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} + def update_pet(connection, pet, _opts \\ []) do + %{} + |> method(:put) + |> url("/pet") + |> add_param(:body, :body, pet) + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> evaluate_response([ + { 400, false}, + { 404, false}, + { 405, false} + ]) + end + + @doc """ + Updates a pet in the store with form data + + ## Parameters + + - connection (OpenAPIPetstore.Connection): Connection to server + - pet_id (integer()): ID of pet that needs to be updated + - opts (KeywordList): [optional] Optional parameters + - :name (String.t): Updated name of the pet + - :status (String.t): Updated status of the pet + ## Returns + + {:ok, %{}} on success + {:error, info} on failure + """ + @spec update_pet_with_form(Tesla.Env.client, integer(), keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} + def update_pet_with_form(connection, pet_id, opts \\ []) do + optional_params = %{ + :"name" => :form, + :"status" => :form + } + %{} + |> method(:post) + |> url("/pet/#{pet_id}") + |> add_optional_params(optional_params, opts) + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> evaluate_response([ + { 405, false} + ]) + end + + @doc """ + uploads an image + + ## Parameters + + - connection (OpenAPIPetstore.Connection): Connection to server + - pet_id (integer()): ID of pet to update + - opts (KeywordList): [optional] Optional parameters + - :additional_metadata (String.t): Additional data to pass to server + - :file (String.t): file to upload + ## Returns + + {:ok, %OpenAPIPetstore.Model.ApiResponse{}} on success + {:error, info} on failure + """ + @spec upload_file(Tesla.Env.client, integer(), keyword()) :: {:ok, OpenAPIPetstore.Model.ApiResponse.t} | {:error, Tesla.Env.t} + def upload_file(connection, pet_id, opts \\ []) do + optional_params = %{ + :"additionalMetadata" => :form, + :"file" => :form + } + %{} + |> method(:post) + |> url("/pet/#{pet_id}/uploadImage") + |> add_optional_params(optional_params, opts) + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> evaluate_response([ + { 200, %OpenAPIPetstore.Model.ApiResponse{}} + ]) + end + + @doc """ + uploads an image (required) + + ## Parameters + + - connection (OpenAPIPetstore.Connection): Connection to server + - pet_id (integer()): ID of pet to update + - required_file (String.t): file to upload + - opts (KeywordList): [optional] Optional parameters + - :additional_metadata (String.t): Additional data to pass to server + ## Returns + + {:ok, %OpenAPIPetstore.Model.ApiResponse{}} on success + {:error, info} on failure + """ + @spec upload_file_with_required_file(Tesla.Env.client, integer(), String.t, keyword()) :: {:ok, OpenAPIPetstore.Model.ApiResponse.t} | {:error, Tesla.Env.t} + def upload_file_with_required_file(connection, pet_id, required_file, opts \\ []) do + optional_params = %{ + :"additionalMetadata" => :form + } + %{} + |> method(:post) + |> url("/fake/#{pet_id}/uploadImageWithRequiredFile") + |> add_param(:file, :"requiredFile", required_file) + |> add_optional_params(optional_params, opts) + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> evaluate_response([ + { 200, %OpenAPIPetstore.Model.ApiResponse{}} + ]) + end +end diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/api/store.ex b/samples/client/petstore/elixir/lib/open_api_petstore/api/store.ex new file mode 100644 index 000000000000..843f2d5ecbf8 --- /dev/null +++ b/samples/client/petstore/elixir/lib/open_api_petstore/api/store.ex @@ -0,0 +1,120 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenAPIPetstore.Api.Store do + @moduledoc """ + API calls for all endpoints tagged `Store`. + """ + + alias OpenAPIPetstore.Connection + import OpenAPIPetstore.RequestBuilder + + + @doc """ + Delete purchase order by ID + For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + + ## Parameters + + - connection (OpenAPIPetstore.Connection): Connection to server + - order_id (String.t): ID of the order that needs to be deleted + - opts (KeywordList): [optional] Optional parameters + ## Returns + + {:ok, %{}} on success + {:error, info} on failure + """ + @spec delete_order(Tesla.Env.client, String.t, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} + def delete_order(connection, order_id, _opts \\ []) do + %{} + |> method(:delete) + |> url("/store/order/#{order_id}") + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> evaluate_response([ + { 400, false}, + { 404, false} + ]) + end + + @doc """ + Returns pet inventories by status + Returns a map of status codes to quantities + + ## Parameters + + - connection (OpenAPIPetstore.Connection): Connection to server + - opts (KeywordList): [optional] Optional parameters + ## Returns + + {:ok, %{}} on success + {:error, info} on failure + """ + @spec get_inventory(Tesla.Env.client, keyword()) :: {:ok, map()} | {:error, Tesla.Env.t} + def get_inventory(connection, _opts \\ []) do + %{} + |> method(:get) + |> url("/store/inventory") + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> evaluate_response([ + { 200, %{}} + ]) + end + + @doc """ + Find purchase order by ID + For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + + ## Parameters + + - connection (OpenAPIPetstore.Connection): Connection to server + - order_id (integer()): ID of pet that needs to be fetched + - opts (KeywordList): [optional] Optional parameters + ## Returns + + {:ok, %OpenAPIPetstore.Model.Order{}} on success + {:error, info} on failure + """ + @spec get_order_by_id(Tesla.Env.client, integer(), keyword()) :: {:ok, OpenAPIPetstore.Model.Order.t} | {:error, Tesla.Env.t} + def get_order_by_id(connection, order_id, _opts \\ []) do + %{} + |> method(:get) + |> url("/store/order/#{order_id}") + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> evaluate_response([ + { 200, %OpenAPIPetstore.Model.Order{}}, + { 400, false}, + { 404, false} + ]) + end + + @doc """ + Place an order for a pet + + ## Parameters + + - connection (OpenAPIPetstore.Connection): Connection to server + - order (Order): order placed for purchasing the pet + - opts (KeywordList): [optional] Optional parameters + ## Returns + + {:ok, %OpenAPIPetstore.Model.Order{}} on success + {:error, info} on failure + """ + @spec place_order(Tesla.Env.client, OpenAPIPetstore.Model.Order.t, keyword()) :: {:ok, OpenAPIPetstore.Model.Order.t} | {:error, Tesla.Env.t} + def place_order(connection, order, _opts \\ []) do + %{} + |> method(:post) + |> url("/store/order") + |> add_param(:body, :body, order) + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> evaluate_response([ + { 200, %OpenAPIPetstore.Model.Order{}}, + { 400, false} + ]) + end +end diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/api/user.ex b/samples/client/petstore/elixir/lib/open_api_petstore/api/user.ex new file mode 100644 index 000000000000..ce8eaeea6bc0 --- /dev/null +++ b/samples/client/petstore/elixir/lib/open_api_petstore/api/user.ex @@ -0,0 +1,228 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenAPIPetstore.Api.User do + @moduledoc """ + API calls for all endpoints tagged `User`. + """ + + alias OpenAPIPetstore.Connection + import OpenAPIPetstore.RequestBuilder + + + @doc """ + Create user + This can only be done by the logged in user. + + ## Parameters + + - connection (OpenAPIPetstore.Connection): Connection to server + - user (User): Created user object + - opts (KeywordList): [optional] Optional parameters + ## Returns + + {:ok, %{}} on success + {:error, info} on failure + """ + @spec create_user(Tesla.Env.client, OpenAPIPetstore.Model.User.t, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} + def create_user(connection, user, _opts \\ []) do + %{} + |> method(:post) + |> url("/user") + |> add_param(:body, :body, user) + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> evaluate_response([ + { :default, false} + ]) + end + + @doc """ + Creates list of users with given input array + + ## Parameters + + - connection (OpenAPIPetstore.Connection): Connection to server + - user ([User]): List of user object + - opts (KeywordList): [optional] Optional parameters + ## Returns + + {:ok, %{}} on success + {:error, info} on failure + """ + @spec create_users_with_array_input(Tesla.Env.client, list(OpenAPIPetstore.Model.User.t), keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} + def create_users_with_array_input(connection, user, _opts \\ []) do + %{} + |> method(:post) + |> url("/user/createWithArray") + |> add_param(:body, :body, user) + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> evaluate_response([ + { :default, false} + ]) + end + + @doc """ + Creates list of users with given input array + + ## Parameters + + - connection (OpenAPIPetstore.Connection): Connection to server + - user ([User]): List of user object + - opts (KeywordList): [optional] Optional parameters + ## Returns + + {:ok, %{}} on success + {:error, info} on failure + """ + @spec create_users_with_list_input(Tesla.Env.client, list(OpenAPIPetstore.Model.User.t), keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} + def create_users_with_list_input(connection, user, _opts \\ []) do + %{} + |> method(:post) + |> url("/user/createWithList") + |> add_param(:body, :body, user) + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> evaluate_response([ + { :default, false} + ]) + end + + @doc """ + Delete user + This can only be done by the logged in user. + + ## Parameters + + - connection (OpenAPIPetstore.Connection): Connection to server + - username (String.t): The name that needs to be deleted + - opts (KeywordList): [optional] Optional parameters + ## Returns + + {:ok, %{}} on success + {:error, info} on failure + """ + @spec delete_user(Tesla.Env.client, String.t, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} + def delete_user(connection, username, _opts \\ []) do + %{} + |> method(:delete) + |> url("/user/#{username}") + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> evaluate_response([ + { 400, false}, + { 404, false} + ]) + end + + @doc """ + Get user by user name + + ## Parameters + + - connection (OpenAPIPetstore.Connection): Connection to server + - username (String.t): The name that needs to be fetched. Use user1 for testing. + - opts (KeywordList): [optional] Optional parameters + ## Returns + + {:ok, %OpenAPIPetstore.Model.User{}} on success + {:error, info} on failure + """ + @spec get_user_by_name(Tesla.Env.client, String.t, keyword()) :: {:ok, OpenAPIPetstore.Model.User.t} | {:error, Tesla.Env.t} + def get_user_by_name(connection, username, _opts \\ []) do + %{} + |> method(:get) + |> url("/user/#{username}") + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> evaluate_response([ + { 200, %OpenAPIPetstore.Model.User{}}, + { 400, false}, + { 404, false} + ]) + end + + @doc """ + Logs user into the system + + ## Parameters + + - connection (OpenAPIPetstore.Connection): Connection to server + - username (String.t): The user name for login + - password (String.t): The password for login in clear text + - opts (KeywordList): [optional] Optional parameters + ## Returns + + {:ok, %OpenAPIPetstore.Model.String.t{}} on success + {:error, info} on failure + """ + @spec login_user(Tesla.Env.client, String.t, String.t, keyword()) :: {:ok, String.t} | {:error, Tesla.Env.t} + def login_user(connection, username, password, _opts \\ []) do + %{} + |> method(:get) + |> url("/user/login") + |> add_param(:query, :"username", username) + |> add_param(:query, :"password", password) + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> evaluate_response([ + { 200, false}, + { 400, false} + ]) + end + + @doc """ + Logs out current logged in user session + + ## Parameters + + - connection (OpenAPIPetstore.Connection): Connection to server + - opts (KeywordList): [optional] Optional parameters + ## Returns + + {:ok, %{}} on success + {:error, info} on failure + """ + @spec logout_user(Tesla.Env.client, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} + def logout_user(connection, _opts \\ []) do + %{} + |> method(:get) + |> url("/user/logout") + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> evaluate_response([ + { :default, false} + ]) + end + + @doc """ + Updated user + This can only be done by the logged in user. + + ## Parameters + + - connection (OpenAPIPetstore.Connection): Connection to server + - username (String.t): name that need to be deleted + - user (User): Updated user object + - opts (KeywordList): [optional] Optional parameters + ## Returns + + {:ok, %{}} on success + {:error, info} on failure + """ + @spec update_user(Tesla.Env.client, String.t, OpenAPIPetstore.Model.User.t, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} + def update_user(connection, username, user, _opts \\ []) do + %{} + |> method(:put) + |> url("/user/#{username}") + |> add_param(:body, :body, user) + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> evaluate_response([ + { 400, false}, + { 404, false} + ]) + end +end diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/connection.ex b/samples/client/petstore/elixir/lib/open_api_petstore/connection.ex new file mode 100644 index 000000000000..f4eb4467bb40 --- /dev/null +++ b/samples/client/petstore/elixir/lib/open_api_petstore/connection.ex @@ -0,0 +1,104 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenAPIPetstore.Connection do + @moduledoc """ + Handle Tesla connections for OpenAPIPetstore. + """ + + use Tesla + + # Add any middleware here (authentication) + plug Tesla.Middleware.BaseUrl, "http://petstore.swagger.io:80/v2" + plug Tesla.Middleware.Headers, [{"user-agent", "Elixir"}] + plug Tesla.Middleware.EncodeJson, engine: Poison + + @doc """ + Configure a client connection using Basic authentication. + + ## Parameters + + - username (String): Username used for authentication + - password (String): Password used for authentication + + # Returns + + Tesla.Env.client + """ + @spec new(String.t, String.t) :: Tesla.Env.client + def new(username, password) do + Tesla.client([ + {Tesla.Middleware.BasicAuth, %{username: username, password: password}} + ]) + end + @doc """ + Configure a client connection using Basic authentication. + + ## Parameters + + - username (String): Username used for authentication + - password (String): Password used for authentication + + # Returns + + Tesla.Env.client + """ + @spec new(String.t, String.t) :: Tesla.Env.client + def new(username, password) do + Tesla.client([ + {Tesla.Middleware.BasicAuth, %{username: username, password: password}} + ]) + end + @scopes [ + "write:pets", # modify pets in your account + "read:pets" # read your pets + ] + + @doc """ + Configure a client connection using a provided OAuth2 token as a Bearer token + + ## Parameters + + - token (String): Bearer token + + ## Returns + + Tesla.Env.client + """ + @spec new(String.t) :: Tesla.Env.client + def new(token) when is_binary(token) do + Tesla.client([ + {Tesla.Middleware.Headers, [{"authorization", "Bearer #{token}"}]} + ]) + end + + @doc """ + Configure a client connection using a function which yields a Bearer token. + + ## Parameters + + - token_fetcher (function arity of 1): Callback which provides an OAuth2 token + given a list of scopes + + ## Returns + + Tesla.Env.client + """ + @spec new(((list(String.t)) -> String.t)) :: Tesla.Env.client + def new(token_fetcher) when is_function(token_fetcher) do + token_fetcher.(@scopes) + |> new + end + @doc """ + Configure an authless client connection + + # Returns + + Tesla.Env.client + """ + @spec new() :: Tesla.Env.client + def new do + Tesla.client([]) + end +end diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/deserializer.ex b/samples/client/petstore/elixir/lib/open_api_petstore/deserializer.ex new file mode 100644 index 000000000000..9df2c684c188 --- /dev/null +++ b/samples/client/petstore/elixir/lib/open_api_petstore/deserializer.ex @@ -0,0 +1,38 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenAPIPetstore.Deserializer do + @moduledoc """ + Helper functions for deserializing responses into models + """ + + @doc """ + Update the provided model with a deserialization of a nested value + """ + @spec deserialize(struct(), :atom, :atom, struct(), keyword()) :: struct() + def deserialize(model, field, :list, mod, options) do + model + |> Map.update!(field, &(Poison.Decode.decode(&1, Keyword.merge(options, [as: [struct(mod)]])))) + end + def deserialize(model, field, :struct, mod, options) do + model + |> Map.update!(field, &(Poison.Decode.decode(&1, Keyword.merge(options, [as: struct(mod)])))) + end + def deserialize(model, field, :map, mod, options) do + model + |> Map.update!(field, &(Map.new(&1, fn {key, val} -> {key, Poison.Decode.decode(val, Keyword.merge(options, [as: struct(mod)]))} end))) + end + def deserialize(model, field, :date, _, _options) do + value = Map.get(model, field) + case is_binary(value) do + true -> case DateTime.from_iso8601(value) do + {:ok, datetime, _offset} -> + Map.put(model, field, datetime) + _ -> + model + end + false -> model + end + end +end diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/_special_model_name_.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/_special_model_name_.ex new file mode 100644 index 000000000000..373453229f66 --- /dev/null +++ b/samples/client/petstore/elixir/lib/open_api_petstore/model/_special_model_name_.ex @@ -0,0 +1,25 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenAPIPetstore.Model.SpecialModelName do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"$special[property.name]" + ] + + @type t :: %__MODULE__{ + :"$special[property.name]" => integer() | nil + } +end + +defimpl Poison.Decoder, for: OpenAPIPetstore.Model.SpecialModelName do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/additional_properties_class.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/additional_properties_class.ex new file mode 100644 index 000000000000..790446815834 --- /dev/null +++ b/samples/client/petstore/elixir/lib/open_api_petstore/model/additional_properties_class.ex @@ -0,0 +1,27 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenAPIPetstore.Model.AdditionalPropertiesClass do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"map_property", + :"map_of_map_property" + ] + + @type t :: %__MODULE__{ + :"map_property" => %{optional(String.t) => String.t} | nil, + :"map_of_map_property" => %{optional(String.t) => %{optional(String.t) => String.t}} | nil + } +end + +defimpl Poison.Decoder, for: OpenAPIPetstore.Model.AdditionalPropertiesClass do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/animal.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/animal.ex new file mode 100644 index 000000000000..528a9004b2f4 --- /dev/null +++ b/samples/client/petstore/elixir/lib/open_api_petstore/model/animal.ex @@ -0,0 +1,27 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenAPIPetstore.Model.Animal do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"className", + :"color" + ] + + @type t :: %__MODULE__{ + :"className" => String.t, + :"color" => String.t | nil + } +end + +defimpl Poison.Decoder, for: OpenAPIPetstore.Model.Animal do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/api_response.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/api_response.ex new file mode 100644 index 000000000000..5d23292c2d6c --- /dev/null +++ b/samples/client/petstore/elixir/lib/open_api_petstore/model/api_response.ex @@ -0,0 +1,29 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenAPIPetstore.Model.ApiResponse do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"code", + :"type", + :"message" + ] + + @type t :: %__MODULE__{ + :"code" => integer() | nil, + :"type" => String.t | nil, + :"message" => String.t | nil + } +end + +defimpl Poison.Decoder, for: OpenAPIPetstore.Model.ApiResponse do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/array_of_array_of_number_only.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/array_of_array_of_number_only.ex new file mode 100644 index 000000000000..940e950c4d59 --- /dev/null +++ b/samples/client/petstore/elixir/lib/open_api_petstore/model/array_of_array_of_number_only.ex @@ -0,0 +1,25 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenAPIPetstore.Model.ArrayOfArrayOfNumberOnly do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"ArrayArrayNumber" + ] + + @type t :: %__MODULE__{ + :"ArrayArrayNumber" => [[float()]] | nil + } +end + +defimpl Poison.Decoder, for: OpenAPIPetstore.Model.ArrayOfArrayOfNumberOnly do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/array_of_number_only.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/array_of_number_only.ex new file mode 100644 index 000000000000..1ed4bab441a1 --- /dev/null +++ b/samples/client/petstore/elixir/lib/open_api_petstore/model/array_of_number_only.ex @@ -0,0 +1,25 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenAPIPetstore.Model.ArrayOfNumberOnly do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"ArrayNumber" + ] + + @type t :: %__MODULE__{ + :"ArrayNumber" => [float()] | nil + } +end + +defimpl Poison.Decoder, for: OpenAPIPetstore.Model.ArrayOfNumberOnly do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/array_test.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/array_test.ex new file mode 100644 index 000000000000..f5e71645ff1d --- /dev/null +++ b/samples/client/petstore/elixir/lib/open_api_petstore/model/array_test.ex @@ -0,0 +1,29 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenAPIPetstore.Model.ArrayTest do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"array_of_string", + :"array_array_of_integer", + :"array_array_of_model" + ] + + @type t :: %__MODULE__{ + :"array_of_string" => [String.t] | nil, + :"array_array_of_integer" => [[integer()]] | nil, + :"array_array_of_model" => [[ReadOnlyFirst]] | nil + } +end + +defimpl Poison.Decoder, for: OpenAPIPetstore.Model.ArrayTest do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/capitalization.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/capitalization.ex new file mode 100644 index 000000000000..1add32240348 --- /dev/null +++ b/samples/client/petstore/elixir/lib/open_api_petstore/model/capitalization.ex @@ -0,0 +1,35 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenAPIPetstore.Model.Capitalization do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"smallCamel", + :"CapitalCamel", + :"small_Snake", + :"Capital_Snake", + :"SCA_ETH_Flow_Points", + :"ATT_NAME" + ] + + @type t :: %__MODULE__{ + :"smallCamel" => String.t | nil, + :"CapitalCamel" => String.t | nil, + :"small_Snake" => String.t | nil, + :"Capital_Snake" => String.t | nil, + :"SCA_ETH_Flow_Points" => String.t | nil, + :"ATT_NAME" => String.t | nil + } +end + +defimpl Poison.Decoder, for: OpenAPIPetstore.Model.Capitalization do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/cat.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/cat.ex new file mode 100644 index 000000000000..ab89301e1ef3 --- /dev/null +++ b/samples/client/petstore/elixir/lib/open_api_petstore/model/cat.ex @@ -0,0 +1,29 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenAPIPetstore.Model.Cat do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"className", + :"color", + :"declawed" + ] + + @type t :: %__MODULE__{ + :"className" => String.t, + :"color" => String.t | nil, + :"declawed" => boolean() | nil + } +end + +defimpl Poison.Decoder, for: OpenAPIPetstore.Model.Cat do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/cat_all_of.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/cat_all_of.ex new file mode 100644 index 000000000000..0da165677fac --- /dev/null +++ b/samples/client/petstore/elixir/lib/open_api_petstore/model/cat_all_of.ex @@ -0,0 +1,25 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenAPIPetstore.Model.CatAllOf do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"declawed" + ] + + @type t :: %__MODULE__{ + :"declawed" => boolean() | nil + } +end + +defimpl Poison.Decoder, for: OpenAPIPetstore.Model.CatAllOf do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/category.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/category.ex new file mode 100644 index 000000000000..eab3b7fca3fe --- /dev/null +++ b/samples/client/petstore/elixir/lib/open_api_petstore/model/category.ex @@ -0,0 +1,27 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenAPIPetstore.Model.Category do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"id", + :"name" + ] + + @type t :: %__MODULE__{ + :"id" => integer() | nil, + :"name" => String.t + } +end + +defimpl Poison.Decoder, for: OpenAPIPetstore.Model.Category do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/class_model.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/class_model.ex new file mode 100644 index 000000000000..c41f3d3921fa --- /dev/null +++ b/samples/client/petstore/elixir/lib/open_api_petstore/model/class_model.ex @@ -0,0 +1,25 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenAPIPetstore.Model.ClassModel do + @moduledoc """ + Model for testing model with \"_class\" property + """ + + @derive [Poison.Encoder] + defstruct [ + :"_class" + ] + + @type t :: %__MODULE__{ + :"_class" => String.t | nil + } +end + +defimpl Poison.Decoder, for: OpenAPIPetstore.Model.ClassModel do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/client.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/client.ex new file mode 100644 index 000000000000..f94164d85fb0 --- /dev/null +++ b/samples/client/petstore/elixir/lib/open_api_petstore/model/client.ex @@ -0,0 +1,25 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenAPIPetstore.Model.Client do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"client" + ] + + @type t :: %__MODULE__{ + :"client" => String.t | nil + } +end + +defimpl Poison.Decoder, for: OpenAPIPetstore.Model.Client do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/dog.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/dog.ex new file mode 100644 index 000000000000..03d874be2bb8 --- /dev/null +++ b/samples/client/petstore/elixir/lib/open_api_petstore/model/dog.ex @@ -0,0 +1,29 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenAPIPetstore.Model.Dog do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"className", + :"color", + :"breed" + ] + + @type t :: %__MODULE__{ + :"className" => String.t, + :"color" => String.t | nil, + :"breed" => String.t | nil + } +end + +defimpl Poison.Decoder, for: OpenAPIPetstore.Model.Dog do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/dog_all_of.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/dog_all_of.ex new file mode 100644 index 000000000000..494ea216a052 --- /dev/null +++ b/samples/client/petstore/elixir/lib/open_api_petstore/model/dog_all_of.ex @@ -0,0 +1,25 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenAPIPetstore.Model.DogAllOf do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"breed" + ] + + @type t :: %__MODULE__{ + :"breed" => String.t | nil + } +end + +defimpl Poison.Decoder, for: OpenAPIPetstore.Model.DogAllOf do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/enum_arrays.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/enum_arrays.ex new file mode 100644 index 000000000000..119f3d737a19 --- /dev/null +++ b/samples/client/petstore/elixir/lib/open_api_petstore/model/enum_arrays.ex @@ -0,0 +1,27 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenAPIPetstore.Model.EnumArrays do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"just_symbol", + :"array_enum" + ] + + @type t :: %__MODULE__{ + :"just_symbol" => String.t | nil, + :"array_enum" => [String.t] | nil + } +end + +defimpl Poison.Decoder, for: OpenAPIPetstore.Model.EnumArrays do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/enum_class.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/enum_class.ex new file mode 100644 index 000000000000..9f6f366cc68f --- /dev/null +++ b/samples/client/petstore/elixir/lib/open_api_petstore/model/enum_class.ex @@ -0,0 +1,25 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenAPIPetstore.Model.EnumClass do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + + ] + + @type t :: %__MODULE__{ + + } +end + +defimpl Poison.Decoder, for: OpenAPIPetstore.Model.EnumClass do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/enum_test.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/enum_test.ex new file mode 100644 index 000000000000..ccdedcda9453 --- /dev/null +++ b/samples/client/petstore/elixir/lib/open_api_petstore/model/enum_test.ex @@ -0,0 +1,44 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenAPIPetstore.Model.EnumTest do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"enum_string", + :"enum_string_required", + :"enum_integer", + :"enum_number", + :"outerEnum", + :"outerEnumInteger", + :"outerEnumDefaultValue", + :"outerEnumIntegerDefaultValue" + ] + + @type t :: %__MODULE__{ + :"enum_string" => String.t | nil, + :"enum_string_required" => String.t, + :"enum_integer" => integer() | nil, + :"enum_number" => float() | nil, + :"outerEnum" => OuterEnum | nil, + :"outerEnumInteger" => OuterEnumInteger | nil, + :"outerEnumDefaultValue" => OuterEnumDefaultValue | nil, + :"outerEnumIntegerDefaultValue" => OuterEnumIntegerDefaultValue | nil + } +end + +defimpl Poison.Decoder, for: OpenAPIPetstore.Model.EnumTest do + import OpenAPIPetstore.Deserializer + def decode(value, options) do + value + |> deserialize(:"outerEnum", :struct, OpenAPIPetstore.Model.OuterEnum, options) + |> deserialize(:"outerEnumInteger", :struct, OpenAPIPetstore.Model.OuterEnumInteger, options) + |> deserialize(:"outerEnumDefaultValue", :struct, OpenAPIPetstore.Model.OuterEnumDefaultValue, options) + |> deserialize(:"outerEnumIntegerDefaultValue", :struct, OpenAPIPetstore.Model.OuterEnumIntegerDefaultValue, options) + end +end + diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/file_schema_test_class.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/file_schema_test_class.ex new file mode 100644 index 000000000000..09aacc33267d --- /dev/null +++ b/samples/client/petstore/elixir/lib/open_api_petstore/model/file_schema_test_class.ex @@ -0,0 +1,30 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenAPIPetstore.Model.FileSchemaTestClass do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"file", + :"files" + ] + + @type t :: %__MODULE__{ + :"file" => File | nil, + :"files" => [File] | nil + } +end + +defimpl Poison.Decoder, for: OpenAPIPetstore.Model.FileSchemaTestClass do + import OpenAPIPetstore.Deserializer + def decode(value, options) do + value + |> deserialize(:"file", :struct, OpenAPIPetstore.Model.File, options) + |> deserialize(:"files", :list, OpenAPIPetstore.Model.File, options) + end +end + diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/foo.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/foo.ex new file mode 100644 index 000000000000..4d98049f3531 --- /dev/null +++ b/samples/client/petstore/elixir/lib/open_api_petstore/model/foo.ex @@ -0,0 +1,25 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenAPIPetstore.Model.Foo do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"bar" + ] + + @type t :: %__MODULE__{ + :"bar" => String.t | nil + } +end + +defimpl Poison.Decoder, for: OpenAPIPetstore.Model.Foo do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/format_test.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/format_test.ex new file mode 100644 index 000000000000..e05f7f5695d4 --- /dev/null +++ b/samples/client/petstore/elixir/lib/open_api_petstore/model/format_test.ex @@ -0,0 +1,55 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenAPIPetstore.Model.FormatTest do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"integer", + :"int32", + :"int64", + :"number", + :"float", + :"double", + :"string", + :"byte", + :"binary", + :"date", + :"dateTime", + :"uuid", + :"password", + :"pattern_with_digits", + :"pattern_with_digits_and_delimiter" + ] + + @type t :: %__MODULE__{ + :"integer" => integer() | nil, + :"int32" => integer() | nil, + :"int64" => integer() | nil, + :"number" => float(), + :"float" => float() | nil, + :"double" => float() | nil, + :"string" => String.t | nil, + :"byte" => binary(), + :"binary" => String.t | nil, + :"date" => Date.t, + :"dateTime" => DateTime.t | nil, + :"uuid" => String.t | nil, + :"password" => String.t, + :"pattern_with_digits" => String.t | nil, + :"pattern_with_digits_and_delimiter" => String.t | nil + } +end + +defimpl Poison.Decoder, for: OpenAPIPetstore.Model.FormatTest do + import OpenAPIPetstore.Deserializer + def decode(value, options) do + value + |> deserialize(:"date", :date, nil, options) + end +end + diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/has_only_read_only.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/has_only_read_only.ex new file mode 100644 index 000000000000..3bae7f8c51f7 --- /dev/null +++ b/samples/client/petstore/elixir/lib/open_api_petstore/model/has_only_read_only.ex @@ -0,0 +1,27 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenAPIPetstore.Model.HasOnlyReadOnly do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"bar", + :"foo" + ] + + @type t :: %__MODULE__{ + :"bar" => String.t | nil, + :"foo" => String.t | nil + } +end + +defimpl Poison.Decoder, for: OpenAPIPetstore.Model.HasOnlyReadOnly do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/health_check_result.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/health_check_result.ex new file mode 100644 index 000000000000..f216ae34f3a3 --- /dev/null +++ b/samples/client/petstore/elixir/lib/open_api_petstore/model/health_check_result.ex @@ -0,0 +1,25 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenAPIPetstore.Model.HealthCheckResult do + @moduledoc """ + Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + """ + + @derive [Poison.Encoder] + defstruct [ + :"NullableMessage" + ] + + @type t :: %__MODULE__{ + :"NullableMessage" => String.t | nil + } +end + +defimpl Poison.Decoder, for: OpenAPIPetstore.Model.HealthCheckResult do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/inline_object.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/inline_object.ex new file mode 100644 index 000000000000..ca71f7bf816d --- /dev/null +++ b/samples/client/petstore/elixir/lib/open_api_petstore/model/inline_object.ex @@ -0,0 +1,27 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenAPIPetstore.Model.InlineObject do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"name", + :"status" + ] + + @type t :: %__MODULE__{ + :"name" => String.t | nil, + :"status" => String.t | nil + } +end + +defimpl Poison.Decoder, for: OpenAPIPetstore.Model.InlineObject do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/inline_object_1.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/inline_object_1.ex new file mode 100644 index 000000000000..aa20fd9d24bf --- /dev/null +++ b/samples/client/petstore/elixir/lib/open_api_petstore/model/inline_object_1.ex @@ -0,0 +1,27 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenAPIPetstore.Model.InlineObject1 do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"additionalMetadata", + :"file" + ] + + @type t :: %__MODULE__{ + :"additionalMetadata" => String.t | nil, + :"file" => String.t | nil + } +end + +defimpl Poison.Decoder, for: OpenAPIPetstore.Model.InlineObject1 do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/inline_object_2.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/inline_object_2.ex new file mode 100644 index 000000000000..3ba98005e75c --- /dev/null +++ b/samples/client/petstore/elixir/lib/open_api_petstore/model/inline_object_2.ex @@ -0,0 +1,27 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenAPIPetstore.Model.InlineObject2 do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"enum_form_string_array", + :"enum_form_string" + ] + + @type t :: %__MODULE__{ + :"enum_form_string_array" => [String.t] | nil, + :"enum_form_string" => String.t | nil + } +end + +defimpl Poison.Decoder, for: OpenAPIPetstore.Model.InlineObject2 do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/inline_object_3.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/inline_object_3.ex new file mode 100644 index 000000000000..228f01e533d5 --- /dev/null +++ b/samples/client/petstore/elixir/lib/open_api_petstore/model/inline_object_3.ex @@ -0,0 +1,53 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenAPIPetstore.Model.InlineObject3 do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"integer", + :"int32", + :"int64", + :"number", + :"float", + :"double", + :"string", + :"pattern_without_delimiter", + :"byte", + :"binary", + :"date", + :"dateTime", + :"password", + :"callback" + ] + + @type t :: %__MODULE__{ + :"integer" => integer() | nil, + :"int32" => integer() | nil, + :"int64" => integer() | nil, + :"number" => float(), + :"float" => float() | nil, + :"double" => float(), + :"string" => String.t | nil, + :"pattern_without_delimiter" => String.t, + :"byte" => binary(), + :"binary" => String.t | nil, + :"date" => Date.t | nil, + :"dateTime" => DateTime.t | nil, + :"password" => String.t | nil, + :"callback" => String.t | nil + } +end + +defimpl Poison.Decoder, for: OpenAPIPetstore.Model.InlineObject3 do + import OpenAPIPetstore.Deserializer + def decode(value, options) do + value + |> deserialize(:"date", :date, nil, options) + end +end + diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/inline_object_4.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/inline_object_4.ex new file mode 100644 index 000000000000..44d619875200 --- /dev/null +++ b/samples/client/petstore/elixir/lib/open_api_petstore/model/inline_object_4.ex @@ -0,0 +1,27 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenAPIPetstore.Model.InlineObject4 do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"param", + :"param2" + ] + + @type t :: %__MODULE__{ + :"param" => String.t, + :"param2" => String.t + } +end + +defimpl Poison.Decoder, for: OpenAPIPetstore.Model.InlineObject4 do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/inline_object_5.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/inline_object_5.ex new file mode 100644 index 000000000000..81d147704476 --- /dev/null +++ b/samples/client/petstore/elixir/lib/open_api_petstore/model/inline_object_5.ex @@ -0,0 +1,27 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenAPIPetstore.Model.InlineObject5 do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"additionalMetadata", + :"requiredFile" + ] + + @type t :: %__MODULE__{ + :"additionalMetadata" => String.t | nil, + :"requiredFile" => String.t + } +end + +defimpl Poison.Decoder, for: OpenAPIPetstore.Model.InlineObject5 do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/inline_response_default.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/inline_response_default.ex new file mode 100644 index 000000000000..695583174751 --- /dev/null +++ b/samples/client/petstore/elixir/lib/open_api_petstore/model/inline_response_default.ex @@ -0,0 +1,27 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenAPIPetstore.Model.InlineResponseDefault do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"string" + ] + + @type t :: %__MODULE__{ + :"string" => Foo | nil + } +end + +defimpl Poison.Decoder, for: OpenAPIPetstore.Model.InlineResponseDefault do + import OpenAPIPetstore.Deserializer + def decode(value, options) do + value + |> deserialize(:"string", :struct, OpenAPIPetstore.Model.Foo, options) + end +end + diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/map_test.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/map_test.ex new file mode 100644 index 000000000000..0a196a715a6a --- /dev/null +++ b/samples/client/petstore/elixir/lib/open_api_petstore/model/map_test.ex @@ -0,0 +1,31 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenAPIPetstore.Model.MapTest do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"map_map_of_string", + :"map_of_enum_string", + :"direct_map", + :"indirect_map" + ] + + @type t :: %__MODULE__{ + :"map_map_of_string" => %{optional(String.t) => %{optional(String.t) => String.t}} | nil, + :"map_of_enum_string" => %{optional(String.t) => String.t} | nil, + :"direct_map" => %{optional(String.t) => boolean()} | nil, + :"indirect_map" => %{optional(String.t) => boolean()} | nil + } +end + +defimpl Poison.Decoder, for: OpenAPIPetstore.Model.MapTest do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/mixed_properties_and_additional_properties_class.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/mixed_properties_and_additional_properties_class.ex new file mode 100644 index 000000000000..3285b9bf222d --- /dev/null +++ b/samples/client/petstore/elixir/lib/open_api_petstore/model/mixed_properties_and_additional_properties_class.ex @@ -0,0 +1,31 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenAPIPetstore.Model.MixedPropertiesAndAdditionalPropertiesClass do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"uuid", + :"dateTime", + :"map" + ] + + @type t :: %__MODULE__{ + :"uuid" => String.t | nil, + :"dateTime" => DateTime.t | nil, + :"map" => %{optional(String.t) => Animal} | nil + } +end + +defimpl Poison.Decoder, for: OpenAPIPetstore.Model.MixedPropertiesAndAdditionalPropertiesClass do + import OpenAPIPetstore.Deserializer + def decode(value, options) do + value + |> deserialize(:"map", :map, OpenAPIPetstore.Model.Animal, options) + end +end + diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/model_200_response.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/model_200_response.ex new file mode 100644 index 000000000000..4b8b9222d84f --- /dev/null +++ b/samples/client/petstore/elixir/lib/open_api_petstore/model/model_200_response.ex @@ -0,0 +1,27 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenAPIPetstore.Model.Model200Response do + @moduledoc """ + Model for testing model name starting with number + """ + + @derive [Poison.Encoder] + defstruct [ + :"name", + :"class" + ] + + @type t :: %__MODULE__{ + :"name" => integer() | nil, + :"class" => String.t | nil + } +end + +defimpl Poison.Decoder, for: OpenAPIPetstore.Model.Model200Response do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/name.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/name.ex new file mode 100644 index 000000000000..0c1928c9fd91 --- /dev/null +++ b/samples/client/petstore/elixir/lib/open_api_petstore/model/name.ex @@ -0,0 +1,31 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenAPIPetstore.Model.Name do + @moduledoc """ + Model for testing model name same as property name + """ + + @derive [Poison.Encoder] + defstruct [ + :"name", + :"snake_case", + :"property", + :"123Number" + ] + + @type t :: %__MODULE__{ + :"name" => integer(), + :"snake_case" => integer() | nil, + :"property" => String.t | nil, + :"123Number" => integer() | nil + } +end + +defimpl Poison.Decoder, for: OpenAPIPetstore.Model.Name do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/nullable_class.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/nullable_class.ex new file mode 100644 index 000000000000..c399f532910b --- /dev/null +++ b/samples/client/petstore/elixir/lib/open_api_petstore/model/nullable_class.ex @@ -0,0 +1,49 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenAPIPetstore.Model.NullableClass do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"integer_prop", + :"number_prop", + :"boolean_prop", + :"string_prop", + :"date_prop", + :"datetime_prop", + :"array_nullable_prop", + :"array_and_items_nullable_prop", + :"array_items_nullable", + :"object_nullable_prop", + :"object_and_items_nullable_prop", + :"object_items_nullable" + ] + + @type t :: %__MODULE__{ + :"integer_prop" => integer() | nil, + :"number_prop" => float() | nil, + :"boolean_prop" => boolean() | nil, + :"string_prop" => String.t | nil, + :"date_prop" => Date.t | nil, + :"datetime_prop" => DateTime.t | nil, + :"array_nullable_prop" => [Map] | nil, + :"array_and_items_nullable_prop" => [Map] | nil, + :"array_items_nullable" => [Map] | nil, + :"object_nullable_prop" => %{optional(String.t) => Map} | nil, + :"object_and_items_nullable_prop" => %{optional(String.t) => Map} | nil, + :"object_items_nullable" => %{optional(String.t) => Map} | nil + } +end + +defimpl Poison.Decoder, for: OpenAPIPetstore.Model.NullableClass do + import OpenAPIPetstore.Deserializer + def decode(value, options) do + value + |> deserialize(:"date_prop", :date, nil, options) + end +end + diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/number_only.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/number_only.ex new file mode 100644 index 000000000000..30a3f9861867 --- /dev/null +++ b/samples/client/petstore/elixir/lib/open_api_petstore/model/number_only.ex @@ -0,0 +1,25 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenAPIPetstore.Model.NumberOnly do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"JustNumber" + ] + + @type t :: %__MODULE__{ + :"JustNumber" => float() | nil + } +end + +defimpl Poison.Decoder, for: OpenAPIPetstore.Model.NumberOnly do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/order.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/order.ex new file mode 100644 index 000000000000..40bb39f6207b --- /dev/null +++ b/samples/client/petstore/elixir/lib/open_api_petstore/model/order.ex @@ -0,0 +1,35 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenAPIPetstore.Model.Order do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"id", + :"petId", + :"quantity", + :"shipDate", + :"status", + :"complete" + ] + + @type t :: %__MODULE__{ + :"id" => integer() | nil, + :"petId" => integer() | nil, + :"quantity" => integer() | nil, + :"shipDate" => DateTime.t | nil, + :"status" => String.t | nil, + :"complete" => boolean() | nil + } +end + +defimpl Poison.Decoder, for: OpenAPIPetstore.Model.Order do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/outer_composite.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/outer_composite.ex new file mode 100644 index 000000000000..4c1d4816303c --- /dev/null +++ b/samples/client/petstore/elixir/lib/open_api_petstore/model/outer_composite.ex @@ -0,0 +1,29 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenAPIPetstore.Model.OuterComposite do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"my_number", + :"my_string", + :"my_boolean" + ] + + @type t :: %__MODULE__{ + :"my_number" => float() | nil, + :"my_string" => String.t | nil, + :"my_boolean" => boolean() | nil + } +end + +defimpl Poison.Decoder, for: OpenAPIPetstore.Model.OuterComposite do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/outer_enum.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/outer_enum.ex new file mode 100644 index 000000000000..f818a4aec401 --- /dev/null +++ b/samples/client/petstore/elixir/lib/open_api_petstore/model/outer_enum.ex @@ -0,0 +1,25 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenAPIPetstore.Model.OuterEnum do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + + ] + + @type t :: %__MODULE__{ + + } +end + +defimpl Poison.Decoder, for: OpenAPIPetstore.Model.OuterEnum do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/outer_enum_default_value.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/outer_enum_default_value.ex new file mode 100644 index 000000000000..d2c2f87157b7 --- /dev/null +++ b/samples/client/petstore/elixir/lib/open_api_petstore/model/outer_enum_default_value.ex @@ -0,0 +1,25 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenAPIPetstore.Model.OuterEnumDefaultValue do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + + ] + + @type t :: %__MODULE__{ + + } +end + +defimpl Poison.Decoder, for: OpenAPIPetstore.Model.OuterEnumDefaultValue do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/outer_enum_integer.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/outer_enum_integer.ex new file mode 100644 index 000000000000..53646faecd0f --- /dev/null +++ b/samples/client/petstore/elixir/lib/open_api_petstore/model/outer_enum_integer.ex @@ -0,0 +1,25 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenAPIPetstore.Model.OuterEnumInteger do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + + ] + + @type t :: %__MODULE__{ + + } +end + +defimpl Poison.Decoder, for: OpenAPIPetstore.Model.OuterEnumInteger do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/outer_enum_integer_default_value.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/outer_enum_integer_default_value.ex new file mode 100644 index 000000000000..afedabe42a63 --- /dev/null +++ b/samples/client/petstore/elixir/lib/open_api_petstore/model/outer_enum_integer_default_value.ex @@ -0,0 +1,25 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenAPIPetstore.Model.OuterEnumIntegerDefaultValue do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + + ] + + @type t :: %__MODULE__{ + + } +end + +defimpl Poison.Decoder, for: OpenAPIPetstore.Model.OuterEnumIntegerDefaultValue do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/pet.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/pet.ex new file mode 100644 index 000000000000..844b31826506 --- /dev/null +++ b/samples/client/petstore/elixir/lib/open_api_petstore/model/pet.ex @@ -0,0 +1,38 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenAPIPetstore.Model.Pet do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"id", + :"category", + :"name", + :"photoUrls", + :"tags", + :"status" + ] + + @type t :: %__MODULE__{ + :"id" => integer() | nil, + :"category" => Category | nil, + :"name" => String.t, + :"photoUrls" => [String.t], + :"tags" => [Tag] | nil, + :"status" => String.t | nil + } +end + +defimpl Poison.Decoder, for: OpenAPIPetstore.Model.Pet do + import OpenAPIPetstore.Deserializer + def decode(value, options) do + value + |> deserialize(:"category", :struct, OpenAPIPetstore.Model.Category, options) + |> deserialize(:"tags", :list, OpenAPIPetstore.Model.Tag, options) + end +end + diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/read_only_first.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/read_only_first.ex new file mode 100644 index 000000000000..9ce08c2f5202 --- /dev/null +++ b/samples/client/petstore/elixir/lib/open_api_petstore/model/read_only_first.ex @@ -0,0 +1,27 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenAPIPetstore.Model.ReadOnlyFirst do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"bar", + :"baz" + ] + + @type t :: %__MODULE__{ + :"bar" => String.t | nil, + :"baz" => String.t | nil + } +end + +defimpl Poison.Decoder, for: OpenAPIPetstore.Model.ReadOnlyFirst do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/return.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/return.ex new file mode 100644 index 000000000000..306421e2c3a9 --- /dev/null +++ b/samples/client/petstore/elixir/lib/open_api_petstore/model/return.ex @@ -0,0 +1,25 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenAPIPetstore.Model.Return do + @moduledoc """ + Model for testing reserved words + """ + + @derive [Poison.Encoder] + defstruct [ + :"return" + ] + + @type t :: %__MODULE__{ + :"return" => integer() | nil + } +end + +defimpl Poison.Decoder, for: OpenAPIPetstore.Model.Return do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/tag.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/tag.ex new file mode 100644 index 000000000000..b7d28a0c7c3c --- /dev/null +++ b/samples/client/petstore/elixir/lib/open_api_petstore/model/tag.ex @@ -0,0 +1,27 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenAPIPetstore.Model.Tag do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"id", + :"name" + ] + + @type t :: %__MODULE__{ + :"id" => integer() | nil, + :"name" => String.t | nil + } +end + +defimpl Poison.Decoder, for: OpenAPIPetstore.Model.Tag do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/user.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/user.ex new file mode 100644 index 000000000000..33afc4d24e54 --- /dev/null +++ b/samples/client/petstore/elixir/lib/open_api_petstore/model/user.ex @@ -0,0 +1,39 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenAPIPetstore.Model.User do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"id", + :"username", + :"firstName", + :"lastName", + :"email", + :"password", + :"phone", + :"userStatus" + ] + + @type t :: %__MODULE__{ + :"id" => integer() | nil, + :"username" => String.t | nil, + :"firstName" => String.t | nil, + :"lastName" => String.t | nil, + :"email" => String.t | nil, + :"password" => String.t | nil, + :"phone" => String.t | nil, + :"userStatus" => integer() | nil + } +end + +defimpl Poison.Decoder, for: OpenAPIPetstore.Model.User do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/request_builder.ex b/samples/client/petstore/elixir/lib/open_api_petstore/request_builder.ex new file mode 100644 index 000000000000..5366cc86c206 --- /dev/null +++ b/samples/client/petstore/elixir/lib/open_api_petstore/request_builder.ex @@ -0,0 +1,143 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenAPIPetstore.RequestBuilder do + @moduledoc """ + Helper functions for building Tesla requests + """ + + @doc """ + Specify the request method when building a request + + ## Parameters + + - request (Map) - Collected request options + - m (atom) - Request method + + ## Returns + + Map + """ + @spec method(map(), atom) :: map() + def method(request, m) do + Map.put_new(request, :method, m) + end + + @doc """ + Specify the request method when building a request + + ## Parameters + + - request (Map) - Collected request options + - u (String) - Request URL + + ## Returns + + Map + """ + @spec url(map(), String.t) :: map() + def url(request, u) do + Map.put_new(request, :url, u) + end + + @doc """ + Add optional parameters to the request + + ## Parameters + + - request (Map) - Collected request options + - definitions (Map) - Map of parameter name to parameter location. + - options (KeywordList) - The provided optional parameters + + ## Returns + + Map + """ + @spec add_optional_params(map(), %{optional(atom) => atom}, keyword()) :: map() + def add_optional_params(request, _, []), do: request + def add_optional_params(request, definitions, [{key, value} | tail]) do + case definitions do + %{^key => location} -> + request + |> add_param(location, key, value) + |> add_optional_params(definitions, tail) + _ -> + add_optional_params(request, definitions, tail) + end + end + + @doc """ + Add optional parameters to the request + + ## Parameters + + - request (Map) - Collected request options + - location (atom) - Where to put the parameter + - key (atom) - The name of the parameter + - value (any) - The value of the parameter + + ## Returns + + Map + """ + @spec add_param(map(), atom, atom, any()) :: map() + def add_param(request, :body, :body, value), do: Map.put(request, :body, value) + def add_param(request, :body, key, value) do + request + |> Map.put_new_lazy(:body, &Tesla.Multipart.new/0) + |> Map.update!(:body, &(Tesla.Multipart.add_field(&1, key, Poison.encode!(value), headers: [{:"Content-Type", "application/json"}]))) + end + def add_param(request, :headers, key, value) do + request + |> Tesla.put_header(key, value) + end + def add_param(request, :file, name, path) do + request + |> Map.put_new_lazy(:body, &Tesla.Multipart.new/0) + |> Map.update!(:body, &(Tesla.Multipart.add_file(&1, path, name: name))) + end + def add_param(request, :form, name, value) do + request + |> Map.update(:body, %{name => value}, &(Map.put(&1, name, value))) + end + def add_param(request, location, key, value) do + Map.update(request, location, [{key, value}], &(&1 ++ [{key, value}])) + end + + @doc """ + Handle the response for a Tesla request + + ## Parameters + + - arg1 (Tesla.Env.t | term) - The response object + - arg2 (:false | struct | [struct]) - The shape of the struct to deserialize into + + ## Returns + + {:ok, struct} on success + {:error, term} on failure + """ + @spec decode(Tesla.Env.t() | term(), false | struct() | [struct()]) :: + {:ok, struct()} | {:ok, Tesla.Env.t()} | {:error, any} + def decode(%Tesla.Env{} = env, false), do: {:ok, env} + def decode(%Tesla.Env{body: body}, struct), do: Poison.decode(body, as: struct) + + def evaluate_response({:ok, %Tesla.Env{} = env}, mapping) do + resolve_mapping(env, mapping) + end + + def evaluate_response({:error, _} = error, _), do: error + + def resolve_mapping(env, mapping, default \\ nil) + + def resolve_mapping(%Tesla.Env{status: status} = env, [{mapping_status, struct} | _], _) + when status == mapping_status do + decode(env, struct) + end + + def resolve_mapping(env, [{:default, struct} | tail], _), do: resolve_mapping(env, tail, struct) + def resolve_mapping(env, [_ | tail], struct), do: resolve_mapping(env, tail, struct) + def resolve_mapping(env, [], nil), do: {:error, env} + def resolve_mapping(env, [], struct), do: decode(env, struct) +end diff --git a/samples/client/petstore/elixir/mix.exs b/samples/client/petstore/elixir/mix.exs index a37e01a8de65..f6edf772be41 100644 --- a/samples/client/petstore/elixir/mix.exs +++ b/samples/client/petstore/elixir/mix.exs @@ -1,8 +1,8 @@ -defmodule OpenapiPetstore.Mixfile do +defmodule OpenAPIPetstore.Mixfile do use Mix.Project def project do - [app: :openapi_petstore, + [app: :open_api_petstore, version: "1.0.0", elixir: "~> 1.6", build_embedded: Mix.env == :prod, diff --git a/samples/client/petstore/elm-0.18/.openapi-generator/VERSION b/samples/client/petstore/elm-0.18/.openapi-generator/VERSION index 479c313e87b9..83a328a9227e 100644 --- a/samples/client/petstore/elm-0.18/.openapi-generator/VERSION +++ b/samples/client/petstore/elm-0.18/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.3-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/elm/.openapi-generator/VERSION b/samples/client/petstore/elm/.openapi-generator/VERSION index 479c313e87b9..83a328a9227e 100644 --- a/samples/client/petstore/elm/.openapi-generator/VERSION +++ b/samples/client/petstore/elm/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.3-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/erlang-client/.openapi-generator/VERSION b/samples/client/petstore/erlang-client/.openapi-generator/VERSION index 105bb87d77b3..83a328a9227e 100644 --- a/samples/client/petstore/erlang-client/.openapi-generator/VERSION +++ b/samples/client/petstore/erlang-client/.openapi-generator/VERSION @@ -1 +1 @@ -3.2.2-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/erlang-client/src/petstore_inline_object.erl b/samples/client/petstore/erlang-client/src/petstore_inline_object.erl new file mode 100644 index 000000000000..9863a8e30bb7 --- /dev/null +++ b/samples/client/petstore/erlang-client/src/petstore_inline_object.erl @@ -0,0 +1,17 @@ +-module(petstore_inline_object). + +-export([encode/1]). + +-export_type([petstore_inline_object/0]). + +-type petstore_inline_object() :: + #{ 'name' => binary(), + 'status' => binary() + }. + +encode(#{ 'name' := Name, + 'status' := Status + }) -> + #{ 'name' => Name, + 'status' => Status + }. diff --git a/samples/client/petstore/erlang-client/src/petstore_inline_object_1.erl b/samples/client/petstore/erlang-client/src/petstore_inline_object_1.erl new file mode 100644 index 000000000000..faf9a97e8964 --- /dev/null +++ b/samples/client/petstore/erlang-client/src/petstore_inline_object_1.erl @@ -0,0 +1,17 @@ +-module(petstore_inline_object_1). + +-export([encode/1]). + +-export_type([petstore_inline_object_1/0]). + +-type petstore_inline_object_1() :: + #{ 'additionalMetadata' => binary(), + 'file' => binary() + }. + +encode(#{ 'additionalMetadata' := AdditionalMetadata, + 'file' := File + }) -> + #{ 'additionalMetadata' => AdditionalMetadata, + 'file' => File + }. diff --git a/samples/client/petstore/erlang-client/src/petstore_pet_api.erl b/samples/client/petstore/erlang-client/src/petstore_pet_api.erl index bbb664f66bda..f8512dcc7b4b 100644 --- a/samples/client/petstore/erlang-client/src/petstore_pet_api.erl +++ b/samples/client/petstore/erlang-client/src/petstore_pet_api.erl @@ -87,7 +87,7 @@ find_pets_by_tags(Ctx, Tags, Optional) -> Method = get, Path = ["/pet/findByTags"], - QS = lists:flatten([[{<<"tags">>, X} || X <- Tags]])++petstore_utils:optional_params([], _OptionalParams), + QS = lists:flatten([[{<<"tags">>, X} || X <- Tags]])++petstore_utils:optional_params(['maxCount'], _OptionalParams), Headers = [], Body1 = [], ContentTypeHeader = petstore_utils:select_header_content_type([]), diff --git a/samples/client/petstore/erlang-client/src/petstore_store_api.erl b/samples/client/petstore/erlang-client/src/petstore_store_api.erl index 178cd0a2cb23..2e72823d9d90 100644 --- a/samples/client/petstore/erlang-client/src/petstore_store_api.erl +++ b/samples/client/petstore/erlang-client/src/petstore_store_api.erl @@ -86,7 +86,7 @@ place_order(Ctx, PetstoreOrder, Optional) -> QS = [], Headers = [], Body1 = PetstoreOrder, - ContentTypeHeader = petstore_utils:select_header_content_type([]), + ContentTypeHeader = petstore_utils:select_header_content_type([<<"application/json">>]), Opts = maps:get(hackney_opts, Optional, []), petstore_utils:request(Ctx, Method, [?BASE_URL, Path], QS, ContentTypeHeader++Headers, Body1, Opts, Cfg). diff --git a/samples/client/petstore/erlang-client/src/petstore_user_api.erl b/samples/client/petstore/erlang-client/src/petstore_user_api.erl index b1f07026be88..45a8a9d78726 100644 --- a/samples/client/petstore/erlang-client/src/petstore_user_api.erl +++ b/samples/client/petstore/erlang-client/src/petstore_user_api.erl @@ -27,7 +27,7 @@ create_user(Ctx, PetstoreUser, Optional) -> QS = [], Headers = [], Body1 = PetstoreUser, - ContentTypeHeader = petstore_utils:select_header_content_type([]), + ContentTypeHeader = petstore_utils:select_header_content_type([<<"application/json">>]), Opts = maps:get(hackney_opts, Optional, []), petstore_utils:request(Ctx, Method, [?BASE_URL, Path], QS, ContentTypeHeader++Headers, Body1, Opts, Cfg). @@ -48,7 +48,7 @@ create_users_with_array_input(Ctx, PetstoreUserArray, Optional) -> QS = [], Headers = [], Body1 = PetstoreUserArray, - ContentTypeHeader = petstore_utils:select_header_content_type([]), + ContentTypeHeader = petstore_utils:select_header_content_type([<<"application/json">>]), Opts = maps:get(hackney_opts, Optional, []), petstore_utils:request(Ctx, Method, [?BASE_URL, Path], QS, ContentTypeHeader++Headers, Body1, Opts, Cfg). @@ -69,7 +69,7 @@ create_users_with_list_input(Ctx, PetstoreUserArray, Optional) -> QS = [], Headers = [], Body1 = PetstoreUserArray, - ContentTypeHeader = petstore_utils:select_header_content_type([]), + ContentTypeHeader = petstore_utils:select_header_content_type([<<"application/json">>]), Opts = maps:get(hackney_opts, Optional, []), petstore_utils:request(Ctx, Method, [?BASE_URL, Path], QS, ContentTypeHeader++Headers, Body1, Opts, Cfg). @@ -174,7 +174,7 @@ update_user(Ctx, Username, PetstoreUser, Optional) -> QS = [], Headers = [], Body1 = PetstoreUser, - ContentTypeHeader = petstore_utils:select_header_content_type([]), + ContentTypeHeader = petstore_utils:select_header_content_type([<<"application/json">>]), Opts = maps:get(hackney_opts, Optional, []), petstore_utils:request(Ctx, Method, [?BASE_URL, Path], QS, ContentTypeHeader++Headers, Body1, Opts, Cfg). diff --git a/samples/client/petstore/erlang-client/src/petstore_utils.erl b/samples/client/petstore/erlang-client/src/petstore_utils.erl index b96ec3da5ad6..e44f922f504a 100644 --- a/samples/client/petstore/erlang-client/src/petstore_utils.erl +++ b/samples/client/petstore/erlang-client/src/petstore_utils.erl @@ -75,7 +75,10 @@ update_params_with_auth(Cfg, Headers, QS) -> Auths = #{ 'api_key' => #{type => 'apiKey', key => <<"api_key">>, - in => header}, 'petstore_auth' => + in => header}, 'auth_cookie' => + #{type => 'apiKey', + key => <<"AUTH_KEY">>, + in => }, 'petstore_auth' => #{type => 'oauth2', key => <<"Authorization">>, in => header}}, diff --git a/samples/client/petstore/erlang-proper/.openapi-generator/VERSION b/samples/client/petstore/erlang-proper/.openapi-generator/VERSION index a65271290834..83a328a9227e 100644 --- a/samples/client/petstore/erlang-proper/.openapi-generator/VERSION +++ b/samples/client/petstore/erlang-proper/.openapi-generator/VERSION @@ -1 +1 @@ -3.3.2-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/erlang-proper/src/petstore_api.erl b/samples/client/petstore/erlang-proper/src/petstore_api.erl index 2f852cfd4073..faf58355ab07 100644 --- a/samples/client/petstore/erlang-proper/src/petstore_api.erl +++ b/samples/client/petstore/erlang-proper/src/petstore_api.erl @@ -16,11 +16,11 @@ %% This can only be done by the logged in user. -spec create_user(petstore_user:petstore_user()) -> petstore_utils:response(). -create_user(PetstoreUser) -> +create_user(Body) -> Method = post, Host = application:get_env(petstore, host, "http://localhost:8080"), Path = ["/user"], - Body = PetstoreUser, + Body = Body, ContentType = "text/plain", petstore_utils:request(Method, [Host, ?BASE_URL, Path], jsx:encode(Body), ContentType). @@ -29,11 +29,11 @@ create_user(PetstoreUser) -> %% -spec create_users_with_array_input(list(petstore_user:petstore_user())) -> petstore_utils:response(). -create_users_with_array_input(PetstoreUserArray) -> +create_users_with_array_input(Body) -> Method = post, Host = application:get_env(petstore, host, "http://localhost:8080"), Path = ["/user/createWithArray"], - Body = PetstoreUserArray, + Body = Body, ContentType = "text/plain", petstore_utils:request(Method, [Host, ?BASE_URL, Path], jsx:encode(Body), ContentType). @@ -42,11 +42,11 @@ create_users_with_array_input(PetstoreUserArray) -> %% -spec create_users_with_list_input(list(petstore_user:petstore_user())) -> petstore_utils:response(). -create_users_with_list_input(PetstoreUserArray) -> +create_users_with_list_input(Body) -> Method = post, Host = application:get_env(petstore, host, "http://localhost:8080"), Path = ["/user/createWithList"], - Body = PetstoreUserArray, + Body = Body, ContentType = "text/plain", petstore_utils:request(Method, [Host, ?BASE_URL, Path], jsx:encode(Body), ContentType). @@ -100,11 +100,11 @@ logout_user() -> %% This can only be done by the logged in user. -spec update_user(binary(), petstore_user:petstore_user()) -> petstore_utils:response(). -update_user(Username, PetstoreUser) -> +update_user(Username, Body) -> Method = put, Host = application:get_env(petstore, host, "http://localhost:8080"), Path = ["/user/", Username, ""], - Body = PetstoreUser, + Body = Body, ContentType = "text/plain", petstore_utils:request(Method, [Host, ?BASE_URL, Path], jsx:encode(Body), ContentType). diff --git a/samples/client/petstore/erlang-proper/src/petstore_statem.erl b/samples/client/petstore/erlang-proper/src/petstore_statem.erl index 9244c6fbf0c0..cb6f3031e878 100644 --- a/samples/client/petstore/erlang-proper/src/petstore_statem.erl +++ b/samples/client/petstore/erlang-proper/src/petstore_statem.erl @@ -61,8 +61,8 @@ initial_state() -> #{}. %% create_user %%============================================================================== -create_user(PetstoreUser) -> - petstore_api:create_user(PetstoreUser). +create_user(Body) -> + petstore_api:create_user(Body). create_user_args(_S) -> [petstore_user:petstore_user()]. @@ -71,8 +71,8 @@ create_user_args(_S) -> %% create_users_with_array_input %%============================================================================== -create_users_with_array_input(PetstoreUserArray) -> - petstore_api:create_users_with_array_input(PetstoreUserArray). +create_users_with_array_input(Body) -> + petstore_api:create_users_with_array_input(Body). create_users_with_array_input_args(_S) -> [list(petstore_user:petstore_user())]. @@ -81,8 +81,8 @@ create_users_with_array_input_args(_S) -> %% create_users_with_list_input %%============================================================================== -create_users_with_list_input(PetstoreUserArray) -> - petstore_api:create_users_with_list_input(PetstoreUserArray). +create_users_with_list_input(Body) -> + petstore_api:create_users_with_list_input(Body). create_users_with_list_input_args(_S) -> [list(petstore_user:petstore_user())]. @@ -131,8 +131,8 @@ logout_user_args(_S) -> %% update_user %%============================================================================== -update_user(Username, PetstoreUser) -> - petstore_api:update_user(Username, PetstoreUser). +update_user(Username, Body) -> + petstore_api:update_user(Username, Body). update_user_args(_S) -> [binary(), petstore_user:petstore_user()]. diff --git a/samples/client/petstore/flash/.openapi-generator/VERSION b/samples/client/petstore/flash/.openapi-generator/VERSION index 096bf47efe31..83a328a9227e 100644 --- a/samples/client/petstore/flash/.openapi-generator/VERSION +++ b/samples/client/petstore/flash/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.0-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/flash/flash/build.xml b/samples/client/petstore/flash/flash/build.xml index da3c67f83443..dedf7e030081 100644 --- a/samples/client/petstore/flash/flash/build.xml +++ b/samples/client/petstore/flash/flash/build.xml @@ -15,7 +15,7 @@ - + @@ -28,7 +28,7 @@ - + @@ -189,4 +189,4 @@ - \ No newline at end of file + diff --git a/samples/client/petstore/flash/flash/src/org/openapitools/client/api/PetApi.as b/samples/client/petstore/flash/flash/src/org/openapitools/client/api/PetApi.as index 3ad9c7c96dc1..2391458b413c 100644 --- a/samples/client/petstore/flash/flash/src/org/openapitools/client/api/PetApi.as +++ b/samples/client/petstore/flash/flash/src/org/openapitools/client/api/PetApi.as @@ -135,7 +135,7 @@ public class PetApi extends OpenApi { /* * Returns Array */ - public function find_pets_by_tags (tags: Array): String { + public function find_pets_by_tags (tags: Array, maxCount: Number): String { // create path and map variables var path: String = "/pet/findByTags".replace(/{format}/g,"xml"); @@ -144,12 +144,18 @@ public class PetApi extends OpenApi { var headerParams: Dictionary = new Dictionary(); // verify required params are set + if( // verify required params are set if() { throw new ApiError(400, "missing required params"); } +) { + throw new ApiError(400, "missing required params"); + } if("null" != String(tags)) queryParams["tags"] = toPathValue(tags); +if("null" != String(maxCount)) + queryParams["maxCount"] = toPathValue(maxCount); var token:AsyncToken = getApiInvoker().invokeAPI(path, "GET", queryParams, null, headerParams); diff --git a/samples/client/petstore/flash/flash/src/org/openapitools/client/model/InlineObject.as b/samples/client/petstore/flash/flash/src/org/openapitools/client/model/InlineObject.as new file mode 100644 index 000000000000..91bf9a588671 --- /dev/null +++ b/samples/client/petstore/flash/flash/src/org/openapitools/client/model/InlineObject.as @@ -0,0 +1,22 @@ +package org.openapitools.client.model { + + + [XmlRootNode(name="InlineObject")] + public class InlineObject { + /* Updated name of the pet */ + [XmlElement(name="name")] + public var name: String = null; + /* Updated status of the pet */ + [XmlElement(name="status")] + public var status: String = null; + + public function toString(): String { + var str: String = "InlineObject: "; + str += " (name: " + name + ")"; + str += " (status: " + status + ")"; + return str; + } + +} + +} diff --git a/samples/client/petstore/flash/flash/src/org/openapitools/client/model/InlineObject1.as b/samples/client/petstore/flash/flash/src/org/openapitools/client/model/InlineObject1.as new file mode 100644 index 000000000000..9ce7463f7074 --- /dev/null +++ b/samples/client/petstore/flash/flash/src/org/openapitools/client/model/InlineObject1.as @@ -0,0 +1,23 @@ +package org.openapitools.client.model { + +import flash.filesystem.File; + + [XmlRootNode(name="InlineObject1")] + public class InlineObject1 { + /* Additional data to pass to server */ + [XmlElement(name="additionalMetadata")] + public var additionalMetadata: String = null; + /* file to upload */ + [XmlElement(name="file")] + public var file: File = null; + + public function toString(): String { + var str: String = "InlineObject1: "; + str += " (additionalMetadata: " + additionalMetadata + ")"; + str += " (file: " + file + ")"; + return str; + } + +} + +} diff --git a/samples/client/petstore/flash/flash/src/org/openapitools/client/model/InlineObject1List.as b/samples/client/petstore/flash/flash/src/org/openapitools/client/model/InlineObject1List.as new file mode 100644 index 000000000000..d5b9fcc3285a --- /dev/null +++ b/samples/client/petstore/flash/flash/src/org/openapitools/client/model/InlineObject1List.as @@ -0,0 +1,18 @@ +package org.openapitools.client.model { + +import org.openapitools.common.ListWrapper; +import flash.filesystem.File; + + public class InlineObject1List implements ListWrapper { + // This declaration below of _inline_object_1_obj_class is to force flash compiler to include this class + private var _inlineObject1_obj_class: org.openapitools.client.model.InlineObject1 = null; + [XmlElements(name="inlineObject1", type="org.openapitools.client.model.InlineObject1")] + public var inlineObject1: Array = new Array(); + + public function getList(): Array{ + return inlineObject1; + } + +} + +} diff --git a/samples/client/petstore/flash/flash/src/org/openapitools/client/model/InlineObjectList.as b/samples/client/petstore/flash/flash/src/org/openapitools/client/model/InlineObjectList.as new file mode 100644 index 000000000000..4cb6a060ec3e --- /dev/null +++ b/samples/client/petstore/flash/flash/src/org/openapitools/client/model/InlineObjectList.as @@ -0,0 +1,17 @@ +package org.openapitools.client.model { + +import org.openapitools.common.ListWrapper; + + public class InlineObjectList implements ListWrapper { + // This declaration below of _inline_object_obj_class is to force flash compiler to include this class + private var _inlineObject_obj_class: org.openapitools.client.model.InlineObject = null; + [XmlElements(name="inlineObject", type="org.openapitools.client.model.InlineObject")] + public var inlineObject: Array = new Array(); + + public function getList(): Array{ + return inlineObject; + } + +} + +} diff --git a/samples/client/petstore/flash/flash/src/org/openapitools/event/ApiClientEvent.as b/samples/client/petstore/flash/flash/src/org/openapitools/event/ApiClientEvent.as index 964dbc26d692..abb0fe121fb2 100644 --- a/samples/client/petstore/flash/flash/src/org/openapitools/event/ApiClientEvent.as +++ b/samples/client/petstore/flash/flash/src/org/openapitools/event/ApiClientEvent.as @@ -11,7 +11,7 @@ import flash.events.Event; public class ApiClientEvent extends Event{ /** - * Event type to indicate a unsuccessful invocation + * Event type to indicate an unsuccessful invocation */ public static const FAILURE_EVENT:String = "unsuccesfulInvocation"; @@ -33,4 +33,4 @@ public class ApiClientEvent extends Event{ super(type, bubbles, cancelable); } } -} \ No newline at end of file +} diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesAnyType.md b/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesAnyType.md index 47b71f2a71f7..d6a64a17629c 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesAnyType.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesAnyType.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | Pointer to **string** | | [optional] +**Name** | Pointer to **string** | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesArray.md b/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesArray.md index b8d3d2e343e0..8fa3956c6cbf 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesArray.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesArray.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | Pointer to **string** | | [optional] +**Name** | Pointer to **string** | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesBoolean.md b/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesBoolean.md index 2c27fcebb9ba..dab05846a08e 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesBoolean.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesBoolean.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | Pointer to **string** | | [optional] +**Name** | Pointer to **string** | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesClass.md b/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesClass.md index a676667ed752..8b22e0ef339a 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesClass.md @@ -4,17 +4,17 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**MapString** | Pointer to **map[string]string** | | [optional] -**MapNumber** | Pointer to **map[string]float32** | | [optional] -**MapInteger** | Pointer to **map[string]int32** | | [optional] -**MapBoolean** | Pointer to **map[string]bool** | | [optional] -**MapArrayInteger** | Pointer to [**map[string][]int32**](array.md) | | [optional] -**MapArrayAnytype** | Pointer to [**map[string][]map[string]interface{}**](array.md) | | [optional] -**MapMapString** | Pointer to [**map[string]map[string]string**](map.md) | | [optional] -**MapMapAnytype** | Pointer to [**map[string]map[string]map[string]interface{}**](map.md) | | [optional] -**Anytype1** | Pointer to [**map[string]interface{}**](.md) | | [optional] -**Anytype2** | Pointer to [**map[string]interface{}**](.md) | | [optional] -**Anytype3** | Pointer to [**map[string]interface{}**](.md) | | [optional] +**MapString** | Pointer to **map[string]string** | | [optional] +**MapNumber** | Pointer to **map[string]float32** | | [optional] +**MapInteger** | Pointer to **map[string]int32** | | [optional] +**MapBoolean** | Pointer to **map[string]bool** | | [optional] +**MapArrayInteger** | Pointer to [**map[string][]int32**](array.md) | | [optional] +**MapArrayAnytype** | Pointer to [**map[string][]map[string]interface{}**](array.md) | | [optional] +**MapMapString** | Pointer to [**map[string]map[string]string**](map.md) | | [optional] +**MapMapAnytype** | Pointer to [**map[string]map[string]map[string]interface{}**](map.md) | | [optional] +**Anytype1** | Pointer to [**map[string]interface{}**](.md) | | [optional] +**Anytype2** | Pointer to [**map[string]interface{}**](.md) | | [optional] +**Anytype3** | Pointer to [**map[string]interface{}**](.md) | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesInteger.md b/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesInteger.md index 5db6d8671d5d..9bed1f72584a 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesInteger.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesInteger.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | Pointer to **string** | | [optional] +**Name** | Pointer to **string** | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesNumber.md b/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesNumber.md index 585ee570058a..efc3cc156c1e 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesNumber.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesNumber.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | Pointer to **string** | | [optional] +**Name** | Pointer to **string** | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesObject.md b/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesObject.md index d71afb494337..af3963446840 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesObject.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesObject.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | Pointer to **string** | | [optional] +**Name** | Pointer to **string** | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesString.md b/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesString.md index 72bbc5d7fd88..0934f9bf5042 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesString.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesString.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | Pointer to **string** | | [optional] +**Name** | Pointer to **string** | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/ApiResponse.md b/samples/client/petstore/go-experimental/go-petstore/docs/ApiResponse.md index 3dd402a3316b..b0c891bbc960 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/ApiResponse.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/ApiResponse.md @@ -4,9 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Code** | Pointer to **int32** | | [optional] -**Type** | Pointer to **string** | | [optional] -**Message** | Pointer to **string** | | [optional] +**Code** | Pointer to **int32** | | [optional] +**Type** | Pointer to **string** | | [optional] +**Message** | Pointer to **string** | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/go-experimental/go-petstore/docs/ArrayOfArrayOfNumberOnly.md index 6e776c78ba64..64ad908ea3bf 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/ArrayOfArrayOfNumberOnly.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/ArrayOfArrayOfNumberOnly.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ArrayArrayNumber** | Pointer to [**[][]float32**](array.md) | | [optional] +**ArrayArrayNumber** | Pointer to [**[][]float32**](array.md) | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/ArrayOfNumberOnly.md b/samples/client/petstore/go-experimental/go-petstore/docs/ArrayOfNumberOnly.md index af74787e38a4..0ce95922a5ed 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/ArrayOfNumberOnly.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/ArrayOfNumberOnly.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ArrayNumber** | Pointer to **[]float32** | | [optional] +**ArrayNumber** | Pointer to **[]float32** | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/ArrayTest.md b/samples/client/petstore/go-experimental/go-petstore/docs/ArrayTest.md index 7c25df85ffcc..f7020fadea38 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/ArrayTest.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/ArrayTest.md @@ -4,9 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ArrayOfString** | Pointer to **[]string** | | [optional] -**ArrayArrayOfInteger** | Pointer to [**[][]int64**](array.md) | | [optional] -**ArrayArrayOfModel** | Pointer to [**[][]ReadOnlyFirst**](array.md) | | [optional] +**ArrayOfString** | Pointer to **[]string** | | [optional] +**ArrayArrayOfInteger** | Pointer to [**[][]int64**](array.md) | | [optional] +**ArrayArrayOfModel** | Pointer to [**[][]ReadOnlyFirst**](array.md) | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/Capitalization.md b/samples/client/petstore/go-experimental/go-petstore/docs/Capitalization.md index fd856f743e6d..a4772d740066 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/Capitalization.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/Capitalization.md @@ -4,12 +4,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**SmallCamel** | Pointer to **string** | | [optional] -**CapitalCamel** | Pointer to **string** | | [optional] -**SmallSnake** | Pointer to **string** | | [optional] -**CapitalSnake** | Pointer to **string** | | [optional] -**SCAETHFlowPoints** | Pointer to **string** | | [optional] -**ATT_NAME** | Pointer to **string** | Name of the pet | [optional] +**SmallCamel** | Pointer to **string** | | [optional] +**CapitalCamel** | Pointer to **string** | | [optional] +**SmallSnake** | Pointer to **string** | | [optional] +**CapitalSnake** | Pointer to **string** | | [optional] +**SCAETHFlowPoints** | Pointer to **string** | | [optional] +**ATT_NAME** | Pointer to **string** | Name of the pet | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/Cat.md b/samples/client/petstore/go-experimental/go-petstore/docs/Cat.md index 262e3d04f6de..0f2fe5a1f1f8 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/Cat.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/Cat.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **ClassName** | Pointer to **string** | | **Color** | Pointer to **string** | | [optional] [default to red] -**Declawed** | Pointer to **bool** | | [optional] +**Declawed** | Pointer to **bool** | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/CatAllOf.md b/samples/client/petstore/go-experimental/go-petstore/docs/CatAllOf.md index a89f0b29fa54..85f40d251d94 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/CatAllOf.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/CatAllOf.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Declawed** | Pointer to **bool** | | [optional] +**Declawed** | Pointer to **bool** | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/Category.md b/samples/client/petstore/go-experimental/go-petstore/docs/Category.md index b8ef18163b83..88b525bade15 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/Category.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/Category.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | Pointer to **int64** | | [optional] -**Name** | Pointer to **string** | | [default to default-name] +**Id** | Pointer to **int64** | | [optional] +**Name** | Pointer to **string** | | [default to default-name] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/ClassModel.md b/samples/client/petstore/go-experimental/go-petstore/docs/ClassModel.md index 9ceae1f3d0b5..d9c4f41e98bc 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/ClassModel.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/ClassModel.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Class** | Pointer to **string** | | [optional] +**Class** | Pointer to **string** | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/Client.md b/samples/client/petstore/go-experimental/go-petstore/docs/Client.md index 9787127b16d7..5ed3098fd491 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/Client.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/Client.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Client** | Pointer to **string** | | [optional] +**Client** | Pointer to **string** | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/Dog.md b/samples/client/petstore/go-experimental/go-petstore/docs/Dog.md index 591ab03c6a64..4b5c332d8e14 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/Dog.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/Dog.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **ClassName** | Pointer to **string** | | **Color** | Pointer to **string** | | [optional] [default to red] -**Breed** | Pointer to **string** | | [optional] +**Breed** | Pointer to **string** | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/DogAllOf.md b/samples/client/petstore/go-experimental/go-petstore/docs/DogAllOf.md index e5103c49754f..a3169521cecc 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/DogAllOf.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/DogAllOf.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Breed** | Pointer to **string** | | [optional] +**Breed** | Pointer to **string** | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/EnumArrays.md b/samples/client/petstore/go-experimental/go-petstore/docs/EnumArrays.md index 6d6028e96663..31d7b2b9faaa 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/EnumArrays.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/EnumArrays.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**JustSymbol** | Pointer to **string** | | [optional] -**ArrayEnum** | Pointer to **[]string** | | [optional] +**JustSymbol** | Pointer to **string** | | [optional] +**ArrayEnum** | Pointer to **[]string** | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/EnumTest.md b/samples/client/petstore/go-experimental/go-petstore/docs/EnumTest.md index f396e0e32a2c..d0e7aebc42d0 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/EnumTest.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/EnumTest.md @@ -4,11 +4,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**EnumString** | Pointer to **string** | | [optional] +**EnumString** | Pointer to **string** | | [optional] **EnumStringRequired** | Pointer to **string** | | -**EnumInteger** | Pointer to **int32** | | [optional] -**EnumNumber** | Pointer to **float64** | | [optional] -**OuterEnum** | Pointer to [**OuterEnum**](OuterEnum.md) | | [optional] +**EnumInteger** | Pointer to **int32** | | [optional] +**EnumNumber** | Pointer to **float64** | | [optional] +**OuterEnum** | Pointer to [**OuterEnum**](OuterEnum.md) | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/File.md b/samples/client/petstore/go-experimental/go-petstore/docs/File.md index 07d269cd8811..454b159609c1 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/File.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/File.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**SourceURI** | Pointer to **string** | Test capitalization | [optional] +**SourceURI** | Pointer to **string** | Test capitalization | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/FileSchemaTestClass.md b/samples/client/petstore/go-experimental/go-petstore/docs/FileSchemaTestClass.md index 4a12b7f6d570..d4a4da7206c4 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/FileSchemaTestClass.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/FileSchemaTestClass.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**File** | Pointer to [**File**](File.md) | | [optional] -**Files** | Pointer to [**[]File**](File.md) | | [optional] +**File** | Pointer to [**File**](File.md) | | [optional] +**Files** | Pointer to [**[]File**](File.md) | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/FormatTest.md b/samples/client/petstore/go-experimental/go-petstore/docs/FormatTest.md index 7b0c3d451ce8..6711f4f4fcc7 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/FormatTest.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/FormatTest.md @@ -4,18 +4,18 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Integer** | Pointer to **int32** | | [optional] -**Int32** | Pointer to **int32** | | [optional] -**Int64** | Pointer to **int64** | | [optional] +**Integer** | Pointer to **int32** | | [optional] +**Int32** | Pointer to **int32** | | [optional] +**Int64** | Pointer to **int64** | | [optional] **Number** | Pointer to **float32** | | -**Float** | Pointer to **float32** | | [optional] -**Double** | Pointer to **float64** | | [optional] -**String** | Pointer to **string** | | [optional] +**Float** | Pointer to **float32** | | [optional] +**Double** | Pointer to **float64** | | [optional] +**String** | Pointer to **string** | | [optional] **Byte** | Pointer to **string** | | -**Binary** | Pointer to [***os.File**](*os.File.md) | | [optional] +**Binary** | Pointer to [***os.File**](*os.File.md) | | [optional] **Date** | Pointer to **string** | | -**DateTime** | Pointer to [**time.Time**](time.Time.md) | | [optional] -**Uuid** | Pointer to **string** | | [optional] +**DateTime** | Pointer to [**time.Time**](time.Time.md) | | [optional] +**Uuid** | Pointer to **string** | | [optional] **Password** | Pointer to **string** | | ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/HasOnlyReadOnly.md b/samples/client/petstore/go-experimental/go-petstore/docs/HasOnlyReadOnly.md index 33cc010f3a2c..78f67041d33a 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/HasOnlyReadOnly.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/HasOnlyReadOnly.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Bar** | Pointer to **string** | | [optional] -**Foo** | Pointer to **string** | | [optional] +**Bar** | Pointer to **string** | | [optional] +**Foo** | Pointer to **string** | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/List.md b/samples/client/petstore/go-experimental/go-petstore/docs/List.md index 53784dd47a95..ca8849936e72 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/List.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/List.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Var123List** | Pointer to **string** | | [optional] +**Var123List** | Pointer to **string** | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/MapTest.md b/samples/client/petstore/go-experimental/go-petstore/docs/MapTest.md index 6994b17ec5b7..6c84c2e89c2a 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/MapTest.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/MapTest.md @@ -4,10 +4,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**MapMapOfString** | Pointer to [**map[string]map[string]string**](map.md) | | [optional] -**MapOfEnumString** | Pointer to **map[string]string** | | [optional] -**DirectMap** | Pointer to **map[string]bool** | | [optional] -**IndirectMap** | Pointer to **map[string]bool** | | [optional] +**MapMapOfString** | Pointer to [**map[string]map[string]string**](map.md) | | [optional] +**MapOfEnumString** | Pointer to **map[string]string** | | [optional] +**DirectMap** | Pointer to **map[string]bool** | | [optional] +**IndirectMap** | Pointer to **map[string]bool** | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/go-experimental/go-petstore/docs/MixedPropertiesAndAdditionalPropertiesClass.md index f12ed969afdb..49f7c8eb7687 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -4,9 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Uuid** | Pointer to **string** | | [optional] -**DateTime** | Pointer to [**time.Time**](time.Time.md) | | [optional] -**Map** | Pointer to [**map[string]Animal**](Animal.md) | | [optional] +**Uuid** | Pointer to **string** | | [optional] +**DateTime** | Pointer to [**time.Time**](time.Time.md) | | [optional] +**Map** | Pointer to [**map[string]Animal**](Animal.md) | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/Model200Response.md b/samples/client/petstore/go-experimental/go-petstore/docs/Model200Response.md index b0fbf5369ef3..d0bde7b7f7b3 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/Model200Response.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/Model200Response.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | Pointer to **int32** | | [optional] -**Class** | Pointer to **string** | | [optional] +**Name** | Pointer to **int32** | | [optional] +**Class** | Pointer to **string** | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/Name.md b/samples/client/petstore/go-experimental/go-petstore/docs/Name.md index 3b1d29f51858..7cc6fd6a3a43 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/Name.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/Name.md @@ -5,9 +5,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Name** | Pointer to **int32** | | -**SnakeCase** | Pointer to **int32** | | [optional] -**Property** | Pointer to **string** | | [optional] -**Var123Number** | Pointer to **int32** | | [optional] +**SnakeCase** | Pointer to **int32** | | [optional] +**Property** | Pointer to **string** | | [optional] +**Var123Number** | Pointer to **int32** | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/NumberOnly.md b/samples/client/petstore/go-experimental/go-petstore/docs/NumberOnly.md index 3521b8b2d089..c8dcac264c2d 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/NumberOnly.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/NumberOnly.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**JustNumber** | Pointer to **float32** | | [optional] +**JustNumber** | Pointer to **float32** | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/Order.md b/samples/client/petstore/go-experimental/go-petstore/docs/Order.md index 982f9f591c97..8aa8bbd1ee54 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/Order.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/Order.md @@ -4,11 +4,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | Pointer to **int64** | | [optional] -**PetId** | Pointer to **int64** | | [optional] -**Quantity** | Pointer to **int32** | | [optional] -**ShipDate** | Pointer to [**time.Time**](time.Time.md) | | [optional] -**Status** | Pointer to **string** | Order Status | [optional] +**Id** | Pointer to **int64** | | [optional] +**PetId** | Pointer to **int64** | | [optional] +**Quantity** | Pointer to **int32** | | [optional] +**ShipDate** | Pointer to [**time.Time**](time.Time.md) | | [optional] +**Status** | Pointer to **string** | Order Status | [optional] **Complete** | Pointer to **bool** | | [optional] [default to false] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/OuterComposite.md b/samples/client/petstore/go-experimental/go-petstore/docs/OuterComposite.md index 30a345dc8d1c..f89080222827 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/OuterComposite.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/OuterComposite.md @@ -4,9 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**MyNumber** | Pointer to **float32** | | [optional] -**MyString** | Pointer to **string** | | [optional] -**MyBoolean** | Pointer to **bool** | | [optional] +**MyNumber** | Pointer to **float32** | | [optional] +**MyString** | Pointer to **string** | | [optional] +**MyBoolean** | Pointer to **bool** | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/Pet.md b/samples/client/petstore/go-experimental/go-petstore/docs/Pet.md index 81a4ec294e72..dba9589f9d77 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/Pet.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/Pet.md @@ -4,12 +4,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | Pointer to **int64** | | [optional] -**Category** | Pointer to [**Category**](Category.md) | | [optional] +**Id** | Pointer to **int64** | | [optional] +**Category** | Pointer to [**Category**](Category.md) | | [optional] **Name** | Pointer to **string** | | **PhotoUrls** | Pointer to **[]string** | | -**Tags** | Pointer to [**[]Tag**](Tag.md) | | [optional] -**Status** | Pointer to **string** | pet status in the store | [optional] +**Tags** | Pointer to [**[]Tag**](Tag.md) | | [optional] +**Status** | Pointer to **string** | pet status in the store | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/ReadOnlyFirst.md b/samples/client/petstore/go-experimental/go-petstore/docs/ReadOnlyFirst.md index e490a0fc96c0..552f0170bd85 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/ReadOnlyFirst.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/ReadOnlyFirst.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Bar** | Pointer to **string** | | [optional] -**Baz** | Pointer to **string** | | [optional] +**Bar** | Pointer to **string** | | [optional] +**Baz** | Pointer to **string** | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/Return.md b/samples/client/petstore/go-experimental/go-petstore/docs/Return.md index 5c586fcbc6c5..1facabb6bbf3 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/Return.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/Return.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Return** | Pointer to **int32** | | [optional] +**Return** | Pointer to **int32** | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/SpecialModelName.md b/samples/client/petstore/go-experimental/go-petstore/docs/SpecialModelName.md index 9e7d3f377def..34d8d8d89c72 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/SpecialModelName.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/SpecialModelName.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**SpecialPropertyName** | Pointer to **int64** | | [optional] +**SpecialPropertyName** | Pointer to **int64** | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/Tag.md b/samples/client/petstore/go-experimental/go-petstore/docs/Tag.md index 570126bd5f4b..bf868298a5e7 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/Tag.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/Tag.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | Pointer to **int64** | | [optional] -**Name** | Pointer to **string** | | [optional] +**Id** | Pointer to **int64** | | [optional] +**Name** | Pointer to **string** | | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/TypeHolderDefault.md b/samples/client/petstore/go-experimental/go-petstore/docs/TypeHolderDefault.md index 09347e617576..85097ef9fbe5 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/TypeHolderDefault.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/TypeHolderDefault.md @@ -4,10 +4,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**StringItem** | Pointer to **string** | | [default to what] +**StringItem** | Pointer to **string** | | [default to what] **NumberItem** | Pointer to **float32** | | **IntegerItem** | Pointer to **int32** | | -**BoolItem** | Pointer to **bool** | | [default to true] +**BoolItem** | Pointer to **bool** | | [default to true] **ArrayItem** | Pointer to **[]int32** | | ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/User.md b/samples/client/petstore/go-experimental/go-petstore/docs/User.md index 4f05d3b473e8..8b93a65d8ab7 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/User.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/User.md @@ -4,14 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | Pointer to **int64** | | [optional] -**Username** | Pointer to **string** | | [optional] -**FirstName** | Pointer to **string** | | [optional] -**LastName** | Pointer to **string** | | [optional] -**Email** | Pointer to **string** | | [optional] -**Password** | Pointer to **string** | | [optional] -**Phone** | Pointer to **string** | | [optional] -**UserStatus** | Pointer to **int32** | User Status | [optional] +**Id** | Pointer to **int64** | | [optional] +**Username** | Pointer to **string** | | [optional] +**FirstName** | Pointer to **string** | | [optional] +**LastName** | Pointer to **string** | | [optional] +**Email** | Pointer to **string** | | [optional] +**Password** | Pointer to **string** | | [optional] +**Phone** | Pointer to **string** | | [optional] +**UserStatus** | Pointer to **int32** | User Status | [optional] ## Methods diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/XmlItem.md b/samples/client/petstore/go-experimental/go-petstore/docs/XmlItem.md index cdee2ad0dd75..99c95015d5ff 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/XmlItem.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/XmlItem.md @@ -4,35 +4,35 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**AttributeString** | Pointer to **string** | | [optional] -**AttributeNumber** | Pointer to **float32** | | [optional] -**AttributeInteger** | Pointer to **int32** | | [optional] -**AttributeBoolean** | Pointer to **bool** | | [optional] -**WrappedArray** | Pointer to **[]int32** | | [optional] -**NameString** | Pointer to **string** | | [optional] -**NameNumber** | Pointer to **float32** | | [optional] -**NameInteger** | Pointer to **int32** | | [optional] -**NameBoolean** | Pointer to **bool** | | [optional] -**NameArray** | Pointer to **[]int32** | | [optional] -**NameWrappedArray** | Pointer to **[]int32** | | [optional] -**PrefixString** | Pointer to **string** | | [optional] -**PrefixNumber** | Pointer to **float32** | | [optional] -**PrefixInteger** | Pointer to **int32** | | [optional] -**PrefixBoolean** | Pointer to **bool** | | [optional] -**PrefixArray** | Pointer to **[]int32** | | [optional] -**PrefixWrappedArray** | Pointer to **[]int32** | | [optional] -**NamespaceString** | Pointer to **string** | | [optional] -**NamespaceNumber** | Pointer to **float32** | | [optional] -**NamespaceInteger** | Pointer to **int32** | | [optional] -**NamespaceBoolean** | Pointer to **bool** | | [optional] -**NamespaceArray** | Pointer to **[]int32** | | [optional] -**NamespaceWrappedArray** | Pointer to **[]int32** | | [optional] -**PrefixNsString** | Pointer to **string** | | [optional] -**PrefixNsNumber** | Pointer to **float32** | | [optional] -**PrefixNsInteger** | Pointer to **int32** | | [optional] -**PrefixNsBoolean** | Pointer to **bool** | | [optional] -**PrefixNsArray** | Pointer to **[]int32** | | [optional] -**PrefixNsWrappedArray** | Pointer to **[]int32** | | [optional] +**AttributeString** | Pointer to **string** | | [optional] +**AttributeNumber** | Pointer to **float32** | | [optional] +**AttributeInteger** | Pointer to **int32** | | [optional] +**AttributeBoolean** | Pointer to **bool** | | [optional] +**WrappedArray** | Pointer to **[]int32** | | [optional] +**NameString** | Pointer to **string** | | [optional] +**NameNumber** | Pointer to **float32** | | [optional] +**NameInteger** | Pointer to **int32** | | [optional] +**NameBoolean** | Pointer to **bool** | | [optional] +**NameArray** | Pointer to **[]int32** | | [optional] +**NameWrappedArray** | Pointer to **[]int32** | | [optional] +**PrefixString** | Pointer to **string** | | [optional] +**PrefixNumber** | Pointer to **float32** | | [optional] +**PrefixInteger** | Pointer to **int32** | | [optional] +**PrefixBoolean** | Pointer to **bool** | | [optional] +**PrefixArray** | Pointer to **[]int32** | | [optional] +**PrefixWrappedArray** | Pointer to **[]int32** | | [optional] +**NamespaceString** | Pointer to **string** | | [optional] +**NamespaceNumber** | Pointer to **float32** | | [optional] +**NamespaceInteger** | Pointer to **int32** | | [optional] +**NamespaceBoolean** | Pointer to **bool** | | [optional] +**NamespaceArray** | Pointer to **[]int32** | | [optional] +**NamespaceWrappedArray** | Pointer to **[]int32** | | [optional] +**PrefixNsString** | Pointer to **string** | | [optional] +**PrefixNsNumber** | Pointer to **float32** | | [optional] +**PrefixNsInteger** | Pointer to **int32** | | [optional] +**PrefixNsBoolean** | Pointer to **bool** | | [optional] +**PrefixNsArray** | Pointer to **[]int32** | | [optional] +**PrefixNsWrappedArray** | Pointer to **[]int32** | | [optional] ## Methods diff --git a/samples/client/petstore/groovy/README.md b/samples/client/petstore/groovy/README.md index 10ee35ffb9d9..65edae7929ba 100644 --- a/samples/client/petstore/groovy/README.md +++ b/samples/client/petstore/groovy/README.md @@ -32,9 +32,9 @@ Then, run: ```groovy def apiInstance = new PetApi() -def body = new Pet() // Pet | Pet object that needs to be added to the store +def pet = new Pet() // Pet | Pet object that needs to be added to the store -apiInstance.addPet(body) +apiInstance.addPet(pet) { // on success println it diff --git a/samples/client/petstore/groovy/bin/main/org/openapitools/api/ApiUtils.groovy b/samples/client/petstore/groovy/bin/main/org/openapitools/api/ApiUtils.groovy new file mode 100644 index 000000000000..c1fe94b1027c --- /dev/null +++ b/samples/client/petstore/groovy/bin/main/org/openapitools/api/ApiUtils.groovy @@ -0,0 +1,54 @@ +package org.openapitools.api + +import static groovyx.net.http.HttpBuilder.configure +import static java.net.URI.create + +class ApiUtils { + + void invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType, method, container, type) { + def (url, uriPath) = buildUrlAndUriPath(basePath, versionPath, resourcePath) + println "url=$url uriPath=$uriPath" + def http = configure { + request.uri = url + request.uri.path = uriPath + } + .invokeMethod(String.valueOf(method).toLowerCase()) { + request.uri.query = queryParams + request.headers = headerParams + if (bodyParams != null) { + request.body = bodyParams + } + request.contentType = contentType + + response.success { resp, json -> + if (type != null) { + onSuccess(parse(json, container, type)) + } + } + response.failure { resp -> + onFailure(resp.statusCode, resp.message) + } + } + + } + + private static def buildUrlAndUriPath(basePath, versionPath, resourcePath) { + // HTTPBuilder expects to get as its constructor parameter an URL, + // without any other additions like path, therefore we need to cut the path + // from the basePath as it is represented by swagger APIs + // we use java.net.URI to manipulate the basePath + // then the uriPath will hold the rest of the path + URI baseUri = create(basePath) + def pathOnly = baseUri.getPath() + [basePath-pathOnly, pathOnly+versionPath+resourcePath] + } + + private def parse(object, container, clazz) { + if (container == "array") { + return object.collect {parse(it, "", clazz)} + } else { + return clazz.newInstance(object) + } + } + +} diff --git a/samples/client/petstore/groovy/bin/main/org/openapitools/api/PetApi.groovy b/samples/client/petstore/groovy/bin/main/org/openapitools/api/PetApi.groovy new file mode 100644 index 000000000000..cd34f2c71f67 --- /dev/null +++ b/samples/client/petstore/groovy/bin/main/org/openapitools/api/PetApi.groovy @@ -0,0 +1,228 @@ +package org.openapitools.api; + +import org.openapitools.api.ApiUtils +import org.openapitools.model.ModelApiResponse +import org.openapitools.model.Pet + +class PetApi { + String basePath = "http://petstore.swagger.io/v2" + String versionPath = "" + ApiUtils apiUtils = new ApiUtils(); + + def addPet ( Pet pet, Closure onSuccess, Closure onFailure) { + String resourcePath = "/pet" + + // params + def queryParams = [:] + def headerParams = [:] + def bodyParams + def contentType + + // verify required params are set + if (pet == null) { + throw new RuntimeException("missing required params pet") + } + + + + contentType = 'application/json'; + bodyParams = pet + + + apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType, + "POST", "", + null ) + + } + + def deletePet ( Long petId, String apiKey, Closure onSuccess, Closure onFailure) { + String resourcePath = "/pet/${petId}" + + // params + def queryParams = [:] + def headerParams = [:] + def bodyParams + def contentType + + // verify required params are set + if (petId == null) { + throw new RuntimeException("missing required params petId") + } + + + if (apiKey != null) { + headerParams.put("api_key", apiKey) + } + + + + apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType, + "DELETE", "", + null ) + + } + + def findPetsByStatus ( List status, Closure onSuccess, Closure onFailure) { + String resourcePath = "/pet/findByStatus" + + // params + def queryParams = [:] + def headerParams = [:] + def bodyParams + def contentType + + // verify required params are set + if (status == null) { + throw new RuntimeException("missing required params status") + } + + if (status != null) { + queryParams.put("status", status) + } + + + + + apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType, + "GET", "array", + Pet.class ) + + } + + def findPetsByTags ( List tags, Integer maxCount, Closure onSuccess, Closure onFailure) { + String resourcePath = "/pet/findByTags" + + // params + def queryParams = [:] + def headerParams = [:] + def bodyParams + def contentType + + // verify required params are set + if (tags == null) { + throw new RuntimeException("missing required params tags") + } + + if (tags != null) { + queryParams.put("tags", tags) + } + if (maxCount != null) { + queryParams.put("maxCount", maxCount) + } + + + + + apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType, + "GET", "array", + Pet.class ) + + } + + def getPetById ( Long petId, Closure onSuccess, Closure onFailure) { + String resourcePath = "/pet/${petId}" + + // params + def queryParams = [:] + def headerParams = [:] + def bodyParams + def contentType + + // verify required params are set + if (petId == null) { + throw new RuntimeException("missing required params petId") + } + + + + + + apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType, + "GET", "", + Pet.class ) + + } + + def updatePet ( Pet pet, Closure onSuccess, Closure onFailure) { + String resourcePath = "/pet" + + // params + def queryParams = [:] + def headerParams = [:] + def bodyParams + def contentType + + // verify required params are set + if (pet == null) { + throw new RuntimeException("missing required params pet") + } + + + + contentType = 'application/json'; + bodyParams = pet + + + apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType, + "PUT", "", + null ) + + } + + def updatePetWithForm ( Long petId, String name, String status, Closure onSuccess, Closure onFailure) { + String resourcePath = "/pet/${petId}" + + // params + def queryParams = [:] + def headerParams = [:] + def bodyParams + def contentType + + // verify required params are set + if (petId == null) { + throw new RuntimeException("missing required params petId") + } + + + + + contentType = 'application/x-www-form-urlencoded'; + bodyParams = [:] + bodyParams.put("name", name) + bodyParams.put("status", status) + + apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType, + "POST", "", + null ) + + } + + def uploadFile ( Long petId, String additionalMetadata, File file, Closure onSuccess, Closure onFailure) { + String resourcePath = "/pet/${petId}/uploadImage" + + // params + def queryParams = [:] + def headerParams = [:] + def bodyParams + def contentType + + // verify required params are set + if (petId == null) { + throw new RuntimeException("missing required params petId") + } + + + + + contentType = 'multipart/form-data'; + bodyParams = [:] + bodyParams.put("additionalMetadata", additionalMetadata) + bodyParams.put("file", file) + + apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType, + "POST", "", + ModelApiResponse.class ) + + } + +} diff --git a/samples/client/petstore/groovy/bin/main/org/openapitools/api/StoreApi.groovy b/samples/client/petstore/groovy/bin/main/org/openapitools/api/StoreApi.groovy new file mode 100644 index 000000000000..319a6ddcaf88 --- /dev/null +++ b/samples/client/petstore/groovy/bin/main/org/openapitools/api/StoreApi.groovy @@ -0,0 +1,105 @@ +package org.openapitools.api; + +import org.openapitools.api.ApiUtils +import org.openapitools.model.Order + +class StoreApi { + String basePath = "http://petstore.swagger.io/v2" + String versionPath = "" + ApiUtils apiUtils = new ApiUtils(); + + def deleteOrder ( String orderId, Closure onSuccess, Closure onFailure) { + String resourcePath = "/store/order/${orderId}" + + // params + def queryParams = [:] + def headerParams = [:] + def bodyParams + def contentType + + // verify required params are set + if (orderId == null) { + throw new RuntimeException("missing required params orderId") + } + + + + + + apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType, + "DELETE", "", + null ) + + } + + def getInventory ( Closure onSuccess, Closure onFailure) { + String resourcePath = "/store/inventory" + + // params + def queryParams = [:] + def headerParams = [:] + def bodyParams + def contentType + + + + + + + apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType, + "GET", "map", + Integer.class ) + + } + + def getOrderById ( Long orderId, Closure onSuccess, Closure onFailure) { + String resourcePath = "/store/order/${orderId}" + + // params + def queryParams = [:] + def headerParams = [:] + def bodyParams + def contentType + + // verify required params are set + if (orderId == null) { + throw new RuntimeException("missing required params orderId") + } + + + + + + apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType, + "GET", "", + Order.class ) + + } + + def placeOrder ( Order order, Closure onSuccess, Closure onFailure) { + String resourcePath = "/store/order" + + // params + def queryParams = [:] + def headerParams = [:] + def bodyParams + def contentType + + // verify required params are set + if (order == null) { + throw new RuntimeException("missing required params order") + } + + + + contentType = 'application/json'; + bodyParams = order + + + apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType, + "POST", "", + Order.class ) + + } + +} diff --git a/samples/client/petstore/groovy/bin/main/org/openapitools/api/UserApi.groovy b/samples/client/petstore/groovy/bin/main/org/openapitools/api/UserApi.groovy new file mode 100644 index 000000000000..82be73e27bcb --- /dev/null +++ b/samples/client/petstore/groovy/bin/main/org/openapitools/api/UserApi.groovy @@ -0,0 +1,222 @@ +package org.openapitools.api; + +import org.openapitools.api.ApiUtils +import java.util.List +import org.openapitools.model.User + +class UserApi { + String basePath = "http://petstore.swagger.io/v2" + String versionPath = "" + ApiUtils apiUtils = new ApiUtils(); + + def createUser ( User user, Closure onSuccess, Closure onFailure) { + String resourcePath = "/user" + + // params + def queryParams = [:] + def headerParams = [:] + def bodyParams + def contentType + + // verify required params are set + if (user == null) { + throw new RuntimeException("missing required params user") + } + + + + contentType = 'application/json'; + bodyParams = user + + + apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType, + "POST", "", + null ) + + } + + def createUsersWithArrayInput ( List user, Closure onSuccess, Closure onFailure) { + String resourcePath = "/user/createWithArray" + + // params + def queryParams = [:] + def headerParams = [:] + def bodyParams + def contentType + + // verify required params are set + if (user == null) { + throw new RuntimeException("missing required params user") + } + + + + contentType = 'application/json'; + bodyParams = user + + + apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType, + "POST", "", + null ) + + } + + def createUsersWithListInput ( List user, Closure onSuccess, Closure onFailure) { + String resourcePath = "/user/createWithList" + + // params + def queryParams = [:] + def headerParams = [:] + def bodyParams + def contentType + + // verify required params are set + if (user == null) { + throw new RuntimeException("missing required params user") + } + + + + contentType = 'application/json'; + bodyParams = user + + + apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType, + "POST", "", + null ) + + } + + def deleteUser ( String username, Closure onSuccess, Closure onFailure) { + String resourcePath = "/user/${username}" + + // params + def queryParams = [:] + def headerParams = [:] + def bodyParams + def contentType + + // verify required params are set + if (username == null) { + throw new RuntimeException("missing required params username") + } + + + + + + apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType, + "DELETE", "", + null ) + + } + + def getUserByName ( String username, Closure onSuccess, Closure onFailure) { + String resourcePath = "/user/${username}" + + // params + def queryParams = [:] + def headerParams = [:] + def bodyParams + def contentType + + // verify required params are set + if (username == null) { + throw new RuntimeException("missing required params username") + } + + + + + + apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType, + "GET", "", + User.class ) + + } + + def loginUser ( String username, String password, Closure onSuccess, Closure onFailure) { + String resourcePath = "/user/login" + + // params + def queryParams = [:] + def headerParams = [:] + def bodyParams + def contentType + + // verify required params are set + if (username == null) { + throw new RuntimeException("missing required params username") + } + // verify required params are set + if (password == null) { + throw new RuntimeException("missing required params password") + } + + if (username != null) { + queryParams.put("username", username) + } + if (password != null) { + queryParams.put("password", password) + } + + + + + apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType, + "GET", "", + String.class ) + + } + + def logoutUser ( Closure onSuccess, Closure onFailure) { + String resourcePath = "/user/logout" + + // params + def queryParams = [:] + def headerParams = [:] + def bodyParams + def contentType + + + + + + + apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType, + "GET", "", + null ) + + } + + def updateUser ( String username, User user, Closure onSuccess, Closure onFailure) { + String resourcePath = "/user/${username}" + + // params + def queryParams = [:] + def headerParams = [:] + def bodyParams + def contentType + + // verify required params are set + if (username == null) { + throw new RuntimeException("missing required params username") + } + // verify required params are set + if (user == null) { + throw new RuntimeException("missing required params user") + } + + + + contentType = 'application/json'; + bodyParams = user + + + apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType, + "PUT", "", + null ) + + } + +} diff --git a/samples/client/petstore/groovy/bin/main/org/openapitools/model/Category.groovy b/samples/client/petstore/groovy/bin/main/org/openapitools/model/Category.groovy new file mode 100644 index 000000000000..d8ccf48a82aa --- /dev/null +++ b/samples/client/petstore/groovy/bin/main/org/openapitools/model/Category.groovy @@ -0,0 +1,13 @@ +package org.openapitools.model; + +import groovy.transform.Canonical +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +@Canonical +class Category { + + Long id + + String name +} diff --git a/samples/client/petstore/groovy/bin/main/org/openapitools/model/InlineObject.groovy b/samples/client/petstore/groovy/bin/main/org/openapitools/model/InlineObject.groovy new file mode 100644 index 000000000000..820695239c39 --- /dev/null +++ b/samples/client/petstore/groovy/bin/main/org/openapitools/model/InlineObject.groovy @@ -0,0 +1,13 @@ +package org.openapitools.model; + +import groovy.transform.Canonical +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +@Canonical +class InlineObject { + /* Updated name of the pet */ + String name + /* Updated status of the pet */ + String status +} diff --git a/samples/client/petstore/groovy/bin/main/org/openapitools/model/InlineObject1.groovy b/samples/client/petstore/groovy/bin/main/org/openapitools/model/InlineObject1.groovy new file mode 100644 index 000000000000..e60a96d81d33 --- /dev/null +++ b/samples/client/petstore/groovy/bin/main/org/openapitools/model/InlineObject1.groovy @@ -0,0 +1,13 @@ +package org.openapitools.model; + +import groovy.transform.Canonical +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +@Canonical +class InlineObject1 { + /* Additional data to pass to server */ + String additionalMetadata + /* file to upload */ + File file +} diff --git a/samples/client/petstore/groovy/bin/main/org/openapitools/model/ModelApiResponse.groovy b/samples/client/petstore/groovy/bin/main/org/openapitools/model/ModelApiResponse.groovy new file mode 100644 index 000000000000..468841ffff37 --- /dev/null +++ b/samples/client/petstore/groovy/bin/main/org/openapitools/model/ModelApiResponse.groovy @@ -0,0 +1,15 @@ +package org.openapitools.model; + +import groovy.transform.Canonical +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +@Canonical +class ModelApiResponse { + + Integer code + + String type + + String message +} diff --git a/samples/client/petstore/groovy/bin/main/org/openapitools/model/Order.groovy b/samples/client/petstore/groovy/bin/main/org/openapitools/model/Order.groovy new file mode 100644 index 000000000000..d9e02f8a6cc8 --- /dev/null +++ b/samples/client/petstore/groovy/bin/main/org/openapitools/model/Order.groovy @@ -0,0 +1,21 @@ +package org.openapitools.model; + +import groovy.transform.Canonical +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +@Canonical +class Order { + + Long id + + Long petId + + Integer quantity + + Date shipDate + /* Order Status */ + String status + + Boolean complete = false +} diff --git a/samples/client/petstore/groovy/bin/main/org/openapitools/model/Pet.groovy b/samples/client/petstore/groovy/bin/main/org/openapitools/model/Pet.groovy new file mode 100644 index 000000000000..ab4b87def725 --- /dev/null +++ b/samples/client/petstore/groovy/bin/main/org/openapitools/model/Pet.groovy @@ -0,0 +1,25 @@ +package org.openapitools.model; + +import groovy.transform.Canonical +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.model.Category; +import org.openapitools.model.Tag; + +@Canonical +class Pet { + + Long id + + Category category = null + + String name + + List photoUrls = new ArrayList() + + List tags = new ArrayList() + /* pet status in the store */ + String status +} diff --git a/samples/client/petstore/groovy/bin/main/org/openapitools/model/Tag.groovy b/samples/client/petstore/groovy/bin/main/org/openapitools/model/Tag.groovy new file mode 100644 index 000000000000..a704bc5ffef0 --- /dev/null +++ b/samples/client/petstore/groovy/bin/main/org/openapitools/model/Tag.groovy @@ -0,0 +1,13 @@ +package org.openapitools.model; + +import groovy.transform.Canonical +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +@Canonical +class Tag { + + Long id + + String name +} diff --git a/samples/client/petstore/groovy/bin/main/org/openapitools/model/User.groovy b/samples/client/petstore/groovy/bin/main/org/openapitools/model/User.groovy new file mode 100644 index 000000000000..a6f850e87543 --- /dev/null +++ b/samples/client/petstore/groovy/bin/main/org/openapitools/model/User.groovy @@ -0,0 +1,25 @@ +package org.openapitools.model; + +import groovy.transform.Canonical +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +@Canonical +class User { + + Long id + + String username + + String firstName + + String lastName + + String email + + String password + + String phone + /* User Status */ + Integer userStatus +} diff --git a/samples/client/petstore/groovy/src/main/groovy/org/openapitools/api/PetApi.groovy b/samples/client/petstore/groovy/src/main/groovy/org/openapitools/api/PetApi.groovy index 60f3f7d45da1..cd34f2c71f67 100644 --- a/samples/client/petstore/groovy/src/main/groovy/org/openapitools/api/PetApi.groovy +++ b/samples/client/petstore/groovy/src/main/groovy/org/openapitools/api/PetApi.groovy @@ -9,7 +9,7 @@ class PetApi { String versionPath = "" ApiUtils apiUtils = new ApiUtils(); - def addPet ( Pet body, Closure onSuccess, Closure onFailure) { + def addPet ( Pet pet, Closure onSuccess, Closure onFailure) { String resourcePath = "/pet" // params @@ -19,14 +19,14 @@ class PetApi { def contentType // verify required params are set - if (body == null) { - throw new RuntimeException("missing required params body") + if (pet == null) { + throw new RuntimeException("missing required params pet") } contentType = 'application/json'; - bodyParams = body + bodyParams = pet apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType, @@ -89,7 +89,7 @@ class PetApi { } - def findPetsByTags ( List tags, Closure onSuccess, Closure onFailure) { + def findPetsByTags ( List tags, Integer maxCount, Closure onSuccess, Closure onFailure) { String resourcePath = "/pet/findByTags" // params @@ -106,6 +106,9 @@ class PetApi { if (tags != null) { queryParams.put("tags", tags) } + if (maxCount != null) { + queryParams.put("maxCount", maxCount) + } @@ -140,7 +143,7 @@ class PetApi { } - def updatePet ( Pet body, Closure onSuccess, Closure onFailure) { + def updatePet ( Pet pet, Closure onSuccess, Closure onFailure) { String resourcePath = "/pet" // params @@ -150,14 +153,14 @@ class PetApi { def contentType // verify required params are set - if (body == null) { - throw new RuntimeException("missing required params body") + if (pet == null) { + throw new RuntimeException("missing required params pet") } contentType = 'application/json'; - bodyParams = body + bodyParams = pet apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType, diff --git a/samples/client/petstore/groovy/src/main/groovy/org/openapitools/api/StoreApi.groovy b/samples/client/petstore/groovy/src/main/groovy/org/openapitools/api/StoreApi.groovy index 8e7a0ee9d279..319a6ddcaf88 100644 --- a/samples/client/petstore/groovy/src/main/groovy/org/openapitools/api/StoreApi.groovy +++ b/samples/client/petstore/groovy/src/main/groovy/org/openapitools/api/StoreApi.groovy @@ -76,7 +76,7 @@ class StoreApi { } - def placeOrder ( Order body, Closure onSuccess, Closure onFailure) { + def placeOrder ( Order order, Closure onSuccess, Closure onFailure) { String resourcePath = "/store/order" // params @@ -86,14 +86,14 @@ class StoreApi { def contentType // verify required params are set - if (body == null) { - throw new RuntimeException("missing required params body") + if (order == null) { + throw new RuntimeException("missing required params order") } contentType = 'application/json'; - bodyParams = body + bodyParams = order apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType, diff --git a/samples/client/petstore/groovy/src/main/groovy/org/openapitools/api/UserApi.groovy b/samples/client/petstore/groovy/src/main/groovy/org/openapitools/api/UserApi.groovy index 8cc839868089..82be73e27bcb 100644 --- a/samples/client/petstore/groovy/src/main/groovy/org/openapitools/api/UserApi.groovy +++ b/samples/client/petstore/groovy/src/main/groovy/org/openapitools/api/UserApi.groovy @@ -9,7 +9,7 @@ class UserApi { String versionPath = "" ApiUtils apiUtils = new ApiUtils(); - def createUser ( User body, Closure onSuccess, Closure onFailure) { + def createUser ( User user, Closure onSuccess, Closure onFailure) { String resourcePath = "/user" // params @@ -19,14 +19,14 @@ class UserApi { def contentType // verify required params are set - if (body == null) { - throw new RuntimeException("missing required params body") + if (user == null) { + throw new RuntimeException("missing required params user") } contentType = 'application/json'; - bodyParams = body + bodyParams = user apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType, @@ -35,7 +35,7 @@ class UserApi { } - def createUsersWithArrayInput ( List body, Closure onSuccess, Closure onFailure) { + def createUsersWithArrayInput ( List user, Closure onSuccess, Closure onFailure) { String resourcePath = "/user/createWithArray" // params @@ -45,14 +45,14 @@ class UserApi { def contentType // verify required params are set - if (body == null) { - throw new RuntimeException("missing required params body") + if (user == null) { + throw new RuntimeException("missing required params user") } contentType = 'application/json'; - bodyParams = body + bodyParams = user apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType, @@ -61,7 +61,7 @@ class UserApi { } - def createUsersWithListInput ( List body, Closure onSuccess, Closure onFailure) { + def createUsersWithListInput ( List user, Closure onSuccess, Closure onFailure) { String resourcePath = "/user/createWithList" // params @@ -71,14 +71,14 @@ class UserApi { def contentType // verify required params are set - if (body == null) { - throw new RuntimeException("missing required params body") + if (user == null) { + throw new RuntimeException("missing required params user") } contentType = 'application/json'; - bodyParams = body + bodyParams = user apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType, @@ -189,7 +189,7 @@ class UserApi { } - def updateUser ( String username, User body, Closure onSuccess, Closure onFailure) { + def updateUser ( String username, User user, Closure onSuccess, Closure onFailure) { String resourcePath = "/user/${username}" // params @@ -203,14 +203,14 @@ class UserApi { throw new RuntimeException("missing required params username") } // verify required params are set - if (body == null) { - throw new RuntimeException("missing required params body") + if (user == null) { + throw new RuntimeException("missing required params user") } contentType = 'application/json'; - bodyParams = body + bodyParams = user apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType, diff --git a/samples/client/petstore/groovy/src/main/groovy/org/openapitools/model/InlineObject.groovy b/samples/client/petstore/groovy/src/main/groovy/org/openapitools/model/InlineObject.groovy new file mode 100644 index 000000000000..820695239c39 --- /dev/null +++ b/samples/client/petstore/groovy/src/main/groovy/org/openapitools/model/InlineObject.groovy @@ -0,0 +1,13 @@ +package org.openapitools.model; + +import groovy.transform.Canonical +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +@Canonical +class InlineObject { + /* Updated name of the pet */ + String name + /* Updated status of the pet */ + String status +} diff --git a/samples/client/petstore/groovy/src/main/groovy/org/openapitools/model/InlineObject1.groovy b/samples/client/petstore/groovy/src/main/groovy/org/openapitools/model/InlineObject1.groovy new file mode 100644 index 000000000000..e60a96d81d33 --- /dev/null +++ b/samples/client/petstore/groovy/src/main/groovy/org/openapitools/model/InlineObject1.groovy @@ -0,0 +1,13 @@ +package org.openapitools.model; + +import groovy.transform.Canonical +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +@Canonical +class InlineObject1 { + /* Additional data to pass to server */ + String additionalMetadata + /* file to upload */ + File file +} diff --git a/samples/client/petstore/haskell-http-client/README.md b/samples/client/petstore/haskell-http-client/README.md index 49b68e11b7ec..5429f1069013 100644 --- a/samples/client/petstore/haskell-http-client/README.md +++ b/samples/client/petstore/haskell-http-client/README.md @@ -2,7 +2,7 @@ The library in `lib` provides auto-generated-from-OpenAPI [http-client](https://www.stackage.org/lts-10.0/package/http-client-0.5.7.1) bindings to the OpenAPI Petstore API. -OpenApi Version: 3.0.1 +OpenApi Version: 3.0.0 ## Installation diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore.hs index 83e607b1ad72..4e71ab9e7206 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore.hs @@ -3,7 +3,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI Version: 3.0.1 + OpenAPI Version: 3.0.0 OpenAPI Petstore API version: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) -} diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API.hs index 7335a85067e3..cfed6b6edcae 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API.hs @@ -3,7 +3,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI Version: 3.0.1 + OpenAPI Version: 3.0.0 OpenAPI Petstore API version: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) -} @@ -14,6 +14,7 @@ Module : OpenAPIPetstore.API module OpenAPIPetstore.API ( module OpenAPIPetstore.API.AnotherFake + , module OpenAPIPetstore.API.ApiDefault , module OpenAPIPetstore.API.Fake , module OpenAPIPetstore.API.FakeClassnameTags123 , module OpenAPIPetstore.API.Pet @@ -22,6 +23,7 @@ module OpenAPIPetstore.API ) where import OpenAPIPetstore.API.AnotherFake +import OpenAPIPetstore.API.ApiDefault import OpenAPIPetstore.API.Fake import OpenAPIPetstore.API.FakeClassnameTags123 import OpenAPIPetstore.API.Pet diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/AnotherFake.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/AnotherFake.hs index 6a08903b8980..8ecaa5703a19 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/AnotherFake.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/AnotherFake.hs @@ -3,7 +3,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI Version: 3.0.1 + OpenAPI Version: 3.0.0 OpenAPI Petstore API version: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) -} @@ -67,15 +67,15 @@ import qualified Prelude as P -- op123testSpecialTags :: (Consumes Op123testSpecialTags MimeJSON, MimeRender MimeJSON Client) - => Client -- ^ "body" - client model + => Client -- ^ "client" - client model -> OpenAPIPetstoreRequest Op123testSpecialTags MimeJSON Client MimeJSON -op123testSpecialTags body = +op123testSpecialTags client = _mkRequest "PATCH" ["/another-fake/dummy"] - `setBodyParam` body + `setBodyParam` client data Op123testSpecialTags --- | /Body Param/ "body" - client model +-- | /Body Param/ "Client" - client model instance HasBodyParam Op123testSpecialTags Client -- | @application/json@ diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/ApiDefault.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/ApiDefault.hs new file mode 100644 index 000000000000..e61d5e50d857 --- /dev/null +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/ApiDefault.hs @@ -0,0 +1,72 @@ +{- + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + OpenAPI Version: 3.0.0 + OpenAPI Petstore API version: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) +-} + +{-| +Module : OpenAPIPetstore.API.ApiDefault +-} + +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE MonoLocalBinds #-} +{-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE OverloadedStrings #-} +{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds -fno-warn-unused-imports #-} + +module OpenAPIPetstore.API.ApiDefault where + +import OpenAPIPetstore.Core +import OpenAPIPetstore.MimeTypes +import OpenAPIPetstore.Model as M + +import qualified Data.Aeson as A +import qualified Data.ByteString as B +import qualified Data.ByteString.Lazy as BL +import qualified Data.Data as P (Typeable, TypeRep, typeOf, typeRep) +import qualified Data.Foldable as P +import qualified Data.Map as Map +import qualified Data.Maybe as P +import qualified Data.Proxy as P (Proxy(..)) +import qualified Data.Set as Set +import qualified Data.String as P +import qualified Data.Text as T +import qualified Data.Text.Encoding as T +import qualified Data.Text.Lazy as TL +import qualified Data.Text.Lazy.Encoding as TL +import qualified Data.Time as TI +import qualified Network.HTTP.Client.MultipartFormData as NH +import qualified Network.HTTP.Media as ME +import qualified Network.HTTP.Types as NH +import qualified Web.FormUrlEncoded as WH +import qualified Web.HttpApiData as WH + +import Data.Text (Text) +import GHC.Base ((<|>)) + +import Prelude ((==),(/=),($), (.),(<$>),(<*>),(>>=),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty,maybe,pure,Monad,Applicative,Functor) +import qualified Prelude as P + +-- * Operations + + +-- ** Default + +-- *** fooGet + +-- | @GET \/foo@ +-- +fooGet + :: OpenAPIPetstoreRequest FooGet MimeNoContent InlineResponseDefault MimeJSON +fooGet = + _mkRequest "GET" ["/foo"] + +data FooGet +-- | @application/json@ +instance Produces FooGet MimeJSON + diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/Fake.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/Fake.hs index 9e8a52b25223..46407a2e8a1d 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/Fake.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/Fake.hs @@ -3,7 +3,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI Version: 3.0.1 + OpenAPI Version: 3.0.0 OpenAPI Petstore API version: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) -} @@ -57,42 +57,20 @@ import qualified Prelude as P -- ** Fake --- *** createXmlItem +-- *** fakeHealthGet --- | @POST \/fake\/create_xml_item@ +-- | @GET \/fake\/health@ -- --- creates an XmlItem +-- Health check endpoint -- --- this route creates an XmlItem --- -createXmlItem - :: (Consumes CreateXmlItem contentType, MimeRender contentType XmlItem) - => ContentType contentType -- ^ request content-type ('MimeType') - -> XmlItem -- ^ "xmlItem" - XmlItem Body - -> OpenAPIPetstoreRequest CreateXmlItem contentType NoContent MimeNoContent -createXmlItem _ xmlItem = - _mkRequest "POST" ["/fake/create_xml_item"] - `setBodyParam` xmlItem - -data CreateXmlItem - --- | /Body Param/ "XmlItem" - XmlItem Body -instance HasBodyParam CreateXmlItem XmlItem - --- | @application/xml@ -instance Consumes CreateXmlItem MimeXML --- | @text/xml@ -instance Consumes CreateXmlItem MimeTextXml --- | @text/xml; charset=utf-8@ -instance Consumes CreateXmlItem MimeTextXmlCharsetutf8 --- | @text/xml; charset=utf-16@ -instance Consumes CreateXmlItem MimeTextXmlCharsetutf16 --- | @application/xml; charset=utf-8@ -instance Consumes CreateXmlItem MimeXmlCharsetutf8 --- | @application/xml; charset=utf-16@ -instance Consumes CreateXmlItem MimeXmlCharsetutf16 - -instance Produces CreateXmlItem MimeNoContent +fakeHealthGet + :: OpenAPIPetstoreRequest FakeHealthGet MimeNoContent HealthCheckResult MimeJSON +fakeHealthGet = + _mkRequest "GET" ["/fake/health"] + +data FakeHealthGet +-- | @application/json@ +instance Produces FakeHealthGet MimeJSON -- *** fakeOuterBooleanSerialize @@ -102,20 +80,19 @@ instance Produces CreateXmlItem MimeNoContent -- Test serialization of outer boolean types -- fakeOuterBooleanSerialize - :: (Consumes FakeOuterBooleanSerialize contentType) - => ContentType contentType -- ^ request content-type ('MimeType') - -> Accept accept -- ^ request accept ('MimeType') - -> OpenAPIPetstoreRequest FakeOuterBooleanSerialize contentType Bool accept -fakeOuterBooleanSerialize _ _ = + :: (Consumes FakeOuterBooleanSerialize MimeJSON) + => Accept accept -- ^ request accept ('MimeType') + -> OpenAPIPetstoreRequest FakeOuterBooleanSerialize MimeJSON Bool accept +fakeOuterBooleanSerialize _ = _mkRequest "POST" ["/fake/outer/boolean"] data FakeOuterBooleanSerialize -- | /Body Param/ "body" - Input boolean as post body instance HasBodyParam FakeOuterBooleanSerialize BodyBool - --- | @*/*@ -instance MimeType mtype => Consumes FakeOuterBooleanSerialize mtype + +-- | @application/json@ +instance Consumes FakeOuterBooleanSerialize MimeJSON -- | @*/*@ instance MimeType mtype => Produces FakeOuterBooleanSerialize mtype @@ -128,20 +105,19 @@ instance MimeType mtype => Produces FakeOuterBooleanSerialize mtype -- Test serialization of object with outer number type -- fakeOuterCompositeSerialize - :: (Consumes FakeOuterCompositeSerialize contentType) - => ContentType contentType -- ^ request content-type ('MimeType') - -> Accept accept -- ^ request accept ('MimeType') - -> OpenAPIPetstoreRequest FakeOuterCompositeSerialize contentType OuterComposite accept -fakeOuterCompositeSerialize _ _ = + :: (Consumes FakeOuterCompositeSerialize MimeJSON) + => Accept accept -- ^ request accept ('MimeType') + -> OpenAPIPetstoreRequest FakeOuterCompositeSerialize MimeJSON OuterComposite accept +fakeOuterCompositeSerialize _ = _mkRequest "POST" ["/fake/outer/composite"] data FakeOuterCompositeSerialize --- | /Body Param/ "body" - Input composite as post body +-- | /Body Param/ "OuterComposite" - Input composite as post body instance HasBodyParam FakeOuterCompositeSerialize OuterComposite - --- | @*/*@ -instance MimeType mtype => Consumes FakeOuterCompositeSerialize mtype + +-- | @application/json@ +instance Consumes FakeOuterCompositeSerialize MimeJSON -- | @*/*@ instance MimeType mtype => Produces FakeOuterCompositeSerialize mtype @@ -154,20 +130,19 @@ instance MimeType mtype => Produces FakeOuterCompositeSerialize mtype -- Test serialization of outer number types -- fakeOuterNumberSerialize - :: (Consumes FakeOuterNumberSerialize contentType) - => ContentType contentType -- ^ request content-type ('MimeType') - -> Accept accept -- ^ request accept ('MimeType') - -> OpenAPIPetstoreRequest FakeOuterNumberSerialize contentType Double accept -fakeOuterNumberSerialize _ _ = + :: (Consumes FakeOuterNumberSerialize MimeJSON) + => Accept accept -- ^ request accept ('MimeType') + -> OpenAPIPetstoreRequest FakeOuterNumberSerialize MimeJSON Double accept +fakeOuterNumberSerialize _ = _mkRequest "POST" ["/fake/outer/number"] data FakeOuterNumberSerialize -- | /Body Param/ "body" - Input number as post body -instance HasBodyParam FakeOuterNumberSerialize BodyDouble - --- | @*/*@ -instance MimeType mtype => Consumes FakeOuterNumberSerialize mtype +instance HasBodyParam FakeOuterNumberSerialize Body + +-- | @application/json@ +instance Consumes FakeOuterNumberSerialize MimeJSON -- | @*/*@ instance MimeType mtype => Produces FakeOuterNumberSerialize mtype @@ -180,20 +155,19 @@ instance MimeType mtype => Produces FakeOuterNumberSerialize mtype -- Test serialization of outer string types -- fakeOuterStringSerialize - :: (Consumes FakeOuterStringSerialize contentType) - => ContentType contentType -- ^ request content-type ('MimeType') - -> Accept accept -- ^ request accept ('MimeType') - -> OpenAPIPetstoreRequest FakeOuterStringSerialize contentType Text accept -fakeOuterStringSerialize _ _ = + :: (Consumes FakeOuterStringSerialize MimeJSON) + => Accept accept -- ^ request accept ('MimeType') + -> OpenAPIPetstoreRequest FakeOuterStringSerialize MimeJSON Text accept +fakeOuterStringSerialize _ = _mkRequest "POST" ["/fake/outer/string"] data FakeOuterStringSerialize -- | /Body Param/ "body" - Input string as post body instance HasBodyParam FakeOuterStringSerialize BodyText - --- | @*/*@ -instance MimeType mtype => Consumes FakeOuterStringSerialize mtype + +-- | @application/json@ +instance Consumes FakeOuterStringSerialize MimeJSON -- | @*/*@ instance MimeType mtype => Produces FakeOuterStringSerialize mtype @@ -207,11 +181,11 @@ instance MimeType mtype => Produces FakeOuterStringSerialize mtype -- testBodyWithFileSchema :: (Consumes TestBodyWithFileSchema MimeJSON, MimeRender MimeJSON FileSchemaTestClass) - => FileSchemaTestClass -- ^ "body" + => FileSchemaTestClass -- ^ "fileSchemaTestClass" -> OpenAPIPetstoreRequest TestBodyWithFileSchema MimeJSON NoContent MimeNoContent -testBodyWithFileSchema body = +testBodyWithFileSchema fileSchemaTestClass = _mkRequest "PUT" ["/fake/body-with-file-schema"] - `setBodyParam` body + `setBodyParam` fileSchemaTestClass data TestBodyWithFileSchema instance HasBodyParam TestBodyWithFileSchema FileSchemaTestClass @@ -228,12 +202,12 @@ instance Produces TestBodyWithFileSchema MimeNoContent -- testBodyWithQueryParams :: (Consumes TestBodyWithQueryParams MimeJSON, MimeRender MimeJSON User) - => User -- ^ "body" + => User -- ^ "user" -> Query -- ^ "query" -> OpenAPIPetstoreRequest TestBodyWithQueryParams MimeJSON NoContent MimeNoContent -testBodyWithQueryParams body (Query query) = +testBodyWithQueryParams user (Query query) = _mkRequest "PUT" ["/fake/body-with-query-params"] - `setBodyParam` body + `setBodyParam` user `setQuery` toQuery ("query", Just query) data TestBodyWithQueryParams @@ -255,15 +229,15 @@ instance Produces TestBodyWithQueryParams MimeNoContent -- testClientModel :: (Consumes TestClientModel MimeJSON, MimeRender MimeJSON Client) - => Client -- ^ "body" - client model + => Client -- ^ "client" - client model -> OpenAPIPetstoreRequest TestClientModel MimeJSON Client MimeJSON -testClientModel body = +testClientModel client = _mkRequest "PATCH" ["/fake"] - `setBodyParam` body + `setBodyParam` client data TestClientModel --- | /Body Param/ "body" - client model +-- | /Body Param/ "Client" - client model instance HasBodyParam TestClientModel Client -- | @application/json@ @@ -395,7 +369,7 @@ instance HasOptionalParam TestEnumParameters EnumHeaderString where -- | /Optional Param/ "enum_query_string_array" - Query parameter enum test (string array) instance HasOptionalParam TestEnumParameters EnumQueryStringArray where applyOptionalParam req (EnumQueryStringArray xs) = - req `setQuery` toQueryColl CommaSeparated ("enum_query_string_array", Just xs) + req `setQuery` toQueryColl MultiParamArray ("enum_query_string_array", Just xs) -- | /Optional Param/ "enum_query_string" - Query parameter enum test (string) instance HasOptionalParam TestEnumParameters EnumQueryString where @@ -426,6 +400,8 @@ instance Produces TestEnumParameters MimeNoContent -- -- Fake endpoint to test group parameters (optional) -- +-- AuthMethod: 'AuthBasicBearerTest' +-- testGroupParameters :: RequiredStringGroup -- ^ "requiredStringGroup" - Required String in group parameters -> RequiredBooleanGroup -- ^ "requiredBooleanGroup" - Required Boolean in group parameters @@ -433,6 +409,7 @@ testGroupParameters -> OpenAPIPetstoreRequest TestGroupParameters MimeNoContent NoContent MimeNoContent testGroupParameters (RequiredStringGroup requiredStringGroup) (RequiredBooleanGroup requiredBooleanGroup) (RequiredInt64Group requiredInt64Group) = _mkRequest "DELETE" ["/fake"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthBasicBearerTest) `setQuery` toQuery ("required_string_group", Just requiredStringGroup) `setHeader` toHeader ("required_boolean_group", requiredBooleanGroup) `setQuery` toQuery ("required_int64_group", Just requiredInt64Group) @@ -463,17 +440,17 @@ instance Produces TestGroupParameters MimeNoContent -- test inline additionalProperties -- testInlineAdditionalProperties - :: (Consumes TestInlineAdditionalProperties MimeJSON, MimeRender MimeJSON ParamMapMapStringText) - => ParamMapMapStringText -- ^ "param" - request body + :: (Consumes TestInlineAdditionalProperties MimeJSON, MimeRender MimeJSON RequestBody) + => RequestBody -- ^ "requestBody" - request body -> OpenAPIPetstoreRequest TestInlineAdditionalProperties MimeJSON NoContent MimeNoContent -testInlineAdditionalProperties param = +testInlineAdditionalProperties requestBody = _mkRequest "POST" ["/fake/inline-additionalProperties"] - `setBodyParam` param + `setBodyParam` requestBody data TestInlineAdditionalProperties --- | /Body Param/ "param" - request body -instance HasBodyParam TestInlineAdditionalProperties ParamMapMapStringText +-- | /Body Param/ "request_body" - request body +instance HasBodyParam TestInlineAdditionalProperties RequestBody -- | @application/json@ instance Consumes TestInlineAdditionalProperties MimeJSON diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/FakeClassnameTags123.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/FakeClassnameTags123.hs index f002c0472583..e1776cbfd8b7 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/FakeClassnameTags123.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/FakeClassnameTags123.hs @@ -3,7 +3,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI Version: 3.0.1 + OpenAPI Version: 3.0.0 OpenAPI Petstore API version: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) -} @@ -69,16 +69,16 @@ import qualified Prelude as P -- testClassname :: (Consumes TestClassname MimeJSON, MimeRender MimeJSON Client) - => Client -- ^ "body" - client model + => Client -- ^ "client" - client model -> OpenAPIPetstoreRequest TestClassname MimeJSON Client MimeJSON -testClassname body = +testClassname client = _mkRequest "PATCH" ["/fake_classname_test"] `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyApiKeyQuery) - `setBodyParam` body + `setBodyParam` client data TestClassname --- | /Body Param/ "body" - client model +-- | /Body Param/ "Client" - client model instance HasBodyParam TestClassname Client -- | @application/json@ diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/Pet.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/Pet.hs index 3620393673d6..6cb8645722c9 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/Pet.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/Pet.hs @@ -3,7 +3,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI Version: 3.0.1 + OpenAPI Version: 3.0.0 OpenAPI Petstore API version: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) -} @@ -68,16 +68,16 @@ import qualified Prelude as P addPet :: (Consumes AddPet contentType, MimeRender contentType Pet) => ContentType contentType -- ^ request content-type ('MimeType') - -> Pet -- ^ "body" - Pet object that needs to be added to the store + -> Pet -- ^ "pet" - Pet object that needs to be added to the store -> OpenAPIPetstoreRequest AddPet contentType NoContent MimeNoContent -addPet _ body = +addPet _ pet = _mkRequest "POST" ["/pet"] `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) - `setBodyParam` body + `setBodyParam` pet data AddPet --- | /Body Param/ "body" - Pet object that needs to be added to the store +-- | /Body Param/ "Pet" - Pet object that needs to be added to the store instance HasBodyParam AddPet Pet -- | @application/xml@ @@ -200,16 +200,16 @@ instance Produces GetPetById MimeJSON updatePet :: (Consumes UpdatePet contentType, MimeRender contentType Pet) => ContentType contentType -- ^ request content-type ('MimeType') - -> Pet -- ^ "body" - Pet object that needs to be added to the store + -> Pet -- ^ "pet" - Pet object that needs to be added to the store -> OpenAPIPetstoreRequest UpdatePet contentType NoContent MimeNoContent -updatePet _ body = +updatePet _ pet = _mkRequest "PUT" ["/pet"] `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) - `setBodyParam` body + `setBodyParam` pet data UpdatePet --- | /Body Param/ "body" - Pet object that needs to be added to the store +-- | /Body Param/ "Pet" - Pet object that needs to be added to the store instance HasBodyParam UpdatePet Pet -- | @application/xml@ diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/Store.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/Store.hs index 522b40491a23..b6cd99ad3843 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/Store.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/Store.hs @@ -3,7 +3,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI Version: 3.0.1 + OpenAPI Version: 3.0.0 OpenAPI Petstore API version: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) -} @@ -125,22 +125,21 @@ instance Produces GetOrderById MimeJSON -- Place an order for a pet -- placeOrder - :: (Consumes PlaceOrder contentType, MimeRender contentType Order) - => ContentType contentType -- ^ request content-type ('MimeType') - -> Accept accept -- ^ request accept ('MimeType') - -> Order -- ^ "body" - order placed for purchasing the pet - -> OpenAPIPetstoreRequest PlaceOrder contentType Order accept -placeOrder _ _ body = + :: (Consumes PlaceOrder MimeJSON, MimeRender MimeJSON Order) + => Accept accept -- ^ request accept ('MimeType') + -> Order -- ^ "order" - order placed for purchasing the pet + -> OpenAPIPetstoreRequest PlaceOrder MimeJSON Order accept +placeOrder _ order = _mkRequest "POST" ["/store/order"] - `setBodyParam` body + `setBodyParam` order data PlaceOrder --- | /Body Param/ "body" - order placed for purchasing the pet +-- | /Body Param/ "Order" - order placed for purchasing the pet instance HasBodyParam PlaceOrder Order - --- | @*/*@ -instance MimeType mtype => Consumes PlaceOrder mtype + +-- | @application/json@ +instance Consumes PlaceOrder MimeJSON -- | @application/xml@ instance Produces PlaceOrder MimeXML diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/User.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/User.hs index 4bf49dda20db..4c7c3642264f 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/User.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/User.hs @@ -3,7 +3,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI Version: 3.0.1 + OpenAPI Version: 3.0.0 OpenAPI Petstore API version: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) -} @@ -66,21 +66,20 @@ import qualified Prelude as P -- This can only be done by the logged in user. -- createUser - :: (Consumes CreateUser contentType, MimeRender contentType User) - => ContentType contentType -- ^ request content-type ('MimeType') - -> User -- ^ "body" - Created user object - -> OpenAPIPetstoreRequest CreateUser contentType NoContent MimeNoContent -createUser _ body = + :: (Consumes CreateUser MimeJSON, MimeRender MimeJSON User) + => User -- ^ "user" - Created user object + -> OpenAPIPetstoreRequest CreateUser MimeJSON NoContent MimeNoContent +createUser user = _mkRequest "POST" ["/user"] - `setBodyParam` body + `setBodyParam` user data CreateUser --- | /Body Param/ "body" - Created user object +-- | /Body Param/ "User" - Created user object instance HasBodyParam CreateUser User - --- | @*/*@ -instance MimeType mtype => Consumes CreateUser mtype + +-- | @application/json@ +instance Consumes CreateUser MimeJSON instance Produces CreateUser MimeNoContent @@ -92,21 +91,20 @@ instance Produces CreateUser MimeNoContent -- Creates list of users with given input array -- createUsersWithArrayInput - :: (Consumes CreateUsersWithArrayInput contentType, MimeRender contentType Body) - => ContentType contentType -- ^ request content-type ('MimeType') - -> Body -- ^ "body" - List of user object - -> OpenAPIPetstoreRequest CreateUsersWithArrayInput contentType NoContent MimeNoContent -createUsersWithArrayInput _ body = + :: (Consumes CreateUsersWithArrayInput MimeJSON, MimeRender MimeJSON User2) + => User2 -- ^ "user" - List of user object + -> OpenAPIPetstoreRequest CreateUsersWithArrayInput MimeJSON NoContent MimeNoContent +createUsersWithArrayInput user = _mkRequest "POST" ["/user/createWithArray"] - `setBodyParam` body + `setBodyParam` user data CreateUsersWithArrayInput --- | /Body Param/ "body" - List of user object -instance HasBodyParam CreateUsersWithArrayInput Body - --- | @*/*@ -instance MimeType mtype => Consumes CreateUsersWithArrayInput mtype +-- | /Body Param/ "User" - List of user object +instance HasBodyParam CreateUsersWithArrayInput User2 + +-- | @application/json@ +instance Consumes CreateUsersWithArrayInput MimeJSON instance Produces CreateUsersWithArrayInput MimeNoContent @@ -118,21 +116,20 @@ instance Produces CreateUsersWithArrayInput MimeNoContent -- Creates list of users with given input array -- createUsersWithListInput - :: (Consumes CreateUsersWithListInput contentType, MimeRender contentType Body) - => ContentType contentType -- ^ request content-type ('MimeType') - -> Body -- ^ "body" - List of user object - -> OpenAPIPetstoreRequest CreateUsersWithListInput contentType NoContent MimeNoContent -createUsersWithListInput _ body = + :: (Consumes CreateUsersWithListInput MimeJSON, MimeRender MimeJSON User2) + => User2 -- ^ "user" - List of user object + -> OpenAPIPetstoreRequest CreateUsersWithListInput MimeJSON NoContent MimeNoContent +createUsersWithListInput user = _mkRequest "POST" ["/user/createWithList"] - `setBodyParam` body + `setBodyParam` user data CreateUsersWithListInput --- | /Body Param/ "body" - List of user object -instance HasBodyParam CreateUsersWithListInput Body - --- | @*/*@ -instance MimeType mtype => Consumes CreateUsersWithListInput mtype +-- | /Body Param/ "User" - List of user object +instance HasBodyParam CreateUsersWithListInput User2 + +-- | @application/json@ +instance Consumes CreateUsersWithListInput MimeJSON instance Produces CreateUsersWithListInput MimeNoContent @@ -222,22 +219,21 @@ instance Produces LogoutUser MimeNoContent -- This can only be done by the logged in user. -- updateUser - :: (Consumes UpdateUser contentType, MimeRender contentType User) - => ContentType contentType -- ^ request content-type ('MimeType') - -> User -- ^ "body" - Updated user object + :: (Consumes UpdateUser MimeJSON, MimeRender MimeJSON User) + => User -- ^ "user" - Updated user object -> Username -- ^ "username" - name that need to be deleted - -> OpenAPIPetstoreRequest UpdateUser contentType NoContent MimeNoContent -updateUser _ body (Username username) = + -> OpenAPIPetstoreRequest UpdateUser MimeJSON NoContent MimeNoContent +updateUser user (Username username) = _mkRequest "PUT" ["/user/",toPath username] - `setBodyParam` body + `setBodyParam` user data UpdateUser --- | /Body Param/ "body" - Updated user object +-- | /Body Param/ "User" - Updated user object instance HasBodyParam UpdateUser User - --- | @*/*@ -instance MimeType mtype => Consumes UpdateUser mtype + +-- | @application/json@ +instance Consumes UpdateUser MimeJSON instance Produces UpdateUser MimeNoContent diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Client.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Client.hs index 31cd12f7adaf..d9203a5bd4f2 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Client.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Client.hs @@ -3,7 +3,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI Version: 3.0.1 + OpenAPI Version: 3.0.0 OpenAPI Petstore API version: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) -} diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Core.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Core.hs index 6fbc9899d343..019f2ce6131c 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Core.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Core.hs @@ -3,7 +3,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI Version: 3.0.1 + OpenAPI Version: 3.0.0 OpenAPI Petstore API version: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) -} diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Logging.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Logging.hs index 6ae2c24035df..526e40926c16 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Logging.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Logging.hs @@ -3,7 +3,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI Version: 3.0.1 + OpenAPI Version: 3.0.0 OpenAPI Petstore API version: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) -} diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/LoggingKatip.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/LoggingKatip.hs index dc02fa713158..1453c00708dd 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/LoggingKatip.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/LoggingKatip.hs @@ -3,7 +3,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI Version: 3.0.1 + OpenAPI Version: 3.0.0 OpenAPI Petstore API version: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) -} diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/LoggingMonadLogger.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/LoggingMonadLogger.hs index a16a9fc227c2..a7edd6ad4720 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/LoggingMonadLogger.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/LoggingMonadLogger.hs @@ -3,7 +3,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI Version: 3.0.1 + OpenAPI Version: 3.0.0 OpenAPI Petstore API version: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) -} diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/MimeTypes.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/MimeTypes.hs index 09a22f663980..33b2868d0fa6 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/MimeTypes.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/MimeTypes.hs @@ -3,7 +3,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI Version: 3.0.1 + OpenAPI Version: 3.0.0 OpenAPI Petstore API version: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) -} @@ -201,55 +201,3 @@ instance MimeUnrender MimeOctetStream String where mimeUnrender _ = P.Right . BC instance MimeUnrender MimeNoContent NoContent where mimeUnrender _ = P.Right . P.const NoContent --- * Custom Mime Types - --- ** MimeXmlCharsetutf16 - -data MimeXmlCharsetutf16 = MimeXmlCharsetutf16 deriving (P.Typeable) - --- | @application/xml; charset=utf-16@ -instance MimeType MimeXmlCharsetutf16 where - mimeType _ = Just $ P.fromString "application/xml; charset=utf-16" --- instance MimeRender MimeXmlCharsetutf16 T.Text where mimeRender _ = undefined --- instance MimeUnrender MimeXmlCharsetutf16 T.Text where mimeUnrender _ = undefined - --- ** MimeXmlCharsetutf8 - -data MimeXmlCharsetutf8 = MimeXmlCharsetutf8 deriving (P.Typeable) - --- | @application/xml; charset=utf-8@ -instance MimeType MimeXmlCharsetutf8 where - mimeType _ = Just $ P.fromString "application/xml; charset=utf-8" --- instance MimeRender MimeXmlCharsetutf8 T.Text where mimeRender _ = undefined --- instance MimeUnrender MimeXmlCharsetutf8 T.Text where mimeUnrender _ = undefined - --- ** MimeTextXml - -data MimeTextXml = MimeTextXml deriving (P.Typeable) - --- | @text/xml@ -instance MimeType MimeTextXml where - mimeType _ = Just $ P.fromString "text/xml" --- instance MimeRender MimeTextXml T.Text where mimeRender _ = undefined --- instance MimeUnrender MimeTextXml T.Text where mimeUnrender _ = undefined - --- ** MimeTextXmlCharsetutf16 - -data MimeTextXmlCharsetutf16 = MimeTextXmlCharsetutf16 deriving (P.Typeable) - --- | @text/xml; charset=utf-16@ -instance MimeType MimeTextXmlCharsetutf16 where - mimeType _ = Just $ P.fromString "text/xml; charset=utf-16" --- instance MimeRender MimeTextXmlCharsetutf16 T.Text where mimeRender _ = undefined --- instance MimeUnrender MimeTextXmlCharsetutf16 T.Text where mimeUnrender _ = undefined - --- ** MimeTextXmlCharsetutf8 - -data MimeTextXmlCharsetutf8 = MimeTextXmlCharsetutf8 deriving (P.Typeable) - --- | @text/xml; charset=utf-8@ -instance MimeType MimeTextXmlCharsetutf8 where - mimeType _ = Just $ P.fromString "text/xml; charset=utf-8" --- instance MimeRender MimeTextXmlCharsetutf8 T.Text where mimeRender _ = undefined --- instance MimeUnrender MimeTextXmlCharsetutf8 T.Text where mimeUnrender _ = undefined - diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Model.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Model.hs index 8c0e231b0edd..006e61597d5b 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Model.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Model.hs @@ -3,7 +3,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI Version: 3.0.1 + OpenAPI Version: 3.0.0 OpenAPI Petstore API version: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) -} @@ -73,14 +73,11 @@ newtype AdditionalMetadata = AdditionalMetadata { unAdditionalMetadata :: Text } newtype ApiKey = ApiKey { unApiKey :: Text } deriving (P.Eq, P.Show) -- ** Body -newtype Body = Body { unBody :: [User] } deriving (P.Eq, P.Show, A.ToJSON) +newtype Body = Body { unBody :: Double } deriving (P.Eq, P.Show, A.ToJSON) -- ** BodyBool newtype BodyBool = BodyBool { unBodyBool :: Bool } deriving (P.Eq, P.Show, A.ToJSON) --- ** BodyDouble -newtype BodyDouble = BodyDouble { unBodyDouble :: Double } deriving (P.Eq, P.Show, A.ToJSON) - -- ** BodyText newtype BodyText = BodyText { unBodyText :: Text } deriving (P.Eq, P.Show, A.ToJSON) @@ -165,9 +162,6 @@ newtype ParamFloat = ParamFloat { unParamFloat :: Float } deriving (P.Eq, P.Show -- ** ParamInteger newtype ParamInteger = ParamInteger { unParamInteger :: Int } deriving (P.Eq, P.Show) --- ** ParamMapMapStringText -newtype ParamMapMapStringText = ParamMapMapStringText { unParamMapMapStringText :: (Map.Map String Text) } deriving (P.Eq, P.Show, A.ToJSON) - -- ** ParamString newtype ParamString = ParamString { unParamString :: Text } deriving (P.Eq, P.Show) @@ -183,6 +177,9 @@ newtype PetId = PetId { unPetId :: Integer } deriving (P.Eq, P.Show) -- ** Query newtype Query = Query { unQuery :: Text } deriving (P.Eq, P.Show) +-- ** RequestBody +newtype RequestBody = RequestBody { unRequestBody :: (Map.Map String Text) } deriving (P.Eq, P.Show, A.ToJSON) + -- ** RequiredBooleanGroup newtype RequiredBooleanGroup = RequiredBooleanGroup { unRequiredBooleanGroup :: Bool } deriving (P.Eq, P.Show) @@ -207,143 +204,35 @@ newtype StringGroup = StringGroup { unStringGroup :: Int } deriving (P.Eq, P.Sho -- ** Tags newtype Tags = Tags { unTags :: [Text] } deriving (P.Eq, P.Show) +-- ** User2 +newtype User2 = User2 { unUser2 :: [User] } deriving (P.Eq, P.Show, A.ToJSON) + -- ** Username newtype Username = Username { unUsername :: Text } deriving (P.Eq, P.Show) -- * Models --- ** AdditionalPropertiesAnyType --- | AdditionalPropertiesAnyType -data AdditionalPropertiesAnyType = AdditionalPropertiesAnyType - { additionalPropertiesAnyTypeName :: !(Maybe Text) -- ^ "name" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON AdditionalPropertiesAnyType -instance A.FromJSON AdditionalPropertiesAnyType where - parseJSON = A.withObject "AdditionalPropertiesAnyType" $ \o -> - AdditionalPropertiesAnyType - <$> (o .:? "name") - --- | ToJSON AdditionalPropertiesAnyType -instance A.ToJSON AdditionalPropertiesAnyType where - toJSON AdditionalPropertiesAnyType {..} = - _omitNulls - [ "name" .= additionalPropertiesAnyTypeName - ] - - --- | Construct a value of type 'AdditionalPropertiesAnyType' (by applying it's required fields, if any) -mkAdditionalPropertiesAnyType - :: AdditionalPropertiesAnyType -mkAdditionalPropertiesAnyType = - AdditionalPropertiesAnyType - { additionalPropertiesAnyTypeName = Nothing - } - --- ** AdditionalPropertiesArray --- | AdditionalPropertiesArray -data AdditionalPropertiesArray = AdditionalPropertiesArray - { additionalPropertiesArrayName :: !(Maybe Text) -- ^ "name" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON AdditionalPropertiesArray -instance A.FromJSON AdditionalPropertiesArray where - parseJSON = A.withObject "AdditionalPropertiesArray" $ \o -> - AdditionalPropertiesArray - <$> (o .:? "name") - --- | ToJSON AdditionalPropertiesArray -instance A.ToJSON AdditionalPropertiesArray where - toJSON AdditionalPropertiesArray {..} = - _omitNulls - [ "name" .= additionalPropertiesArrayName - ] - - --- | Construct a value of type 'AdditionalPropertiesArray' (by applying it's required fields, if any) -mkAdditionalPropertiesArray - :: AdditionalPropertiesArray -mkAdditionalPropertiesArray = - AdditionalPropertiesArray - { additionalPropertiesArrayName = Nothing - } - --- ** AdditionalPropertiesBoolean --- | AdditionalPropertiesBoolean -data AdditionalPropertiesBoolean = AdditionalPropertiesBoolean - { additionalPropertiesBooleanName :: !(Maybe Text) -- ^ "name" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON AdditionalPropertiesBoolean -instance A.FromJSON AdditionalPropertiesBoolean where - parseJSON = A.withObject "AdditionalPropertiesBoolean" $ \o -> - AdditionalPropertiesBoolean - <$> (o .:? "name") - --- | ToJSON AdditionalPropertiesBoolean -instance A.ToJSON AdditionalPropertiesBoolean where - toJSON AdditionalPropertiesBoolean {..} = - _omitNulls - [ "name" .= additionalPropertiesBooleanName - ] - - --- | Construct a value of type 'AdditionalPropertiesBoolean' (by applying it's required fields, if any) -mkAdditionalPropertiesBoolean - :: AdditionalPropertiesBoolean -mkAdditionalPropertiesBoolean = - AdditionalPropertiesBoolean - { additionalPropertiesBooleanName = Nothing - } - -- ** AdditionalPropertiesClass -- | AdditionalPropertiesClass data AdditionalPropertiesClass = AdditionalPropertiesClass - { additionalPropertiesClassMapString :: !(Maybe (Map.Map String Text)) -- ^ "map_string" - , additionalPropertiesClassMapNumber :: !(Maybe (Map.Map String Double)) -- ^ "map_number" - , additionalPropertiesClassMapInteger :: !(Maybe (Map.Map String Int)) -- ^ "map_integer" - , additionalPropertiesClassMapBoolean :: !(Maybe (Map.Map String Bool)) -- ^ "map_boolean" - , additionalPropertiesClassMapArrayInteger :: !(Maybe (Map.Map String [Int])) -- ^ "map_array_integer" - , additionalPropertiesClassMapArrayAnytype :: !(Maybe (Map.Map String [A.Value])) -- ^ "map_array_anytype" - , additionalPropertiesClassMapMapString :: !(Maybe (Map.Map String (Map.Map String Text))) -- ^ "map_map_string" - , additionalPropertiesClassMapMapAnytype :: !(Maybe (Map.Map String (Map.Map String A.Value))) -- ^ "map_map_anytype" - , additionalPropertiesClassAnytype1 :: !(Maybe A.Value) -- ^ "anytype_1" - , additionalPropertiesClassAnytype2 :: !(Maybe A.Value) -- ^ "anytype_2" - , additionalPropertiesClassAnytype3 :: !(Maybe A.Value) -- ^ "anytype_3" + { additionalPropertiesClassMapProperty :: !(Maybe (Map.Map String Text)) -- ^ "map_property" + , additionalPropertiesClassMapOfMapProperty :: !(Maybe (Map.Map String (Map.Map String Text))) -- ^ "map_of_map_property" } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON AdditionalPropertiesClass instance A.FromJSON AdditionalPropertiesClass where parseJSON = A.withObject "AdditionalPropertiesClass" $ \o -> AdditionalPropertiesClass - <$> (o .:? "map_string") - <*> (o .:? "map_number") - <*> (o .:? "map_integer") - <*> (o .:? "map_boolean") - <*> (o .:? "map_array_integer") - <*> (o .:? "map_array_anytype") - <*> (o .:? "map_map_string") - <*> (o .:? "map_map_anytype") - <*> (o .:? "anytype_1") - <*> (o .:? "anytype_2") - <*> (o .:? "anytype_3") + <$> (o .:? "map_property") + <*> (o .:? "map_of_map_property") -- | ToJSON AdditionalPropertiesClass instance A.ToJSON AdditionalPropertiesClass where toJSON AdditionalPropertiesClass {..} = _omitNulls - [ "map_string" .= additionalPropertiesClassMapString - , "map_number" .= additionalPropertiesClassMapNumber - , "map_integer" .= additionalPropertiesClassMapInteger - , "map_boolean" .= additionalPropertiesClassMapBoolean - , "map_array_integer" .= additionalPropertiesClassMapArrayInteger - , "map_array_anytype" .= additionalPropertiesClassMapArrayAnytype - , "map_map_string" .= additionalPropertiesClassMapMapString - , "map_map_anytype" .= additionalPropertiesClassMapMapAnytype - , "anytype_1" .= additionalPropertiesClassAnytype1 - , "anytype_2" .= additionalPropertiesClassAnytype2 - , "anytype_3" .= additionalPropertiesClassAnytype3 + [ "map_property" .= additionalPropertiesClassMapProperty + , "map_of_map_property" .= additionalPropertiesClassMapOfMapProperty ] @@ -352,129 +241,8 @@ mkAdditionalPropertiesClass :: AdditionalPropertiesClass mkAdditionalPropertiesClass = AdditionalPropertiesClass - { additionalPropertiesClassMapString = Nothing - , additionalPropertiesClassMapNumber = Nothing - , additionalPropertiesClassMapInteger = Nothing - , additionalPropertiesClassMapBoolean = Nothing - , additionalPropertiesClassMapArrayInteger = Nothing - , additionalPropertiesClassMapArrayAnytype = Nothing - , additionalPropertiesClassMapMapString = Nothing - , additionalPropertiesClassMapMapAnytype = Nothing - , additionalPropertiesClassAnytype1 = Nothing - , additionalPropertiesClassAnytype2 = Nothing - , additionalPropertiesClassAnytype3 = Nothing - } - --- ** AdditionalPropertiesInteger --- | AdditionalPropertiesInteger -data AdditionalPropertiesInteger = AdditionalPropertiesInteger - { additionalPropertiesIntegerName :: !(Maybe Text) -- ^ "name" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON AdditionalPropertiesInteger -instance A.FromJSON AdditionalPropertiesInteger where - parseJSON = A.withObject "AdditionalPropertiesInteger" $ \o -> - AdditionalPropertiesInteger - <$> (o .:? "name") - --- | ToJSON AdditionalPropertiesInteger -instance A.ToJSON AdditionalPropertiesInteger where - toJSON AdditionalPropertiesInteger {..} = - _omitNulls - [ "name" .= additionalPropertiesIntegerName - ] - - --- | Construct a value of type 'AdditionalPropertiesInteger' (by applying it's required fields, if any) -mkAdditionalPropertiesInteger - :: AdditionalPropertiesInteger -mkAdditionalPropertiesInteger = - AdditionalPropertiesInteger - { additionalPropertiesIntegerName = Nothing - } - --- ** AdditionalPropertiesNumber --- | AdditionalPropertiesNumber -data AdditionalPropertiesNumber = AdditionalPropertiesNumber - { additionalPropertiesNumberName :: !(Maybe Text) -- ^ "name" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON AdditionalPropertiesNumber -instance A.FromJSON AdditionalPropertiesNumber where - parseJSON = A.withObject "AdditionalPropertiesNumber" $ \o -> - AdditionalPropertiesNumber - <$> (o .:? "name") - --- | ToJSON AdditionalPropertiesNumber -instance A.ToJSON AdditionalPropertiesNumber where - toJSON AdditionalPropertiesNumber {..} = - _omitNulls - [ "name" .= additionalPropertiesNumberName - ] - - --- | Construct a value of type 'AdditionalPropertiesNumber' (by applying it's required fields, if any) -mkAdditionalPropertiesNumber - :: AdditionalPropertiesNumber -mkAdditionalPropertiesNumber = - AdditionalPropertiesNumber - { additionalPropertiesNumberName = Nothing - } - --- ** AdditionalPropertiesObject --- | AdditionalPropertiesObject -data AdditionalPropertiesObject = AdditionalPropertiesObject - { additionalPropertiesObjectName :: !(Maybe Text) -- ^ "name" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON AdditionalPropertiesObject -instance A.FromJSON AdditionalPropertiesObject where - parseJSON = A.withObject "AdditionalPropertiesObject" $ \o -> - AdditionalPropertiesObject - <$> (o .:? "name") - --- | ToJSON AdditionalPropertiesObject -instance A.ToJSON AdditionalPropertiesObject where - toJSON AdditionalPropertiesObject {..} = - _omitNulls - [ "name" .= additionalPropertiesObjectName - ] - - --- | Construct a value of type 'AdditionalPropertiesObject' (by applying it's required fields, if any) -mkAdditionalPropertiesObject - :: AdditionalPropertiesObject -mkAdditionalPropertiesObject = - AdditionalPropertiesObject - { additionalPropertiesObjectName = Nothing - } - --- ** AdditionalPropertiesString --- | AdditionalPropertiesString -data AdditionalPropertiesString = AdditionalPropertiesString - { additionalPropertiesStringName :: !(Maybe Text) -- ^ "name" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON AdditionalPropertiesString -instance A.FromJSON AdditionalPropertiesString where - parseJSON = A.withObject "AdditionalPropertiesString" $ \o -> - AdditionalPropertiesString - <$> (o .:? "name") - --- | ToJSON AdditionalPropertiesString -instance A.ToJSON AdditionalPropertiesString where - toJSON AdditionalPropertiesString {..} = - _omitNulls - [ "name" .= additionalPropertiesStringName - ] - - --- | Construct a value of type 'AdditionalPropertiesString' (by applying it's required fields, if any) -mkAdditionalPropertiesString - :: AdditionalPropertiesString -mkAdditionalPropertiesString = - AdditionalPropertiesString - { additionalPropertiesStringName = Nothing + { additionalPropertiesClassMapProperty = Nothing + , additionalPropertiesClassMapOfMapProperty = Nothing } -- ** Animal @@ -946,6 +714,9 @@ data EnumTest = EnumTest , enumTestEnumInteger :: !(Maybe E'EnumInteger) -- ^ "enum_integer" , enumTestEnumNumber :: !(Maybe E'EnumNumber) -- ^ "enum_number" , enumTestOuterEnum :: !(Maybe OuterEnum) -- ^ "outerEnum" + , enumTestOuterEnumInteger :: !(Maybe OuterEnumInteger) -- ^ "outerEnumInteger" + , enumTestOuterEnumDefaultValue :: !(Maybe OuterEnumDefaultValue) -- ^ "outerEnumDefaultValue" + , enumTestOuterEnumIntegerDefaultValue :: !(Maybe OuterEnumIntegerDefaultValue) -- ^ "outerEnumIntegerDefaultValue" } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON EnumTest @@ -957,6 +728,9 @@ instance A.FromJSON EnumTest where <*> (o .:? "enum_integer") <*> (o .:? "enum_number") <*> (o .:? "outerEnum") + <*> (o .:? "outerEnumInteger") + <*> (o .:? "outerEnumDefaultValue") + <*> (o .:? "outerEnumIntegerDefaultValue") -- | ToJSON EnumTest instance A.ToJSON EnumTest where @@ -967,6 +741,9 @@ instance A.ToJSON EnumTest where , "enum_integer" .= enumTestEnumInteger , "enum_number" .= enumTestEnumNumber , "outerEnum" .= enumTestOuterEnum + , "outerEnumInteger" .= enumTestOuterEnumInteger + , "outerEnumDefaultValue" .= enumTestOuterEnumDefaultValue + , "outerEnumIntegerDefaultValue" .= enumTestOuterEnumIntegerDefaultValue ] @@ -981,6 +758,9 @@ mkEnumTest enumTestEnumStringRequired = , enumTestEnumInteger = Nothing , enumTestEnumNumber = Nothing , enumTestOuterEnum = Nothing + , enumTestOuterEnumInteger = Nothing + , enumTestOuterEnumDefaultValue = Nothing + , enumTestOuterEnumIntegerDefaultValue = Nothing } -- ** File @@ -1044,6 +824,34 @@ mkFileSchemaTestClass = , fileSchemaTestClassFiles = Nothing } +-- ** Foo +-- | Foo +data Foo = Foo + { fooBar :: !(Maybe Text) -- ^ "bar" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON Foo +instance A.FromJSON Foo where + parseJSON = A.withObject "Foo" $ \o -> + Foo + <$> (o .:? "bar") + +-- | ToJSON Foo +instance A.ToJSON Foo where + toJSON Foo {..} = + _omitNulls + [ "bar" .= fooBar + ] + + +-- | Construct a value of type 'Foo' (by applying it's required fields, if any) +mkFoo + :: Foo +mkFoo = + Foo + { fooBar = Nothing + } + -- ** FormatTest -- | FormatTest data FormatTest = FormatTest @@ -1060,6 +868,8 @@ data FormatTest = FormatTest , formatTestDateTime :: !(Maybe DateTime) -- ^ "dateTime" , formatTestUuid :: !(Maybe Text) -- ^ "uuid" , formatTestPassword :: !(Text) -- ^ /Required/ "password" + , formatTestPatternWithDigits :: !(Maybe Text) -- ^ "pattern_with_digits" - A string that is a 10 digit number. Can have leading zeros. + , formatTestPatternWithDigitsAndDelimiter :: !(Maybe Text) -- ^ "pattern_with_digits_and_delimiter" - A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON FormatTest @@ -1079,6 +889,8 @@ instance A.FromJSON FormatTest where <*> (o .:? "dateTime") <*> (o .:? "uuid") <*> (o .: "password") + <*> (o .:? "pattern_with_digits") + <*> (o .:? "pattern_with_digits_and_delimiter") -- | ToJSON FormatTest instance A.ToJSON FormatTest where @@ -1097,6 +909,8 @@ instance A.ToJSON FormatTest where , "dateTime" .= formatTestDateTime , "uuid" .= formatTestUuid , "password" .= formatTestPassword + , "pattern_with_digits" .= formatTestPatternWithDigits + , "pattern_with_digits_and_delimiter" .= formatTestPatternWithDigitsAndDelimiter ] @@ -1122,6 +936,8 @@ mkFormatTest formatTestNumber formatTestByte formatTestDate formatTestPassword = , formatTestDateTime = Nothing , formatTestUuid = Nothing , formatTestPassword + , formatTestPatternWithDigits = Nothing + , formatTestPatternWithDigitsAndDelimiter = Nothing } -- ** HasOnlyReadOnly @@ -1156,6 +972,310 @@ mkHasOnlyReadOnly = , hasOnlyReadOnlyFoo = Nothing } +-- ** HealthCheckResult +-- | HealthCheckResult +-- Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. +data HealthCheckResult = HealthCheckResult + { healthCheckResultNullableMessage :: !(Maybe Text) -- ^ "NullableMessage" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON HealthCheckResult +instance A.FromJSON HealthCheckResult where + parseJSON = A.withObject "HealthCheckResult" $ \o -> + HealthCheckResult + <$> (o .:? "NullableMessage") + +-- | ToJSON HealthCheckResult +instance A.ToJSON HealthCheckResult where + toJSON HealthCheckResult {..} = + _omitNulls + [ "NullableMessage" .= healthCheckResultNullableMessage + ] + + +-- | Construct a value of type 'HealthCheckResult' (by applying it's required fields, if any) +mkHealthCheckResult + :: HealthCheckResult +mkHealthCheckResult = + HealthCheckResult + { healthCheckResultNullableMessage = Nothing + } + +-- ** InlineObject +-- | InlineObject +data InlineObject = InlineObject + { inlineObjectName :: !(Maybe Text) -- ^ "name" - Updated name of the pet + , inlineObjectStatus :: !(Maybe Text) -- ^ "status" - Updated status of the pet + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON InlineObject +instance A.FromJSON InlineObject where + parseJSON = A.withObject "InlineObject" $ \o -> + InlineObject + <$> (o .:? "name") + <*> (o .:? "status") + +-- | ToJSON InlineObject +instance A.ToJSON InlineObject where + toJSON InlineObject {..} = + _omitNulls + [ "name" .= inlineObjectName + , "status" .= inlineObjectStatus + ] + + +-- | Construct a value of type 'InlineObject' (by applying it's required fields, if any) +mkInlineObject + :: InlineObject +mkInlineObject = + InlineObject + { inlineObjectName = Nothing + , inlineObjectStatus = Nothing + } + +-- ** InlineObject1 +-- | InlineObject1 +data InlineObject1 = InlineObject1 + { inlineObject1AdditionalMetadata :: !(Maybe Text) -- ^ "additionalMetadata" - Additional data to pass to server + , inlineObject1File :: !(Maybe FilePath) -- ^ "file" - file to upload + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON InlineObject1 +instance A.FromJSON InlineObject1 where + parseJSON = A.withObject "InlineObject1" $ \o -> + InlineObject1 + <$> (o .:? "additionalMetadata") + <*> (o .:? "file") + +-- | ToJSON InlineObject1 +instance A.ToJSON InlineObject1 where + toJSON InlineObject1 {..} = + _omitNulls + [ "additionalMetadata" .= inlineObject1AdditionalMetadata + , "file" .= inlineObject1File + ] + + +-- | Construct a value of type 'InlineObject1' (by applying it's required fields, if any) +mkInlineObject1 + :: InlineObject1 +mkInlineObject1 = + InlineObject1 + { inlineObject1AdditionalMetadata = Nothing + , inlineObject1File = Nothing + } + +-- ** InlineObject2 +-- | InlineObject2 +data InlineObject2 = InlineObject2 + { inlineObject2EnumFormStringArray :: !(Maybe [E'EnumFormStringArray]) -- ^ "enum_form_string_array" - Form parameter enum test (string array) + , inlineObject2EnumFormString :: !(Maybe E'EnumFormString) -- ^ "enum_form_string" - Form parameter enum test (string) + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON InlineObject2 +instance A.FromJSON InlineObject2 where + parseJSON = A.withObject "InlineObject2" $ \o -> + InlineObject2 + <$> (o .:? "enum_form_string_array") + <*> (o .:? "enum_form_string") + +-- | ToJSON InlineObject2 +instance A.ToJSON InlineObject2 where + toJSON InlineObject2 {..} = + _omitNulls + [ "enum_form_string_array" .= inlineObject2EnumFormStringArray + , "enum_form_string" .= inlineObject2EnumFormString + ] + + +-- | Construct a value of type 'InlineObject2' (by applying it's required fields, if any) +mkInlineObject2 + :: InlineObject2 +mkInlineObject2 = + InlineObject2 + { inlineObject2EnumFormStringArray = Nothing + , inlineObject2EnumFormString = Nothing + } + +-- ** InlineObject3 +-- | InlineObject3 +data InlineObject3 = InlineObject3 + { inlineObject3Integer :: !(Maybe Int) -- ^ "integer" - None + , inlineObject3Int32 :: !(Maybe Int) -- ^ "int32" - None + , inlineObject3Int64 :: !(Maybe Integer) -- ^ "int64" - None + , inlineObject3Number :: !(Double) -- ^ /Required/ "number" - None + , inlineObject3Float :: !(Maybe Float) -- ^ "float" - None + , inlineObject3Double :: !(Double) -- ^ /Required/ "double" - None + , inlineObject3String :: !(Maybe Text) -- ^ "string" - None + , inlineObject3PatternWithoutDelimiter :: !(Text) -- ^ /Required/ "pattern_without_delimiter" - None + , inlineObject3Byte :: !(ByteArray) -- ^ /Required/ "byte" - None + , inlineObject3Binary :: !(Maybe FilePath) -- ^ "binary" - None + , inlineObject3Date :: !(Maybe Date) -- ^ "date" - None + , inlineObject3DateTime :: !(Maybe DateTime) -- ^ "dateTime" - None + , inlineObject3Password :: !(Maybe Text) -- ^ "password" - None + , inlineObject3Callback :: !(Maybe Text) -- ^ "callback" - None + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON InlineObject3 +instance A.FromJSON InlineObject3 where + parseJSON = A.withObject "InlineObject3" $ \o -> + InlineObject3 + <$> (o .:? "integer") + <*> (o .:? "int32") + <*> (o .:? "int64") + <*> (o .: "number") + <*> (o .:? "float") + <*> (o .: "double") + <*> (o .:? "string") + <*> (o .: "pattern_without_delimiter") + <*> (o .: "byte") + <*> (o .:? "binary") + <*> (o .:? "date") + <*> (o .:? "dateTime") + <*> (o .:? "password") + <*> (o .:? "callback") + +-- | ToJSON InlineObject3 +instance A.ToJSON InlineObject3 where + toJSON InlineObject3 {..} = + _omitNulls + [ "integer" .= inlineObject3Integer + , "int32" .= inlineObject3Int32 + , "int64" .= inlineObject3Int64 + , "number" .= inlineObject3Number + , "float" .= inlineObject3Float + , "double" .= inlineObject3Double + , "string" .= inlineObject3String + , "pattern_without_delimiter" .= inlineObject3PatternWithoutDelimiter + , "byte" .= inlineObject3Byte + , "binary" .= inlineObject3Binary + , "date" .= inlineObject3Date + , "dateTime" .= inlineObject3DateTime + , "password" .= inlineObject3Password + , "callback" .= inlineObject3Callback + ] + + +-- | Construct a value of type 'InlineObject3' (by applying it's required fields, if any) +mkInlineObject3 + :: Double -- ^ 'inlineObject3Number': None + -> Double -- ^ 'inlineObject3Double': None + -> Text -- ^ 'inlineObject3PatternWithoutDelimiter': None + -> ByteArray -- ^ 'inlineObject3Byte': None + -> InlineObject3 +mkInlineObject3 inlineObject3Number inlineObject3Double inlineObject3PatternWithoutDelimiter inlineObject3Byte = + InlineObject3 + { inlineObject3Integer = Nothing + , inlineObject3Int32 = Nothing + , inlineObject3Int64 = Nothing + , inlineObject3Number + , inlineObject3Float = Nothing + , inlineObject3Double + , inlineObject3String = Nothing + , inlineObject3PatternWithoutDelimiter + , inlineObject3Byte + , inlineObject3Binary = Nothing + , inlineObject3Date = Nothing + , inlineObject3DateTime = Nothing + , inlineObject3Password = Nothing + , inlineObject3Callback = Nothing + } + +-- ** InlineObject4 +-- | InlineObject4 +data InlineObject4 = InlineObject4 + { inlineObject4Param :: !(Text) -- ^ /Required/ "param" - field1 + , inlineObject4Param2 :: !(Text) -- ^ /Required/ "param2" - field2 + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON InlineObject4 +instance A.FromJSON InlineObject4 where + parseJSON = A.withObject "InlineObject4" $ \o -> + InlineObject4 + <$> (o .: "param") + <*> (o .: "param2") + +-- | ToJSON InlineObject4 +instance A.ToJSON InlineObject4 where + toJSON InlineObject4 {..} = + _omitNulls + [ "param" .= inlineObject4Param + , "param2" .= inlineObject4Param2 + ] + + +-- | Construct a value of type 'InlineObject4' (by applying it's required fields, if any) +mkInlineObject4 + :: Text -- ^ 'inlineObject4Param': field1 + -> Text -- ^ 'inlineObject4Param2': field2 + -> InlineObject4 +mkInlineObject4 inlineObject4Param inlineObject4Param2 = + InlineObject4 + { inlineObject4Param + , inlineObject4Param2 + } + +-- ** InlineObject5 +-- | InlineObject5 +data InlineObject5 = InlineObject5 + { inlineObject5AdditionalMetadata :: !(Maybe Text) -- ^ "additionalMetadata" - Additional data to pass to server + , inlineObject5RequiredFile :: !(FilePath) -- ^ /Required/ "requiredFile" - file to upload + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON InlineObject5 +instance A.FromJSON InlineObject5 where + parseJSON = A.withObject "InlineObject5" $ \o -> + InlineObject5 + <$> (o .:? "additionalMetadata") + <*> (o .: "requiredFile") + +-- | ToJSON InlineObject5 +instance A.ToJSON InlineObject5 where + toJSON InlineObject5 {..} = + _omitNulls + [ "additionalMetadata" .= inlineObject5AdditionalMetadata + , "requiredFile" .= inlineObject5RequiredFile + ] + + +-- | Construct a value of type 'InlineObject5' (by applying it's required fields, if any) +mkInlineObject5 + :: FilePath -- ^ 'inlineObject5RequiredFile': file to upload + -> InlineObject5 +mkInlineObject5 inlineObject5RequiredFile = + InlineObject5 + { inlineObject5AdditionalMetadata = Nothing + , inlineObject5RequiredFile + } + +-- ** InlineResponseDefault +-- | InlineResponseDefault +data InlineResponseDefault = InlineResponseDefault + { inlineResponseDefaultString :: !(Maybe Foo) -- ^ "string" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON InlineResponseDefault +instance A.FromJSON InlineResponseDefault where + parseJSON = A.withObject "InlineResponseDefault" $ \o -> + InlineResponseDefault + <$> (o .:? "string") + +-- | ToJSON InlineResponseDefault +instance A.ToJSON InlineResponseDefault where + toJSON InlineResponseDefault {..} = + _omitNulls + [ "string" .= inlineResponseDefaultString + ] + + +-- | Construct a value of type 'InlineResponseDefault' (by applying it's required fields, if any) +mkInlineResponseDefault + :: InlineResponseDefault +mkInlineResponseDefault = + InlineResponseDefault + { inlineResponseDefaultString = Nothing + } + -- ** MapTest -- | MapTest data MapTest = MapTest @@ -1364,6 +1484,78 @@ mkName nameName = , name123number = Nothing } +-- ** NullableClass +-- | NullableClass +data NullableClass = NullableClass + { nullableClassIntegerProp :: !(Maybe Int) -- ^ "integer_prop" + , nullableClassNumberProp :: !(Maybe Double) -- ^ "number_prop" + , nullableClassBooleanProp :: !(Maybe Bool) -- ^ "boolean_prop" + , nullableClassStringProp :: !(Maybe Text) -- ^ "string_prop" + , nullableClassDateProp :: !(Maybe Date) -- ^ "date_prop" + , nullableClassDatetimeProp :: !(Maybe DateTime) -- ^ "datetime_prop" + , nullableClassArrayNullableProp :: !(Maybe [A.Value]) -- ^ "array_nullable_prop" + , nullableClassArrayAndItemsNullableProp :: !(Maybe [A.Value]) -- ^ "array_and_items_nullable_prop" + , nullableClassArrayItemsNullable :: !(Maybe [A.Value]) -- ^ "array_items_nullable" + , nullableClassObjectNullableProp :: !(Maybe (Map.Map String A.Value)) -- ^ "object_nullable_prop" + , nullableClassObjectAndItemsNullableProp :: !(Maybe (Map.Map String A.Value)) -- ^ "object_and_items_nullable_prop" + , nullableClassObjectItemsNullable :: !(Maybe (Map.Map String A.Value)) -- ^ "object_items_nullable" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON NullableClass +instance A.FromJSON NullableClass where + parseJSON = A.withObject "NullableClass" $ \o -> + NullableClass + <$> (o .:? "integer_prop") + <*> (o .:? "number_prop") + <*> (o .:? "boolean_prop") + <*> (o .:? "string_prop") + <*> (o .:? "date_prop") + <*> (o .:? "datetime_prop") + <*> (o .:? "array_nullable_prop") + <*> (o .:? "array_and_items_nullable_prop") + <*> (o .:? "array_items_nullable") + <*> (o .:? "object_nullable_prop") + <*> (o .:? "object_and_items_nullable_prop") + <*> (o .:? "object_items_nullable") + +-- | ToJSON NullableClass +instance A.ToJSON NullableClass where + toJSON NullableClass {..} = + _omitNulls + [ "integer_prop" .= nullableClassIntegerProp + , "number_prop" .= nullableClassNumberProp + , "boolean_prop" .= nullableClassBooleanProp + , "string_prop" .= nullableClassStringProp + , "date_prop" .= nullableClassDateProp + , "datetime_prop" .= nullableClassDatetimeProp + , "array_nullable_prop" .= nullableClassArrayNullableProp + , "array_and_items_nullable_prop" .= nullableClassArrayAndItemsNullableProp + , "array_items_nullable" .= nullableClassArrayItemsNullable + , "object_nullable_prop" .= nullableClassObjectNullableProp + , "object_and_items_nullable_prop" .= nullableClassObjectAndItemsNullableProp + , "object_items_nullable" .= nullableClassObjectItemsNullable + ] + + +-- | Construct a value of type 'NullableClass' (by applying it's required fields, if any) +mkNullableClass + :: NullableClass +mkNullableClass = + NullableClass + { nullableClassIntegerProp = Nothing + , nullableClassNumberProp = Nothing + , nullableClassBooleanProp = Nothing + , nullableClassStringProp = Nothing + , nullableClassDateProp = Nothing + , nullableClassDatetimeProp = Nothing + , nullableClassArrayNullableProp = Nothing + , nullableClassArrayAndItemsNullableProp = Nothing + , nullableClassArrayItemsNullable = Nothing + , nullableClassObjectNullableProp = Nothing + , nullableClassObjectAndItemsNullableProp = Nothing + , nullableClassObjectItemsNullable = Nothing + } + -- ** NumberOnly -- | NumberOnly data NumberOnly = NumberOnly @@ -1618,104 +1810,6 @@ mkTag = , tagName = Nothing } --- ** TypeHolderDefault --- | TypeHolderDefault -data TypeHolderDefault = TypeHolderDefault - { typeHolderDefaultStringItem :: !(Text) -- ^ /Required/ "string_item" - , typeHolderDefaultNumberItem :: !(Double) -- ^ /Required/ "number_item" - , typeHolderDefaultIntegerItem :: !(Int) -- ^ /Required/ "integer_item" - , typeHolderDefaultBoolItem :: !(Bool) -- ^ /Required/ "bool_item" - , typeHolderDefaultArrayItem :: !([Int]) -- ^ /Required/ "array_item" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON TypeHolderDefault -instance A.FromJSON TypeHolderDefault where - parseJSON = A.withObject "TypeHolderDefault" $ \o -> - TypeHolderDefault - <$> (o .: "string_item") - <*> (o .: "number_item") - <*> (o .: "integer_item") - <*> (o .: "bool_item") - <*> (o .: "array_item") - --- | ToJSON TypeHolderDefault -instance A.ToJSON TypeHolderDefault where - toJSON TypeHolderDefault {..} = - _omitNulls - [ "string_item" .= typeHolderDefaultStringItem - , "number_item" .= typeHolderDefaultNumberItem - , "integer_item" .= typeHolderDefaultIntegerItem - , "bool_item" .= typeHolderDefaultBoolItem - , "array_item" .= typeHolderDefaultArrayItem - ] - - --- | Construct a value of type 'TypeHolderDefault' (by applying it's required fields, if any) -mkTypeHolderDefault - :: Text -- ^ 'typeHolderDefaultStringItem' - -> Double -- ^ 'typeHolderDefaultNumberItem' - -> Int -- ^ 'typeHolderDefaultIntegerItem' - -> Bool -- ^ 'typeHolderDefaultBoolItem' - -> [Int] -- ^ 'typeHolderDefaultArrayItem' - -> TypeHolderDefault -mkTypeHolderDefault typeHolderDefaultStringItem typeHolderDefaultNumberItem typeHolderDefaultIntegerItem typeHolderDefaultBoolItem typeHolderDefaultArrayItem = - TypeHolderDefault - { typeHolderDefaultStringItem - , typeHolderDefaultNumberItem - , typeHolderDefaultIntegerItem - , typeHolderDefaultBoolItem - , typeHolderDefaultArrayItem - } - --- ** TypeHolderExample --- | TypeHolderExample -data TypeHolderExample = TypeHolderExample - { typeHolderExampleStringItem :: !(Text) -- ^ /Required/ "string_item" - , typeHolderExampleNumberItem :: !(Double) -- ^ /Required/ "number_item" - , typeHolderExampleIntegerItem :: !(Int) -- ^ /Required/ "integer_item" - , typeHolderExampleBoolItem :: !(Bool) -- ^ /Required/ "bool_item" - , typeHolderExampleArrayItem :: !([Int]) -- ^ /Required/ "array_item" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON TypeHolderExample -instance A.FromJSON TypeHolderExample where - parseJSON = A.withObject "TypeHolderExample" $ \o -> - TypeHolderExample - <$> (o .: "string_item") - <*> (o .: "number_item") - <*> (o .: "integer_item") - <*> (o .: "bool_item") - <*> (o .: "array_item") - --- | ToJSON TypeHolderExample -instance A.ToJSON TypeHolderExample where - toJSON TypeHolderExample {..} = - _omitNulls - [ "string_item" .= typeHolderExampleStringItem - , "number_item" .= typeHolderExampleNumberItem - , "integer_item" .= typeHolderExampleIntegerItem - , "bool_item" .= typeHolderExampleBoolItem - , "array_item" .= typeHolderExampleArrayItem - ] - - --- | Construct a value of type 'TypeHolderExample' (by applying it's required fields, if any) -mkTypeHolderExample - :: Text -- ^ 'typeHolderExampleStringItem' - -> Double -- ^ 'typeHolderExampleNumberItem' - -> Int -- ^ 'typeHolderExampleIntegerItem' - -> Bool -- ^ 'typeHolderExampleBoolItem' - -> [Int] -- ^ 'typeHolderExampleArrayItem' - -> TypeHolderExample -mkTypeHolderExample typeHolderExampleStringItem typeHolderExampleNumberItem typeHolderExampleIntegerItem typeHolderExampleBoolItem typeHolderExampleArrayItem = - TypeHolderExample - { typeHolderExampleStringItem - , typeHolderExampleNumberItem - , typeHolderExampleIntegerItem - , typeHolderExampleBoolItem - , typeHolderExampleArrayItem - } - -- ** User -- | User data User = User @@ -1772,146 +1866,6 @@ mkUser = , userUserStatus = Nothing } --- ** XmlItem --- | XmlItem -data XmlItem = XmlItem - { xmlItemAttributeString :: !(Maybe Text) -- ^ "attribute_string" - , xmlItemAttributeNumber :: !(Maybe Double) -- ^ "attribute_number" - , xmlItemAttributeInteger :: !(Maybe Int) -- ^ "attribute_integer" - , xmlItemAttributeBoolean :: !(Maybe Bool) -- ^ "attribute_boolean" - , xmlItemWrappedArray :: !(Maybe [Int]) -- ^ "wrapped_array" - , xmlItemNameString :: !(Maybe Text) -- ^ "name_string" - , xmlItemNameNumber :: !(Maybe Double) -- ^ "name_number" - , xmlItemNameInteger :: !(Maybe Int) -- ^ "name_integer" - , xmlItemNameBoolean :: !(Maybe Bool) -- ^ "name_boolean" - , xmlItemNameArray :: !(Maybe [Int]) -- ^ "name_array" - , xmlItemNameWrappedArray :: !(Maybe [Int]) -- ^ "name_wrapped_array" - , xmlItemPrefixString :: !(Maybe Text) -- ^ "prefix_string" - , xmlItemPrefixNumber :: !(Maybe Double) -- ^ "prefix_number" - , xmlItemPrefixInteger :: !(Maybe Int) -- ^ "prefix_integer" - , xmlItemPrefixBoolean :: !(Maybe Bool) -- ^ "prefix_boolean" - , xmlItemPrefixArray :: !(Maybe [Int]) -- ^ "prefix_array" - , xmlItemPrefixWrappedArray :: !(Maybe [Int]) -- ^ "prefix_wrapped_array" - , xmlItemNamespaceString :: !(Maybe Text) -- ^ "namespace_string" - , xmlItemNamespaceNumber :: !(Maybe Double) -- ^ "namespace_number" - , xmlItemNamespaceInteger :: !(Maybe Int) -- ^ "namespace_integer" - , xmlItemNamespaceBoolean :: !(Maybe Bool) -- ^ "namespace_boolean" - , xmlItemNamespaceArray :: !(Maybe [Int]) -- ^ "namespace_array" - , xmlItemNamespaceWrappedArray :: !(Maybe [Int]) -- ^ "namespace_wrapped_array" - , xmlItemPrefixNsString :: !(Maybe Text) -- ^ "prefix_ns_string" - , xmlItemPrefixNsNumber :: !(Maybe Double) -- ^ "prefix_ns_number" - , xmlItemPrefixNsInteger :: !(Maybe Int) -- ^ "prefix_ns_integer" - , xmlItemPrefixNsBoolean :: !(Maybe Bool) -- ^ "prefix_ns_boolean" - , xmlItemPrefixNsArray :: !(Maybe [Int]) -- ^ "prefix_ns_array" - , xmlItemPrefixNsWrappedArray :: !(Maybe [Int]) -- ^ "prefix_ns_wrapped_array" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON XmlItem -instance A.FromJSON XmlItem where - parseJSON = A.withObject "XmlItem" $ \o -> - XmlItem - <$> (o .:? "attribute_string") - <*> (o .:? "attribute_number") - <*> (o .:? "attribute_integer") - <*> (o .:? "attribute_boolean") - <*> (o .:? "wrapped_array") - <*> (o .:? "name_string") - <*> (o .:? "name_number") - <*> (o .:? "name_integer") - <*> (o .:? "name_boolean") - <*> (o .:? "name_array") - <*> (o .:? "name_wrapped_array") - <*> (o .:? "prefix_string") - <*> (o .:? "prefix_number") - <*> (o .:? "prefix_integer") - <*> (o .:? "prefix_boolean") - <*> (o .:? "prefix_array") - <*> (o .:? "prefix_wrapped_array") - <*> (o .:? "namespace_string") - <*> (o .:? "namespace_number") - <*> (o .:? "namespace_integer") - <*> (o .:? "namespace_boolean") - <*> (o .:? "namespace_array") - <*> (o .:? "namespace_wrapped_array") - <*> (o .:? "prefix_ns_string") - <*> (o .:? "prefix_ns_number") - <*> (o .:? "prefix_ns_integer") - <*> (o .:? "prefix_ns_boolean") - <*> (o .:? "prefix_ns_array") - <*> (o .:? "prefix_ns_wrapped_array") - --- | ToJSON XmlItem -instance A.ToJSON XmlItem where - toJSON XmlItem {..} = - _omitNulls - [ "attribute_string" .= xmlItemAttributeString - , "attribute_number" .= xmlItemAttributeNumber - , "attribute_integer" .= xmlItemAttributeInteger - , "attribute_boolean" .= xmlItemAttributeBoolean - , "wrapped_array" .= xmlItemWrappedArray - , "name_string" .= xmlItemNameString - , "name_number" .= xmlItemNameNumber - , "name_integer" .= xmlItemNameInteger - , "name_boolean" .= xmlItemNameBoolean - , "name_array" .= xmlItemNameArray - , "name_wrapped_array" .= xmlItemNameWrappedArray - , "prefix_string" .= xmlItemPrefixString - , "prefix_number" .= xmlItemPrefixNumber - , "prefix_integer" .= xmlItemPrefixInteger - , "prefix_boolean" .= xmlItemPrefixBoolean - , "prefix_array" .= xmlItemPrefixArray - , "prefix_wrapped_array" .= xmlItemPrefixWrappedArray - , "namespace_string" .= xmlItemNamespaceString - , "namespace_number" .= xmlItemNamespaceNumber - , "namespace_integer" .= xmlItemNamespaceInteger - , "namespace_boolean" .= xmlItemNamespaceBoolean - , "namespace_array" .= xmlItemNamespaceArray - , "namespace_wrapped_array" .= xmlItemNamespaceWrappedArray - , "prefix_ns_string" .= xmlItemPrefixNsString - , "prefix_ns_number" .= xmlItemPrefixNsNumber - , "prefix_ns_integer" .= xmlItemPrefixNsInteger - , "prefix_ns_boolean" .= xmlItemPrefixNsBoolean - , "prefix_ns_array" .= xmlItemPrefixNsArray - , "prefix_ns_wrapped_array" .= xmlItemPrefixNsWrappedArray - ] - - --- | Construct a value of type 'XmlItem' (by applying it's required fields, if any) -mkXmlItem - :: XmlItem -mkXmlItem = - XmlItem - { xmlItemAttributeString = Nothing - , xmlItemAttributeNumber = Nothing - , xmlItemAttributeInteger = Nothing - , xmlItemAttributeBoolean = Nothing - , xmlItemWrappedArray = Nothing - , xmlItemNameString = Nothing - , xmlItemNameNumber = Nothing - , xmlItemNameInteger = Nothing - , xmlItemNameBoolean = Nothing - , xmlItemNameArray = Nothing - , xmlItemNameWrappedArray = Nothing - , xmlItemPrefixString = Nothing - , xmlItemPrefixNumber = Nothing - , xmlItemPrefixInteger = Nothing - , xmlItemPrefixBoolean = Nothing - , xmlItemPrefixArray = Nothing - , xmlItemPrefixWrappedArray = Nothing - , xmlItemNamespaceString = Nothing - , xmlItemNamespaceNumber = Nothing - , xmlItemNamespaceInteger = Nothing - , xmlItemNamespaceBoolean = Nothing - , xmlItemNamespaceArray = Nothing - , xmlItemNamespaceWrappedArray = Nothing - , xmlItemPrefixNsString = Nothing - , xmlItemPrefixNsNumber = Nothing - , xmlItemPrefixNsInteger = Nothing - , xmlItemPrefixNsBoolean = Nothing - , xmlItemPrefixNsArray = Nothing - , xmlItemPrefixNsWrappedArray = Nothing - } - -- * Enums @@ -2301,6 +2255,99 @@ toOuterEnum = \case s -> P.Left $ "toOuterEnum: enum parse failure: " P.++ P.show s +-- ** OuterEnumDefaultValue + +-- | Enum of 'Text' +data OuterEnumDefaultValue + = OuterEnumDefaultValue'Placed -- ^ @"placed"@ + | OuterEnumDefaultValue'Approved -- ^ @"approved"@ + | OuterEnumDefaultValue'Delivered -- ^ @"delivered"@ + deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) + +instance A.ToJSON OuterEnumDefaultValue where toJSON = A.toJSON . fromOuterEnumDefaultValue +instance A.FromJSON OuterEnumDefaultValue where parseJSON o = P.either P.fail (pure . P.id) . toOuterEnumDefaultValue =<< A.parseJSON o +instance WH.ToHttpApiData OuterEnumDefaultValue where toQueryParam = WH.toQueryParam . fromOuterEnumDefaultValue +instance WH.FromHttpApiData OuterEnumDefaultValue where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toOuterEnumDefaultValue +instance MimeRender MimeMultipartFormData OuterEnumDefaultValue where mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | unwrap 'OuterEnumDefaultValue' enum +fromOuterEnumDefaultValue :: OuterEnumDefaultValue -> Text +fromOuterEnumDefaultValue = \case + OuterEnumDefaultValue'Placed -> "placed" + OuterEnumDefaultValue'Approved -> "approved" + OuterEnumDefaultValue'Delivered -> "delivered" + +-- | parse 'OuterEnumDefaultValue' enum +toOuterEnumDefaultValue :: Text -> P.Either String OuterEnumDefaultValue +toOuterEnumDefaultValue = \case + "placed" -> P.Right OuterEnumDefaultValue'Placed + "approved" -> P.Right OuterEnumDefaultValue'Approved + "delivered" -> P.Right OuterEnumDefaultValue'Delivered + s -> P.Left $ "toOuterEnumDefaultValue: enum parse failure: " P.++ P.show s + + +-- ** OuterEnumInteger + +-- | Enum of 'Int' +data OuterEnumInteger + = OuterEnumInteger'Num0 -- ^ @0@ + | OuterEnumInteger'Num1 -- ^ @1@ + | OuterEnumInteger'Num2 -- ^ @2@ + deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) + +instance A.ToJSON OuterEnumInteger where toJSON = A.toJSON . fromOuterEnumInteger +instance A.FromJSON OuterEnumInteger where parseJSON o = P.either P.fail (pure . P.id) . toOuterEnumInteger =<< A.parseJSON o +instance WH.ToHttpApiData OuterEnumInteger where toQueryParam = WH.toQueryParam . fromOuterEnumInteger +instance WH.FromHttpApiData OuterEnumInteger where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toOuterEnumInteger +instance MimeRender MimeMultipartFormData OuterEnumInteger where mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | unwrap 'OuterEnumInteger' enum +fromOuterEnumInteger :: OuterEnumInteger -> Int +fromOuterEnumInteger = \case + OuterEnumInteger'Num0 -> 0 + OuterEnumInteger'Num1 -> 1 + OuterEnumInteger'Num2 -> 2 + +-- | parse 'OuterEnumInteger' enum +toOuterEnumInteger :: Int -> P.Either String OuterEnumInteger +toOuterEnumInteger = \case + 0 -> P.Right OuterEnumInteger'Num0 + 1 -> P.Right OuterEnumInteger'Num1 + 2 -> P.Right OuterEnumInteger'Num2 + s -> P.Left $ "toOuterEnumInteger: enum parse failure: " P.++ P.show s + + +-- ** OuterEnumIntegerDefaultValue + +-- | Enum of 'Int' +data OuterEnumIntegerDefaultValue + = OuterEnumIntegerDefaultValue'Num0 -- ^ @0@ + | OuterEnumIntegerDefaultValue'Num1 -- ^ @1@ + | OuterEnumIntegerDefaultValue'Num2 -- ^ @2@ + deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) + +instance A.ToJSON OuterEnumIntegerDefaultValue where toJSON = A.toJSON . fromOuterEnumIntegerDefaultValue +instance A.FromJSON OuterEnumIntegerDefaultValue where parseJSON o = P.either P.fail (pure . P.id) . toOuterEnumIntegerDefaultValue =<< A.parseJSON o +instance WH.ToHttpApiData OuterEnumIntegerDefaultValue where toQueryParam = WH.toQueryParam . fromOuterEnumIntegerDefaultValue +instance WH.FromHttpApiData OuterEnumIntegerDefaultValue where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toOuterEnumIntegerDefaultValue +instance MimeRender MimeMultipartFormData OuterEnumIntegerDefaultValue where mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | unwrap 'OuterEnumIntegerDefaultValue' enum +fromOuterEnumIntegerDefaultValue :: OuterEnumIntegerDefaultValue -> Int +fromOuterEnumIntegerDefaultValue = \case + OuterEnumIntegerDefaultValue'Num0 -> 0 + OuterEnumIntegerDefaultValue'Num1 -> 1 + OuterEnumIntegerDefaultValue'Num2 -> 2 + +-- | parse 'OuterEnumIntegerDefaultValue' enum +toOuterEnumIntegerDefaultValue :: Int -> P.Either String OuterEnumIntegerDefaultValue +toOuterEnumIntegerDefaultValue = \case + 0 -> P.Right OuterEnumIntegerDefaultValue'Num0 + 1 -> P.Right OuterEnumIntegerDefaultValue'Num1 + 2 -> P.Right OuterEnumIntegerDefaultValue'Num2 + s -> P.Left $ "toOuterEnumIntegerDefaultValue: enum parse failure: " P.++ P.show s + + -- * Auth Methods -- ** AuthApiKeyApiKey @@ -2329,6 +2376,20 @@ instance AuthMethod AuthApiKeyApiKeyQuery where & L.over rAuthTypesL (P.filter (/= P.typeOf a)) else req +-- ** AuthBasicBearerTest +data AuthBasicBearerTest = + AuthBasicBearerTest B.ByteString B.ByteString -- ^ username password + deriving (P.Eq, P.Show, P.Typeable) + +instance AuthMethod AuthBasicBearerTest where + applyAuthMethod _ a@(AuthBasicBearerTest user pw) req = + P.pure $ + if (P.typeOf a `P.elem` rAuthTypes req) + then req `setHeader` toHeader ("Authorization", T.decodeUtf8 cred) + & L.over rAuthTypesL (P.filter (/= P.typeOf a)) + else req + where cred = BC.append "Basic " (B64.encode $ BC.concat [ user, ":", pw ]) + -- ** AuthBasicHttpBasicTest data AuthBasicHttpBasicTest = AuthBasicHttpBasicTest B.ByteString B.ByteString -- ^ username password diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/ModelLens.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/ModelLens.hs index 353dacb6e6f0..c1889ffd27b8 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/ModelLens.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/ModelLens.hs @@ -3,7 +3,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI Version: 3.0.1 + OpenAPI Version: 3.0.0 OpenAPI Petstore API version: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) -} @@ -36,125 +36,17 @@ import OpenAPIPetstore.Model import OpenAPIPetstore.Core --- * AdditionalPropertiesAnyType - --- | 'additionalPropertiesAnyTypeName' Lens -additionalPropertiesAnyTypeNameL :: Lens_' AdditionalPropertiesAnyType (Maybe Text) -additionalPropertiesAnyTypeNameL f AdditionalPropertiesAnyType{..} = (\additionalPropertiesAnyTypeName -> AdditionalPropertiesAnyType { additionalPropertiesAnyTypeName, ..} ) <$> f additionalPropertiesAnyTypeName -{-# INLINE additionalPropertiesAnyTypeNameL #-} - - - --- * AdditionalPropertiesArray - --- | 'additionalPropertiesArrayName' Lens -additionalPropertiesArrayNameL :: Lens_' AdditionalPropertiesArray (Maybe Text) -additionalPropertiesArrayNameL f AdditionalPropertiesArray{..} = (\additionalPropertiesArrayName -> AdditionalPropertiesArray { additionalPropertiesArrayName, ..} ) <$> f additionalPropertiesArrayName -{-# INLINE additionalPropertiesArrayNameL #-} - - - --- * AdditionalPropertiesBoolean - --- | 'additionalPropertiesBooleanName' Lens -additionalPropertiesBooleanNameL :: Lens_' AdditionalPropertiesBoolean (Maybe Text) -additionalPropertiesBooleanNameL f AdditionalPropertiesBoolean{..} = (\additionalPropertiesBooleanName -> AdditionalPropertiesBoolean { additionalPropertiesBooleanName, ..} ) <$> f additionalPropertiesBooleanName -{-# INLINE additionalPropertiesBooleanNameL #-} - - - -- * AdditionalPropertiesClass --- | 'additionalPropertiesClassMapString' Lens -additionalPropertiesClassMapStringL :: Lens_' AdditionalPropertiesClass (Maybe (Map.Map String Text)) -additionalPropertiesClassMapStringL f AdditionalPropertiesClass{..} = (\additionalPropertiesClassMapString -> AdditionalPropertiesClass { additionalPropertiesClassMapString, ..} ) <$> f additionalPropertiesClassMapString -{-# INLINE additionalPropertiesClassMapStringL #-} - --- | 'additionalPropertiesClassMapNumber' Lens -additionalPropertiesClassMapNumberL :: Lens_' AdditionalPropertiesClass (Maybe (Map.Map String Double)) -additionalPropertiesClassMapNumberL f AdditionalPropertiesClass{..} = (\additionalPropertiesClassMapNumber -> AdditionalPropertiesClass { additionalPropertiesClassMapNumber, ..} ) <$> f additionalPropertiesClassMapNumber -{-# INLINE additionalPropertiesClassMapNumberL #-} - --- | 'additionalPropertiesClassMapInteger' Lens -additionalPropertiesClassMapIntegerL :: Lens_' AdditionalPropertiesClass (Maybe (Map.Map String Int)) -additionalPropertiesClassMapIntegerL f AdditionalPropertiesClass{..} = (\additionalPropertiesClassMapInteger -> AdditionalPropertiesClass { additionalPropertiesClassMapInteger, ..} ) <$> f additionalPropertiesClassMapInteger -{-# INLINE additionalPropertiesClassMapIntegerL #-} - --- | 'additionalPropertiesClassMapBoolean' Lens -additionalPropertiesClassMapBooleanL :: Lens_' AdditionalPropertiesClass (Maybe (Map.Map String Bool)) -additionalPropertiesClassMapBooleanL f AdditionalPropertiesClass{..} = (\additionalPropertiesClassMapBoolean -> AdditionalPropertiesClass { additionalPropertiesClassMapBoolean, ..} ) <$> f additionalPropertiesClassMapBoolean -{-# INLINE additionalPropertiesClassMapBooleanL #-} - --- | 'additionalPropertiesClassMapArrayInteger' Lens -additionalPropertiesClassMapArrayIntegerL :: Lens_' AdditionalPropertiesClass (Maybe (Map.Map String [Int])) -additionalPropertiesClassMapArrayIntegerL f AdditionalPropertiesClass{..} = (\additionalPropertiesClassMapArrayInteger -> AdditionalPropertiesClass { additionalPropertiesClassMapArrayInteger, ..} ) <$> f additionalPropertiesClassMapArrayInteger -{-# INLINE additionalPropertiesClassMapArrayIntegerL #-} - --- | 'additionalPropertiesClassMapArrayAnytype' Lens -additionalPropertiesClassMapArrayAnytypeL :: Lens_' AdditionalPropertiesClass (Maybe (Map.Map String [A.Value])) -additionalPropertiesClassMapArrayAnytypeL f AdditionalPropertiesClass{..} = (\additionalPropertiesClassMapArrayAnytype -> AdditionalPropertiesClass { additionalPropertiesClassMapArrayAnytype, ..} ) <$> f additionalPropertiesClassMapArrayAnytype -{-# INLINE additionalPropertiesClassMapArrayAnytypeL #-} - --- | 'additionalPropertiesClassMapMapString' Lens -additionalPropertiesClassMapMapStringL :: Lens_' AdditionalPropertiesClass (Maybe (Map.Map String (Map.Map String Text))) -additionalPropertiesClassMapMapStringL f AdditionalPropertiesClass{..} = (\additionalPropertiesClassMapMapString -> AdditionalPropertiesClass { additionalPropertiesClassMapMapString, ..} ) <$> f additionalPropertiesClassMapMapString -{-# INLINE additionalPropertiesClassMapMapStringL #-} - --- | 'additionalPropertiesClassMapMapAnytype' Lens -additionalPropertiesClassMapMapAnytypeL :: Lens_' AdditionalPropertiesClass (Maybe (Map.Map String (Map.Map String A.Value))) -additionalPropertiesClassMapMapAnytypeL f AdditionalPropertiesClass{..} = (\additionalPropertiesClassMapMapAnytype -> AdditionalPropertiesClass { additionalPropertiesClassMapMapAnytype, ..} ) <$> f additionalPropertiesClassMapMapAnytype -{-# INLINE additionalPropertiesClassMapMapAnytypeL #-} - --- | 'additionalPropertiesClassAnytype1' Lens -additionalPropertiesClassAnytype1L :: Lens_' AdditionalPropertiesClass (Maybe A.Value) -additionalPropertiesClassAnytype1L f AdditionalPropertiesClass{..} = (\additionalPropertiesClassAnytype1 -> AdditionalPropertiesClass { additionalPropertiesClassAnytype1, ..} ) <$> f additionalPropertiesClassAnytype1 -{-# INLINE additionalPropertiesClassAnytype1L #-} - --- | 'additionalPropertiesClassAnytype2' Lens -additionalPropertiesClassAnytype2L :: Lens_' AdditionalPropertiesClass (Maybe A.Value) -additionalPropertiesClassAnytype2L f AdditionalPropertiesClass{..} = (\additionalPropertiesClassAnytype2 -> AdditionalPropertiesClass { additionalPropertiesClassAnytype2, ..} ) <$> f additionalPropertiesClassAnytype2 -{-# INLINE additionalPropertiesClassAnytype2L #-} - --- | 'additionalPropertiesClassAnytype3' Lens -additionalPropertiesClassAnytype3L :: Lens_' AdditionalPropertiesClass (Maybe A.Value) -additionalPropertiesClassAnytype3L f AdditionalPropertiesClass{..} = (\additionalPropertiesClassAnytype3 -> AdditionalPropertiesClass { additionalPropertiesClassAnytype3, ..} ) <$> f additionalPropertiesClassAnytype3 -{-# INLINE additionalPropertiesClassAnytype3L #-} - - - --- * AdditionalPropertiesInteger - --- | 'additionalPropertiesIntegerName' Lens -additionalPropertiesIntegerNameL :: Lens_' AdditionalPropertiesInteger (Maybe Text) -additionalPropertiesIntegerNameL f AdditionalPropertiesInteger{..} = (\additionalPropertiesIntegerName -> AdditionalPropertiesInteger { additionalPropertiesIntegerName, ..} ) <$> f additionalPropertiesIntegerName -{-# INLINE additionalPropertiesIntegerNameL #-} - - - --- * AdditionalPropertiesNumber - --- | 'additionalPropertiesNumberName' Lens -additionalPropertiesNumberNameL :: Lens_' AdditionalPropertiesNumber (Maybe Text) -additionalPropertiesNumberNameL f AdditionalPropertiesNumber{..} = (\additionalPropertiesNumberName -> AdditionalPropertiesNumber { additionalPropertiesNumberName, ..} ) <$> f additionalPropertiesNumberName -{-# INLINE additionalPropertiesNumberNameL #-} - - - --- * AdditionalPropertiesObject - --- | 'additionalPropertiesObjectName' Lens -additionalPropertiesObjectNameL :: Lens_' AdditionalPropertiesObject (Maybe Text) -additionalPropertiesObjectNameL f AdditionalPropertiesObject{..} = (\additionalPropertiesObjectName -> AdditionalPropertiesObject { additionalPropertiesObjectName, ..} ) <$> f additionalPropertiesObjectName -{-# INLINE additionalPropertiesObjectNameL #-} - +-- | 'additionalPropertiesClassMapProperty' Lens +additionalPropertiesClassMapPropertyL :: Lens_' AdditionalPropertiesClass (Maybe (Map.Map String Text)) +additionalPropertiesClassMapPropertyL f AdditionalPropertiesClass{..} = (\additionalPropertiesClassMapProperty -> AdditionalPropertiesClass { additionalPropertiesClassMapProperty, ..} ) <$> f additionalPropertiesClassMapProperty +{-# INLINE additionalPropertiesClassMapPropertyL #-} - --- * AdditionalPropertiesString - --- | 'additionalPropertiesStringName' Lens -additionalPropertiesStringNameL :: Lens_' AdditionalPropertiesString (Maybe Text) -additionalPropertiesStringNameL f AdditionalPropertiesString{..} = (\additionalPropertiesStringName -> AdditionalPropertiesString { additionalPropertiesStringName, ..} ) <$> f additionalPropertiesStringName -{-# INLINE additionalPropertiesStringNameL #-} +-- | 'additionalPropertiesClassMapOfMapProperty' Lens +additionalPropertiesClassMapOfMapPropertyL :: Lens_' AdditionalPropertiesClass (Maybe (Map.Map String (Map.Map String Text))) +additionalPropertiesClassMapOfMapPropertyL f AdditionalPropertiesClass{..} = (\additionalPropertiesClassMapOfMapProperty -> AdditionalPropertiesClass { additionalPropertiesClassMapOfMapProperty, ..} ) <$> f additionalPropertiesClassMapOfMapProperty +{-# INLINE additionalPropertiesClassMapOfMapPropertyL #-} @@ -395,6 +287,21 @@ enumTestOuterEnumL :: Lens_' EnumTest (Maybe OuterEnum) enumTestOuterEnumL f EnumTest{..} = (\enumTestOuterEnum -> EnumTest { enumTestOuterEnum, ..} ) <$> f enumTestOuterEnum {-# INLINE enumTestOuterEnumL #-} +-- | 'enumTestOuterEnumInteger' Lens +enumTestOuterEnumIntegerL :: Lens_' EnumTest (Maybe OuterEnumInteger) +enumTestOuterEnumIntegerL f EnumTest{..} = (\enumTestOuterEnumInteger -> EnumTest { enumTestOuterEnumInteger, ..} ) <$> f enumTestOuterEnumInteger +{-# INLINE enumTestOuterEnumIntegerL #-} + +-- | 'enumTestOuterEnumDefaultValue' Lens +enumTestOuterEnumDefaultValueL :: Lens_' EnumTest (Maybe OuterEnumDefaultValue) +enumTestOuterEnumDefaultValueL f EnumTest{..} = (\enumTestOuterEnumDefaultValue -> EnumTest { enumTestOuterEnumDefaultValue, ..} ) <$> f enumTestOuterEnumDefaultValue +{-# INLINE enumTestOuterEnumDefaultValueL #-} + +-- | 'enumTestOuterEnumIntegerDefaultValue' Lens +enumTestOuterEnumIntegerDefaultValueL :: Lens_' EnumTest (Maybe OuterEnumIntegerDefaultValue) +enumTestOuterEnumIntegerDefaultValueL f EnumTest{..} = (\enumTestOuterEnumIntegerDefaultValue -> EnumTest { enumTestOuterEnumIntegerDefaultValue, ..} ) <$> f enumTestOuterEnumIntegerDefaultValue +{-# INLINE enumTestOuterEnumIntegerDefaultValueL #-} + -- * File @@ -420,6 +327,15 @@ fileSchemaTestClassFilesL f FileSchemaTestClass{..} = (\fileSchemaTestClassFiles +-- * Foo + +-- | 'fooBar' Lens +fooBarL :: Lens_' Foo (Maybe Text) +fooBarL f Foo{..} = (\fooBar -> Foo { fooBar, ..} ) <$> f fooBar +{-# INLINE fooBarL #-} + + + -- * FormatTest -- | 'formatTestInteger' Lens @@ -487,6 +403,16 @@ formatTestPasswordL :: Lens_' FormatTest (Text) formatTestPasswordL f FormatTest{..} = (\formatTestPassword -> FormatTest { formatTestPassword, ..} ) <$> f formatTestPassword {-# INLINE formatTestPasswordL #-} +-- | 'formatTestPatternWithDigits' Lens +formatTestPatternWithDigitsL :: Lens_' FormatTest (Maybe Text) +formatTestPatternWithDigitsL f FormatTest{..} = (\formatTestPatternWithDigits -> FormatTest { formatTestPatternWithDigits, ..} ) <$> f formatTestPatternWithDigits +{-# INLINE formatTestPatternWithDigitsL #-} + +-- | 'formatTestPatternWithDigitsAndDelimiter' Lens +formatTestPatternWithDigitsAndDelimiterL :: Lens_' FormatTest (Maybe Text) +formatTestPatternWithDigitsAndDelimiterL f FormatTest{..} = (\formatTestPatternWithDigitsAndDelimiter -> FormatTest { formatTestPatternWithDigitsAndDelimiter, ..} ) <$> f formatTestPatternWithDigitsAndDelimiter +{-# INLINE formatTestPatternWithDigitsAndDelimiterL #-} + -- * HasOnlyReadOnly @@ -503,6 +429,168 @@ hasOnlyReadOnlyFooL f HasOnlyReadOnly{..} = (\hasOnlyReadOnlyFoo -> HasOnlyReadO +-- * HealthCheckResult + +-- | 'healthCheckResultNullableMessage' Lens +healthCheckResultNullableMessageL :: Lens_' HealthCheckResult (Maybe Text) +healthCheckResultNullableMessageL f HealthCheckResult{..} = (\healthCheckResultNullableMessage -> HealthCheckResult { healthCheckResultNullableMessage, ..} ) <$> f healthCheckResultNullableMessage +{-# INLINE healthCheckResultNullableMessageL #-} + + + +-- * InlineObject + +-- | 'inlineObjectName' Lens +inlineObjectNameL :: Lens_' InlineObject (Maybe Text) +inlineObjectNameL f InlineObject{..} = (\inlineObjectName -> InlineObject { inlineObjectName, ..} ) <$> f inlineObjectName +{-# INLINE inlineObjectNameL #-} + +-- | 'inlineObjectStatus' Lens +inlineObjectStatusL :: Lens_' InlineObject (Maybe Text) +inlineObjectStatusL f InlineObject{..} = (\inlineObjectStatus -> InlineObject { inlineObjectStatus, ..} ) <$> f inlineObjectStatus +{-# INLINE inlineObjectStatusL #-} + + + +-- * InlineObject1 + +-- | 'inlineObject1AdditionalMetadata' Lens +inlineObject1AdditionalMetadataL :: Lens_' InlineObject1 (Maybe Text) +inlineObject1AdditionalMetadataL f InlineObject1{..} = (\inlineObject1AdditionalMetadata -> InlineObject1 { inlineObject1AdditionalMetadata, ..} ) <$> f inlineObject1AdditionalMetadata +{-# INLINE inlineObject1AdditionalMetadataL #-} + +-- | 'inlineObject1File' Lens +inlineObject1FileL :: Lens_' InlineObject1 (Maybe FilePath) +inlineObject1FileL f InlineObject1{..} = (\inlineObject1File -> InlineObject1 { inlineObject1File, ..} ) <$> f inlineObject1File +{-# INLINE inlineObject1FileL #-} + + + +-- * InlineObject2 + +-- | 'inlineObject2EnumFormStringArray' Lens +inlineObject2EnumFormStringArrayL :: Lens_' InlineObject2 (Maybe [E'EnumFormStringArray]) +inlineObject2EnumFormStringArrayL f InlineObject2{..} = (\inlineObject2EnumFormStringArray -> InlineObject2 { inlineObject2EnumFormStringArray, ..} ) <$> f inlineObject2EnumFormStringArray +{-# INLINE inlineObject2EnumFormStringArrayL #-} + +-- | 'inlineObject2EnumFormString' Lens +inlineObject2EnumFormStringL :: Lens_' InlineObject2 (Maybe E'EnumFormString) +inlineObject2EnumFormStringL f InlineObject2{..} = (\inlineObject2EnumFormString -> InlineObject2 { inlineObject2EnumFormString, ..} ) <$> f inlineObject2EnumFormString +{-# INLINE inlineObject2EnumFormStringL #-} + + + +-- * InlineObject3 + +-- | 'inlineObject3Integer' Lens +inlineObject3IntegerL :: Lens_' InlineObject3 (Maybe Int) +inlineObject3IntegerL f InlineObject3{..} = (\inlineObject3Integer -> InlineObject3 { inlineObject3Integer, ..} ) <$> f inlineObject3Integer +{-# INLINE inlineObject3IntegerL #-} + +-- | 'inlineObject3Int32' Lens +inlineObject3Int32L :: Lens_' InlineObject3 (Maybe Int) +inlineObject3Int32L f InlineObject3{..} = (\inlineObject3Int32 -> InlineObject3 { inlineObject3Int32, ..} ) <$> f inlineObject3Int32 +{-# INLINE inlineObject3Int32L #-} + +-- | 'inlineObject3Int64' Lens +inlineObject3Int64L :: Lens_' InlineObject3 (Maybe Integer) +inlineObject3Int64L f InlineObject3{..} = (\inlineObject3Int64 -> InlineObject3 { inlineObject3Int64, ..} ) <$> f inlineObject3Int64 +{-# INLINE inlineObject3Int64L #-} + +-- | 'inlineObject3Number' Lens +inlineObject3NumberL :: Lens_' InlineObject3 (Double) +inlineObject3NumberL f InlineObject3{..} = (\inlineObject3Number -> InlineObject3 { inlineObject3Number, ..} ) <$> f inlineObject3Number +{-# INLINE inlineObject3NumberL #-} + +-- | 'inlineObject3Float' Lens +inlineObject3FloatL :: Lens_' InlineObject3 (Maybe Float) +inlineObject3FloatL f InlineObject3{..} = (\inlineObject3Float -> InlineObject3 { inlineObject3Float, ..} ) <$> f inlineObject3Float +{-# INLINE inlineObject3FloatL #-} + +-- | 'inlineObject3Double' Lens +inlineObject3DoubleL :: Lens_' InlineObject3 (Double) +inlineObject3DoubleL f InlineObject3{..} = (\inlineObject3Double -> InlineObject3 { inlineObject3Double, ..} ) <$> f inlineObject3Double +{-# INLINE inlineObject3DoubleL #-} + +-- | 'inlineObject3String' Lens +inlineObject3StringL :: Lens_' InlineObject3 (Maybe Text) +inlineObject3StringL f InlineObject3{..} = (\inlineObject3String -> InlineObject3 { inlineObject3String, ..} ) <$> f inlineObject3String +{-# INLINE inlineObject3StringL #-} + +-- | 'inlineObject3PatternWithoutDelimiter' Lens +inlineObject3PatternWithoutDelimiterL :: Lens_' InlineObject3 (Text) +inlineObject3PatternWithoutDelimiterL f InlineObject3{..} = (\inlineObject3PatternWithoutDelimiter -> InlineObject3 { inlineObject3PatternWithoutDelimiter, ..} ) <$> f inlineObject3PatternWithoutDelimiter +{-# INLINE inlineObject3PatternWithoutDelimiterL #-} + +-- | 'inlineObject3Byte' Lens +inlineObject3ByteL :: Lens_' InlineObject3 (ByteArray) +inlineObject3ByteL f InlineObject3{..} = (\inlineObject3Byte -> InlineObject3 { inlineObject3Byte, ..} ) <$> f inlineObject3Byte +{-# INLINE inlineObject3ByteL #-} + +-- | 'inlineObject3Binary' Lens +inlineObject3BinaryL :: Lens_' InlineObject3 (Maybe FilePath) +inlineObject3BinaryL f InlineObject3{..} = (\inlineObject3Binary -> InlineObject3 { inlineObject3Binary, ..} ) <$> f inlineObject3Binary +{-# INLINE inlineObject3BinaryL #-} + +-- | 'inlineObject3Date' Lens +inlineObject3DateL :: Lens_' InlineObject3 (Maybe Date) +inlineObject3DateL f InlineObject3{..} = (\inlineObject3Date -> InlineObject3 { inlineObject3Date, ..} ) <$> f inlineObject3Date +{-# INLINE inlineObject3DateL #-} + +-- | 'inlineObject3DateTime' Lens +inlineObject3DateTimeL :: Lens_' InlineObject3 (Maybe DateTime) +inlineObject3DateTimeL f InlineObject3{..} = (\inlineObject3DateTime -> InlineObject3 { inlineObject3DateTime, ..} ) <$> f inlineObject3DateTime +{-# INLINE inlineObject3DateTimeL #-} + +-- | 'inlineObject3Password' Lens +inlineObject3PasswordL :: Lens_' InlineObject3 (Maybe Text) +inlineObject3PasswordL f InlineObject3{..} = (\inlineObject3Password -> InlineObject3 { inlineObject3Password, ..} ) <$> f inlineObject3Password +{-# INLINE inlineObject3PasswordL #-} + +-- | 'inlineObject3Callback' Lens +inlineObject3CallbackL :: Lens_' InlineObject3 (Maybe Text) +inlineObject3CallbackL f InlineObject3{..} = (\inlineObject3Callback -> InlineObject3 { inlineObject3Callback, ..} ) <$> f inlineObject3Callback +{-# INLINE inlineObject3CallbackL #-} + + + +-- * InlineObject4 + +-- | 'inlineObject4Param' Lens +inlineObject4ParamL :: Lens_' InlineObject4 (Text) +inlineObject4ParamL f InlineObject4{..} = (\inlineObject4Param -> InlineObject4 { inlineObject4Param, ..} ) <$> f inlineObject4Param +{-# INLINE inlineObject4ParamL #-} + +-- | 'inlineObject4Param2' Lens +inlineObject4Param2L :: Lens_' InlineObject4 (Text) +inlineObject4Param2L f InlineObject4{..} = (\inlineObject4Param2 -> InlineObject4 { inlineObject4Param2, ..} ) <$> f inlineObject4Param2 +{-# INLINE inlineObject4Param2L #-} + + + +-- * InlineObject5 + +-- | 'inlineObject5AdditionalMetadata' Lens +inlineObject5AdditionalMetadataL :: Lens_' InlineObject5 (Maybe Text) +inlineObject5AdditionalMetadataL f InlineObject5{..} = (\inlineObject5AdditionalMetadata -> InlineObject5 { inlineObject5AdditionalMetadata, ..} ) <$> f inlineObject5AdditionalMetadata +{-# INLINE inlineObject5AdditionalMetadataL #-} + +-- | 'inlineObject5RequiredFile' Lens +inlineObject5RequiredFileL :: Lens_' InlineObject5 (FilePath) +inlineObject5RequiredFileL f InlineObject5{..} = (\inlineObject5RequiredFile -> InlineObject5 { inlineObject5RequiredFile, ..} ) <$> f inlineObject5RequiredFile +{-# INLINE inlineObject5RequiredFileL #-} + + + +-- * InlineResponseDefault + +-- | 'inlineResponseDefaultString' Lens +inlineResponseDefaultStringL :: Lens_' InlineResponseDefault (Maybe Foo) +inlineResponseDefaultStringL f InlineResponseDefault{..} = (\inlineResponseDefaultString -> InlineResponseDefault { inlineResponseDefaultString, ..} ) <$> f inlineResponseDefaultString +{-# INLINE inlineResponseDefaultStringL #-} + + + -- * MapTest -- | 'mapTestMapMapOfString' Lens @@ -602,6 +690,70 @@ name123numberL f Name{..} = (\name123number -> Name { name123number, ..} ) <$> f +-- * NullableClass + +-- | 'nullableClassIntegerProp' Lens +nullableClassIntegerPropL :: Lens_' NullableClass (Maybe Int) +nullableClassIntegerPropL f NullableClass{..} = (\nullableClassIntegerProp -> NullableClass { nullableClassIntegerProp, ..} ) <$> f nullableClassIntegerProp +{-# INLINE nullableClassIntegerPropL #-} + +-- | 'nullableClassNumberProp' Lens +nullableClassNumberPropL :: Lens_' NullableClass (Maybe Double) +nullableClassNumberPropL f NullableClass{..} = (\nullableClassNumberProp -> NullableClass { nullableClassNumberProp, ..} ) <$> f nullableClassNumberProp +{-# INLINE nullableClassNumberPropL #-} + +-- | 'nullableClassBooleanProp' Lens +nullableClassBooleanPropL :: Lens_' NullableClass (Maybe Bool) +nullableClassBooleanPropL f NullableClass{..} = (\nullableClassBooleanProp -> NullableClass { nullableClassBooleanProp, ..} ) <$> f nullableClassBooleanProp +{-# INLINE nullableClassBooleanPropL #-} + +-- | 'nullableClassStringProp' Lens +nullableClassStringPropL :: Lens_' NullableClass (Maybe Text) +nullableClassStringPropL f NullableClass{..} = (\nullableClassStringProp -> NullableClass { nullableClassStringProp, ..} ) <$> f nullableClassStringProp +{-# INLINE nullableClassStringPropL #-} + +-- | 'nullableClassDateProp' Lens +nullableClassDatePropL :: Lens_' NullableClass (Maybe Date) +nullableClassDatePropL f NullableClass{..} = (\nullableClassDateProp -> NullableClass { nullableClassDateProp, ..} ) <$> f nullableClassDateProp +{-# INLINE nullableClassDatePropL #-} + +-- | 'nullableClassDatetimeProp' Lens +nullableClassDatetimePropL :: Lens_' NullableClass (Maybe DateTime) +nullableClassDatetimePropL f NullableClass{..} = (\nullableClassDatetimeProp -> NullableClass { nullableClassDatetimeProp, ..} ) <$> f nullableClassDatetimeProp +{-# INLINE nullableClassDatetimePropL #-} + +-- | 'nullableClassArrayNullableProp' Lens +nullableClassArrayNullablePropL :: Lens_' NullableClass (Maybe [A.Value]) +nullableClassArrayNullablePropL f NullableClass{..} = (\nullableClassArrayNullableProp -> NullableClass { nullableClassArrayNullableProp, ..} ) <$> f nullableClassArrayNullableProp +{-# INLINE nullableClassArrayNullablePropL #-} + +-- | 'nullableClassArrayAndItemsNullableProp' Lens +nullableClassArrayAndItemsNullablePropL :: Lens_' NullableClass (Maybe [A.Value]) +nullableClassArrayAndItemsNullablePropL f NullableClass{..} = (\nullableClassArrayAndItemsNullableProp -> NullableClass { nullableClassArrayAndItemsNullableProp, ..} ) <$> f nullableClassArrayAndItemsNullableProp +{-# INLINE nullableClassArrayAndItemsNullablePropL #-} + +-- | 'nullableClassArrayItemsNullable' Lens +nullableClassArrayItemsNullableL :: Lens_' NullableClass (Maybe [A.Value]) +nullableClassArrayItemsNullableL f NullableClass{..} = (\nullableClassArrayItemsNullable -> NullableClass { nullableClassArrayItemsNullable, ..} ) <$> f nullableClassArrayItemsNullable +{-# INLINE nullableClassArrayItemsNullableL #-} + +-- | 'nullableClassObjectNullableProp' Lens +nullableClassObjectNullablePropL :: Lens_' NullableClass (Maybe (Map.Map String A.Value)) +nullableClassObjectNullablePropL f NullableClass{..} = (\nullableClassObjectNullableProp -> NullableClass { nullableClassObjectNullableProp, ..} ) <$> f nullableClassObjectNullableProp +{-# INLINE nullableClassObjectNullablePropL #-} + +-- | 'nullableClassObjectAndItemsNullableProp' Lens +nullableClassObjectAndItemsNullablePropL :: Lens_' NullableClass (Maybe (Map.Map String A.Value)) +nullableClassObjectAndItemsNullablePropL f NullableClass{..} = (\nullableClassObjectAndItemsNullableProp -> NullableClass { nullableClassObjectAndItemsNullableProp, ..} ) <$> f nullableClassObjectAndItemsNullableProp +{-# INLINE nullableClassObjectAndItemsNullablePropL #-} + +-- | 'nullableClassObjectItemsNullable' Lens +nullableClassObjectItemsNullableL :: Lens_' NullableClass (Maybe (Map.Map String A.Value)) +nullableClassObjectItemsNullableL f NullableClass{..} = (\nullableClassObjectItemsNullable -> NullableClass { nullableClassObjectItemsNullable, ..} ) <$> f nullableClassObjectItemsNullable +{-# INLINE nullableClassObjectItemsNullableL #-} + + + -- * NumberOnly -- | 'numberOnlyJustNumber' Lens @@ -668,6 +820,18 @@ outerCompositeMyBooleanL f OuterComposite{..} = (\outerCompositeMyBoolean -> Out +-- * OuterEnumDefaultValue + + + +-- * OuterEnumInteger + + + +-- * OuterEnumIntegerDefaultValue + + + -- * Pet -- | 'petId' Lens @@ -739,64 +903,6 @@ tagNameL f Tag{..} = (\tagName -> Tag { tagName, ..} ) <$> f tagName --- * TypeHolderDefault - --- | 'typeHolderDefaultStringItem' Lens -typeHolderDefaultStringItemL :: Lens_' TypeHolderDefault (Text) -typeHolderDefaultStringItemL f TypeHolderDefault{..} = (\typeHolderDefaultStringItem -> TypeHolderDefault { typeHolderDefaultStringItem, ..} ) <$> f typeHolderDefaultStringItem -{-# INLINE typeHolderDefaultStringItemL #-} - --- | 'typeHolderDefaultNumberItem' Lens -typeHolderDefaultNumberItemL :: Lens_' TypeHolderDefault (Double) -typeHolderDefaultNumberItemL f TypeHolderDefault{..} = (\typeHolderDefaultNumberItem -> TypeHolderDefault { typeHolderDefaultNumberItem, ..} ) <$> f typeHolderDefaultNumberItem -{-# INLINE typeHolderDefaultNumberItemL #-} - --- | 'typeHolderDefaultIntegerItem' Lens -typeHolderDefaultIntegerItemL :: Lens_' TypeHolderDefault (Int) -typeHolderDefaultIntegerItemL f TypeHolderDefault{..} = (\typeHolderDefaultIntegerItem -> TypeHolderDefault { typeHolderDefaultIntegerItem, ..} ) <$> f typeHolderDefaultIntegerItem -{-# INLINE typeHolderDefaultIntegerItemL #-} - --- | 'typeHolderDefaultBoolItem' Lens -typeHolderDefaultBoolItemL :: Lens_' TypeHolderDefault (Bool) -typeHolderDefaultBoolItemL f TypeHolderDefault{..} = (\typeHolderDefaultBoolItem -> TypeHolderDefault { typeHolderDefaultBoolItem, ..} ) <$> f typeHolderDefaultBoolItem -{-# INLINE typeHolderDefaultBoolItemL #-} - --- | 'typeHolderDefaultArrayItem' Lens -typeHolderDefaultArrayItemL :: Lens_' TypeHolderDefault ([Int]) -typeHolderDefaultArrayItemL f TypeHolderDefault{..} = (\typeHolderDefaultArrayItem -> TypeHolderDefault { typeHolderDefaultArrayItem, ..} ) <$> f typeHolderDefaultArrayItem -{-# INLINE typeHolderDefaultArrayItemL #-} - - - --- * TypeHolderExample - --- | 'typeHolderExampleStringItem' Lens -typeHolderExampleStringItemL :: Lens_' TypeHolderExample (Text) -typeHolderExampleStringItemL f TypeHolderExample{..} = (\typeHolderExampleStringItem -> TypeHolderExample { typeHolderExampleStringItem, ..} ) <$> f typeHolderExampleStringItem -{-# INLINE typeHolderExampleStringItemL #-} - --- | 'typeHolderExampleNumberItem' Lens -typeHolderExampleNumberItemL :: Lens_' TypeHolderExample (Double) -typeHolderExampleNumberItemL f TypeHolderExample{..} = (\typeHolderExampleNumberItem -> TypeHolderExample { typeHolderExampleNumberItem, ..} ) <$> f typeHolderExampleNumberItem -{-# INLINE typeHolderExampleNumberItemL #-} - --- | 'typeHolderExampleIntegerItem' Lens -typeHolderExampleIntegerItemL :: Lens_' TypeHolderExample (Int) -typeHolderExampleIntegerItemL f TypeHolderExample{..} = (\typeHolderExampleIntegerItem -> TypeHolderExample { typeHolderExampleIntegerItem, ..} ) <$> f typeHolderExampleIntegerItem -{-# INLINE typeHolderExampleIntegerItemL #-} - --- | 'typeHolderExampleBoolItem' Lens -typeHolderExampleBoolItemL :: Lens_' TypeHolderExample (Bool) -typeHolderExampleBoolItemL f TypeHolderExample{..} = (\typeHolderExampleBoolItem -> TypeHolderExample { typeHolderExampleBoolItem, ..} ) <$> f typeHolderExampleBoolItem -{-# INLINE typeHolderExampleBoolItemL #-} - --- | 'typeHolderExampleArrayItem' Lens -typeHolderExampleArrayItemL :: Lens_' TypeHolderExample ([Int]) -typeHolderExampleArrayItemL f TypeHolderExample{..} = (\typeHolderExampleArrayItem -> TypeHolderExample { typeHolderExampleArrayItem, ..} ) <$> f typeHolderExampleArrayItem -{-# INLINE typeHolderExampleArrayItemL #-} - - - -- * User -- | 'userId' Lens @@ -840,152 +946,3 @@ userUserStatusL f User{..} = (\userUserStatus -> User { userUserStatus, ..} ) <$ {-# INLINE userUserStatusL #-} - --- * XmlItem - --- | 'xmlItemAttributeString' Lens -xmlItemAttributeStringL :: Lens_' XmlItem (Maybe Text) -xmlItemAttributeStringL f XmlItem{..} = (\xmlItemAttributeString -> XmlItem { xmlItemAttributeString, ..} ) <$> f xmlItemAttributeString -{-# INLINE xmlItemAttributeStringL #-} - --- | 'xmlItemAttributeNumber' Lens -xmlItemAttributeNumberL :: Lens_' XmlItem (Maybe Double) -xmlItemAttributeNumberL f XmlItem{..} = (\xmlItemAttributeNumber -> XmlItem { xmlItemAttributeNumber, ..} ) <$> f xmlItemAttributeNumber -{-# INLINE xmlItemAttributeNumberL #-} - --- | 'xmlItemAttributeInteger' Lens -xmlItemAttributeIntegerL :: Lens_' XmlItem (Maybe Int) -xmlItemAttributeIntegerL f XmlItem{..} = (\xmlItemAttributeInteger -> XmlItem { xmlItemAttributeInteger, ..} ) <$> f xmlItemAttributeInteger -{-# INLINE xmlItemAttributeIntegerL #-} - --- | 'xmlItemAttributeBoolean' Lens -xmlItemAttributeBooleanL :: Lens_' XmlItem (Maybe Bool) -xmlItemAttributeBooleanL f XmlItem{..} = (\xmlItemAttributeBoolean -> XmlItem { xmlItemAttributeBoolean, ..} ) <$> f xmlItemAttributeBoolean -{-# INLINE xmlItemAttributeBooleanL #-} - --- | 'xmlItemWrappedArray' Lens -xmlItemWrappedArrayL :: Lens_' XmlItem (Maybe [Int]) -xmlItemWrappedArrayL f XmlItem{..} = (\xmlItemWrappedArray -> XmlItem { xmlItemWrappedArray, ..} ) <$> f xmlItemWrappedArray -{-# INLINE xmlItemWrappedArrayL #-} - --- | 'xmlItemNameString' Lens -xmlItemNameStringL :: Lens_' XmlItem (Maybe Text) -xmlItemNameStringL f XmlItem{..} = (\xmlItemNameString -> XmlItem { xmlItemNameString, ..} ) <$> f xmlItemNameString -{-# INLINE xmlItemNameStringL #-} - --- | 'xmlItemNameNumber' Lens -xmlItemNameNumberL :: Lens_' XmlItem (Maybe Double) -xmlItemNameNumberL f XmlItem{..} = (\xmlItemNameNumber -> XmlItem { xmlItemNameNumber, ..} ) <$> f xmlItemNameNumber -{-# INLINE xmlItemNameNumberL #-} - --- | 'xmlItemNameInteger' Lens -xmlItemNameIntegerL :: Lens_' XmlItem (Maybe Int) -xmlItemNameIntegerL f XmlItem{..} = (\xmlItemNameInteger -> XmlItem { xmlItemNameInteger, ..} ) <$> f xmlItemNameInteger -{-# INLINE xmlItemNameIntegerL #-} - --- | 'xmlItemNameBoolean' Lens -xmlItemNameBooleanL :: Lens_' XmlItem (Maybe Bool) -xmlItemNameBooleanL f XmlItem{..} = (\xmlItemNameBoolean -> XmlItem { xmlItemNameBoolean, ..} ) <$> f xmlItemNameBoolean -{-# INLINE xmlItemNameBooleanL #-} - --- | 'xmlItemNameArray' Lens -xmlItemNameArrayL :: Lens_' XmlItem (Maybe [Int]) -xmlItemNameArrayL f XmlItem{..} = (\xmlItemNameArray -> XmlItem { xmlItemNameArray, ..} ) <$> f xmlItemNameArray -{-# INLINE xmlItemNameArrayL #-} - --- | 'xmlItemNameWrappedArray' Lens -xmlItemNameWrappedArrayL :: Lens_' XmlItem (Maybe [Int]) -xmlItemNameWrappedArrayL f XmlItem{..} = (\xmlItemNameWrappedArray -> XmlItem { xmlItemNameWrappedArray, ..} ) <$> f xmlItemNameWrappedArray -{-# INLINE xmlItemNameWrappedArrayL #-} - --- | 'xmlItemPrefixString' Lens -xmlItemPrefixStringL :: Lens_' XmlItem (Maybe Text) -xmlItemPrefixStringL f XmlItem{..} = (\xmlItemPrefixString -> XmlItem { xmlItemPrefixString, ..} ) <$> f xmlItemPrefixString -{-# INLINE xmlItemPrefixStringL #-} - --- | 'xmlItemPrefixNumber' Lens -xmlItemPrefixNumberL :: Lens_' XmlItem (Maybe Double) -xmlItemPrefixNumberL f XmlItem{..} = (\xmlItemPrefixNumber -> XmlItem { xmlItemPrefixNumber, ..} ) <$> f xmlItemPrefixNumber -{-# INLINE xmlItemPrefixNumberL #-} - --- | 'xmlItemPrefixInteger' Lens -xmlItemPrefixIntegerL :: Lens_' XmlItem (Maybe Int) -xmlItemPrefixIntegerL f XmlItem{..} = (\xmlItemPrefixInteger -> XmlItem { xmlItemPrefixInteger, ..} ) <$> f xmlItemPrefixInteger -{-# INLINE xmlItemPrefixIntegerL #-} - --- | 'xmlItemPrefixBoolean' Lens -xmlItemPrefixBooleanL :: Lens_' XmlItem (Maybe Bool) -xmlItemPrefixBooleanL f XmlItem{..} = (\xmlItemPrefixBoolean -> XmlItem { xmlItemPrefixBoolean, ..} ) <$> f xmlItemPrefixBoolean -{-# INLINE xmlItemPrefixBooleanL #-} - --- | 'xmlItemPrefixArray' Lens -xmlItemPrefixArrayL :: Lens_' XmlItem (Maybe [Int]) -xmlItemPrefixArrayL f XmlItem{..} = (\xmlItemPrefixArray -> XmlItem { xmlItemPrefixArray, ..} ) <$> f xmlItemPrefixArray -{-# INLINE xmlItemPrefixArrayL #-} - --- | 'xmlItemPrefixWrappedArray' Lens -xmlItemPrefixWrappedArrayL :: Lens_' XmlItem (Maybe [Int]) -xmlItemPrefixWrappedArrayL f XmlItem{..} = (\xmlItemPrefixWrappedArray -> XmlItem { xmlItemPrefixWrappedArray, ..} ) <$> f xmlItemPrefixWrappedArray -{-# INLINE xmlItemPrefixWrappedArrayL #-} - --- | 'xmlItemNamespaceString' Lens -xmlItemNamespaceStringL :: Lens_' XmlItem (Maybe Text) -xmlItemNamespaceStringL f XmlItem{..} = (\xmlItemNamespaceString -> XmlItem { xmlItemNamespaceString, ..} ) <$> f xmlItemNamespaceString -{-# INLINE xmlItemNamespaceStringL #-} - --- | 'xmlItemNamespaceNumber' Lens -xmlItemNamespaceNumberL :: Lens_' XmlItem (Maybe Double) -xmlItemNamespaceNumberL f XmlItem{..} = (\xmlItemNamespaceNumber -> XmlItem { xmlItemNamespaceNumber, ..} ) <$> f xmlItemNamespaceNumber -{-# INLINE xmlItemNamespaceNumberL #-} - --- | 'xmlItemNamespaceInteger' Lens -xmlItemNamespaceIntegerL :: Lens_' XmlItem (Maybe Int) -xmlItemNamespaceIntegerL f XmlItem{..} = (\xmlItemNamespaceInteger -> XmlItem { xmlItemNamespaceInteger, ..} ) <$> f xmlItemNamespaceInteger -{-# INLINE xmlItemNamespaceIntegerL #-} - --- | 'xmlItemNamespaceBoolean' Lens -xmlItemNamespaceBooleanL :: Lens_' XmlItem (Maybe Bool) -xmlItemNamespaceBooleanL f XmlItem{..} = (\xmlItemNamespaceBoolean -> XmlItem { xmlItemNamespaceBoolean, ..} ) <$> f xmlItemNamespaceBoolean -{-# INLINE xmlItemNamespaceBooleanL #-} - --- | 'xmlItemNamespaceArray' Lens -xmlItemNamespaceArrayL :: Lens_' XmlItem (Maybe [Int]) -xmlItemNamespaceArrayL f XmlItem{..} = (\xmlItemNamespaceArray -> XmlItem { xmlItemNamespaceArray, ..} ) <$> f xmlItemNamespaceArray -{-# INLINE xmlItemNamespaceArrayL #-} - --- | 'xmlItemNamespaceWrappedArray' Lens -xmlItemNamespaceWrappedArrayL :: Lens_' XmlItem (Maybe [Int]) -xmlItemNamespaceWrappedArrayL f XmlItem{..} = (\xmlItemNamespaceWrappedArray -> XmlItem { xmlItemNamespaceWrappedArray, ..} ) <$> f xmlItemNamespaceWrappedArray -{-# INLINE xmlItemNamespaceWrappedArrayL #-} - --- | 'xmlItemPrefixNsString' Lens -xmlItemPrefixNsStringL :: Lens_' XmlItem (Maybe Text) -xmlItemPrefixNsStringL f XmlItem{..} = (\xmlItemPrefixNsString -> XmlItem { xmlItemPrefixNsString, ..} ) <$> f xmlItemPrefixNsString -{-# INLINE xmlItemPrefixNsStringL #-} - --- | 'xmlItemPrefixNsNumber' Lens -xmlItemPrefixNsNumberL :: Lens_' XmlItem (Maybe Double) -xmlItemPrefixNsNumberL f XmlItem{..} = (\xmlItemPrefixNsNumber -> XmlItem { xmlItemPrefixNsNumber, ..} ) <$> f xmlItemPrefixNsNumber -{-# INLINE xmlItemPrefixNsNumberL #-} - --- | 'xmlItemPrefixNsInteger' Lens -xmlItemPrefixNsIntegerL :: Lens_' XmlItem (Maybe Int) -xmlItemPrefixNsIntegerL f XmlItem{..} = (\xmlItemPrefixNsInteger -> XmlItem { xmlItemPrefixNsInteger, ..} ) <$> f xmlItemPrefixNsInteger -{-# INLINE xmlItemPrefixNsIntegerL #-} - --- | 'xmlItemPrefixNsBoolean' Lens -xmlItemPrefixNsBooleanL :: Lens_' XmlItem (Maybe Bool) -xmlItemPrefixNsBooleanL f XmlItem{..} = (\xmlItemPrefixNsBoolean -> XmlItem { xmlItemPrefixNsBoolean, ..} ) <$> f xmlItemPrefixNsBoolean -{-# INLINE xmlItemPrefixNsBooleanL #-} - --- | 'xmlItemPrefixNsArray' Lens -xmlItemPrefixNsArrayL :: Lens_' XmlItem (Maybe [Int]) -xmlItemPrefixNsArrayL f XmlItem{..} = (\xmlItemPrefixNsArray -> XmlItem { xmlItemPrefixNsArray, ..} ) <$> f xmlItemPrefixNsArray -{-# INLINE xmlItemPrefixNsArrayL #-} - --- | 'xmlItemPrefixNsWrappedArray' Lens -xmlItemPrefixNsWrappedArrayL :: Lens_' XmlItem (Maybe [Int]) -xmlItemPrefixNsWrappedArrayL f XmlItem{..} = (\xmlItemPrefixNsWrappedArray -> XmlItem { xmlItemPrefixNsWrappedArray, ..} ) <$> f xmlItemPrefixNsWrappedArray -{-# INLINE xmlItemPrefixNsWrappedArrayL #-} - - diff --git a/samples/client/petstore/haskell-http-client/openapi-petstore.cabal b/samples/client/petstore/haskell-http-client/openapi-petstore.cabal index dc5fae3a2894..3a57d2e3b9b2 100644 --- a/samples/client/petstore/haskell-http-client/openapi-petstore.cabal +++ b/samples/client/petstore/haskell-http-client/openapi-petstore.cabal @@ -10,7 +10,7 @@ description: . . OpenAPI Petstore API version: 1.0.0 . - OpenAPI version: 3.0.1 + OpenAPI version: 3.0.0 . category: Web homepage: https://openapi-generator.tech @@ -65,6 +65,7 @@ library OpenAPIPetstore OpenAPIPetstore.API OpenAPIPetstore.API.AnotherFake + OpenAPIPetstore.API.ApiDefault OpenAPIPetstore.API.Fake OpenAPIPetstore.API.FakeClassnameTags123 OpenAPIPetstore.API.Pet diff --git a/samples/client/petstore/haskell-http-client/openapi.yaml b/samples/client/petstore/haskell-http-client/openapi.yaml index 5a020a1d0ab8..95b487afebfc 100644 --- a/samples/client/petstore/haskell-http-client/openapi.yaml +++ b/samples/client/petstore/haskell-http-client/openapi.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: 3.0.0 info: description: 'This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: @@ -9,7 +9,28 @@ info: title: OpenAPI Petstore version: 1.0.0 servers: -- url: http://petstore.swagger.io:80/v2 +- description: petstore server + url: http://{server}.swagger.io:{port}/v2 + variables: + server: + default: petstore + enum: + - petstore + - qa-petstore + - dev-petstore + port: + default: "80" + enum: + - "80" + - "8080" +- description: The local server + url: https://localhost:8080/{version} + variables: + version: + default: v2 + enum: + - v1 + - v2 tags: - description: Everything about your Pets name: pet @@ -18,25 +39,22 @@ tags: - description: Operations about user name: user paths: + /foo: + get: + responses: + default: + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_default' + description: response /pet: post: operationId: addPet requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - description: Pet object that needs to be added to the store - required: true + $ref: '#/components/requestBodies/Pet' responses: - 200: - content: {} - description: successful operation 405: - content: {} description: Invalid input security: - petstore_auth: @@ -45,31 +63,16 @@ paths: summary: Add a new pet to the store tags: - pet - x-codegen-request-body-name: body put: operationId: updatePet requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - description: Pet object that needs to be added to the store - required: true + $ref: '#/components/requestBodies/Pet' responses: - 200: - content: {} - description: successful operation 400: - content: {} description: Invalid ID supplied 404: - content: {} description: Pet not found 405: - content: {} description: Validation exception security: - petstore_auth: @@ -78,7 +81,9 @@ paths: summary: Update an existing pet tags: - pet - x-codegen-request-body-name: body + servers: + - url: http://petstore.swagger.io/v2 + - url: http://path-server-test.petstore.local/v2 /pet/findByStatus: get: description: Multiple status values can be provided with comma separated strings @@ -114,7 +119,6 @@ paths: type: array description: successful operation 400: - content: {} description: Invalid status value security: - petstore_auth: @@ -155,7 +159,6 @@ paths: type: array description: successful operation 400: - content: {} description: Invalid tag value security: - petstore_auth: @@ -168,23 +171,24 @@ paths: delete: operationId: deletePet parameters: - - in: header + - explode: false + in: header name: api_key + required: false schema: type: string + style: simple - description: Pet id to delete + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: - 200: - content: {} - description: successful operation 400: - content: {} description: Invalid pet value security: - petstore_auth: @@ -198,12 +202,14 @@ paths: operationId: getPetById parameters: - description: ID of pet to return + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: 200: content: @@ -215,10 +221,8 @@ paths: $ref: '#/components/schemas/Pet' description: successful operation 400: - content: {} description: Invalid ID supplied 404: - content: {} description: Pet not found security: - api_key: [] @@ -229,13 +233,16 @@ paths: operationId: updatePetWithForm parameters: - description: ID of pet that needs to be updated + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: + $ref: '#/components/requestBodies/inline_object' content: application/x-www-form-urlencoded: schema: @@ -246,9 +253,9 @@ paths: status: description: Updated status of the pet type: string + type: object responses: 405: - content: {} description: Invalid input security: - petstore_auth: @@ -262,13 +269,16 @@ paths: operationId: uploadFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: + $ref: '#/components/requestBodies/inline_object_1' content: multipart/form-data: schema: @@ -280,6 +290,7 @@ paths: description: file to upload format: binary type: string + type: object responses: 200: content: @@ -318,7 +329,7 @@ paths: operationId: placeOrder requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/Order' description: order placed for purchasing the pet @@ -334,12 +345,10 @@ paths: $ref: '#/components/schemas/Order' description: successful operation 400: - content: {} description: Invalid Order summary: Place an order for a pet tags: - store - x-codegen-request-body-name: body /store/order/{order_id}: delete: description: For valid response try integer IDs with value < 1000. Anything @@ -347,17 +356,17 @@ paths: operationId: deleteOrder parameters: - description: ID of the order that needs to be deleted + explode: false in: path name: order_id required: true schema: type: string + style: simple responses: 400: - content: {} description: Invalid ID supplied 404: - content: {} description: Order not found summary: Delete purchase order by ID tags: @@ -368,6 +377,7 @@ paths: operationId: getOrderById parameters: - description: ID of pet that needs to be fetched + explode: false in: path name: order_id required: true @@ -376,6 +386,7 @@ paths: maximum: 5 minimum: 1 type: integer + style: simple responses: 200: content: @@ -387,10 +398,8 @@ paths: $ref: '#/components/schemas/Order' description: successful operation 400: - content: {} description: Invalid ID supplied 404: - content: {} description: Order not found summary: Find purchase order by ID tags: @@ -401,75 +410,59 @@ paths: operationId: createUser requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' description: Created user object required: true responses: default: - content: {} description: successful operation summary: Create user tags: - user - x-codegen-request-body-name: body /user/createWithArray: post: operationId: createUsersWithArrayInput requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true + $ref: '#/components/requestBodies/UserArray' responses: default: - content: {} description: successful operation summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body /user/createWithList: post: operationId: createUsersWithListInput requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true + $ref: '#/components/requestBodies/UserArray' responses: default: - content: {} description: successful operation summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body /user/login: get: operationId: loginUser parameters: - description: The user name for login + explode: true in: query name: username required: true schema: type: string + style: form - description: The password for login in clear text + explode: true in: query name: password required: true schema: type: string + style: form responses: 200: content: @@ -483,16 +476,19 @@ paths: headers: X-Rate-Limit: description: calls per hour allowed by the user + explode: false schema: format: int32 type: integer + style: simple X-Expires-After: description: date in UTC when token expires + explode: false schema: format: date-time type: string + style: simple 400: - content: {} description: Invalid username/password supplied summary: Logs user into the system tags: @@ -502,7 +498,6 @@ paths: operationId: logoutUser responses: default: - content: {} description: successful operation summary: Logs out current logged in user session tags: @@ -513,17 +508,17 @@ paths: operationId: deleteUser parameters: - description: The name that needs to be deleted + explode: false in: path name: username required: true schema: type: string + style: simple responses: 400: - content: {} description: Invalid username supplied 404: - content: {} description: User not found summary: Delete user tags: @@ -532,11 +527,13 @@ paths: operationId: getUserByName parameters: - description: The name that needs to be fetched. Use user1 for testing. + explode: false in: path name: username required: true schema: type: string + style: simple responses: 200: content: @@ -548,10 +545,8 @@ paths: $ref: '#/components/schemas/User' description: successful operation 400: - content: {} description: Invalid username supplied 404: - content: {} description: User not found summary: Get user by user name tags: @@ -561,40 +556,34 @@ paths: operationId: updateUser parameters: - description: name that need to be deleted + explode: false in: path name: username required: true schema: type: string + style: simple requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' description: Updated user object required: true responses: 400: - content: {} description: Invalid user supplied 404: - content: {} description: User not found summary: Updated user tags: - user - x-codegen-request-body-name: body /fake_classname_test: patch: description: To test class name in snake case operationId: testClassname requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: 200: content: @@ -607,51 +596,66 @@ paths: summary: To test class name in snake case tags: - fake_classname_tags 123#$%^ - x-codegen-request-body-name: body /fake: delete: description: Fake endpoint to test group parameters (optional) operationId: testGroupParameters parameters: - description: Required String in group parameters + explode: true in: query name: required_string_group required: true schema: type: integer + style: form - description: Required Boolean in group parameters + explode: false in: header name: required_boolean_group required: true schema: type: boolean + style: simple - description: Required Integer in group parameters + explode: true in: query name: required_int64_group required: true schema: format: int64 type: integer + style: form - description: String in group parameters + explode: true in: query name: string_group + required: false schema: type: integer + style: form - description: Boolean in group parameters + explode: false in: header name: boolean_group + required: false schema: type: boolean + style: simple - description: Integer in group parameters + explode: true in: query name: int64_group + required: false schema: format: int64 type: integer + style: form responses: 400: - content: {} description: Someting wrong + security: + - bearer_test: [] summary: Fake endpoint to test group parameters (optional) tags: - fake @@ -664,6 +668,7 @@ paths: explode: false in: header name: enum_header_string_array + required: false schema: items: default: $ @@ -674,8 +679,10 @@ paths: type: array style: simple - description: Header parameter enum test (string) + explode: false in: header name: enum_header_string + required: false schema: default: -efg enum: @@ -683,10 +690,12 @@ paths: - -efg - (xyz) type: string + style: simple - description: Query parameter enum test (string array) - explode: false + explode: true in: query name: enum_query_string_array + required: false schema: items: default: $ @@ -697,8 +706,10 @@ paths: type: array style: form - description: Query parameter enum test (string) + explode: true in: query name: enum_query_string + required: false schema: default: -efg enum: @@ -706,25 +717,33 @@ paths: - -efg - (xyz) type: string + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_integer + required: false schema: enum: - 1 - -2 format: int32 type: integer + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_double + required: false schema: enum: - 1.1 - -1.2 format: double type: number + style: form requestBody: + $ref: '#/components/requestBodies/inline_object_2' content: application/x-www-form-urlencoded: schema: @@ -746,12 +765,11 @@ paths: - -efg - (xyz) type: string + type: object responses: 400: - content: {} description: Invalid request 404: - content: {} description: Not found summary: To test enum parameters tags: @@ -760,12 +778,7 @@ paths: description: To test "client" model operationId: testClientModel requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: 200: content: @@ -776,7 +789,6 @@ paths: summary: To test "client" model tags: - fake - x-codegen-request-body-name: body post: description: | Fake endpoint for testing various parameters @@ -785,6 +797,7 @@ paths: 가짜 엔드 포인트 operationId: testEndpointParameters requestBody: + $ref: '#/components/requestBodies/inline_object_3' content: application/x-www-form-urlencoded: schema: @@ -858,13 +871,11 @@ paths: - double - number - pattern_without_delimiter - required: true + type: object responses: 400: - content: {} description: Invalid username supplied 404: - content: {} description: User not found security: - http_basic_test: [] @@ -881,11 +892,10 @@ paths: operationId: fakeOuterNumberSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterNumber' description: Input number as post body - required: false responses: 200: content: @@ -895,18 +905,16 @@ paths: description: Output number tags: - fake - x-codegen-request-body-name: body /fake/outer/string: post: description: Test serialization of outer string types operationId: fakeOuterStringSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterString' description: Input string as post body - required: false responses: 200: content: @@ -916,18 +924,16 @@ paths: description: Output string tags: - fake - x-codegen-request-body-name: body /fake/outer/boolean: post: description: Test serialization of outer boolean types operationId: fakeOuterBooleanSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterBoolean' description: Input boolean as post body - required: false responses: 200: content: @@ -937,18 +943,16 @@ paths: description: Output boolean tags: - fake - x-codegen-request-body-name: body /fake/outer/composite: post: description: Test serialization of object with outer number type operationId: fakeOuterCompositeSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterComposite' description: Input composite as post body - required: false responses: 200: content: @@ -958,11 +962,11 @@ paths: description: Output composite tags: - fake - x-codegen-request-body-name: body /fake/jsonFormData: get: operationId: testJsonFormData requestBody: + $ref: '#/components/requestBodies/inline_object_4' content: application/x-www-form-urlencoded: schema: @@ -976,10 +980,9 @@ paths: required: - param - param2 - required: true + type: object responses: 200: - content: {} description: successful operation summary: test json serialization of form data tags: @@ -998,21 +1001,21 @@ paths: required: true responses: 200: - content: {} description: successful operation summary: test inline additionalProperties tags: - fake - x-codegen-request-body-name: param /fake/body-with-query-params: put: operationId: testBodyWithQueryParams parameters: - - in: query + - explode: true + in: query name: query required: true schema: type: string + style: form requestBody: content: application/json: @@ -1021,56 +1024,15 @@ paths: required: true responses: 200: - content: {} description: Success tags: - fake - x-codegen-request-body-name: body - /fake/create_xml_item: - post: - description: this route creates an XmlItem - operationId: createXmlItem - requestBody: - content: - application/xml: - schema: - $ref: '#/components/schemas/XmlItem' - application/xml; charset=utf-8: - schema: - $ref: '#/components/schemas/XmlItem' - application/xml; charset=utf-16: - schema: - $ref: '#/components/schemas/XmlItem' - text/xml: - schema: - $ref: '#/components/schemas/XmlItem' - text/xml; charset=utf-8: - schema: - $ref: '#/components/schemas/XmlItem' - text/xml; charset=utf-16: - schema: - $ref: '#/components/schemas/XmlItem' - description: XmlItem Body - required: true - responses: - 200: - content: {} - description: successful operation - summary: creates an XmlItem - tags: - - fake - x-codegen-request-body-name: XmlItem /another-fake/dummy: patch: description: To test special tags and operation ID starting with number operationId: 123_test_@#$%_special_tags requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: 200: content: @@ -1081,7 +1043,6 @@ paths: summary: To test special tags tags: - $another-fake? - x-codegen-request-body-name: body /fake/body-with-file-schema: put: description: For this test, the body for this request much reference a schema @@ -1095,23 +1056,24 @@ paths: required: true responses: 200: - content: {} description: Success tags: - fake - x-codegen-request-body-name: body /fake/{petId}/uploadImageWithRequiredFile: post: operationId: uploadFileWithRequiredFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: + $ref: '#/components/requestBodies/inline_object_5' content: multipart/form-data: schema: @@ -1125,7 +1087,7 @@ paths: type: string required: - requiredFile - required: true + type: object responses: 200: content: @@ -1140,8 +1102,88 @@ paths: summary: uploads an image (required) tags: - pet + /fake/health: + get: + responses: + 200: + content: + application/json: + schema: + $ref: '#/components/schemas/HealthCheckResult' + description: The instance started successfully + summary: Health check endpoint + tags: + - fake components: + requestBodies: + UserArray: + content: + application/json: + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + Client: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + inline_object: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/inline_object' + inline_object_1: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/inline_object_1' + inline_object_2: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/inline_object_2' + inline_object_3: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/inline_object_3' + inline_object_4: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/inline_object_4' + inline_object_5: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/inline_object_5' schemas: + Foo: + example: + bar: bar + properties: + bar: + default: bar + type: string + type: object + Bar: + default: bar + type: string Order: example: petId: 6 @@ -1306,21 +1348,12 @@ components: message: type: string type: object - $special[model.name]: - properties: - $special[property.name]: - format: int64 - type: integer - type: object - xml: - name: $special[model.name] Return: description: Model for testing reserved words properties: return: format: int32 type: integer - type: object xml: name: Return Name: @@ -1340,7 +1373,6 @@ components: type: integer required: - name - type: object xml: name: Name 200_response: @@ -1351,7 +1383,6 @@ components: type: integer class: type: string - type: object xml: name: Name ClassModel: @@ -1359,7 +1390,6 @@ components: properties: _class: type: string - type: object Dog: allOf: - $ref: '#/components/schemas/Animal' @@ -1387,13 +1417,13 @@ components: format_test: properties: integer: - maximum: 1E+2 - minimum: 1E+1 + maximum: 100 + minimum: 10 type: integer int32: format: int32 - maximum: 2E+2 - minimum: 2E+1 + maximum: 200 + minimum: 20 type: integer int64: format: int64 @@ -1417,7 +1447,6 @@ components: type: string byte: format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ type: string binary: format: binary @@ -1437,6 +1466,15 @@ components: maxLength: 64 minLength: 10 type: string + pattern_with_digits: + description: A string that is a 10 digit number. Can have leading zeros. + pattern: ^\d{10}$ + type: string + pattern_with_digits_and_delimiter: + description: A string starting with 'image_' (case insensitive) and one + to three digits following i.e. Image_01. + pattern: /^image_\d{1,3}$/i + type: string required: - byte - date @@ -1478,117 +1516,27 @@ components: type: number outerEnum: $ref: '#/components/schemas/OuterEnum' + outerEnumInteger: + $ref: '#/components/schemas/OuterEnumInteger' + outerEnumDefaultValue: + $ref: '#/components/schemas/OuterEnumDefaultValue' + outerEnumIntegerDefaultValue: + $ref: '#/components/schemas/OuterEnumIntegerDefaultValue' required: - enum_string_required type: object AdditionalPropertiesClass: properties: - map_string: + map_property: additionalProperties: type: string type: object - map_number: - additionalProperties: - type: number - type: object - map_integer: - additionalProperties: - type: integer - type: object - map_boolean: - additionalProperties: - type: boolean - type: object - map_array_integer: - additionalProperties: - items: - type: integer - type: array - type: object - map_array_anytype: - additionalProperties: - items: - properties: {} - type: object - type: array - type: object - map_map_string: + map_of_map_property: additionalProperties: additionalProperties: type: string type: object type: object - map_map_anytype: - additionalProperties: - additionalProperties: - properties: {} - type: object - type: object - type: object - anytype_1: - properties: {} - type: object - anytype_2: - type: object - anytype_3: - properties: {} - type: object - type: object - AdditionalPropertiesString: - additionalProperties: - type: string - properties: - name: - type: string - type: object - AdditionalPropertiesInteger: - additionalProperties: - type: integer - properties: - name: - type: string - type: object - AdditionalPropertiesNumber: - additionalProperties: - type: number - properties: - name: - type: string - type: object - AdditionalPropertiesBoolean: - additionalProperties: - type: boolean - properties: - name: - type: string - type: object - AdditionalPropertiesArray: - additionalProperties: - items: - properties: {} - type: object - type: array - properties: - name: - type: string - type: object - AdditionalPropertiesObject: - additionalProperties: - additionalProperties: - properties: {} - type: object - type: object - properties: - name: - type: string - type: object - AdditionalPropertiesAnyType: - additionalProperties: - properties: {} - type: object - properties: - name: - type: string type: object MixedPropertiesAndAdditionalPropertiesClass: properties: @@ -1730,11 +1678,32 @@ components: type: array type: object OuterEnum: + enum: + - placed + - approved + - delivered + nullable: true + type: string + OuterEnumInteger: + enum: + - 0 + - 1 + - 2 + type: integer + OuterEnumDefaultValue: + default: placed enum: - placed - approved - delivered type: string + OuterEnumIntegerDefaultValue: + default: 0 + enum: + - 0 + - 1 + - 2 + type: integer OuterComposite: example: my_string: my_string @@ -1784,238 +1753,223 @@ components: description: Test capitalization type: string type: object - TypeHolderDefault: + _special_model.name_: properties: - string_item: - default: what - type: string - number_item: - type: number - integer_item: + $special[property.name]: + format: int64 type: integer - bool_item: - default: true - type: boolean - array_item: - items: - type: integer - type: array - required: - - array_item - - bool_item - - integer_item - - number_item - - string_item - type: object - TypeHolderExample: + xml: + name: $special[model.name] + HealthCheckResult: + description: Just a string to inform instance is up and running. Make it nullable + in hope to get it as pointer in generated model. + example: + NullableMessage: NullableMessage properties: - string_item: - example: what + NullableMessage: + nullable: true type: string - number_item: - example: 1.234 - type: number - integer_item: - example: -2 - type: integer - bool_item: - example: true - type: boolean - array_item: - example: - - 0 - - 1 - - 2 - - 3 - items: - type: integer - type: array - required: - - array_item - - bool_item - - integer_item - - number_item - - string_item type: object - XmlItem: + NullableClass: + additionalProperties: + nullable: true + type: object properties: - attribute_string: - example: string - type: string - xml: - attribute: true - attribute_number: - example: 1.234 - type: number - xml: - attribute: true - attribute_integer: - example: -2 + integer_prop: + nullable: true type: integer - xml: - attribute: true - attribute_boolean: - example: true - type: boolean - xml: - attribute: true - wrapped_array: - items: - type: integer - type: array - xml: - wrapped: true - name_string: - example: string - type: string - xml: - name: xml_name_string - name_number: - example: 1.234 + number_prop: + nullable: true type: number - xml: - name: xml_name_number - name_integer: - example: -2 - type: integer - xml: - name: xml_name_integer - name_boolean: - example: true + boolean_prop: + nullable: true type: boolean - xml: - name: xml_name_boolean - name_array: - items: - type: integer - xml: - name: xml_name_array_item - type: array - name_wrapped_array: - items: - type: integer - xml: - name: xml_name_wrapped_array_item - type: array - xml: - name: xml_name_wrapped_array - wrapped: true - prefix_string: - example: string + string_prop: + nullable: true type: string - xml: - prefix: ab - prefix_number: - example: 1.234 - type: number - xml: - prefix: cd - prefix_integer: - example: -2 - type: integer - xml: - prefix: ef - prefix_boolean: - example: true - type: boolean - xml: - prefix: gh - prefix_array: + date_prop: + format: date + nullable: true + type: string + datetime_prop: + format: date-time + nullable: true + type: string + array_nullable_prop: items: - type: integer - xml: - prefix: ij + type: object + nullable: true type: array - prefix_wrapped_array: + array_and_items_nullable_prop: items: - type: integer - xml: - prefix: mn + nullable: true + type: object + nullable: true type: array - xml: - prefix: kl - wrapped: true - namespace_string: - example: string - type: string - xml: - namespace: http://a.com/schema - namespace_number: - example: 1.234 - type: number - xml: - namespace: http://b.com/schema - namespace_integer: - example: -2 - type: integer - xml: - namespace: http://c.com/schema - namespace_boolean: - example: true - type: boolean - xml: - namespace: http://d.com/schema - namespace_array: + array_items_nullable: items: - type: integer - xml: - namespace: http://e.com/schema + nullable: true + type: object type: array - namespace_wrapped_array: + object_nullable_prop: + additionalProperties: + type: object + nullable: true + type: object + object_and_items_nullable_prop: + additionalProperties: + nullable: true + type: object + nullable: true + type: object + object_items_nullable: + additionalProperties: + nullable: true + type: object + type: object + type: object + inline_response_default: + example: + string: + bar: bar + properties: + string: + $ref: '#/components/schemas/Foo' + inline_object: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + type: object + inline_object_1: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + type: object + inline_object_2: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) items: - type: integer - xml: - namespace: http://g.com/schema + default: $ + enum: + - '>' + - $ + type: string type: array - xml: - namespace: http://f.com/schema - wrapped: true - prefix_ns_string: - example: string + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) type: string - xml: - namespace: http://a.com/schema - prefix: a - prefix_ns_number: - example: 1.234 - type: number - xml: - namespace: http://b.com/schema - prefix: b - prefix_ns_integer: - example: -2 + type: object + inline_object_3: + properties: + integer: + description: None + maximum: 100 + minimum: 10 type: integer - xml: - namespace: http://c.com/schema - prefix: c - prefix_ns_boolean: - example: true - type: boolean - xml: - namespace: http://d.com/schema - prefix: d - prefix_ns_array: - items: - type: integer - xml: - namespace: http://e.com/schema - prefix: e - type: array - prefix_ns_wrapped_array: - items: - type: integer - xml: - namespace: http://g.com/schema - prefix: g - type: array - xml: - namespace: http://f.com/schema - prefix: f - wrapped: true + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: /[a-z]/i + type: string + pattern_without_delimiter: + description: None + pattern: ^[A-Z].* + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + type: object + inline_object_4: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + type: object + inline_object_5: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile type: object - xml: - namespace: http://a.com/schema - prefix: pre Dog_allOf: properties: breed: @@ -2044,3 +1998,7 @@ components: http_basic_test: scheme: basic type: http + bearer_test: + bearerFormat: JWT + scheme: bearer + type: http diff --git a/samples/client/petstore/haskell-http-client/tests/Instances.hs b/samples/client/petstore/haskell-http-client/tests/Instances.hs index 8926e3e4ed71..cf1548420eec 100644 --- a/samples/client/petstore/haskell-http-client/tests/Instances.hs +++ b/samples/client/petstore/haskell-http-client/tests/Instances.hs @@ -104,79 +104,14 @@ arbitraryReducedMaybeValue n = do -- * Models -instance Arbitrary AdditionalPropertiesAnyType where - arbitrary = sized genAdditionalPropertiesAnyType - -genAdditionalPropertiesAnyType :: Int -> Gen AdditionalPropertiesAnyType -genAdditionalPropertiesAnyType n = - AdditionalPropertiesAnyType - <$> arbitraryReducedMaybe n -- additionalPropertiesAnyTypeName :: Maybe Text - -instance Arbitrary AdditionalPropertiesArray where - arbitrary = sized genAdditionalPropertiesArray - -genAdditionalPropertiesArray :: Int -> Gen AdditionalPropertiesArray -genAdditionalPropertiesArray n = - AdditionalPropertiesArray - <$> arbitraryReducedMaybe n -- additionalPropertiesArrayName :: Maybe Text - -instance Arbitrary AdditionalPropertiesBoolean where - arbitrary = sized genAdditionalPropertiesBoolean - -genAdditionalPropertiesBoolean :: Int -> Gen AdditionalPropertiesBoolean -genAdditionalPropertiesBoolean n = - AdditionalPropertiesBoolean - <$> arbitraryReducedMaybe n -- additionalPropertiesBooleanName :: Maybe Text - instance Arbitrary AdditionalPropertiesClass where arbitrary = sized genAdditionalPropertiesClass genAdditionalPropertiesClass :: Int -> Gen AdditionalPropertiesClass genAdditionalPropertiesClass n = AdditionalPropertiesClass - <$> arbitraryReducedMaybe n -- additionalPropertiesClassMapString :: Maybe (Map.Map String Text) - <*> arbitraryReducedMaybe n -- additionalPropertiesClassMapNumber :: Maybe (Map.Map String Double) - <*> arbitraryReducedMaybe n -- additionalPropertiesClassMapInteger :: Maybe (Map.Map String Int) - <*> arbitraryReducedMaybe n -- additionalPropertiesClassMapBoolean :: Maybe (Map.Map String Bool) - <*> arbitraryReducedMaybe n -- additionalPropertiesClassMapArrayInteger :: Maybe (Map.Map String [Int]) - <*> arbitraryReducedMaybe n -- additionalPropertiesClassMapArrayAnytype :: Maybe (Map.Map String [A.Value]) - <*> arbitraryReducedMaybe n -- additionalPropertiesClassMapMapString :: Maybe (Map.Map String (Map.Map String Text)) - <*> arbitraryReducedMaybe n -- additionalPropertiesClassMapMapAnytype :: Maybe (Map.Map String (Map.Map String A.Value)) - <*> arbitraryReducedMaybeValue n -- additionalPropertiesClassAnytype1 :: Maybe A.Value - <*> arbitraryReducedMaybeValue n -- additionalPropertiesClassAnytype2 :: Maybe A.Value - <*> arbitraryReducedMaybeValue n -- additionalPropertiesClassAnytype3 :: Maybe A.Value - -instance Arbitrary AdditionalPropertiesInteger where - arbitrary = sized genAdditionalPropertiesInteger - -genAdditionalPropertiesInteger :: Int -> Gen AdditionalPropertiesInteger -genAdditionalPropertiesInteger n = - AdditionalPropertiesInteger - <$> arbitraryReducedMaybe n -- additionalPropertiesIntegerName :: Maybe Text - -instance Arbitrary AdditionalPropertiesNumber where - arbitrary = sized genAdditionalPropertiesNumber - -genAdditionalPropertiesNumber :: Int -> Gen AdditionalPropertiesNumber -genAdditionalPropertiesNumber n = - AdditionalPropertiesNumber - <$> arbitraryReducedMaybe n -- additionalPropertiesNumberName :: Maybe Text - -instance Arbitrary AdditionalPropertiesObject where - arbitrary = sized genAdditionalPropertiesObject - -genAdditionalPropertiesObject :: Int -> Gen AdditionalPropertiesObject -genAdditionalPropertiesObject n = - AdditionalPropertiesObject - <$> arbitraryReducedMaybe n -- additionalPropertiesObjectName :: Maybe Text - -instance Arbitrary AdditionalPropertiesString where - arbitrary = sized genAdditionalPropertiesString - -genAdditionalPropertiesString :: Int -> Gen AdditionalPropertiesString -genAdditionalPropertiesString n = - AdditionalPropertiesString - <$> arbitraryReducedMaybe n -- additionalPropertiesStringName :: Maybe Text + <$> arbitraryReducedMaybe n -- additionalPropertiesClassMapProperty :: Maybe (Map.Map String Text) + <*> arbitraryReducedMaybe n -- additionalPropertiesClassMapOfMapProperty :: Maybe (Map.Map String (Map.Map String Text)) instance Arbitrary Animal where arbitrary = sized genAnimal @@ -317,6 +252,9 @@ genEnumTest n = <*> arbitraryReducedMaybe n -- enumTestEnumInteger :: Maybe E'EnumInteger <*> arbitraryReducedMaybe n -- enumTestEnumNumber :: Maybe E'EnumNumber <*> arbitraryReducedMaybe n -- enumTestOuterEnum :: Maybe OuterEnum + <*> arbitraryReducedMaybe n -- enumTestOuterEnumInteger :: Maybe OuterEnumInteger + <*> arbitraryReducedMaybe n -- enumTestOuterEnumDefaultValue :: Maybe OuterEnumDefaultValue + <*> arbitraryReducedMaybe n -- enumTestOuterEnumIntegerDefaultValue :: Maybe OuterEnumIntegerDefaultValue instance Arbitrary File where arbitrary = sized genFile @@ -335,6 +273,14 @@ genFileSchemaTestClass n = <$> arbitraryReducedMaybe n -- fileSchemaTestClassFile :: Maybe File <*> arbitraryReducedMaybe n -- fileSchemaTestClassFiles :: Maybe [File] +instance Arbitrary Foo where + arbitrary = sized genFoo + +genFoo :: Int -> Gen Foo +genFoo n = + Foo + <$> arbitraryReducedMaybe n -- fooBar :: Maybe Text + instance Arbitrary FormatTest where arbitrary = sized genFormatTest @@ -354,6 +300,8 @@ genFormatTest n = <*> arbitraryReducedMaybe n -- formatTestDateTime :: Maybe DateTime <*> arbitraryReducedMaybe n -- formatTestUuid :: Maybe Text <*> arbitrary -- formatTestPassword :: Text + <*> arbitraryReducedMaybe n -- formatTestPatternWithDigits :: Maybe Text + <*> arbitraryReducedMaybe n -- formatTestPatternWithDigitsAndDelimiter :: Maybe Text instance Arbitrary HasOnlyReadOnly where arbitrary = sized genHasOnlyReadOnly @@ -364,6 +312,88 @@ genHasOnlyReadOnly n = <$> arbitraryReducedMaybe n -- hasOnlyReadOnlyBar :: Maybe Text <*> arbitraryReducedMaybe n -- hasOnlyReadOnlyFoo :: Maybe Text +instance Arbitrary HealthCheckResult where + arbitrary = sized genHealthCheckResult + +genHealthCheckResult :: Int -> Gen HealthCheckResult +genHealthCheckResult n = + HealthCheckResult + <$> arbitraryReducedMaybe n -- healthCheckResultNullableMessage :: Maybe Text + +instance Arbitrary InlineObject where + arbitrary = sized genInlineObject + +genInlineObject :: Int -> Gen InlineObject +genInlineObject n = + InlineObject + <$> arbitraryReducedMaybe n -- inlineObjectName :: Maybe Text + <*> arbitraryReducedMaybe n -- inlineObjectStatus :: Maybe Text + +instance Arbitrary InlineObject1 where + arbitrary = sized genInlineObject1 + +genInlineObject1 :: Int -> Gen InlineObject1 +genInlineObject1 n = + InlineObject1 + <$> arbitraryReducedMaybe n -- inlineObject1AdditionalMetadata :: Maybe Text + <*> arbitraryReducedMaybe n -- inlineObject1File :: Maybe FilePath + +instance Arbitrary InlineObject2 where + arbitrary = sized genInlineObject2 + +genInlineObject2 :: Int -> Gen InlineObject2 +genInlineObject2 n = + InlineObject2 + <$> arbitraryReducedMaybe n -- inlineObject2EnumFormStringArray :: Maybe [E'EnumFormStringArray] + <*> arbitraryReducedMaybe n -- inlineObject2EnumFormString :: Maybe E'EnumFormString + +instance Arbitrary InlineObject3 where + arbitrary = sized genInlineObject3 + +genInlineObject3 :: Int -> Gen InlineObject3 +genInlineObject3 n = + InlineObject3 + <$> arbitraryReducedMaybe n -- inlineObject3Integer :: Maybe Int + <*> arbitraryReducedMaybe n -- inlineObject3Int32 :: Maybe Int + <*> arbitraryReducedMaybe n -- inlineObject3Int64 :: Maybe Integer + <*> arbitrary -- inlineObject3Number :: Double + <*> arbitraryReducedMaybe n -- inlineObject3Float :: Maybe Float + <*> arbitrary -- inlineObject3Double :: Double + <*> arbitraryReducedMaybe n -- inlineObject3String :: Maybe Text + <*> arbitrary -- inlineObject3PatternWithoutDelimiter :: Text + <*> arbitraryReduced n -- inlineObject3Byte :: ByteArray + <*> arbitraryReducedMaybe n -- inlineObject3Binary :: Maybe FilePath + <*> arbitraryReducedMaybe n -- inlineObject3Date :: Maybe Date + <*> arbitraryReducedMaybe n -- inlineObject3DateTime :: Maybe DateTime + <*> arbitraryReducedMaybe n -- inlineObject3Password :: Maybe Text + <*> arbitraryReducedMaybe n -- inlineObject3Callback :: Maybe Text + +instance Arbitrary InlineObject4 where + arbitrary = sized genInlineObject4 + +genInlineObject4 :: Int -> Gen InlineObject4 +genInlineObject4 n = + InlineObject4 + <$> arbitrary -- inlineObject4Param :: Text + <*> arbitrary -- inlineObject4Param2 :: Text + +instance Arbitrary InlineObject5 where + arbitrary = sized genInlineObject5 + +genInlineObject5 :: Int -> Gen InlineObject5 +genInlineObject5 n = + InlineObject5 + <$> arbitraryReducedMaybe n -- inlineObject5AdditionalMetadata :: Maybe Text + <*> arbitrary -- inlineObject5RequiredFile :: FilePath + +instance Arbitrary InlineResponseDefault where + arbitrary = sized genInlineResponseDefault + +genInlineResponseDefault :: Int -> Gen InlineResponseDefault +genInlineResponseDefault n = + InlineResponseDefault + <$> arbitraryReducedMaybe n -- inlineResponseDefaultString :: Maybe Foo + instance Arbitrary MapTest where arbitrary = sized genMapTest @@ -421,6 +451,25 @@ genName n = <*> arbitraryReducedMaybe n -- nameProperty :: Maybe Text <*> arbitraryReducedMaybe n -- name123number :: Maybe Int +instance Arbitrary NullableClass where + arbitrary = sized genNullableClass + +genNullableClass :: Int -> Gen NullableClass +genNullableClass n = + NullableClass + <$> arbitraryReducedMaybe n -- nullableClassIntegerProp :: Maybe Int + <*> arbitraryReducedMaybe n -- nullableClassNumberProp :: Maybe Double + <*> arbitraryReducedMaybe n -- nullableClassBooleanProp :: Maybe Bool + <*> arbitraryReducedMaybe n -- nullableClassStringProp :: Maybe Text + <*> arbitraryReducedMaybe n -- nullableClassDateProp :: Maybe Date + <*> arbitraryReducedMaybe n -- nullableClassDatetimeProp :: Maybe DateTime + <*> arbitraryReducedMaybe n -- nullableClassArrayNullableProp :: Maybe [A.Value] + <*> arbitraryReducedMaybe n -- nullableClassArrayAndItemsNullableProp :: Maybe [A.Value] + <*> arbitraryReducedMaybe n -- nullableClassArrayItemsNullable :: Maybe [A.Value] + <*> arbitraryReducedMaybe n -- nullableClassObjectNullableProp :: Maybe (Map.Map String A.Value) + <*> arbitraryReducedMaybe n -- nullableClassObjectAndItemsNullableProp :: Maybe (Map.Map String A.Value) + <*> arbitraryReducedMaybe n -- nullableClassObjectItemsNullable :: Maybe (Map.Map String A.Value) + instance Arbitrary NumberOnly where arbitrary = sized genNumberOnly @@ -491,30 +540,6 @@ genTag n = <$> arbitraryReducedMaybe n -- tagId :: Maybe Integer <*> arbitraryReducedMaybe n -- tagName :: Maybe Text -instance Arbitrary TypeHolderDefault where - arbitrary = sized genTypeHolderDefault - -genTypeHolderDefault :: Int -> Gen TypeHolderDefault -genTypeHolderDefault n = - TypeHolderDefault - <$> arbitrary -- typeHolderDefaultStringItem :: Text - <*> arbitrary -- typeHolderDefaultNumberItem :: Double - <*> arbitrary -- typeHolderDefaultIntegerItem :: Int - <*> arbitrary -- typeHolderDefaultBoolItem :: Bool - <*> arbitrary -- typeHolderDefaultArrayItem :: [Int] - -instance Arbitrary TypeHolderExample where - arbitrary = sized genTypeHolderExample - -genTypeHolderExample :: Int -> Gen TypeHolderExample -genTypeHolderExample n = - TypeHolderExample - <$> arbitrary -- typeHolderExampleStringItem :: Text - <*> arbitrary -- typeHolderExampleNumberItem :: Double - <*> arbitrary -- typeHolderExampleIntegerItem :: Int - <*> arbitrary -- typeHolderExampleBoolItem :: Bool - <*> arbitrary -- typeHolderExampleArrayItem :: [Int] - instance Arbitrary User where arbitrary = sized genUser @@ -530,42 +555,6 @@ genUser n = <*> arbitraryReducedMaybe n -- userPhone :: Maybe Text <*> arbitraryReducedMaybe n -- userUserStatus :: Maybe Int -instance Arbitrary XmlItem where - arbitrary = sized genXmlItem - -genXmlItem :: Int -> Gen XmlItem -genXmlItem n = - XmlItem - <$> arbitraryReducedMaybe n -- xmlItemAttributeString :: Maybe Text - <*> arbitraryReducedMaybe n -- xmlItemAttributeNumber :: Maybe Double - <*> arbitraryReducedMaybe n -- xmlItemAttributeInteger :: Maybe Int - <*> arbitraryReducedMaybe n -- xmlItemAttributeBoolean :: Maybe Bool - <*> arbitraryReducedMaybe n -- xmlItemWrappedArray :: Maybe [Int] - <*> arbitraryReducedMaybe n -- xmlItemNameString :: Maybe Text - <*> arbitraryReducedMaybe n -- xmlItemNameNumber :: Maybe Double - <*> arbitraryReducedMaybe n -- xmlItemNameInteger :: Maybe Int - <*> arbitraryReducedMaybe n -- xmlItemNameBoolean :: Maybe Bool - <*> arbitraryReducedMaybe n -- xmlItemNameArray :: Maybe [Int] - <*> arbitraryReducedMaybe n -- xmlItemNameWrappedArray :: Maybe [Int] - <*> arbitraryReducedMaybe n -- xmlItemPrefixString :: Maybe Text - <*> arbitraryReducedMaybe n -- xmlItemPrefixNumber :: Maybe Double - <*> arbitraryReducedMaybe n -- xmlItemPrefixInteger :: Maybe Int - <*> arbitraryReducedMaybe n -- xmlItemPrefixBoolean :: Maybe Bool - <*> arbitraryReducedMaybe n -- xmlItemPrefixArray :: Maybe [Int] - <*> arbitraryReducedMaybe n -- xmlItemPrefixWrappedArray :: Maybe [Int] - <*> arbitraryReducedMaybe n -- xmlItemNamespaceString :: Maybe Text - <*> arbitraryReducedMaybe n -- xmlItemNamespaceNumber :: Maybe Double - <*> arbitraryReducedMaybe n -- xmlItemNamespaceInteger :: Maybe Int - <*> arbitraryReducedMaybe n -- xmlItemNamespaceBoolean :: Maybe Bool - <*> arbitraryReducedMaybe n -- xmlItemNamespaceArray :: Maybe [Int] - <*> arbitraryReducedMaybe n -- xmlItemNamespaceWrappedArray :: Maybe [Int] - <*> arbitraryReducedMaybe n -- xmlItemPrefixNsString :: Maybe Text - <*> arbitraryReducedMaybe n -- xmlItemPrefixNsNumber :: Maybe Double - <*> arbitraryReducedMaybe n -- xmlItemPrefixNsInteger :: Maybe Int - <*> arbitraryReducedMaybe n -- xmlItemPrefixNsBoolean :: Maybe Bool - <*> arbitraryReducedMaybe n -- xmlItemPrefixNsArray :: Maybe [Int] - <*> arbitraryReducedMaybe n -- xmlItemPrefixNsWrappedArray :: Maybe [Int] - @@ -608,3 +597,12 @@ instance Arbitrary EnumClass where instance Arbitrary OuterEnum where arbitrary = arbitraryBoundedEnum +instance Arbitrary OuterEnumDefaultValue where + arbitrary = arbitraryBoundedEnum + +instance Arbitrary OuterEnumInteger where + arbitrary = arbitraryBoundedEnum + +instance Arbitrary OuterEnumIntegerDefaultValue where + arbitrary = arbitraryBoundedEnum + diff --git a/samples/client/petstore/haskell-http-client/tests/Test.hs b/samples/client/petstore/haskell-http-client/tests/Test.hs index 6db1f28e4d6d..c663afa5026b 100644 --- a/samples/client/petstore/haskell-http-client/tests/Test.hs +++ b/samples/client/petstore/haskell-http-client/tests/Test.hs @@ -20,14 +20,7 @@ main = hspec $ modifyMaxSize (const 10) $ do describe "JSON instances" $ do pure () - propMimeEq MimeJSON (Proxy :: Proxy AdditionalPropertiesAnyType) - propMimeEq MimeJSON (Proxy :: Proxy AdditionalPropertiesArray) - propMimeEq MimeJSON (Proxy :: Proxy AdditionalPropertiesBoolean) propMimeEq MimeJSON (Proxy :: Proxy AdditionalPropertiesClass) - propMimeEq MimeJSON (Proxy :: Proxy AdditionalPropertiesInteger) - propMimeEq MimeJSON (Proxy :: Proxy AdditionalPropertiesNumber) - propMimeEq MimeJSON (Proxy :: Proxy AdditionalPropertiesObject) - propMimeEq MimeJSON (Proxy :: Proxy AdditionalPropertiesString) propMimeEq MimeJSON (Proxy :: Proxy Animal) propMimeEq MimeJSON (Proxy :: Proxy ApiResponse) propMimeEq MimeJSON (Proxy :: Proxy ArrayOfArrayOfNumberOnly) @@ -46,24 +39,34 @@ main = propMimeEq MimeJSON (Proxy :: Proxy EnumTest) propMimeEq MimeJSON (Proxy :: Proxy File) propMimeEq MimeJSON (Proxy :: Proxy FileSchemaTestClass) + propMimeEq MimeJSON (Proxy :: Proxy Foo) propMimeEq MimeJSON (Proxy :: Proxy FormatTest) propMimeEq MimeJSON (Proxy :: Proxy HasOnlyReadOnly) + propMimeEq MimeJSON (Proxy :: Proxy HealthCheckResult) + propMimeEq MimeJSON (Proxy :: Proxy InlineObject) + propMimeEq MimeJSON (Proxy :: Proxy InlineObject1) + propMimeEq MimeJSON (Proxy :: Proxy InlineObject2) + propMimeEq MimeJSON (Proxy :: Proxy InlineObject3) + propMimeEq MimeJSON (Proxy :: Proxy InlineObject4) + propMimeEq MimeJSON (Proxy :: Proxy InlineObject5) + propMimeEq MimeJSON (Proxy :: Proxy InlineResponseDefault) propMimeEq MimeJSON (Proxy :: Proxy MapTest) propMimeEq MimeJSON (Proxy :: Proxy MixedPropertiesAndAdditionalPropertiesClass) propMimeEq MimeJSON (Proxy :: Proxy Model200Response) propMimeEq MimeJSON (Proxy :: Proxy ModelList) propMimeEq MimeJSON (Proxy :: Proxy ModelReturn) propMimeEq MimeJSON (Proxy :: Proxy Name) + propMimeEq MimeJSON (Proxy :: Proxy NullableClass) propMimeEq MimeJSON (Proxy :: Proxy NumberOnly) propMimeEq MimeJSON (Proxy :: Proxy Order) propMimeEq MimeJSON (Proxy :: Proxy OuterComposite) propMimeEq MimeJSON (Proxy :: Proxy OuterEnum) + propMimeEq MimeJSON (Proxy :: Proxy OuterEnumDefaultValue) + propMimeEq MimeJSON (Proxy :: Proxy OuterEnumInteger) + propMimeEq MimeJSON (Proxy :: Proxy OuterEnumIntegerDefaultValue) propMimeEq MimeJSON (Proxy :: Proxy Pet) propMimeEq MimeJSON (Proxy :: Proxy ReadOnlyFirst) propMimeEq MimeJSON (Proxy :: Proxy SpecialModelName) propMimeEq MimeJSON (Proxy :: Proxy Tag) - propMimeEq MimeJSON (Proxy :: Proxy TypeHolderDefault) - propMimeEq MimeJSON (Proxy :: Proxy TypeHolderExample) propMimeEq MimeJSON (Proxy :: Proxy User) - propMimeEq MimeJSON (Proxy :: Proxy XmlItem) diff --git a/samples/client/petstore/javascript-closure-angular/.openapi-generator/VERSION b/samples/client/petstore/javascript-closure-angular/.openapi-generator/VERSION index 096bf47efe31..83a328a9227e 100644 --- a/samples/client/petstore/javascript-closure-angular/.openapi-generator/VERSION +++ b/samples/client/petstore/javascript-closure-angular/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.0-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/javascript-closure-angular/API/Client/InlineObject.js b/samples/client/petstore/javascript-closure-angular/API/Client/InlineObject.js new file mode 100644 index 000000000000..99eff4f58385 --- /dev/null +++ b/samples/client/petstore/javascript-closure-angular/API/Client/InlineObject.js @@ -0,0 +1,21 @@ +goog.provide('API.Client.inline_object'); + +/** + * @record + */ +API.Client.InlineObject = function() {} + +/** + * Updated name of the pet + * @type {!string} + * @export + */ +API.Client.InlineObject.prototype.name; + +/** + * Updated status of the pet + * @type {!string} + * @export + */ +API.Client.InlineObject.prototype.status; + diff --git a/samples/client/petstore/javascript-closure-angular/API/Client/InlineObject1.js b/samples/client/petstore/javascript-closure-angular/API/Client/InlineObject1.js new file mode 100644 index 000000000000..745eaacd234e --- /dev/null +++ b/samples/client/petstore/javascript-closure-angular/API/Client/InlineObject1.js @@ -0,0 +1,21 @@ +goog.provide('API.Client.inline_object_1'); + +/** + * @record + */ +API.Client.InlineObject1 = function() {} + +/** + * Additional data to pass to server + * @type {!string} + * @export + */ +API.Client.InlineObject1.prototype.additionalMetadata; + +/** + * file to upload + * @type {!Object} + * @export + */ +API.Client.InlineObject1.prototype.file; + diff --git a/samples/client/petstore/javascript-closure-angular/API/Client/PetApi.js b/samples/client/petstore/javascript-closure-angular/API/Client/PetApi.js index 6d065b731c50..7c217bd6291a 100644 --- a/samples/client/petstore/javascript-closure-angular/API/Client/PetApi.js +++ b/samples/client/petstore/javascript-closure-angular/API/Client/PetApi.js @@ -165,10 +165,11 @@ API.Client.PetApi.prototype.findPetsByStatus = function(status, opt_extraHttpReq * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param {!Array} tags Tags to filter by + * @param {!number=} opt_maxCount Maximum number of items to return * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send. * @return {!angular.$q.Promise>} */ -API.Client.PetApi.prototype.findPetsByTags = function(tags, opt_extraHttpRequestParams) { +API.Client.PetApi.prototype.findPetsByTags = function(tags, opt_maxCount, opt_extraHttpRequestParams) { /** @const {string} */ var path = this.basePath_ + '/pet/findByTags'; @@ -185,6 +186,10 @@ API.Client.PetApi.prototype.findPetsByTags = function(tags, opt_extraHttpRequest queryParameters['tags'] = tags; } + if (opt_maxCount !== undefined) { + queryParameters['maxCount'] = opt_maxCount; + } + /** @type {!Object} */ var httpRequestParams = { method: 'GET', diff --git a/samples/client/petstore/jaxrs-cxf-client/.openapi-generator/VERSION b/samples/client/petstore/jaxrs-cxf-client/.openapi-generator/VERSION index afa636560641..83a328a9227e 100644 --- a/samples/client/petstore/jaxrs-cxf-client/.openapi-generator/VERSION +++ b/samples/client/petstore/jaxrs-cxf-client/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/api/PetApi.java b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/api/PetApi.java index 72df7daef99a..9ceb1f92c7d2 100644 --- a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/api/PetApi.java @@ -39,7 +39,7 @@ public interface PetApi { @ApiOperation(value = "Add a new pet to the store", tags={ }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input") }) - public void addPet(Pet body); + public void addPet(Pet pet); /** * Deletes a pet @@ -80,7 +80,7 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid tag value") }) - public List findPetsByTags(@QueryParam("tags") List tags); + public List findPetsByTags(@QueryParam("tags") List tags, @QueryParam("maxCount") Integer maxCount); /** * Find pet by ID @@ -110,7 +110,7 @@ public interface PetApi { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found"), @ApiResponse(code = 405, message = "Validation exception") }) - public void updatePet(Pet body); + public void updatePet(Pet pet); /** * Updates a pet in the store with form data diff --git a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/api/StoreApi.java index f335bf43c6be..5c473da6e8f4 100644 --- a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/api/StoreApi.java @@ -77,11 +77,12 @@ public interface StoreApi { */ @POST @Path("/store/order") + @Consumes({ "application/json" }) @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Place an order for a pet", tags={ }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order") }) - public Order placeOrder(Order body); + public Order placeOrder(Order order); } diff --git a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/api/UserApi.java b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/api/UserApi.java index eb14a63a71b5..879c83b1ba94 100644 --- a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/api/UserApi.java @@ -35,10 +35,11 @@ public interface UserApi { */ @POST @Path("/user") + @Consumes({ "application/json" }) @ApiOperation(value = "Create user", tags={ }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - public void createUser(User body); + public void createUser(User user); /** * Creates list of users with given input array @@ -46,10 +47,11 @@ public interface UserApi { */ @POST @Path("/user/createWithArray") + @Consumes({ "application/json" }) @ApiOperation(value = "Creates list of users with given input array", tags={ }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - public void createUsersWithArrayInput(List body); + public void createUsersWithArrayInput(List user); /** * Creates list of users with given input array @@ -57,10 +59,11 @@ public interface UserApi { */ @POST @Path("/user/createWithList") + @Consumes({ "application/json" }) @ApiOperation(value = "Creates list of users with given input array", tags={ }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - public void createUsersWithListInput(List body); + public void createUsersWithListInput(List user); /** * Delete user @@ -122,10 +125,11 @@ public interface UserApi { */ @PUT @Path("/user/{username}") + @Consumes({ "application/json" }) @ApiOperation(value = "Updated user", tags={ }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied"), @ApiResponse(code = 404, message = "User not found") }) - public void updateUser(@PathParam("username") String username, User body); + public void updateUser(@PathParam("username") String username, User user); } diff --git a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/InlineObject.java b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/InlineObject.java new file mode 100644 index 000000000000..2910fe034ae9 --- /dev/null +++ b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/InlineObject.java @@ -0,0 +1,86 @@ +package org.openapitools.model; + + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; + +public class InlineObject { + + @ApiModelProperty(value = "Updated name of the pet") + /** + * Updated name of the pet + **/ + private String name; + + @ApiModelProperty(value = "Updated status of the pet") + /** + * Updated status of the pet + **/ + private String status; + /** + * Updated name of the pet + * @return name + **/ + @JsonProperty("name") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public InlineObject name(String name) { + this.name = name; + return this; + } + + /** + * Updated status of the pet + * @return status + **/ + @JsonProperty("status") + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public InlineObject status(String status) { + this.status = status; + return this; + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InlineObject {\n"); + + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/InlineObject1.java b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/InlineObject1.java new file mode 100644 index 000000000000..8fb7e4dee62d --- /dev/null +++ b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/InlineObject1.java @@ -0,0 +1,87 @@ +package org.openapitools.model; + +import java.io.File; + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; + +public class InlineObject1 { + + @ApiModelProperty(value = "Additional data to pass to server") + /** + * Additional data to pass to server + **/ + private String additionalMetadata; + + @ApiModelProperty(value = "file to upload") + /** + * file to upload + **/ + private File file; + /** + * Additional data to pass to server + * @return additionalMetadata + **/ + @JsonProperty("additionalMetadata") + public String getAdditionalMetadata() { + return additionalMetadata; + } + + public void setAdditionalMetadata(String additionalMetadata) { + this.additionalMetadata = additionalMetadata; + } + + public InlineObject1 additionalMetadata(String additionalMetadata) { + this.additionalMetadata = additionalMetadata; + return this; + } + + /** + * file to upload + * @return file + **/ + @JsonProperty("file") + public File getFile() { + return file; + } + + public void setFile(File file) { + this.file = file; + } + + public InlineObject1 file(File file) { + this.file = file; + return this; + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InlineObject1 {\n"); + + sb.append(" additionalMetadata: ").append(toIndentedString(additionalMetadata)).append("\n"); + sb.append(" file: ").append(toIndentedString(file)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/Order.java b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/Order.java index 660962be0e43..85036661f993 100644 --- a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/Order.java +++ b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/Order.java @@ -53,13 +53,13 @@ public String toString() { return String.valueOf(value); } - public static StatusEnum fromValue(String v) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(v)) { + if (b.value.equals(value)) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + v + "'"); + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } diff --git a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/Pet.java b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/Pet.java index 0ba245486396..c9299e93dcf4 100644 --- a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/Pet.java @@ -59,13 +59,13 @@ public String toString() { return String.valueOf(value); } - public static StatusEnum fromValue(String v) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(v)) { + if (b.value.equals(value)) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + v + "'"); + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } diff --git a/samples/client/petstore/jmeter/.openapi-generator/VERSION b/samples/client/petstore/jmeter/.openapi-generator/VERSION index 82602aa4190d..83a328a9227e 100644 --- a/samples/client/petstore/jmeter/.openapi-generator/VERSION +++ b/samples/client/petstore/jmeter/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.3-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/jmeter/PetApi.csv b/samples/client/petstore/jmeter/PetApi.csv index 2ab795b50f75..29b09a1715de 100644 --- a/samples/client/petstore/jmeter/PetApi.csv +++ b/samples/client/petstore/jmeter/PetApi.csv @@ -1,2 +1,2 @@ -testCase,httpStatusCode,pet,petId,apiKey,status,tags,petId,pet,petId,name,status,petId,additionalMetadata,file +testCase,httpStatusCode,body,petId,apiKey,status,tags,petId,body,petId,name,status,petId,additionalMetadata,file Success,200,0,0,0,0,0,0,0,0,0,0,0,0,0 \ No newline at end of file diff --git a/samples/client/petstore/jmeter/StoreApi.csv b/samples/client/petstore/jmeter/StoreApi.csv index 2ccf8884aff0..70fd54e2b204 100644 --- a/samples/client/petstore/jmeter/StoreApi.csv +++ b/samples/client/petstore/jmeter/StoreApi.csv @@ -1,2 +1,2 @@ -testCase,httpStatusCode,orderId,orderId,order +testCase,httpStatusCode,orderId,orderId,body Success,200,0,0,0 \ No newline at end of file diff --git a/samples/client/petstore/jmeter/UserApi.csv b/samples/client/petstore/jmeter/UserApi.csv index 66fcc84a5901..92242d4077c7 100644 --- a/samples/client/petstore/jmeter/UserApi.csv +++ b/samples/client/petstore/jmeter/UserApi.csv @@ -1,2 +1,2 @@ -testCase,httpStatusCode,user,user,user,username,username,username,password,username,user +testCase,httpStatusCode,body,body,body,username,username,username,password,username,body Success,200,0,0,0,0,0,0,0,0,0 \ No newline at end of file diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/apis/PetApi.kt new file mode 100644 index 000000000000..36c7ad826136 --- /dev/null +++ b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/apis/PetApi.kt @@ -0,0 +1,280 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.apis + +import org.openapitools.client.models.ApiResponse +import org.openapitools.client.models.Pet + +import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ClientException +import org.openapitools.client.infrastructure.ClientError +import org.openapitools.client.infrastructure.ServerException +import org.openapitools.client.infrastructure.ServerError +import org.openapitools.client.infrastructure.MultiValueMap +import org.openapitools.client.infrastructure.RequestConfig +import org.openapitools.client.infrastructure.RequestMethod +import org.openapitools.client.infrastructure.ResponseType +import org.openapitools.client.infrastructure.Success +import org.openapitools.client.infrastructure.toMultiValue + +class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiClient(basePath) { + + /** + * Add a new pet to the store + * + * @param body Pet object that needs to be added to the store + * @return void + */ + fun addPet(body: Pet) : Unit { + val localVariableBody: kotlin.Any? = body + val localVariableQuery: MultiValueMap = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/pet", + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + + /** + * Deletes a pet + * + * @param petId Pet id to delete + * @param apiKey (optional) + * @return void + */ + fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf("api_key" to apiKey.toString()) + val localVariableConfig = RequestConfig( + RequestMethod.DELETE, + "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter + * @return kotlin.Array + */ + @Suppress("UNCHECKED_CAST") + fun findPetsByStatus(status: kotlin.Array) : kotlin.Array { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mapOf("status" to toMultiValue(status.toList(), "csv")) + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/pet/findByStatus", + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request>( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> (response as Success<*>).data as kotlin.Array + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by + * @return kotlin.Array + */ + @Suppress("UNCHECKED_CAST") + fun findPetsByTags(tags: kotlin.Array) : kotlin.Array { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mapOf("tags" to toMultiValue(tags.toList(), "csv")) + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/pet/findByTags", + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request>( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> (response as Success<*>).data as kotlin.Array + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return + * @return Pet + */ + @Suppress("UNCHECKED_CAST") + fun getPetById(petId: kotlin.Long) : Pet { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> (response as Success<*>).data as Pet + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + + /** + * Update an existing pet + * + * @param body Pet object that needs to be added to the store + * @return void + */ + fun updatePet(body: Pet) : Unit { + val localVariableBody: kotlin.Any? = body + val localVariableQuery: MultiValueMap = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.PUT, + "/pet", + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return void + */ + fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { + val localVariableBody: kotlin.Any? = mapOf("name" to "$name", "status" to "$status") + val localVariableQuery: MultiValueMap = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "") + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + + /** + * uploads an image + * + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return ApiResponse + */ + @Suppress("UNCHECKED_CAST") + fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { + val localVariableBody: kotlin.Any? = mapOf("additionalMetadata" to "$additionalMetadata", "file" to "$file") + val localVariableQuery: MultiValueMap = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "") + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/pet/{petId}/uploadImage".replace("{"+"petId"+"}", "$petId"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> (response as Success<*>).data as ApiResponse + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + +} diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/apis/StoreApi.kt new file mode 100644 index 000000000000..891b91d68142 --- /dev/null +++ b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/apis/StoreApi.kt @@ -0,0 +1,152 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.apis + +import org.openapitools.client.models.Order + +import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ClientException +import org.openapitools.client.infrastructure.ClientError +import org.openapitools.client.infrastructure.ServerException +import org.openapitools.client.infrastructure.ServerError +import org.openapitools.client.infrastructure.MultiValueMap +import org.openapitools.client.infrastructure.RequestConfig +import org.openapitools.client.infrastructure.RequestMethod +import org.openapitools.client.infrastructure.ResponseType +import org.openapitools.client.infrastructure.Success +import org.openapitools.client.infrastructure.toMultiValue + +class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiClient(basePath) { + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted + * @return void + */ + fun deleteOrder(orderId: kotlin.String) : Unit { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.DELETE, + "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @return kotlin.collections.Map + */ + @Suppress("UNCHECKED_CAST") + fun getInventory() : kotlin.collections.Map { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/store/inventory", + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request>( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> (response as Success<*>).data as kotlin.collections.Map + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched + * @return Order + */ + @Suppress("UNCHECKED_CAST") + fun getOrderById(orderId: kotlin.Long) : Order { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> (response as Success<*>).data as Order + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + + /** + * Place an order for a pet + * + * @param body order placed for purchasing the pet + * @return Order + */ + @Suppress("UNCHECKED_CAST") + fun placeOrder(body: Order) : Order { + val localVariableBody: kotlin.Any? = body + val localVariableQuery: MultiValueMap = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/store/order", + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> (response as Success<*>).data as Order + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + +} diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/apis/UserApi.kt new file mode 100644 index 000000000000..ea538f439a1d --- /dev/null +++ b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/apis/UserApi.kt @@ -0,0 +1,273 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.apis + +import org.openapitools.client.models.User + +import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ClientException +import org.openapitools.client.infrastructure.ClientError +import org.openapitools.client.infrastructure.ServerException +import org.openapitools.client.infrastructure.ServerError +import org.openapitools.client.infrastructure.MultiValueMap +import org.openapitools.client.infrastructure.RequestConfig +import org.openapitools.client.infrastructure.RequestMethod +import org.openapitools.client.infrastructure.ResponseType +import org.openapitools.client.infrastructure.Success +import org.openapitools.client.infrastructure.toMultiValue + +class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiClient(basePath) { + + /** + * Create user + * This can only be done by the logged in user. + * @param body Created user object + * @return void + */ + fun createUser(body: User) : Unit { + val localVariableBody: kotlin.Any? = body + val localVariableQuery: MultiValueMap = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/user", + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + + /** + * Creates list of users with given input array + * + * @param body List of user object + * @return void + */ + fun createUsersWithArrayInput(body: kotlin.Array) : Unit { + val localVariableBody: kotlin.Any? = body + val localVariableQuery: MultiValueMap = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/user/createWithArray", + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + + /** + * Creates list of users with given input array + * + * @param body List of user object + * @return void + */ + fun createUsersWithListInput(body: kotlin.Array) : Unit { + val localVariableBody: kotlin.Any? = body + val localVariableQuery: MultiValueMap = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/user/createWithList", + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted + * @return void + */ + fun deleteUser(username: kotlin.String) : Unit { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.DELETE, + "/user/{username}".replace("{"+"username"+"}", "$username"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. + * @return User + */ + @Suppress("UNCHECKED_CAST") + fun getUserByName(username: kotlin.String) : User { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/user/{username}".replace("{"+"username"+"}", "$username"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> (response as Success<*>).data as User + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + + /** + * Logs user into the system + * + * @param username The user name for login + * @param password The password for login in clear text + * @return kotlin.String + */ + @Suppress("UNCHECKED_CAST") + fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mapOf("username" to listOf("$username"), "password" to listOf("$password")) + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/user/login", + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> (response as Success<*>).data as kotlin.String + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + + /** + * Logs out current logged in user session + * + * @return void + */ + fun logoutUser() : Unit { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/user/logout", + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted + * @param body Updated user object + * @return void + */ + fun updateUser(username: kotlin.String, body: User) : Unit { + val localVariableBody: kotlin.Any? = body + val localVariableQuery: MultiValueMap = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.PUT, + "/user/{username}".replace("{"+"username"+"}", "$username"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + +} diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt new file mode 100644 index 000000000000..c2c3f1f0eaea --- /dev/null +++ b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt @@ -0,0 +1,20 @@ +package org.openapitools.client.infrastructure + +typealias MultiValueMap = Map> + +fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { + "csv" -> "," + "tsv" -> "\t" + "pipes" -> "|" + "ssv" -> " " + else -> "" +} + +val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" } + +fun toMultiValue(items: List, collectionFormat: String, map: (item: Any?) -> String = defaultMultiValueConverter): List { + return when(collectionFormat) { + "multi" -> items.map(map) + else -> listOf(items.map(map).joinToString(separator = collectionDelimiter(collectionFormat))) + } +} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ApiClient.kt new file mode 100644 index 000000000000..c9107fcb0857 --- /dev/null +++ b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ApiClient.kt @@ -0,0 +1,143 @@ +package org.openapitools.client.infrastructure + +import okhttp3.OkHttpClient +import okhttp3.RequestBody +import okhttp3.MediaType +import okhttp3.FormBody +import okhttp3.HttpUrl +import okhttp3.ResponseBody +import okhttp3.Request +import java.io.File + +open class ApiClient(val baseUrl: String) { + companion object { + protected const val ContentType = "Content-Type" + protected const val Accept = "Accept" + protected const val JsonMediaType = "application/json" + protected const val FormDataMediaType = "multipart/form-data" + protected const val FormUrlEncMediaType = "application/x-www-form-urlencoded" + protected const val XmlMediaType = "application/xml" + + @JvmStatic + val client: OkHttpClient by lazy { + builder.build() + } + + @JvmStatic + val builder: OkHttpClient.Builder = OkHttpClient.Builder() + } + + protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = + when { + content is File -> RequestBody.create( + MediaType.parse(mediaType), content + ) + mediaType == FormDataMediaType || mediaType == FormUrlEncMediaType -> { + FormBody.Builder().apply { + // content's type *must* be Map + @Suppress("UNCHECKED_CAST") + (content as Map).forEach { (key, value) -> + add(key, value) + } + }.build() + } + mediaType == JsonMediaType -> RequestBody.create( + MediaType.parse(mediaType), Serializer.moshi.adapter(T::class.java).toJson(content) + ) + mediaType == XmlMediaType -> TODO("xml not currently supported.") + // TODO: this should be extended with other serializers + else -> TODO("requestBody currently only supports JSON body and File body.") + } + + protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { + if(body == null) { + return null + } + val bodyContent = body.string() + if (bodyContent.isEmpty()) { + return null + } + return when(mediaType) { + JsonMediaType -> Serializer.moshi.adapter(T::class.java).fromJson(bodyContent) + else -> TODO("responseBody currently only supports JSON body.") + } + } + + protected inline fun request(requestConfig: RequestConfig, body : Any? = null): ApiInfrastructureResponse { + val httpUrl = HttpUrl.parse(baseUrl) ?: throw IllegalStateException("baseUrl is invalid.") + + val url = httpUrl.newBuilder() + .addPathSegments(requestConfig.path.trimStart('/')) + .apply { + requestConfig.query.forEach { query -> + query.value.forEach { queryValue -> + addQueryParameter(query.key, queryValue) + } + } + }.build() + + // take content-type/accept from spec or set to default (application/json) if not defined + if (requestConfig.headers[ContentType].isNullOrEmpty()) { + requestConfig.headers[ContentType] = JsonMediaType + } + if (requestConfig.headers[Accept].isNullOrEmpty()) { + requestConfig.headers[Accept] = JsonMediaType + } + val headers = requestConfig.headers + + if(headers[ContentType] ?: "" == "") { + throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") + } + + if(headers[Accept] ?: "" == "") { + throw kotlin.IllegalStateException("Missing Accept header. This is required.") + } + + // TODO: support multiple contentType options here. + val contentType = (headers[ContentType] as String).substringBefore(";").toLowerCase() + + val request = when (requestConfig.method) { + RequestMethod.DELETE -> Request.Builder().url(url).delete() + RequestMethod.GET -> Request.Builder().url(url) + RequestMethod.HEAD -> Request.Builder().url(url).head() + RequestMethod.PATCH -> Request.Builder().url(url).patch(requestBody(body, contentType)) + RequestMethod.PUT -> Request.Builder().url(url).put(requestBody(body, contentType)) + RequestMethod.POST -> Request.Builder().url(url).post(requestBody(body, contentType)) + RequestMethod.OPTIONS -> Request.Builder().url(url).method("OPTIONS", null) + }.apply { + headers.forEach { header -> addHeader(header.key, header.value) } + }.build() + + val response = client.newCall(request).execute() + val accept = response.header(ContentType)?.substringBefore(";")?.toLowerCase() + + // TODO: handle specific mapping types. e.g. Map> + when { + response.isRedirect -> return Redirection( + response.code(), + response.headers().toMultimap() + ) + response.isInformational -> return Informational( + response.message(), + response.code(), + response.headers().toMultimap() + ) + response.isSuccessful -> return Success( + responseBody(response.body(), accept), + response.code(), + response.headers().toMultimap() + ) + response.isClientError -> return ClientError( + response.body()?.string(), + response.code(), + response.headers().toMultimap() + ) + else -> return ServerError( + null, + response.body()?.string(), + response.code(), + response.headers().toMultimap() + ) + } + } +} diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt new file mode 100644 index 000000000000..f1a8aecc914b --- /dev/null +++ b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt @@ -0,0 +1,40 @@ +package org.openapitools.client.infrastructure + +enum class ResponseType { + Success, Informational, Redirection, ClientError, ServerError +} + +abstract class ApiInfrastructureResponse(val responseType: ResponseType) { + abstract val statusCode: Int + abstract val headers: Map> +} + +class Success( + val data: T, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +): ApiInfrastructureResponse(ResponseType.Success) + +class Informational( + val statusText: String, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiInfrastructureResponse(ResponseType.Informational) + +class Redirection( + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiInfrastructureResponse(ResponseType.Redirection) + +class ClientError( + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiInfrastructureResponse(ResponseType.ClientError) + +class ServerError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> +): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt new file mode 100644 index 000000000000..dd34bd48b2c0 --- /dev/null +++ b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt @@ -0,0 +1,29 @@ +package org.openapitools.client.infrastructure + +import kotlin.properties.ReadWriteProperty +import kotlin.reflect.KProperty + +object ApplicationDelegates { + /** + * Provides a property delegate, allowing the property to be set once and only once. + * + * If unset (no default value), a get on the property will throw [IllegalStateException]. + */ + fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) + + private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { + private var isSet = false + private var value: T? = defaultValue + + override fun getValue(thisRef: Any?, property: KProperty<*>): T { + return value ?: throw IllegalStateException("${property.name} not initialized") + } + + override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { + if (!isSet) { + this.value = value + isSet = true + } + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt new file mode 100644 index 000000000000..617ac3fe9069 --- /dev/null +++ b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt @@ -0,0 +1,12 @@ +package org.openapitools.client.infrastructure + +import com.squareup.moshi.FromJson +import com.squareup.moshi.ToJson + +class ByteArrayAdapter { + @ToJson + fun toJson(data: ByteArray): String = String(data) + + @FromJson + fun fromJson(data: String): ByteArray = data.toByteArray() +} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/Errors.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/Errors.kt new file mode 100644 index 000000000000..2f3b0157ba70 --- /dev/null +++ b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/Errors.kt @@ -0,0 +1,42 @@ +@file:Suppress("unused") +package org.openapitools.client.infrastructure + +import java.lang.RuntimeException + +open class ClientException : RuntimeException { + + /** + * Constructs an [ClientException] with no detail message. + */ + constructor() : super() + + /** + * Constructs an [ClientException] with the specified detail message. + + * @param message the detail message. + */ + constructor(message: kotlin.String) : super(message) + + companion object { + private const val serialVersionUID: Long = 123L + } +} + +open class ServerException : RuntimeException { + + /** + * Constructs an [ServerException] with no detail message. + */ + constructor() : super() + + /** + * Constructs an [ServerException] with the specified detail message. + + * @param message the detail message. + */ + constructor(message: kotlin.String) : super(message) + + companion object { + private const val serialVersionUID: Long = 456L + } +} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt new file mode 100644 index 000000000000..b2e1654479a0 --- /dev/null +++ b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt @@ -0,0 +1,19 @@ +package org.openapitools.client.infrastructure + +import com.squareup.moshi.FromJson +import com.squareup.moshi.ToJson +import java.time.LocalDate +import java.time.format.DateTimeFormatter + +class LocalDateAdapter { + @ToJson + fun toJson(value: LocalDate): String { + return DateTimeFormatter.ISO_LOCAL_DATE.format(value) + } + + @FromJson + fun fromJson(value: String): LocalDate { + return LocalDate.parse(value, DateTimeFormatter.ISO_LOCAL_DATE) + } + +} diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt new file mode 100644 index 000000000000..e082db94811d --- /dev/null +++ b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt @@ -0,0 +1,19 @@ +package org.openapitools.client.infrastructure + +import com.squareup.moshi.FromJson +import com.squareup.moshi.ToJson +import java.time.LocalDateTime +import java.time.format.DateTimeFormatter + +class LocalDateTimeAdapter { + @ToJson + fun toJson(value: LocalDateTime): String { + return DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(value) + } + + @FromJson + fun fromJson(value: String): LocalDateTime { + return LocalDateTime.parse(value, DateTimeFormatter.ISO_LOCAL_DATE_TIME) + } + +} diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt new file mode 100644 index 000000000000..53e689237d71 --- /dev/null +++ b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt @@ -0,0 +1,16 @@ +package org.openapitools.client.infrastructure + +/** + * Defines a config object for a given request. + * NOTE: This object doesn't include 'body' because it + * allows for caching of the constructed object + * for many request definitions. + * NOTE: Headers is a Map because rfc2616 defines + * multi-valued headers as csv-only. + */ +data class RequestConfig( + val method: RequestMethod, + val path: String, + val headers: MutableMap = mutableMapOf(), + val query: Map> = mapOf() +) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt new file mode 100644 index 000000000000..931b12b8bd7a --- /dev/null +++ b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt @@ -0,0 +1,8 @@ +package org.openapitools.client.infrastructure + +/** + * Provides enumerated HTTP verbs + */ +enum class RequestMethod { + GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT +} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt new file mode 100644 index 000000000000..f50104a6f352 --- /dev/null +++ b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt @@ -0,0 +1,23 @@ +package org.openapitools.client.infrastructure + +import okhttp3.Response + +/** + * Provides an extension to evaluation whether the response is a 1xx code + */ +val Response.isInformational : Boolean get() = this.code() in 100..199 + +/** + * Provides an extension to evaluation whether the response is a 3xx code + */ +val Response.isRedirect : Boolean get() = this.code() in 300..399 + +/** + * Provides an extension to evaluation whether the response is a 4xx code + */ +val Response.isClientError : Boolean get() = this.code() in 400..499 + +/** + * Provides an extension to evaluation whether the response is a 5xx (Standard) through 999 (non-standard) code + */ +val Response.isServerError : Boolean get() = this.code() in 500..999 \ No newline at end of file diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/Serializer.kt new file mode 100644 index 000000000000..7c5a353e0f7f --- /dev/null +++ b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/Serializer.kt @@ -0,0 +1,18 @@ +package org.openapitools.client.infrastructure + +import com.squareup.moshi.Moshi +import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter +import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory +import java.util.Date + +object Serializer { + @JvmStatic + val moshi: Moshi = Moshi.Builder() + .add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe()) + .add(LocalDateTimeAdapter()) + .add(LocalDateAdapter()) + .add(UUIDAdapter()) + .add(ByteArrayAdapter()) + .add(KotlinJsonAdapterFactory()) + .build() +} diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt new file mode 100644 index 000000000000..a4a44cc18b73 --- /dev/null +++ b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt @@ -0,0 +1,13 @@ +package org.openapitools.client.infrastructure + +import com.squareup.moshi.FromJson +import com.squareup.moshi.ToJson +import java.util.UUID + +class UUIDAdapter { + @ToJson + fun toJson(uuid: UUID) = uuid.toString() + + @FromJson + fun fromJson(s: String) = UUID.fromString(s) +} diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/ApiResponse.kt new file mode 100644 index 000000000000..47109faf6125 --- /dev/null +++ b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/ApiResponse.kt @@ -0,0 +1,32 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.squareup.moshi.Json +/** + * Describes the result of uploading an image resource + * @param code + * @param type + * @param message + */ +data class ApiResponse ( + @Json(name = "code") + val code: kotlin.Int? = null, + @Json(name = "type") + val type: kotlin.String? = null, + @Json(name = "message") + val message: kotlin.String? = null +) { + +} + diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/Category.kt new file mode 100644 index 000000000000..f068a02b1a03 --- /dev/null +++ b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/Category.kt @@ -0,0 +1,29 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.squareup.moshi.Json +/** + * A category for a pet + * @param id + * @param name + */ +data class Category ( + @Json(name = "id") + val id: kotlin.Long? = null, + @Json(name = "name") + val name: kotlin.String? = null +) { + +} + diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/Order.kt new file mode 100644 index 000000000000..a263c25f33c2 --- /dev/null +++ b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/Order.kt @@ -0,0 +1,59 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.squareup.moshi.Json +/** + * An order for a pets from the pet store + * @param id + * @param petId + * @param quantity + * @param shipDate + * @param status Order Status + * @param complete + */ +data class Order ( + @Json(name = "id") + val id: kotlin.Long? = null, + @Json(name = "petId") + val petId: kotlin.Long? = null, + @Json(name = "quantity") + val quantity: kotlin.Int? = null, + @Json(name = "shipDate") + val shipDate: kotlin.String? = null, + /* Order Status */ + @Json(name = "status") + val status: Order.Status? = null, + @Json(name = "complete") + val complete: kotlin.Boolean? = null +) { + + /** + * Order Status + * Values: placed,approved,delivered + */ + enum class Status(val value: kotlin.String){ + + @Json(name = "placed") + placed("placed"), + + @Json(name = "approved") + approved("approved"), + + @Json(name = "delivered") + delivered("delivered"); + + } + +} + diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/Pet.kt new file mode 100644 index 000000000000..88a536ea6227 --- /dev/null +++ b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/Pet.kt @@ -0,0 +1,61 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + +import org.openapitools.client.models.Category +import org.openapitools.client.models.Tag + +import com.squareup.moshi.Json +/** + * A pet for sale in the pet store + * @param id + * @param category + * @param name + * @param photoUrls + * @param tags + * @param status pet status in the store + */ +data class Pet ( + @Json(name = "name") + val name: kotlin.String, + @Json(name = "photoUrls") + val photoUrls: kotlin.Array, + @Json(name = "id") + val id: kotlin.Long? = null, + @Json(name = "category") + val category: Category? = null, + @Json(name = "tags") + val tags: kotlin.Array? = null, + /* pet status in the store */ + @Json(name = "status") + val status: Pet.Status? = null +) { + + /** + * pet status in the store + * Values: available,pending,sold + */ + enum class Status(val value: kotlin.String){ + + @Json(name = "available") + available("available"), + + @Json(name = "pending") + pending("pending"), + + @Json(name = "sold") + sold("sold"); + + } + +} + diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/Tag.kt new file mode 100644 index 000000000000..e67b899b1ff8 --- /dev/null +++ b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/Tag.kt @@ -0,0 +1,29 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.squareup.moshi.Json +/** + * A tag for a pet + * @param id + * @param name + */ +data class Tag ( + @Json(name = "id") + val id: kotlin.Long? = null, + @Json(name = "name") + val name: kotlin.String? = null +) { + +} + diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/User.kt new file mode 100644 index 000000000000..6a66d8e523b9 --- /dev/null +++ b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/User.kt @@ -0,0 +1,48 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.squareup.moshi.Json +/** + * A User who is purchasing from the pet store + * @param id + * @param username + * @param firstName + * @param lastName + * @param email + * @param password + * @param phone + * @param userStatus User Status + */ +data class User ( + @Json(name = "id") + val id: kotlin.Long? = null, + @Json(name = "username") + val username: kotlin.String? = null, + @Json(name = "firstName") + val firstName: kotlin.String? = null, + @Json(name = "lastName") + val lastName: kotlin.String? = null, + @Json(name = "email") + val email: kotlin.String? = null, + @Json(name = "password") + val password: kotlin.String? = null, + @Json(name = "phone") + val phone: kotlin.String? = null, + /* User Status */ + @Json(name = "userStatus") + val userStatus: kotlin.Int? = null +) { + +} + diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/apis/PetApi.kt new file mode 100644 index 000000000000..36c7ad826136 --- /dev/null +++ b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/apis/PetApi.kt @@ -0,0 +1,280 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.apis + +import org.openapitools.client.models.ApiResponse +import org.openapitools.client.models.Pet + +import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ClientException +import org.openapitools.client.infrastructure.ClientError +import org.openapitools.client.infrastructure.ServerException +import org.openapitools.client.infrastructure.ServerError +import org.openapitools.client.infrastructure.MultiValueMap +import org.openapitools.client.infrastructure.RequestConfig +import org.openapitools.client.infrastructure.RequestMethod +import org.openapitools.client.infrastructure.ResponseType +import org.openapitools.client.infrastructure.Success +import org.openapitools.client.infrastructure.toMultiValue + +class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiClient(basePath) { + + /** + * Add a new pet to the store + * + * @param body Pet object that needs to be added to the store + * @return void + */ + fun addPet(body: Pet) : Unit { + val localVariableBody: kotlin.Any? = body + val localVariableQuery: MultiValueMap = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/pet", + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + + /** + * Deletes a pet + * + * @param petId Pet id to delete + * @param apiKey (optional) + * @return void + */ + fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf("api_key" to apiKey.toString()) + val localVariableConfig = RequestConfig( + RequestMethod.DELETE, + "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter + * @return kotlin.Array + */ + @Suppress("UNCHECKED_CAST") + fun findPetsByStatus(status: kotlin.Array) : kotlin.Array { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mapOf("status" to toMultiValue(status.toList(), "csv")) + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/pet/findByStatus", + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request>( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> (response as Success<*>).data as kotlin.Array + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by + * @return kotlin.Array + */ + @Suppress("UNCHECKED_CAST") + fun findPetsByTags(tags: kotlin.Array) : kotlin.Array { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mapOf("tags" to toMultiValue(tags.toList(), "csv")) + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/pet/findByTags", + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request>( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> (response as Success<*>).data as kotlin.Array + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return + * @return Pet + */ + @Suppress("UNCHECKED_CAST") + fun getPetById(petId: kotlin.Long) : Pet { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> (response as Success<*>).data as Pet + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + + /** + * Update an existing pet + * + * @param body Pet object that needs to be added to the store + * @return void + */ + fun updatePet(body: Pet) : Unit { + val localVariableBody: kotlin.Any? = body + val localVariableQuery: MultiValueMap = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.PUT, + "/pet", + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return void + */ + fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { + val localVariableBody: kotlin.Any? = mapOf("name" to "$name", "status" to "$status") + val localVariableQuery: MultiValueMap = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "") + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + + /** + * uploads an image + * + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return ApiResponse + */ + @Suppress("UNCHECKED_CAST") + fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { + val localVariableBody: kotlin.Any? = mapOf("additionalMetadata" to "$additionalMetadata", "file" to "$file") + val localVariableQuery: MultiValueMap = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "") + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/pet/{petId}/uploadImage".replace("{"+"petId"+"}", "$petId"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> (response as Success<*>).data as ApiResponse + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + +} diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/apis/StoreApi.kt new file mode 100644 index 000000000000..891b91d68142 --- /dev/null +++ b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/apis/StoreApi.kt @@ -0,0 +1,152 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.apis + +import org.openapitools.client.models.Order + +import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ClientException +import org.openapitools.client.infrastructure.ClientError +import org.openapitools.client.infrastructure.ServerException +import org.openapitools.client.infrastructure.ServerError +import org.openapitools.client.infrastructure.MultiValueMap +import org.openapitools.client.infrastructure.RequestConfig +import org.openapitools.client.infrastructure.RequestMethod +import org.openapitools.client.infrastructure.ResponseType +import org.openapitools.client.infrastructure.Success +import org.openapitools.client.infrastructure.toMultiValue + +class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiClient(basePath) { + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted + * @return void + */ + fun deleteOrder(orderId: kotlin.String) : Unit { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.DELETE, + "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @return kotlin.collections.Map + */ + @Suppress("UNCHECKED_CAST") + fun getInventory() : kotlin.collections.Map { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/store/inventory", + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request>( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> (response as Success<*>).data as kotlin.collections.Map + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched + * @return Order + */ + @Suppress("UNCHECKED_CAST") + fun getOrderById(orderId: kotlin.Long) : Order { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> (response as Success<*>).data as Order + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + + /** + * Place an order for a pet + * + * @param body order placed for purchasing the pet + * @return Order + */ + @Suppress("UNCHECKED_CAST") + fun placeOrder(body: Order) : Order { + val localVariableBody: kotlin.Any? = body + val localVariableQuery: MultiValueMap = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/store/order", + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> (response as Success<*>).data as Order + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + +} diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/apis/UserApi.kt new file mode 100644 index 000000000000..ea538f439a1d --- /dev/null +++ b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/apis/UserApi.kt @@ -0,0 +1,273 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.apis + +import org.openapitools.client.models.User + +import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ClientException +import org.openapitools.client.infrastructure.ClientError +import org.openapitools.client.infrastructure.ServerException +import org.openapitools.client.infrastructure.ServerError +import org.openapitools.client.infrastructure.MultiValueMap +import org.openapitools.client.infrastructure.RequestConfig +import org.openapitools.client.infrastructure.RequestMethod +import org.openapitools.client.infrastructure.ResponseType +import org.openapitools.client.infrastructure.Success +import org.openapitools.client.infrastructure.toMultiValue + +class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiClient(basePath) { + + /** + * Create user + * This can only be done by the logged in user. + * @param body Created user object + * @return void + */ + fun createUser(body: User) : Unit { + val localVariableBody: kotlin.Any? = body + val localVariableQuery: MultiValueMap = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/user", + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + + /** + * Creates list of users with given input array + * + * @param body List of user object + * @return void + */ + fun createUsersWithArrayInput(body: kotlin.Array) : Unit { + val localVariableBody: kotlin.Any? = body + val localVariableQuery: MultiValueMap = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/user/createWithArray", + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + + /** + * Creates list of users with given input array + * + * @param body List of user object + * @return void + */ + fun createUsersWithListInput(body: kotlin.Array) : Unit { + val localVariableBody: kotlin.Any? = body + val localVariableQuery: MultiValueMap = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/user/createWithList", + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted + * @return void + */ + fun deleteUser(username: kotlin.String) : Unit { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.DELETE, + "/user/{username}".replace("{"+"username"+"}", "$username"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. + * @return User + */ + @Suppress("UNCHECKED_CAST") + fun getUserByName(username: kotlin.String) : User { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/user/{username}".replace("{"+"username"+"}", "$username"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> (response as Success<*>).data as User + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + + /** + * Logs user into the system + * + * @param username The user name for login + * @param password The password for login in clear text + * @return kotlin.String + */ + @Suppress("UNCHECKED_CAST") + fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mapOf("username" to listOf("$username"), "password" to listOf("$password")) + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/user/login", + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> (response as Success<*>).data as kotlin.String + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + + /** + * Logs out current logged in user session + * + * @return void + */ + fun logoutUser() : Unit { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/user/logout", + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted + * @param body Updated user object + * @return void + */ + fun updateUser(username: kotlin.String, body: User) : Unit { + val localVariableBody: kotlin.Any? = body + val localVariableQuery: MultiValueMap = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.PUT, + "/user/{username}".replace("{"+"username"+"}", "$username"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + +} diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt new file mode 100644 index 000000000000..c2c3f1f0eaea --- /dev/null +++ b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt @@ -0,0 +1,20 @@ +package org.openapitools.client.infrastructure + +typealias MultiValueMap = Map> + +fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { + "csv" -> "," + "tsv" -> "\t" + "pipes" -> "|" + "ssv" -> " " + else -> "" +} + +val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" } + +fun toMultiValue(items: List, collectionFormat: String, map: (item: Any?) -> String = defaultMultiValueConverter): List { + return when(collectionFormat) { + "multi" -> items.map(map) + else -> listOf(items.map(map).joinToString(separator = collectionDelimiter(collectionFormat))) + } +} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ApiClient.kt new file mode 100644 index 000000000000..c9107fcb0857 --- /dev/null +++ b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ApiClient.kt @@ -0,0 +1,143 @@ +package org.openapitools.client.infrastructure + +import okhttp3.OkHttpClient +import okhttp3.RequestBody +import okhttp3.MediaType +import okhttp3.FormBody +import okhttp3.HttpUrl +import okhttp3.ResponseBody +import okhttp3.Request +import java.io.File + +open class ApiClient(val baseUrl: String) { + companion object { + protected const val ContentType = "Content-Type" + protected const val Accept = "Accept" + protected const val JsonMediaType = "application/json" + protected const val FormDataMediaType = "multipart/form-data" + protected const val FormUrlEncMediaType = "application/x-www-form-urlencoded" + protected const val XmlMediaType = "application/xml" + + @JvmStatic + val client: OkHttpClient by lazy { + builder.build() + } + + @JvmStatic + val builder: OkHttpClient.Builder = OkHttpClient.Builder() + } + + protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = + when { + content is File -> RequestBody.create( + MediaType.parse(mediaType), content + ) + mediaType == FormDataMediaType || mediaType == FormUrlEncMediaType -> { + FormBody.Builder().apply { + // content's type *must* be Map + @Suppress("UNCHECKED_CAST") + (content as Map).forEach { (key, value) -> + add(key, value) + } + }.build() + } + mediaType == JsonMediaType -> RequestBody.create( + MediaType.parse(mediaType), Serializer.moshi.adapter(T::class.java).toJson(content) + ) + mediaType == XmlMediaType -> TODO("xml not currently supported.") + // TODO: this should be extended with other serializers + else -> TODO("requestBody currently only supports JSON body and File body.") + } + + protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { + if(body == null) { + return null + } + val bodyContent = body.string() + if (bodyContent.isEmpty()) { + return null + } + return when(mediaType) { + JsonMediaType -> Serializer.moshi.adapter(T::class.java).fromJson(bodyContent) + else -> TODO("responseBody currently only supports JSON body.") + } + } + + protected inline fun request(requestConfig: RequestConfig, body : Any? = null): ApiInfrastructureResponse { + val httpUrl = HttpUrl.parse(baseUrl) ?: throw IllegalStateException("baseUrl is invalid.") + + val url = httpUrl.newBuilder() + .addPathSegments(requestConfig.path.trimStart('/')) + .apply { + requestConfig.query.forEach { query -> + query.value.forEach { queryValue -> + addQueryParameter(query.key, queryValue) + } + } + }.build() + + // take content-type/accept from spec or set to default (application/json) if not defined + if (requestConfig.headers[ContentType].isNullOrEmpty()) { + requestConfig.headers[ContentType] = JsonMediaType + } + if (requestConfig.headers[Accept].isNullOrEmpty()) { + requestConfig.headers[Accept] = JsonMediaType + } + val headers = requestConfig.headers + + if(headers[ContentType] ?: "" == "") { + throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") + } + + if(headers[Accept] ?: "" == "") { + throw kotlin.IllegalStateException("Missing Accept header. This is required.") + } + + // TODO: support multiple contentType options here. + val contentType = (headers[ContentType] as String).substringBefore(";").toLowerCase() + + val request = when (requestConfig.method) { + RequestMethod.DELETE -> Request.Builder().url(url).delete() + RequestMethod.GET -> Request.Builder().url(url) + RequestMethod.HEAD -> Request.Builder().url(url).head() + RequestMethod.PATCH -> Request.Builder().url(url).patch(requestBody(body, contentType)) + RequestMethod.PUT -> Request.Builder().url(url).put(requestBody(body, contentType)) + RequestMethod.POST -> Request.Builder().url(url).post(requestBody(body, contentType)) + RequestMethod.OPTIONS -> Request.Builder().url(url).method("OPTIONS", null) + }.apply { + headers.forEach { header -> addHeader(header.key, header.value) } + }.build() + + val response = client.newCall(request).execute() + val accept = response.header(ContentType)?.substringBefore(";")?.toLowerCase() + + // TODO: handle specific mapping types. e.g. Map> + when { + response.isRedirect -> return Redirection( + response.code(), + response.headers().toMultimap() + ) + response.isInformational -> return Informational( + response.message(), + response.code(), + response.headers().toMultimap() + ) + response.isSuccessful -> return Success( + responseBody(response.body(), accept), + response.code(), + response.headers().toMultimap() + ) + response.isClientError -> return ClientError( + response.body()?.string(), + response.code(), + response.headers().toMultimap() + ) + else -> return ServerError( + null, + response.body()?.string(), + response.code(), + response.headers().toMultimap() + ) + } + } +} diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt new file mode 100644 index 000000000000..f1a8aecc914b --- /dev/null +++ b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt @@ -0,0 +1,40 @@ +package org.openapitools.client.infrastructure + +enum class ResponseType { + Success, Informational, Redirection, ClientError, ServerError +} + +abstract class ApiInfrastructureResponse(val responseType: ResponseType) { + abstract val statusCode: Int + abstract val headers: Map> +} + +class Success( + val data: T, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +): ApiInfrastructureResponse(ResponseType.Success) + +class Informational( + val statusText: String, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiInfrastructureResponse(ResponseType.Informational) + +class Redirection( + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiInfrastructureResponse(ResponseType.Redirection) + +class ClientError( + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiInfrastructureResponse(ResponseType.ClientError) + +class ServerError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> +): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt new file mode 100644 index 000000000000..dd34bd48b2c0 --- /dev/null +++ b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt @@ -0,0 +1,29 @@ +package org.openapitools.client.infrastructure + +import kotlin.properties.ReadWriteProperty +import kotlin.reflect.KProperty + +object ApplicationDelegates { + /** + * Provides a property delegate, allowing the property to be set once and only once. + * + * If unset (no default value), a get on the property will throw [IllegalStateException]. + */ + fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) + + private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { + private var isSet = false + private var value: T? = defaultValue + + override fun getValue(thisRef: Any?, property: KProperty<*>): T { + return value ?: throw IllegalStateException("${property.name} not initialized") + } + + override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { + if (!isSet) { + this.value = value + isSet = true + } + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt new file mode 100644 index 000000000000..617ac3fe9069 --- /dev/null +++ b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt @@ -0,0 +1,12 @@ +package org.openapitools.client.infrastructure + +import com.squareup.moshi.FromJson +import com.squareup.moshi.ToJson + +class ByteArrayAdapter { + @ToJson + fun toJson(data: ByteArray): String = String(data) + + @FromJson + fun fromJson(data: String): ByteArray = data.toByteArray() +} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/Errors.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/Errors.kt new file mode 100644 index 000000000000..2f3b0157ba70 --- /dev/null +++ b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/Errors.kt @@ -0,0 +1,42 @@ +@file:Suppress("unused") +package org.openapitools.client.infrastructure + +import java.lang.RuntimeException + +open class ClientException : RuntimeException { + + /** + * Constructs an [ClientException] with no detail message. + */ + constructor() : super() + + /** + * Constructs an [ClientException] with the specified detail message. + + * @param message the detail message. + */ + constructor(message: kotlin.String) : super(message) + + companion object { + private const val serialVersionUID: Long = 123L + } +} + +open class ServerException : RuntimeException { + + /** + * Constructs an [ServerException] with no detail message. + */ + constructor() : super() + + /** + * Constructs an [ServerException] with the specified detail message. + + * @param message the detail message. + */ + constructor(message: kotlin.String) : super(message) + + companion object { + private const val serialVersionUID: Long = 456L + } +} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt new file mode 100644 index 000000000000..ff5439aeb42f --- /dev/null +++ b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt @@ -0,0 +1,19 @@ +package org.openapitools.client.infrastructure + +import com.squareup.moshi.FromJson +import com.squareup.moshi.ToJson +import org.threeten.bp.LocalDate +import org.threeten.bp.format.DateTimeFormatter + +class LocalDateAdapter { + @ToJson + fun toJson(value: LocalDate): String { + return DateTimeFormatter.ISO_LOCAL_DATE.format(value) + } + + @FromJson + fun fromJson(value: String): LocalDate { + return LocalDate.parse(value, DateTimeFormatter.ISO_LOCAL_DATE) + } + +} diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt new file mode 100644 index 000000000000..710a9cc13178 --- /dev/null +++ b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt @@ -0,0 +1,19 @@ +package org.openapitools.client.infrastructure + +import com.squareup.moshi.FromJson +import com.squareup.moshi.ToJson +import org.threeten.bp.LocalDateTime +import org.threeten.bp.format.DateTimeFormatter + +class LocalDateTimeAdapter { + @ToJson + fun toJson(value: LocalDateTime): String { + return DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(value) + } + + @FromJson + fun fromJson(value: String): LocalDateTime { + return LocalDateTime.parse(value, DateTimeFormatter.ISO_LOCAL_DATE_TIME) + } + +} diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt new file mode 100644 index 000000000000..53e689237d71 --- /dev/null +++ b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt @@ -0,0 +1,16 @@ +package org.openapitools.client.infrastructure + +/** + * Defines a config object for a given request. + * NOTE: This object doesn't include 'body' because it + * allows for caching of the constructed object + * for many request definitions. + * NOTE: Headers is a Map because rfc2616 defines + * multi-valued headers as csv-only. + */ +data class RequestConfig( + val method: RequestMethod, + val path: String, + val headers: MutableMap = mutableMapOf(), + val query: Map> = mapOf() +) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt new file mode 100644 index 000000000000..931b12b8bd7a --- /dev/null +++ b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt @@ -0,0 +1,8 @@ +package org.openapitools.client.infrastructure + +/** + * Provides enumerated HTTP verbs + */ +enum class RequestMethod { + GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT +} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt new file mode 100644 index 000000000000..f50104a6f352 --- /dev/null +++ b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt @@ -0,0 +1,23 @@ +package org.openapitools.client.infrastructure + +import okhttp3.Response + +/** + * Provides an extension to evaluation whether the response is a 1xx code + */ +val Response.isInformational : Boolean get() = this.code() in 100..199 + +/** + * Provides an extension to evaluation whether the response is a 3xx code + */ +val Response.isRedirect : Boolean get() = this.code() in 300..399 + +/** + * Provides an extension to evaluation whether the response is a 4xx code + */ +val Response.isClientError : Boolean get() = this.code() in 400..499 + +/** + * Provides an extension to evaluation whether the response is a 5xx (Standard) through 999 (non-standard) code + */ +val Response.isServerError : Boolean get() = this.code() in 500..999 \ No newline at end of file diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/Serializer.kt new file mode 100644 index 000000000000..7c5a353e0f7f --- /dev/null +++ b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/Serializer.kt @@ -0,0 +1,18 @@ +package org.openapitools.client.infrastructure + +import com.squareup.moshi.Moshi +import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter +import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory +import java.util.Date + +object Serializer { + @JvmStatic + val moshi: Moshi = Moshi.Builder() + .add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe()) + .add(LocalDateTimeAdapter()) + .add(LocalDateAdapter()) + .add(UUIDAdapter()) + .add(ByteArrayAdapter()) + .add(KotlinJsonAdapterFactory()) + .build() +} diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt new file mode 100644 index 000000000000..a4a44cc18b73 --- /dev/null +++ b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt @@ -0,0 +1,13 @@ +package org.openapitools.client.infrastructure + +import com.squareup.moshi.FromJson +import com.squareup.moshi.ToJson +import java.util.UUID + +class UUIDAdapter { + @ToJson + fun toJson(uuid: UUID) = uuid.toString() + + @FromJson + fun fromJson(s: String) = UUID.fromString(s) +} diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/ApiResponse.kt new file mode 100644 index 000000000000..47109faf6125 --- /dev/null +++ b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/ApiResponse.kt @@ -0,0 +1,32 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.squareup.moshi.Json +/** + * Describes the result of uploading an image resource + * @param code + * @param type + * @param message + */ +data class ApiResponse ( + @Json(name = "code") + val code: kotlin.Int? = null, + @Json(name = "type") + val type: kotlin.String? = null, + @Json(name = "message") + val message: kotlin.String? = null +) { + +} + diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/Category.kt new file mode 100644 index 000000000000..f068a02b1a03 --- /dev/null +++ b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/Category.kt @@ -0,0 +1,29 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.squareup.moshi.Json +/** + * A category for a pet + * @param id + * @param name + */ +data class Category ( + @Json(name = "id") + val id: kotlin.Long? = null, + @Json(name = "name") + val name: kotlin.String? = null +) { + +} + diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/Order.kt new file mode 100644 index 000000000000..916fe3094b23 --- /dev/null +++ b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/Order.kt @@ -0,0 +1,59 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.squareup.moshi.Json +/** + * An order for a pets from the pet store + * @param id + * @param petId + * @param quantity + * @param shipDate + * @param status Order Status + * @param complete + */ +data class Order ( + @Json(name = "id") + val id: kotlin.Long? = null, + @Json(name = "petId") + val petId: kotlin.Long? = null, + @Json(name = "quantity") + val quantity: kotlin.Int? = null, + @Json(name = "shipDate") + val shipDate: org.threeten.bp.LocalDateTime? = null, + /* Order Status */ + @Json(name = "status") + val status: Order.Status? = null, + @Json(name = "complete") + val complete: kotlin.Boolean? = null +) { + + /** + * Order Status + * Values: placed,approved,delivered + */ + enum class Status(val value: kotlin.String){ + + @Json(name = "placed") + placed("placed"), + + @Json(name = "approved") + approved("approved"), + + @Json(name = "delivered") + delivered("delivered"); + + } + +} + diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/Pet.kt new file mode 100644 index 000000000000..88a536ea6227 --- /dev/null +++ b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/Pet.kt @@ -0,0 +1,61 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + +import org.openapitools.client.models.Category +import org.openapitools.client.models.Tag + +import com.squareup.moshi.Json +/** + * A pet for sale in the pet store + * @param id + * @param category + * @param name + * @param photoUrls + * @param tags + * @param status pet status in the store + */ +data class Pet ( + @Json(name = "name") + val name: kotlin.String, + @Json(name = "photoUrls") + val photoUrls: kotlin.Array, + @Json(name = "id") + val id: kotlin.Long? = null, + @Json(name = "category") + val category: Category? = null, + @Json(name = "tags") + val tags: kotlin.Array? = null, + /* pet status in the store */ + @Json(name = "status") + val status: Pet.Status? = null +) { + + /** + * pet status in the store + * Values: available,pending,sold + */ + enum class Status(val value: kotlin.String){ + + @Json(name = "available") + available("available"), + + @Json(name = "pending") + pending("pending"), + + @Json(name = "sold") + sold("sold"); + + } + +} + diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/Tag.kt new file mode 100644 index 000000000000..e67b899b1ff8 --- /dev/null +++ b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/Tag.kt @@ -0,0 +1,29 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.squareup.moshi.Json +/** + * A tag for a pet + * @param id + * @param name + */ +data class Tag ( + @Json(name = "id") + val id: kotlin.Long? = null, + @Json(name = "name") + val name: kotlin.String? = null +) { + +} + diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/User.kt new file mode 100644 index 000000000000..6a66d8e523b9 --- /dev/null +++ b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/User.kt @@ -0,0 +1,48 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.squareup.moshi.Json +/** + * A User who is purchasing from the pet store + * @param id + * @param username + * @param firstName + * @param lastName + * @param email + * @param password + * @param phone + * @param userStatus User Status + */ +data class User ( + @Json(name = "id") + val id: kotlin.Long? = null, + @Json(name = "username") + val username: kotlin.String? = null, + @Json(name = "firstName") + val firstName: kotlin.String? = null, + @Json(name = "lastName") + val lastName: kotlin.String? = null, + @Json(name = "email") + val email: kotlin.String? = null, + @Json(name = "password") + val password: kotlin.String? = null, + @Json(name = "phone") + val phone: kotlin.String? = null, + /* User Status */ + @Json(name = "userStatus") + val userStatus: kotlin.Int? = null +) { + +} + diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/apis/PetApi.kt new file mode 100644 index 000000000000..36c7ad826136 --- /dev/null +++ b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/apis/PetApi.kt @@ -0,0 +1,280 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.apis + +import org.openapitools.client.models.ApiResponse +import org.openapitools.client.models.Pet + +import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ClientException +import org.openapitools.client.infrastructure.ClientError +import org.openapitools.client.infrastructure.ServerException +import org.openapitools.client.infrastructure.ServerError +import org.openapitools.client.infrastructure.MultiValueMap +import org.openapitools.client.infrastructure.RequestConfig +import org.openapitools.client.infrastructure.RequestMethod +import org.openapitools.client.infrastructure.ResponseType +import org.openapitools.client.infrastructure.Success +import org.openapitools.client.infrastructure.toMultiValue + +class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiClient(basePath) { + + /** + * Add a new pet to the store + * + * @param body Pet object that needs to be added to the store + * @return void + */ + fun addPet(body: Pet) : Unit { + val localVariableBody: kotlin.Any? = body + val localVariableQuery: MultiValueMap = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/pet", + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + + /** + * Deletes a pet + * + * @param petId Pet id to delete + * @param apiKey (optional) + * @return void + */ + fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf("api_key" to apiKey.toString()) + val localVariableConfig = RequestConfig( + RequestMethod.DELETE, + "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter + * @return kotlin.Array + */ + @Suppress("UNCHECKED_CAST") + fun findPetsByStatus(status: kotlin.Array) : kotlin.Array { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mapOf("status" to toMultiValue(status.toList(), "csv")) + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/pet/findByStatus", + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request>( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> (response as Success<*>).data as kotlin.Array + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by + * @return kotlin.Array + */ + @Suppress("UNCHECKED_CAST") + fun findPetsByTags(tags: kotlin.Array) : kotlin.Array { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mapOf("tags" to toMultiValue(tags.toList(), "csv")) + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/pet/findByTags", + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request>( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> (response as Success<*>).data as kotlin.Array + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return + * @return Pet + */ + @Suppress("UNCHECKED_CAST") + fun getPetById(petId: kotlin.Long) : Pet { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> (response as Success<*>).data as Pet + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + + /** + * Update an existing pet + * + * @param body Pet object that needs to be added to the store + * @return void + */ + fun updatePet(body: Pet) : Unit { + val localVariableBody: kotlin.Any? = body + val localVariableQuery: MultiValueMap = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.PUT, + "/pet", + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return void + */ + fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { + val localVariableBody: kotlin.Any? = mapOf("name" to "$name", "status" to "$status") + val localVariableQuery: MultiValueMap = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "") + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + + /** + * uploads an image + * + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return ApiResponse + */ + @Suppress("UNCHECKED_CAST") + fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { + val localVariableBody: kotlin.Any? = mapOf("additionalMetadata" to "$additionalMetadata", "file" to "$file") + val localVariableQuery: MultiValueMap = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "") + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/pet/{petId}/uploadImage".replace("{"+"petId"+"}", "$petId"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> (response as Success<*>).data as ApiResponse + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + +} diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/apis/StoreApi.kt new file mode 100644 index 000000000000..891b91d68142 --- /dev/null +++ b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/apis/StoreApi.kt @@ -0,0 +1,152 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.apis + +import org.openapitools.client.models.Order + +import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ClientException +import org.openapitools.client.infrastructure.ClientError +import org.openapitools.client.infrastructure.ServerException +import org.openapitools.client.infrastructure.ServerError +import org.openapitools.client.infrastructure.MultiValueMap +import org.openapitools.client.infrastructure.RequestConfig +import org.openapitools.client.infrastructure.RequestMethod +import org.openapitools.client.infrastructure.ResponseType +import org.openapitools.client.infrastructure.Success +import org.openapitools.client.infrastructure.toMultiValue + +class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiClient(basePath) { + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted + * @return void + */ + fun deleteOrder(orderId: kotlin.String) : Unit { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.DELETE, + "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @return kotlin.collections.Map + */ + @Suppress("UNCHECKED_CAST") + fun getInventory() : kotlin.collections.Map { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/store/inventory", + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request>( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> (response as Success<*>).data as kotlin.collections.Map + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched + * @return Order + */ + @Suppress("UNCHECKED_CAST") + fun getOrderById(orderId: kotlin.Long) : Order { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> (response as Success<*>).data as Order + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + + /** + * Place an order for a pet + * + * @param body order placed for purchasing the pet + * @return Order + */ + @Suppress("UNCHECKED_CAST") + fun placeOrder(body: Order) : Order { + val localVariableBody: kotlin.Any? = body + val localVariableQuery: MultiValueMap = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/store/order", + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> (response as Success<*>).data as Order + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + +} diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/apis/UserApi.kt new file mode 100644 index 000000000000..ea538f439a1d --- /dev/null +++ b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/apis/UserApi.kt @@ -0,0 +1,273 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.apis + +import org.openapitools.client.models.User + +import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ClientException +import org.openapitools.client.infrastructure.ClientError +import org.openapitools.client.infrastructure.ServerException +import org.openapitools.client.infrastructure.ServerError +import org.openapitools.client.infrastructure.MultiValueMap +import org.openapitools.client.infrastructure.RequestConfig +import org.openapitools.client.infrastructure.RequestMethod +import org.openapitools.client.infrastructure.ResponseType +import org.openapitools.client.infrastructure.Success +import org.openapitools.client.infrastructure.toMultiValue + +class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiClient(basePath) { + + /** + * Create user + * This can only be done by the logged in user. + * @param body Created user object + * @return void + */ + fun createUser(body: User) : Unit { + val localVariableBody: kotlin.Any? = body + val localVariableQuery: MultiValueMap = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/user", + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + + /** + * Creates list of users with given input array + * + * @param body List of user object + * @return void + */ + fun createUsersWithArrayInput(body: kotlin.Array) : Unit { + val localVariableBody: kotlin.Any? = body + val localVariableQuery: MultiValueMap = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/user/createWithArray", + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + + /** + * Creates list of users with given input array + * + * @param body List of user object + * @return void + */ + fun createUsersWithListInput(body: kotlin.Array) : Unit { + val localVariableBody: kotlin.Any? = body + val localVariableQuery: MultiValueMap = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/user/createWithList", + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted + * @return void + */ + fun deleteUser(username: kotlin.String) : Unit { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.DELETE, + "/user/{username}".replace("{"+"username"+"}", "$username"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. + * @return User + */ + @Suppress("UNCHECKED_CAST") + fun getUserByName(username: kotlin.String) : User { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/user/{username}".replace("{"+"username"+"}", "$username"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> (response as Success<*>).data as User + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + + /** + * Logs user into the system + * + * @param username The user name for login + * @param password The password for login in clear text + * @return kotlin.String + */ + @Suppress("UNCHECKED_CAST") + fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mapOf("username" to listOf("$username"), "password" to listOf("$password")) + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/user/login", + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> (response as Success<*>).data as kotlin.String + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + + /** + * Logs out current logged in user session + * + * @return void + */ + fun logoutUser() : Unit { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/user/logout", + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted + * @param body Updated user object + * @return void + */ + fun updateUser(username: kotlin.String, body: User) : Unit { + val localVariableBody: kotlin.Any? = body + val localVariableQuery: MultiValueMap = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.PUT, + "/user/{username}".replace("{"+"username"+"}", "$username"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val response = request( + localVariableConfig, + localVariableBody + ) + + return when (response.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> TODO() + ResponseType.Redirection -> TODO() + ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") + ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + } + } + +} diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt new file mode 100644 index 000000000000..c2c3f1f0eaea --- /dev/null +++ b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt @@ -0,0 +1,20 @@ +package org.openapitools.client.infrastructure + +typealias MultiValueMap = Map> + +fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { + "csv" -> "," + "tsv" -> "\t" + "pipes" -> "|" + "ssv" -> " " + else -> "" +} + +val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" } + +fun toMultiValue(items: List, collectionFormat: String, map: (item: Any?) -> String = defaultMultiValueConverter): List { + return when(collectionFormat) { + "multi" -> items.map(map) + else -> listOf(items.map(map).joinToString(separator = collectionDelimiter(collectionFormat))) + } +} \ No newline at end of file diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ApiClient.kt new file mode 100644 index 000000000000..c9107fcb0857 --- /dev/null +++ b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ApiClient.kt @@ -0,0 +1,143 @@ +package org.openapitools.client.infrastructure + +import okhttp3.OkHttpClient +import okhttp3.RequestBody +import okhttp3.MediaType +import okhttp3.FormBody +import okhttp3.HttpUrl +import okhttp3.ResponseBody +import okhttp3.Request +import java.io.File + +open class ApiClient(val baseUrl: String) { + companion object { + protected const val ContentType = "Content-Type" + protected const val Accept = "Accept" + protected const val JsonMediaType = "application/json" + protected const val FormDataMediaType = "multipart/form-data" + protected const val FormUrlEncMediaType = "application/x-www-form-urlencoded" + protected const val XmlMediaType = "application/xml" + + @JvmStatic + val client: OkHttpClient by lazy { + builder.build() + } + + @JvmStatic + val builder: OkHttpClient.Builder = OkHttpClient.Builder() + } + + protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = + when { + content is File -> RequestBody.create( + MediaType.parse(mediaType), content + ) + mediaType == FormDataMediaType || mediaType == FormUrlEncMediaType -> { + FormBody.Builder().apply { + // content's type *must* be Map + @Suppress("UNCHECKED_CAST") + (content as Map).forEach { (key, value) -> + add(key, value) + } + }.build() + } + mediaType == JsonMediaType -> RequestBody.create( + MediaType.parse(mediaType), Serializer.moshi.adapter(T::class.java).toJson(content) + ) + mediaType == XmlMediaType -> TODO("xml not currently supported.") + // TODO: this should be extended with other serializers + else -> TODO("requestBody currently only supports JSON body and File body.") + } + + protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { + if(body == null) { + return null + } + val bodyContent = body.string() + if (bodyContent.isEmpty()) { + return null + } + return when(mediaType) { + JsonMediaType -> Serializer.moshi.adapter(T::class.java).fromJson(bodyContent) + else -> TODO("responseBody currently only supports JSON body.") + } + } + + protected inline fun request(requestConfig: RequestConfig, body : Any? = null): ApiInfrastructureResponse { + val httpUrl = HttpUrl.parse(baseUrl) ?: throw IllegalStateException("baseUrl is invalid.") + + val url = httpUrl.newBuilder() + .addPathSegments(requestConfig.path.trimStart('/')) + .apply { + requestConfig.query.forEach { query -> + query.value.forEach { queryValue -> + addQueryParameter(query.key, queryValue) + } + } + }.build() + + // take content-type/accept from spec or set to default (application/json) if not defined + if (requestConfig.headers[ContentType].isNullOrEmpty()) { + requestConfig.headers[ContentType] = JsonMediaType + } + if (requestConfig.headers[Accept].isNullOrEmpty()) { + requestConfig.headers[Accept] = JsonMediaType + } + val headers = requestConfig.headers + + if(headers[ContentType] ?: "" == "") { + throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") + } + + if(headers[Accept] ?: "" == "") { + throw kotlin.IllegalStateException("Missing Accept header. This is required.") + } + + // TODO: support multiple contentType options here. + val contentType = (headers[ContentType] as String).substringBefore(";").toLowerCase() + + val request = when (requestConfig.method) { + RequestMethod.DELETE -> Request.Builder().url(url).delete() + RequestMethod.GET -> Request.Builder().url(url) + RequestMethod.HEAD -> Request.Builder().url(url).head() + RequestMethod.PATCH -> Request.Builder().url(url).patch(requestBody(body, contentType)) + RequestMethod.PUT -> Request.Builder().url(url).put(requestBody(body, contentType)) + RequestMethod.POST -> Request.Builder().url(url).post(requestBody(body, contentType)) + RequestMethod.OPTIONS -> Request.Builder().url(url).method("OPTIONS", null) + }.apply { + headers.forEach { header -> addHeader(header.key, header.value) } + }.build() + + val response = client.newCall(request).execute() + val accept = response.header(ContentType)?.substringBefore(";")?.toLowerCase() + + // TODO: handle specific mapping types. e.g. Map> + when { + response.isRedirect -> return Redirection( + response.code(), + response.headers().toMultimap() + ) + response.isInformational -> return Informational( + response.message(), + response.code(), + response.headers().toMultimap() + ) + response.isSuccessful -> return Success( + responseBody(response.body(), accept), + response.code(), + response.headers().toMultimap() + ) + response.isClientError -> return ClientError( + response.body()?.string(), + response.code(), + response.headers().toMultimap() + ) + else -> return ServerError( + null, + response.body()?.string(), + response.code(), + response.headers().toMultimap() + ) + } + } +} diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt new file mode 100644 index 000000000000..f1a8aecc914b --- /dev/null +++ b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt @@ -0,0 +1,40 @@ +package org.openapitools.client.infrastructure + +enum class ResponseType { + Success, Informational, Redirection, ClientError, ServerError +} + +abstract class ApiInfrastructureResponse(val responseType: ResponseType) { + abstract val statusCode: Int + abstract val headers: Map> +} + +class Success( + val data: T, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +): ApiInfrastructureResponse(ResponseType.Success) + +class Informational( + val statusText: String, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiInfrastructureResponse(ResponseType.Informational) + +class Redirection( + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiInfrastructureResponse(ResponseType.Redirection) + +class ClientError( + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiInfrastructureResponse(ResponseType.ClientError) + +class ServerError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> +): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt new file mode 100644 index 000000000000..dd34bd48b2c0 --- /dev/null +++ b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt @@ -0,0 +1,29 @@ +package org.openapitools.client.infrastructure + +import kotlin.properties.ReadWriteProperty +import kotlin.reflect.KProperty + +object ApplicationDelegates { + /** + * Provides a property delegate, allowing the property to be set once and only once. + * + * If unset (no default value), a get on the property will throw [IllegalStateException]. + */ + fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) + + private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { + private var isSet = false + private var value: T? = defaultValue + + override fun getValue(thisRef: Any?, property: KProperty<*>): T { + return value ?: throw IllegalStateException("${property.name} not initialized") + } + + override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { + if (!isSet) { + this.value = value + isSet = true + } + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt new file mode 100644 index 000000000000..617ac3fe9069 --- /dev/null +++ b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt @@ -0,0 +1,12 @@ +package org.openapitools.client.infrastructure + +import com.squareup.moshi.FromJson +import com.squareup.moshi.ToJson + +class ByteArrayAdapter { + @ToJson + fun toJson(data: ByteArray): String = String(data) + + @FromJson + fun fromJson(data: String): ByteArray = data.toByteArray() +} \ No newline at end of file diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/Errors.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/Errors.kt new file mode 100644 index 000000000000..2f3b0157ba70 --- /dev/null +++ b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/Errors.kt @@ -0,0 +1,42 @@ +@file:Suppress("unused") +package org.openapitools.client.infrastructure + +import java.lang.RuntimeException + +open class ClientException : RuntimeException { + + /** + * Constructs an [ClientException] with no detail message. + */ + constructor() : super() + + /** + * Constructs an [ClientException] with the specified detail message. + + * @param message the detail message. + */ + constructor(message: kotlin.String) : super(message) + + companion object { + private const val serialVersionUID: Long = 123L + } +} + +open class ServerException : RuntimeException { + + /** + * Constructs an [ServerException] with no detail message. + */ + constructor() : super() + + /** + * Constructs an [ServerException] with the specified detail message. + + * @param message the detail message. + */ + constructor(message: kotlin.String) : super(message) + + companion object { + private const val serialVersionUID: Long = 456L + } +} \ No newline at end of file diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt new file mode 100644 index 000000000000..b2e1654479a0 --- /dev/null +++ b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt @@ -0,0 +1,19 @@ +package org.openapitools.client.infrastructure + +import com.squareup.moshi.FromJson +import com.squareup.moshi.ToJson +import java.time.LocalDate +import java.time.format.DateTimeFormatter + +class LocalDateAdapter { + @ToJson + fun toJson(value: LocalDate): String { + return DateTimeFormatter.ISO_LOCAL_DATE.format(value) + } + + @FromJson + fun fromJson(value: String): LocalDate { + return LocalDate.parse(value, DateTimeFormatter.ISO_LOCAL_DATE) + } + +} diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt new file mode 100644 index 000000000000..e082db94811d --- /dev/null +++ b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt @@ -0,0 +1,19 @@ +package org.openapitools.client.infrastructure + +import com.squareup.moshi.FromJson +import com.squareup.moshi.ToJson +import java.time.LocalDateTime +import java.time.format.DateTimeFormatter + +class LocalDateTimeAdapter { + @ToJson + fun toJson(value: LocalDateTime): String { + return DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(value) + } + + @FromJson + fun fromJson(value: String): LocalDateTime { + return LocalDateTime.parse(value, DateTimeFormatter.ISO_LOCAL_DATE_TIME) + } + +} diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt new file mode 100644 index 000000000000..53e689237d71 --- /dev/null +++ b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt @@ -0,0 +1,16 @@ +package org.openapitools.client.infrastructure + +/** + * Defines a config object for a given request. + * NOTE: This object doesn't include 'body' because it + * allows for caching of the constructed object + * for many request definitions. + * NOTE: Headers is a Map because rfc2616 defines + * multi-valued headers as csv-only. + */ +data class RequestConfig( + val method: RequestMethod, + val path: String, + val headers: MutableMap = mutableMapOf(), + val query: Map> = mapOf() +) \ No newline at end of file diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt new file mode 100644 index 000000000000..931b12b8bd7a --- /dev/null +++ b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt @@ -0,0 +1,8 @@ +package org.openapitools.client.infrastructure + +/** + * Provides enumerated HTTP verbs + */ +enum class RequestMethod { + GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT +} \ No newline at end of file diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt new file mode 100644 index 000000000000..f50104a6f352 --- /dev/null +++ b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt @@ -0,0 +1,23 @@ +package org.openapitools.client.infrastructure + +import okhttp3.Response + +/** + * Provides an extension to evaluation whether the response is a 1xx code + */ +val Response.isInformational : Boolean get() = this.code() in 100..199 + +/** + * Provides an extension to evaluation whether the response is a 3xx code + */ +val Response.isRedirect : Boolean get() = this.code() in 300..399 + +/** + * Provides an extension to evaluation whether the response is a 4xx code + */ +val Response.isClientError : Boolean get() = this.code() in 400..499 + +/** + * Provides an extension to evaluation whether the response is a 5xx (Standard) through 999 (non-standard) code + */ +val Response.isServerError : Boolean get() = this.code() in 500..999 \ No newline at end of file diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/Serializer.kt new file mode 100644 index 000000000000..7c5a353e0f7f --- /dev/null +++ b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/Serializer.kt @@ -0,0 +1,18 @@ +package org.openapitools.client.infrastructure + +import com.squareup.moshi.Moshi +import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter +import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory +import java.util.Date + +object Serializer { + @JvmStatic + val moshi: Moshi = Moshi.Builder() + .add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe()) + .add(LocalDateTimeAdapter()) + .add(LocalDateAdapter()) + .add(UUIDAdapter()) + .add(ByteArrayAdapter()) + .add(KotlinJsonAdapterFactory()) + .build() +} diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt new file mode 100644 index 000000000000..a4a44cc18b73 --- /dev/null +++ b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt @@ -0,0 +1,13 @@ +package org.openapitools.client.infrastructure + +import com.squareup.moshi.FromJson +import com.squareup.moshi.ToJson +import java.util.UUID + +class UUIDAdapter { + @ToJson + fun toJson(uuid: UUID) = uuid.toString() + + @FromJson + fun fromJson(s: String) = UUID.fromString(s) +} diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/ApiResponse.kt new file mode 100644 index 000000000000..47109faf6125 --- /dev/null +++ b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/ApiResponse.kt @@ -0,0 +1,32 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.squareup.moshi.Json +/** + * Describes the result of uploading an image resource + * @param code + * @param type + * @param message + */ +data class ApiResponse ( + @Json(name = "code") + val code: kotlin.Int? = null, + @Json(name = "type") + val type: kotlin.String? = null, + @Json(name = "message") + val message: kotlin.String? = null +) { + +} + diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/Category.kt new file mode 100644 index 000000000000..f068a02b1a03 --- /dev/null +++ b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/Category.kt @@ -0,0 +1,29 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.squareup.moshi.Json +/** + * A category for a pet + * @param id + * @param name + */ +data class Category ( + @Json(name = "id") + val id: kotlin.Long? = null, + @Json(name = "name") + val name: kotlin.String? = null +) { + +} + diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/Order.kt new file mode 100644 index 000000000000..00e62b88092c --- /dev/null +++ b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/Order.kt @@ -0,0 +1,59 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.squareup.moshi.Json +/** + * An order for a pets from the pet store + * @param id + * @param petId + * @param quantity + * @param shipDate + * @param status Order Status + * @param complete + */ +data class Order ( + @Json(name = "id") + val id: kotlin.Long? = null, + @Json(name = "petId") + val petId: kotlin.Long? = null, + @Json(name = "quantity") + val quantity: kotlin.Int? = null, + @Json(name = "shipDate") + val shipDate: java.time.LocalDateTime? = null, + /* Order Status */ + @Json(name = "status") + val status: Order.Status? = null, + @Json(name = "complete") + val complete: kotlin.Boolean? = null +) { + + /** + * Order Status + * Values: placed,approved,delivered + */ + enum class Status(val value: kotlin.String){ + + @Json(name = "placed") + placed("placed"), + + @Json(name = "approved") + approved("approved"), + + @Json(name = "delivered") + delivered("delivered"); + + } + +} + diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/Pet.kt new file mode 100644 index 000000000000..88a536ea6227 --- /dev/null +++ b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/Pet.kt @@ -0,0 +1,61 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + +import org.openapitools.client.models.Category +import org.openapitools.client.models.Tag + +import com.squareup.moshi.Json +/** + * A pet for sale in the pet store + * @param id + * @param category + * @param name + * @param photoUrls + * @param tags + * @param status pet status in the store + */ +data class Pet ( + @Json(name = "name") + val name: kotlin.String, + @Json(name = "photoUrls") + val photoUrls: kotlin.Array, + @Json(name = "id") + val id: kotlin.Long? = null, + @Json(name = "category") + val category: Category? = null, + @Json(name = "tags") + val tags: kotlin.Array? = null, + /* pet status in the store */ + @Json(name = "status") + val status: Pet.Status? = null +) { + + /** + * pet status in the store + * Values: available,pending,sold + */ + enum class Status(val value: kotlin.String){ + + @Json(name = "available") + available("available"), + + @Json(name = "pending") + pending("pending"), + + @Json(name = "sold") + sold("sold"); + + } + +} + diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/Tag.kt new file mode 100644 index 000000000000..e67b899b1ff8 --- /dev/null +++ b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/Tag.kt @@ -0,0 +1,29 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.squareup.moshi.Json +/** + * A tag for a pet + * @param id + * @param name + */ +data class Tag ( + @Json(name = "id") + val id: kotlin.Long? = null, + @Json(name = "name") + val name: kotlin.String? = null +) { + +} + diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/User.kt new file mode 100644 index 000000000000..6a66d8e523b9 --- /dev/null +++ b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/User.kt @@ -0,0 +1,48 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.squareup.moshi.Json +/** + * A User who is purchasing from the pet store + * @param id + * @param username + * @param firstName + * @param lastName + * @param email + * @param password + * @param phone + * @param userStatus User Status + */ +data class User ( + @Json(name = "id") + val id: kotlin.Long? = null, + @Json(name = "username") + val username: kotlin.String? = null, + @Json(name = "firstName") + val firstName: kotlin.String? = null, + @Json(name = "lastName") + val lastName: kotlin.String? = null, + @Json(name = "email") + val email: kotlin.String? = null, + @Json(name = "password") + val password: kotlin.String? = null, + @Json(name = "phone") + val phone: kotlin.String? = null, + /* User Status */ + @Json(name = "userStatus") + val userStatus: kotlin.Int? = null +) { + +} + diff --git a/samples/client/petstore/lua/.openapi-generator/VERSION b/samples/client/petstore/lua/.openapi-generator/VERSION index 2c6109e5bb82..83a328a9227e 100644 --- a/samples/client/petstore/lua/.openapi-generator/VERSION +++ b/samples/client/petstore/lua/.openapi-generator/VERSION @@ -1 +1 @@ -3.3.4 \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/lua/petstore-1.0.0-1.rockspec b/samples/client/petstore/lua/petstore-1.0.0-1.rockspec index d6b7f2f4ccf6..7f8afbe3b891 100644 --- a/samples/client/petstore/lua/petstore-1.0.0-1.rockspec +++ b/samples/client/petstore/lua/petstore-1.0.0-1.rockspec @@ -28,6 +28,8 @@ build = { ["petstore.api.user_api"] = "petstore/api/user_api.lua"; ["petstore.model.api_response"] = "petstore/model/api_response.lua"; ["petstore.model.category"] = "petstore/model/category.lua"; + ["petstore.model.inline_object"] = "petstore/model/inline_object.lua"; + ["petstore.model.inline_object_1"] = "petstore/model/inline_object_1.lua"; ["petstore.model.order"] = "petstore/model/order.lua"; ["petstore.model.pet"] = "petstore/model/pet.lua"; ["petstore.model.tag"] = "petstore/model/tag.lua"; diff --git a/samples/client/petstore/lua/petstore/api/pet_api.lua b/samples/client/petstore/lua/petstore/api/pet_api.lua index d9ce3e8df7fd..5897bef8325f 100644 --- a/samples/client/petstore/lua/petstore/api/pet_api.lua +++ b/samples/client/petstore/lua/petstore/api/pet_api.lua @@ -3,7 +3,7 @@ This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech ]] @@ -177,13 +177,13 @@ function pet_api:find_pets_by_status(status) end end -function pet_api:find_pets_by_tags(tags) +function pet_api:find_pets_by_tags(tags, max_count) local req = http_request.new_from_uri({ scheme = self.default_scheme; host = self.host; port = self.port; - path = string.format("%s/pet/findByTags?tags=%s", - self.basePath, http_util.encodeURIComponent(tags)); + path = string.format("%s/pet/findByTags?tags=%s&maxCount=%s", + self.basePath, http_util.encodeURIComponent(tags), http_util.encodeURIComponent(max_count)); }) -- set HTTP verb diff --git a/samples/client/petstore/lua/petstore/api/store_api.lua b/samples/client/petstore/lua/petstore/api/store_api.lua index 456a1bb6018b..d50456ffffd6 100644 --- a/samples/client/petstore/lua/petstore/api/store_api.lua +++ b/samples/client/petstore/lua/petstore/api/store_api.lua @@ -3,7 +3,7 @@ This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech ]] @@ -182,6 +182,10 @@ function store_api:place_order(order) -- set HTTP verb req.headers:upsert(":method", "POST") + -- TODO: create a function to select proper accept + --local var_content_type = { "application/json" } + req.headers:upsert("accept", "application/json") + -- TODO: create a function to select proper content-type --local var_accept = { "application/xml", "application/json" } req.headers:upsert("content-type", "application/xml") diff --git a/samples/client/petstore/lua/petstore/api/user_api.lua b/samples/client/petstore/lua/petstore/api/user_api.lua index 6cc3f251976c..16a037608ab5 100644 --- a/samples/client/petstore/lua/petstore/api/user_api.lua +++ b/samples/client/petstore/lua/petstore/api/user_api.lua @@ -3,7 +3,7 @@ This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech ]] @@ -55,6 +55,10 @@ function user_api:create_user(user) -- set HTTP verb req.headers:upsert(":method", "POST") + -- TODO: create a function to select proper accept + --local var_content_type = { "application/json" } + req.headers:upsert("accept", "application/json") + req:set_body(dkjson.encode(user)) @@ -88,6 +92,10 @@ function user_api:create_users_with_array_input(user) -- set HTTP verb req.headers:upsert(":method", "POST") + -- TODO: create a function to select proper accept + --local var_content_type = { "application/json" } + req.headers:upsert("accept", "application/json") + req:set_body(dkjson.encode(user)) @@ -121,6 +129,10 @@ function user_api:create_users_with_list_input(user) -- set HTTP verb req.headers:upsert(":method", "POST") + -- TODO: create a function to select proper accept + --local var_content_type = { "application/json" } + req.headers:upsert("accept", "application/json") + req:set_body(dkjson.encode(user)) @@ -308,6 +320,10 @@ function user_api:update_user(username, user) -- set HTTP verb req.headers:upsert(":method", "PUT") + -- TODO: create a function to select proper accept + --local var_content_type = { "application/json" } + req.headers:upsert("accept", "application/json") + req:set_body(dkjson.encode(user)) diff --git a/samples/client/petstore/lua/petstore/model/api_response.lua b/samples/client/petstore/lua/petstore/model/api_response.lua index e96796dc5d06..9531219b71b0 100644 --- a/samples/client/petstore/lua/petstore/model/api_response.lua +++ b/samples/client/petstore/lua/petstore/model/api_response.lua @@ -3,7 +3,7 @@ This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech ]] diff --git a/samples/client/petstore/lua/petstore/model/category.lua b/samples/client/petstore/lua/petstore/model/category.lua index 711124a4fbee..fd15b89da0e6 100644 --- a/samples/client/petstore/lua/petstore/model/category.lua +++ b/samples/client/petstore/lua/petstore/model/category.lua @@ -3,7 +3,7 @@ This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech ]] diff --git a/samples/client/petstore/lua/petstore/model/inline_object.lua b/samples/client/petstore/lua/petstore/model/inline_object.lua new file mode 100644 index 000000000000..c09af2857951 --- /dev/null +++ b/samples/client/petstore/lua/petstore/model/inline_object.lua @@ -0,0 +1,32 @@ +--[[ + OpenAPI Petstore + + This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + + The version of the OpenAPI document: 1.0.0 + + Generated by: https://openapi-generator.tech +]] + +-- inline_object class +local inline_object = {} +local inline_object_mt = { + __name = "inline_object"; + __index = inline_object; +} + +local function cast_inline_object(t) + return setmetatable(t, inline_object_mt) +end + +local function new_inline_object(name, status) + return cast_inline_object({ + ["name"] = name; + ["status"] = status; + }) +end + +return { + cast = cast_inline_object; + new = new_inline_object; +} diff --git a/samples/client/petstore/lua/petstore/model/inline_object_1.lua b/samples/client/petstore/lua/petstore/model/inline_object_1.lua new file mode 100644 index 000000000000..a7d19b29997a --- /dev/null +++ b/samples/client/petstore/lua/petstore/model/inline_object_1.lua @@ -0,0 +1,32 @@ +--[[ + OpenAPI Petstore + + This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + + The version of the OpenAPI document: 1.0.0 + + Generated by: https://openapi-generator.tech +]] + +-- inline_object_1 class +local inline_object_1 = {} +local inline_object_1_mt = { + __name = "inline_object_1"; + __index = inline_object_1; +} + +local function cast_inline_object_1(t) + return setmetatable(t, inline_object_1_mt) +end + +local function new_inline_object_1(additional_metadata, file) + return cast_inline_object_1({ + ["additionalMetadata"] = additional_metadata; + ["file"] = file; + }) +end + +return { + cast = cast_inline_object_1; + new = new_inline_object_1; +} diff --git a/samples/client/petstore/lua/petstore/model/order.lua b/samples/client/petstore/lua/petstore/model/order.lua index 3b67e997f9eb..48a691b72d70 100644 --- a/samples/client/petstore/lua/petstore/model/order.lua +++ b/samples/client/petstore/lua/petstore/model/order.lua @@ -3,7 +3,7 @@ This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech ]] diff --git a/samples/client/petstore/lua/petstore/model/pet.lua b/samples/client/petstore/lua/petstore/model/pet.lua index 3a750e3a1a34..5f887e32b552 100644 --- a/samples/client/petstore/lua/petstore/model/pet.lua +++ b/samples/client/petstore/lua/petstore/model/pet.lua @@ -3,7 +3,7 @@ This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech ]] diff --git a/samples/client/petstore/lua/petstore/model/tag.lua b/samples/client/petstore/lua/petstore/model/tag.lua index 7daf7fcc7220..872dfab64bc7 100644 --- a/samples/client/petstore/lua/petstore/model/tag.lua +++ b/samples/client/petstore/lua/petstore/model/tag.lua @@ -3,7 +3,7 @@ This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech ]] diff --git a/samples/client/petstore/lua/petstore/model/user.lua b/samples/client/petstore/lua/petstore/model/user.lua index c7cb44013b6a..82539d731da6 100644 --- a/samples/client/petstore/lua/petstore/model/user.lua +++ b/samples/client/petstore/lua/petstore/model/user.lua @@ -3,7 +3,7 @@ This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech ]] diff --git a/samples/client/petstore/lua/spec/inline_object_1_spec.lua b/samples/client/petstore/lua/spec/inline_object_1_spec.lua new file mode 100644 index 000000000000..ba0da43dd7aa --- /dev/null +++ b/samples/client/petstore/lua/spec/inline_object_1_spec.lua @@ -0,0 +1,33 @@ +--[[ + OpenAPI Petstore + + This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + + The version of the OpenAPI document: 1.0.0 + + Generated by: https://openapi-generator.tech +]] + +--[[ +Unit tests for petstore.model.inline_object_1 +Automatically generated by openapi-generator (https://openapi-generator.tech) +Please update as you see appropriate +]] +describe("inline_object_1", function() + local petstore_inline_object_1 = require "petstore.model.inline_object_1" + + -- unit tests for the property 'additional_metadata' + describe("property additional_metadata test", function() + it("should work", function() + -- TODO assertion here: http://olivinelabs.com/busted/#asserts + end) + end) + + -- unit tests for the property 'file' + describe("property file test", function() + it("should work", function() + -- TODO assertion here: http://olivinelabs.com/busted/#asserts + end) + end) + +end) diff --git a/samples/client/petstore/lua/spec/inline_object_spec.lua b/samples/client/petstore/lua/spec/inline_object_spec.lua new file mode 100644 index 000000000000..00d34720f838 --- /dev/null +++ b/samples/client/petstore/lua/spec/inline_object_spec.lua @@ -0,0 +1,33 @@ +--[[ + OpenAPI Petstore + + This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + + The version of the OpenAPI document: 1.0.0 + + Generated by: https://openapi-generator.tech +]] + +--[[ +Unit tests for petstore.model.inline_object +Automatically generated by openapi-generator (https://openapi-generator.tech) +Please update as you see appropriate +]] +describe("inline_object", function() + local petstore_inline_object = require "petstore.model.inline_object" + + -- unit tests for the property 'name' + describe("property name test", function() + it("should work", function() + -- TODO assertion here: http://olivinelabs.com/busted/#asserts + end) + end) + + -- unit tests for the property 'status' + describe("property status test", function() + it("should work", function() + -- TODO assertion here: http://olivinelabs.com/busted/#asserts + end) + end) + +end) diff --git a/samples/client/petstore/objc/core-data/.openapi-generator/VERSION b/samples/client/petstore/objc/core-data/.openapi-generator/VERSION index 096bf47efe31..83a328a9227e 100644 --- a/samples/client/petstore/objc/core-data/.openapi-generator/VERSION +++ b/samples/client/petstore/objc/core-data/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.0-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient.podspec b/samples/client/petstore/objc/core-data/OpenAPIClient.podspec new file mode 100644 index 000000000000..bb7198a98f6c --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient.podspec @@ -0,0 +1,37 @@ +# +# Be sure to run `pod lib lint OpenAPIClient.podspec' to ensure this is a +# valid spec and remove all comments before submitting the spec. +# +# Any lines starting with a # are optional, but encouraged +# +# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html +# + +Pod::Spec.new do |s| + s.name = "OpenAPIClient" + s.version = "1.0.0" + + s.summary = "OpenAPI Petstore" + s.description = <<-DESC + This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters + DESC + + s.platform = :ios, '7.0' + s.requires_arc = true + + s.frameworks = 'SystemConfiguration', 'CoreData' + + s.homepage = "https://github.com/openapitools/openapi-generator" + s.license = "Proprietary" + s.source = { :git => "https://github.com/openapitools/openapi-generator.git", :tag => "#{s.version}" } + s.author = { "OpenAPI" => "team@openapitools.org" } + + s.source_files = 'OpenAPIClient/**/*.{m,h}' + s.public_header_files = 'OpenAPIClient/**/*.h' + s.resources = 'OpenAPIClient/**/*.{xcdatamodeld,xcdatamodel}' + + s.dependency 'AFNetworking', '~> 3' + s.dependency 'JSONModel', '~> 1.2' + s.dependency 'ISO8601', '~> 0.6' +end + diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Api/OAIPetApi.h b/samples/client/petstore/objc/core-data/OpenAPIClient/Api/OAIPetApi.h new file mode 100644 index 000000000000..621435f54d42 --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Api/OAIPetApi.h @@ -0,0 +1,139 @@ +#import +#import "OAIPet.h" +#import "OAIApi.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + + +@interface OAIPetApi: NSObject + +extern NSString* kOAIPetApiErrorDomain; +extern NSInteger kOAIPetApiMissingParamErrorCode; + +-(instancetype) initWithApiClient:(OAIApiClient *)apiClient NS_DESIGNATED_INITIALIZER; + +/// Add a new pet to the store +/// +/// +/// @param pet Pet object that needs to be added to the store (optional) +/// +/// code:405 message:"Invalid input" +/// +/// @return void +-(NSURLSessionTask*) addPetWithPet: (OAIPet*) pet + completionHandler: (void (^)(NSError* error)) handler; + + +/// Deletes a pet +/// +/// +/// @param petId Pet id to delete +/// @param apiKey (optional) +/// +/// code:400 message:"Invalid pet value" +/// +/// @return void +-(NSURLSessionTask*) deletePetWithPetId: (NSNumber*) petId + apiKey: (NSString*) apiKey + completionHandler: (void (^)(NSError* error)) handler; + + +/// Finds Pets by status +/// Multiple status values can be provided with comma separated strings +/// +/// @param status Status values that need to be considered for filter (optional) +/// +/// code:200 message:"successful operation", +/// code:400 message:"Invalid status value" +/// +/// @return NSArray* +-(NSURLSessionTask*) findPetsByStatusWithStatus: (NSArray*) status + completionHandler: (void (^)(NSArray* output, NSError* error)) handler; + + +/// Finds Pets by tags +/// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. +/// +/// @param tags Tags to filter by (optional) +/// +/// code:200 message:"successful operation", +/// code:400 message:"Invalid tag value" +/// +/// @return NSArray* +-(NSURLSessionTask*) findPetsByTagsWithTags: (NSArray*) tags + completionHandler: (void (^)(NSArray* output, NSError* error)) handler; + + +/// Find pet by ID +/// Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions +/// +/// @param petId ID of pet that needs to be fetched +/// +/// code:200 message:"successful operation", +/// code:400 message:"Invalid ID supplied", +/// code:404 message:"Pet not found" +/// +/// @return OAIPet* +-(NSURLSessionTask*) getPetByIdWithPetId: (NSNumber*) petId + completionHandler: (void (^)(OAIPet* output, NSError* error)) handler; + + +/// Update an existing pet +/// +/// +/// @param pet Pet object that needs to be added to the store (optional) +/// +/// code:400 message:"Invalid ID supplied", +/// code:404 message:"Pet not found", +/// code:405 message:"Validation exception" +/// +/// @return void +-(NSURLSessionTask*) updatePetWithPet: (OAIPet*) pet + completionHandler: (void (^)(NSError* error)) handler; + + +/// Updates a pet in the store with form data +/// +/// +/// @param petId ID of pet that needs to be updated +/// @param name Updated name of the pet (optional) +/// @param status Updated status of the pet (optional) +/// +/// code:405 message:"Invalid input" +/// +/// @return void +-(NSURLSessionTask*) updatePetWithFormWithPetId: (NSString*) petId + name: (NSString*) name + status: (NSString*) status + completionHandler: (void (^)(NSError* error)) handler; + + +/// uploads an image +/// +/// +/// @param petId ID of pet to update +/// @param additionalMetadata Additional data to pass to server (optional) +/// @param file file to upload (optional) +/// +/// code:0 message:"successful operation" +/// +/// @return void +-(NSURLSessionTask*) uploadFileWithPetId: (NSNumber*) petId + additionalMetadata: (NSString*) additionalMetadata + file: (NSURL*) file + completionHandler: (void (^)(NSError* error)) handler; + + + +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Api/OAIPetApi.m b/samples/client/petstore/objc/core-data/OpenAPIClient/Api/OAIPetApi.m new file mode 100644 index 000000000000..75d4c2a0f1fb --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Api/OAIPetApi.m @@ -0,0 +1,578 @@ +#import "OAIPetApi.h" +#import "OAIQueryParamCollection.h" +#import "OAIApiClient.h" +#import "OAIPet.h" + + +@interface OAIPetApi () + +@property (nonatomic, strong, readwrite) NSMutableDictionary *mutableDefaultHeaders; + +@end + +@implementation OAIPetApi + +NSString* kOAIPetApiErrorDomain = @"OAIPetApiErrorDomain"; +NSInteger kOAIPetApiMissingParamErrorCode = 234513; + +@synthesize apiClient = _apiClient; + +#pragma mark - Initialize methods + +- (instancetype) init { + return [self initWithApiClient:[OAIApiClient sharedClient]]; +} + + +-(instancetype) initWithApiClient:(OAIApiClient *)apiClient { + self = [super init]; + if (self) { + _apiClient = apiClient; + _mutableDefaultHeaders = [NSMutableDictionary dictionary]; + } + return self; +} + +#pragma mark - + +-(NSString*) defaultHeaderForKey:(NSString*)key { + return self.mutableDefaultHeaders[key]; +} + +-(void) setDefaultHeaderValue:(NSString*) value forKey:(NSString*)key { + [self.mutableDefaultHeaders setValue:value forKey:key]; +} + +-(NSDictionary *)defaultHeaders { + return self.mutableDefaultHeaders; +} + +#pragma mark - Api Methods + +/// +/// Add a new pet to the store +/// +/// @param pet Pet object that needs to be added to the store (optional) +/// +/// @returns void +/// +-(NSURLSessionTask*) addPetWithPet: (OAIPet*) pet + completionHandler: (void (^)(NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/json", @"application/xml"]]; + + // Authentication setting + NSArray *authSettings = @[@"petstore_auth"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + bodyParam = pet; + + return [self.apiClient requestWithPath: resourcePath + method: @"POST" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: nil + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler(error); + } + }]; +} + +/// +/// Deletes a pet +/// +/// @param petId Pet id to delete +/// +/// @param apiKey (optional) +/// +/// @returns void +/// +-(NSURLSessionTask*) deletePetWithPetId: (NSNumber*) petId + apiKey: (NSString*) apiKey + completionHandler: (void (^)(NSError* error)) handler { + // verify the required parameter 'petId' is set + if (petId == nil) { + NSParameterAssert(petId); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"petId"] }; + NSError* error = [NSError errorWithDomain:kOAIPetApiErrorDomain code:kOAIPetApiMissingParamErrorCode userInfo:userInfo]; + handler(error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/{petId}"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + if (petId != nil) { + pathParams[@"petId"] = petId; + } + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + if (apiKey != nil) { + headerParams[@"api_key"] = apiKey; + } + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[@"petstore_auth"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"DELETE" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: nil + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler(error); + } + }]; +} + +/// +/// Finds Pets by status +/// Multiple status values can be provided with comma separated strings +/// @param status Status values that need to be considered for filter (optional) +/// +/// @returns NSArray* +/// +-(NSURLSessionTask*) findPetsByStatusWithStatus: (NSArray*) status + completionHandler: (void (^)(NSArray* output, NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/findByStatus"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + if (status != nil) { + queryParams[@"status"] = [[OAIQueryParamCollection alloc] initWithValuesAndFormat: status format: @"multi"]; + } + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[@"petstore_auth"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"NSArray*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((NSArray*)data, error); + } + }]; +} + +/// +/// Finds Pets by tags +/// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. +/// @param tags Tags to filter by (optional) +/// +/// @returns NSArray* +/// +-(NSURLSessionTask*) findPetsByTagsWithTags: (NSArray*) tags + completionHandler: (void (^)(NSArray* output, NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/findByTags"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + if (tags != nil) { + queryParams[@"tags"] = [[OAIQueryParamCollection alloc] initWithValuesAndFormat: tags format: @"multi"]; + } + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[@"petstore_auth"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"NSArray*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((NSArray*)data, error); + } + }]; +} + +/// +/// Find pet by ID +/// Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions +/// @param petId ID of pet that needs to be fetched +/// +/// @returns OAIPet* +/// +-(NSURLSessionTask*) getPetByIdWithPetId: (NSNumber*) petId + completionHandler: (void (^)(OAIPet* output, NSError* error)) handler { + // verify the required parameter 'petId' is set + if (petId == nil) { + NSParameterAssert(petId); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"petId"] }; + NSError* error = [NSError errorWithDomain:kOAIPetApiErrorDomain code:kOAIPetApiMissingParamErrorCode userInfo:userInfo]; + handler(nil, error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/{petId}"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + if (petId != nil) { + pathParams[@"petId"] = petId; + } + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[@"api_key", @"petstore_auth"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"OAIPet*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((OAIPet*)data, error); + } + }]; +} + +/// +/// Update an existing pet +/// +/// @param pet Pet object that needs to be added to the store (optional) +/// +/// @returns void +/// +-(NSURLSessionTask*) updatePetWithPet: (OAIPet*) pet + completionHandler: (void (^)(NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/json", @"application/xml"]]; + + // Authentication setting + NSArray *authSettings = @[@"petstore_auth"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + bodyParam = pet; + + return [self.apiClient requestWithPath: resourcePath + method: @"PUT" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: nil + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler(error); + } + }]; +} + +/// +/// Updates a pet in the store with form data +/// +/// @param petId ID of pet that needs to be updated +/// +/// @param name Updated name of the pet (optional) +/// +/// @param status Updated status of the pet (optional) +/// +/// @returns void +/// +-(NSURLSessionTask*) updatePetWithFormWithPetId: (NSString*) petId + name: (NSString*) name + status: (NSString*) status + completionHandler: (void (^)(NSError* error)) handler { + // verify the required parameter 'petId' is set + if (petId == nil) { + NSParameterAssert(petId); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"petId"] }; + NSError* error = [NSError errorWithDomain:kOAIPetApiErrorDomain code:kOAIPetApiMissingParamErrorCode userInfo:userInfo]; + handler(error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/{petId}"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + if (petId != nil) { + pathParams[@"petId"] = petId; + } + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/x-www-form-urlencoded"]]; + + // Authentication setting + NSArray *authSettings = @[@"petstore_auth"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + if (name) { + formParams[@"name"] = name; + } + if (status) { + formParams[@"status"] = status; + } + + return [self.apiClient requestWithPath: resourcePath + method: @"POST" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: nil + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler(error); + } + }]; +} + +/// +/// uploads an image +/// +/// @param petId ID of pet to update +/// +/// @param additionalMetadata Additional data to pass to server (optional) +/// +/// @param file file to upload (optional) +/// +/// @returns void +/// +-(NSURLSessionTask*) uploadFileWithPetId: (NSNumber*) petId + additionalMetadata: (NSString*) additionalMetadata + file: (NSURL*) file + completionHandler: (void (^)(NSError* error)) handler { + // verify the required parameter 'petId' is set + if (petId == nil) { + NSParameterAssert(petId); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"petId"] }; + NSError* error = [NSError errorWithDomain:kOAIPetApiErrorDomain code:kOAIPetApiMissingParamErrorCode userInfo:userInfo]; + handler(error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/{petId}/uploadImage"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + if (petId != nil) { + pathParams[@"petId"] = petId; + } + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"multipart/form-data"]]; + + // Authentication setting + NSArray *authSettings = @[@"petstore_auth"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + if (additionalMetadata) { + formParams[@"additionalMetadata"] = additionalMetadata; + } + localVarFiles[@"file"] = file; + + return [self.apiClient requestWithPath: resourcePath + method: @"POST" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: nil + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler(error); + } + }]; +} + + + +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Api/OAIStoreApi.h b/samples/client/petstore/objc/core-data/OpenAPIClient/Api/OAIStoreApi.h new file mode 100644 index 000000000000..4f9081984443 --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Api/OAIStoreApi.h @@ -0,0 +1,78 @@ +#import +#import "OAIOrder.h" +#import "OAIApi.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + + +@interface OAIStoreApi: NSObject + +extern NSString* kOAIStoreApiErrorDomain; +extern NSInteger kOAIStoreApiMissingParamErrorCode; + +-(instancetype) initWithApiClient:(OAIApiClient *)apiClient NS_DESIGNATED_INITIALIZER; + +/// Delete purchase order by ID +/// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors +/// +/// @param orderId ID of the order that needs to be deleted +/// +/// code:400 message:"Invalid ID supplied", +/// code:404 message:"Order not found" +/// +/// @return void +-(NSURLSessionTask*) deleteOrderWithOrderId: (NSString*) orderId + completionHandler: (void (^)(NSError* error)) handler; + + +/// Returns pet inventories by status +/// Returns a map of status codes to quantities +/// +/// +/// code:200 message:"successful operation" +/// +/// @return NSDictionary* +-(NSURLSessionTask*) getInventoryWithCompletionHandler: + (void (^)(NSDictionary* output, NSError* error)) handler; + + +/// Find purchase order by ID +/// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions +/// +/// @param orderId ID of pet that needs to be fetched +/// +/// code:200 message:"successful operation", +/// code:400 message:"Invalid ID supplied", +/// code:404 message:"Order not found" +/// +/// @return OAIOrder* +-(NSURLSessionTask*) getOrderByIdWithOrderId: (NSString*) orderId + completionHandler: (void (^)(OAIOrder* output, NSError* error)) handler; + + +/// Place an order for a pet +/// +/// +/// @param order order placed for purchasing the pet (optional) +/// +/// code:200 message:"successful operation", +/// code:400 message:"Invalid Order" +/// +/// @return OAIOrder* +-(NSURLSessionTask*) placeOrderWithOrder: (OAIOrder*) order + completionHandler: (void (^)(OAIOrder* output, NSError* error)) handler; + + + +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Api/OAIStoreApi.m b/samples/client/petstore/objc/core-data/OpenAPIClient/Api/OAIStoreApi.m new file mode 100644 index 000000000000..4a164d26226e --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Api/OAIStoreApi.m @@ -0,0 +1,297 @@ +#import "OAIStoreApi.h" +#import "OAIQueryParamCollection.h" +#import "OAIApiClient.h" +#import "OAIOrder.h" + + +@interface OAIStoreApi () + +@property (nonatomic, strong, readwrite) NSMutableDictionary *mutableDefaultHeaders; + +@end + +@implementation OAIStoreApi + +NSString* kOAIStoreApiErrorDomain = @"OAIStoreApiErrorDomain"; +NSInteger kOAIStoreApiMissingParamErrorCode = 234513; + +@synthesize apiClient = _apiClient; + +#pragma mark - Initialize methods + +- (instancetype) init { + return [self initWithApiClient:[OAIApiClient sharedClient]]; +} + + +-(instancetype) initWithApiClient:(OAIApiClient *)apiClient { + self = [super init]; + if (self) { + _apiClient = apiClient; + _mutableDefaultHeaders = [NSMutableDictionary dictionary]; + } + return self; +} + +#pragma mark - + +-(NSString*) defaultHeaderForKey:(NSString*)key { + return self.mutableDefaultHeaders[key]; +} + +-(void) setDefaultHeaderValue:(NSString*) value forKey:(NSString*)key { + [self.mutableDefaultHeaders setValue:value forKey:key]; +} + +-(NSDictionary *)defaultHeaders { + return self.mutableDefaultHeaders; +} + +#pragma mark - Api Methods + +/// +/// Delete purchase order by ID +/// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors +/// @param orderId ID of the order that needs to be deleted +/// +/// @returns void +/// +-(NSURLSessionTask*) deleteOrderWithOrderId: (NSString*) orderId + completionHandler: (void (^)(NSError* error)) handler { + // verify the required parameter 'orderId' is set + if (orderId == nil) { + NSParameterAssert(orderId); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"orderId"] }; + NSError* error = [NSError errorWithDomain:kOAIStoreApiErrorDomain code:kOAIStoreApiMissingParamErrorCode userInfo:userInfo]; + handler(error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/order/{orderId}"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + if (orderId != nil) { + pathParams[@"orderId"] = orderId; + } + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"DELETE" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: nil + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler(error); + } + }]; +} + +/// +/// Returns pet inventories by status +/// Returns a map of status codes to quantities +/// @returns NSDictionary* +/// +-(NSURLSessionTask*) getInventoryWithCompletionHandler: + (void (^)(NSDictionary* output, NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/inventory"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[@"api_key"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"NSDictionary*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((NSDictionary*)data, error); + } + }]; +} + +/// +/// Find purchase order by ID +/// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions +/// @param orderId ID of pet that needs to be fetched +/// +/// @returns OAIOrder* +/// +-(NSURLSessionTask*) getOrderByIdWithOrderId: (NSString*) orderId + completionHandler: (void (^)(OAIOrder* output, NSError* error)) handler { + // verify the required parameter 'orderId' is set + if (orderId == nil) { + NSParameterAssert(orderId); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"orderId"] }; + NSError* error = [NSError errorWithDomain:kOAIStoreApiErrorDomain code:kOAIStoreApiMissingParamErrorCode userInfo:userInfo]; + handler(nil, error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/order/{orderId}"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + if (orderId != nil) { + pathParams[@"orderId"] = orderId; + } + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"OAIOrder*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((OAIOrder*)data, error); + } + }]; +} + +/// +/// Place an order for a pet +/// +/// @param order order placed for purchasing the pet (optional) +/// +/// @returns OAIOrder* +/// +-(NSURLSessionTask*) placeOrderWithOrder: (OAIOrder*) order + completionHandler: (void (^)(OAIOrder* output, NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/order"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/json"]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + bodyParam = order; + + return [self.apiClient requestWithPath: resourcePath + method: @"POST" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"OAIOrder*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((OAIOrder*)data, error); + } + }]; +} + + + +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Api/OAIUserApi.h b/samples/client/petstore/objc/core-data/OpenAPIClient/Api/OAIUserApi.h new file mode 100644 index 000000000000..d2103d4a06fb --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Api/OAIUserApi.h @@ -0,0 +1,131 @@ +#import +#import "OAIUser.h" +#import "OAIApi.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + + +@interface OAIUserApi: NSObject + +extern NSString* kOAIUserApiErrorDomain; +extern NSInteger kOAIUserApiMissingParamErrorCode; + +-(instancetype) initWithApiClient:(OAIApiClient *)apiClient NS_DESIGNATED_INITIALIZER; + +/// Create user +/// This can only be done by the logged in user. +/// +/// @param user Created user object (optional) +/// +/// code:0 message:"successful operation" +/// +/// @return void +-(NSURLSessionTask*) createUserWithUser: (OAIUser*) user + completionHandler: (void (^)(NSError* error)) handler; + + +/// Creates list of users with given input array +/// +/// +/// @param user List of user object (optional) +/// +/// code:0 message:"successful operation" +/// +/// @return void +-(NSURLSessionTask*) createUsersWithArrayInputWithUser: (NSArray*) user + completionHandler: (void (^)(NSError* error)) handler; + + +/// Creates list of users with given input array +/// +/// +/// @param user List of user object (optional) +/// +/// code:0 message:"successful operation" +/// +/// @return void +-(NSURLSessionTask*) createUsersWithListInputWithUser: (NSArray*) user + completionHandler: (void (^)(NSError* error)) handler; + + +/// Delete user +/// This can only be done by the logged in user. +/// +/// @param username The name that needs to be deleted +/// +/// code:400 message:"Invalid username supplied", +/// code:404 message:"User not found" +/// +/// @return void +-(NSURLSessionTask*) deleteUserWithUsername: (NSString*) username + completionHandler: (void (^)(NSError* error)) handler; + + +/// Get user by user name +/// +/// +/// @param username The name that needs to be fetched. Use user1 for testing. +/// +/// code:200 message:"successful operation", +/// code:400 message:"Invalid username supplied", +/// code:404 message:"User not found" +/// +/// @return OAIUser* +-(NSURLSessionTask*) getUserByNameWithUsername: (NSString*) username + completionHandler: (void (^)(OAIUser* output, NSError* error)) handler; + + +/// Logs user into the system +/// +/// +/// @param username The user name for login (optional) +/// @param password The password for login in clear text (optional) +/// +/// code:200 message:"successful operation", +/// code:400 message:"Invalid username/password supplied" +/// +/// @return NSString* +-(NSURLSessionTask*) loginUserWithUsername: (NSString*) username + password: (NSString*) password + completionHandler: (void (^)(NSString* output, NSError* error)) handler; + + +/// Logs out current logged in user session +/// +/// +/// +/// code:0 message:"successful operation" +/// +/// @return void +-(NSURLSessionTask*) logoutUserWithCompletionHandler: + (void (^)(NSError* error)) handler; + + +/// Updated user +/// This can only be done by the logged in user. +/// +/// @param username name that need to be deleted +/// @param user Updated user object (optional) +/// +/// code:400 message:"Invalid user supplied", +/// code:404 message:"User not found" +/// +/// @return void +-(NSURLSessionTask*) updateUserWithUsername: (NSString*) username + user: (OAIUser*) user + completionHandler: (void (^)(NSError* error)) handler; + + + +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Api/OAIUserApi.m b/samples/client/petstore/objc/core-data/OpenAPIClient/Api/OAIUserApi.m new file mode 100644 index 000000000000..0a6f5a493bdd --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Api/OAIUserApi.m @@ -0,0 +1,542 @@ +#import "OAIUserApi.h" +#import "OAIQueryParamCollection.h" +#import "OAIApiClient.h" +#import "OAIUser.h" + + +@interface OAIUserApi () + +@property (nonatomic, strong, readwrite) NSMutableDictionary *mutableDefaultHeaders; + +@end + +@implementation OAIUserApi + +NSString* kOAIUserApiErrorDomain = @"OAIUserApiErrorDomain"; +NSInteger kOAIUserApiMissingParamErrorCode = 234513; + +@synthesize apiClient = _apiClient; + +#pragma mark - Initialize methods + +- (instancetype) init { + return [self initWithApiClient:[OAIApiClient sharedClient]]; +} + + +-(instancetype) initWithApiClient:(OAIApiClient *)apiClient { + self = [super init]; + if (self) { + _apiClient = apiClient; + _mutableDefaultHeaders = [NSMutableDictionary dictionary]; + } + return self; +} + +#pragma mark - + +-(NSString*) defaultHeaderForKey:(NSString*)key { + return self.mutableDefaultHeaders[key]; +} + +-(void) setDefaultHeaderValue:(NSString*) value forKey:(NSString*)key { + [self.mutableDefaultHeaders setValue:value forKey:key]; +} + +-(NSDictionary *)defaultHeaders { + return self.mutableDefaultHeaders; +} + +#pragma mark - Api Methods + +/// +/// Create user +/// This can only be done by the logged in user. +/// @param user Created user object (optional) +/// +/// @returns void +/// +-(NSURLSessionTask*) createUserWithUser: (OAIUser*) user + completionHandler: (void (^)(NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/json"]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + bodyParam = user; + + return [self.apiClient requestWithPath: resourcePath + method: @"POST" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: nil + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler(error); + } + }]; +} + +/// +/// Creates list of users with given input array +/// +/// @param user List of user object (optional) +/// +/// @returns void +/// +-(NSURLSessionTask*) createUsersWithArrayInputWithUser: (NSArray*) user + completionHandler: (void (^)(NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/createWithArray"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/json"]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + bodyParam = user; + + return [self.apiClient requestWithPath: resourcePath + method: @"POST" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: nil + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler(error); + } + }]; +} + +/// +/// Creates list of users with given input array +/// +/// @param user List of user object (optional) +/// +/// @returns void +/// +-(NSURLSessionTask*) createUsersWithListInputWithUser: (NSArray*) user + completionHandler: (void (^)(NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/createWithList"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/json"]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + bodyParam = user; + + return [self.apiClient requestWithPath: resourcePath + method: @"POST" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: nil + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler(error); + } + }]; +} + +/// +/// Delete user +/// This can only be done by the logged in user. +/// @param username The name that needs to be deleted +/// +/// @returns void +/// +-(NSURLSessionTask*) deleteUserWithUsername: (NSString*) username + completionHandler: (void (^)(NSError* error)) handler { + // verify the required parameter 'username' is set + if (username == nil) { + NSParameterAssert(username); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"username"] }; + NSError* error = [NSError errorWithDomain:kOAIUserApiErrorDomain code:kOAIUserApiMissingParamErrorCode userInfo:userInfo]; + handler(error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/{username}"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + if (username != nil) { + pathParams[@"username"] = username; + } + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"DELETE" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: nil + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler(error); + } + }]; +} + +/// +/// Get user by user name +/// +/// @param username The name that needs to be fetched. Use user1 for testing. +/// +/// @returns OAIUser* +/// +-(NSURLSessionTask*) getUserByNameWithUsername: (NSString*) username + completionHandler: (void (^)(OAIUser* output, NSError* error)) handler { + // verify the required parameter 'username' is set + if (username == nil) { + NSParameterAssert(username); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"username"] }; + NSError* error = [NSError errorWithDomain:kOAIUserApiErrorDomain code:kOAIUserApiMissingParamErrorCode userInfo:userInfo]; + handler(nil, error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/{username}"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + if (username != nil) { + pathParams[@"username"] = username; + } + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"OAIUser*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((OAIUser*)data, error); + } + }]; +} + +/// +/// Logs user into the system +/// +/// @param username The user name for login (optional) +/// +/// @param password The password for login in clear text (optional) +/// +/// @returns NSString* +/// +-(NSURLSessionTask*) loginUserWithUsername: (NSString*) username + password: (NSString*) password + completionHandler: (void (^)(NSString* output, NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/login"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + if (username != nil) { + queryParams[@"username"] = username; + } + if (password != nil) { + queryParams[@"password"] = password; + } + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"NSString*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((NSString*)data, error); + } + }]; +} + +/// +/// Logs out current logged in user session +/// +/// @returns void +/// +-(NSURLSessionTask*) logoutUserWithCompletionHandler: + (void (^)(NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/logout"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: nil + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler(error); + } + }]; +} + +/// +/// Updated user +/// This can only be done by the logged in user. +/// @param username name that need to be deleted +/// +/// @param user Updated user object (optional) +/// +/// @returns void +/// +-(NSURLSessionTask*) updateUserWithUsername: (NSString*) username + user: (OAIUser*) user + completionHandler: (void (^)(NSError* error)) handler { + // verify the required parameter 'username' is set + if (username == nil) { + NSParameterAssert(username); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"username"] }; + NSError* error = [NSError errorWithDomain:kOAIUserApiErrorDomain code:kOAIUserApiMissingParamErrorCode userInfo:userInfo]; + handler(error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/{username}"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + if (username != nil) { + pathParams[@"username"] = username; + } + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/json"]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + bodyParam = user; + + return [self.apiClient requestWithPath: resourcePath + method: @"PUT" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: nil + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler(error); + } + }]; +} + + + +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Core/JSONValueTransformer+ISO8601.h b/samples/client/petstore/objc/core-data/OpenAPIClient/Core/JSONValueTransformer+ISO8601.h new file mode 100644 index 000000000000..5179ca2e99b8 --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Core/JSONValueTransformer+ISO8601.h @@ -0,0 +1,19 @@ +#import +#import + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +@interface JSONValueTransformer (ISO8601) + +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Core/JSONValueTransformer+ISO8601.m b/samples/client/petstore/objc/core-data/OpenAPIClient/Core/JSONValueTransformer+ISO8601.m new file mode 100644 index 000000000000..61ae254a8aa0 --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Core/JSONValueTransformer+ISO8601.m @@ -0,0 +1,17 @@ +#import +#import "JSONValueTransformer+ISO8601.h" +#import "OAISanitizer.h" + +@implementation JSONValueTransformer (ISO8601) + +- (NSDate *) NSDateFromNSString:(NSString *)string +{ + return [NSDate dateWithISO8601String:string]; +} + +- (NSString *)JSONObjectFromNSDate:(NSDate *)date +{ + return [OAISanitizer dateToString:date]; +} + +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAIApi.h b/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAIApi.h new file mode 100644 index 000000000000..91302b6736d1 --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAIApi.h @@ -0,0 +1,29 @@ +#import + +@class OAIApiClient; + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +@protocol OAIApi + +@property(readonly, nonatomic, strong) OAIApiClient *apiClient; + +-(instancetype) initWithApiClient:(OAIApiClient *)apiClient; + +-(void) setDefaultHeaderValue:(NSString*) value forKey:(NSString*)key; +-(NSString*) defaultHeaderForKey:(NSString*)key; + +-(NSDictionary *)defaultHeaders; + +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAIApiClient.h b/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAIApiClient.h new file mode 100644 index 000000000000..33301dd2f58d --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAIApiClient.h @@ -0,0 +1,121 @@ +#import +#import "OAIConfiguration.h" +#import "OAIResponseDeserializer.h" +#import "OAISanitizer.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +/** + * A key for `NSError` user info dictionaries. + * + * The corresponding value is the parsed response body for an HTTP error. + */ +extern NSString *const OAIResponseObjectErrorKey; + + +@interface OAIApiClient : AFHTTPSessionManager + +@property (nonatomic, strong, readonly) id configuration; + +@property(nonatomic, assign) NSTimeInterval timeoutInterval; + +@property(nonatomic, strong) id responseDeserializer; + +@property(nonatomic, strong) id sanitizer; + +/** + * Gets if the client is unreachable + * + * @return The client offline state + */ ++(BOOL) getOfflineState; + +/** + * Sets the client reachability, this may be overridden by the reachability manager if reachability changes + * + * @param status The client reachability status. + */ ++(void) setReachabilityStatus:(AFNetworkReachabilityStatus) status; + +/** + * Gets the client reachability + * + * @return The client reachability. + */ ++(AFNetworkReachabilityStatus) getReachabilityStatus; + +@property (nonatomic, strong) NSDictionary< NSString *, AFHTTPRequestSerializer *>* requestSerializerForContentType; + +/** + * Gets client singleton instance + */ ++ (instancetype) sharedClient; + + +/** + * Updates header parameters and query parameters for authentication + * + * @param headers The header parameter will be updated, passed by pointer to pointer. + * @param querys The query parameters will be updated, passed by pointer to pointer. + * @param authSettings The authentication names NSArray. + */ +- (void) updateHeaderParams:(NSDictionary **)headers queryParams:(NSDictionary **)querys WithAuthSettings:(NSArray *)authSettings; + + +/** + * Initializes the session manager with a configuration. + * + * @param configuration The configuration implementation + */ +- (instancetype)initWithConfiguration:(id)configuration; + +/** +* Initializes the session manager with a configuration and url +* +* @param url The base url +* @param configuration The configuration implementation +*/ +- (instancetype)initWithBaseURL:(NSURL *)url configuration:(id)configuration; + +/** + * Performs request + * + * @param path Request url. + * @param method Request method. + * @param pathParams Request path parameters. + * @param queryParams Request query parameters. + * @param body Request body. + * @param headerParams Request header parameters. + * @param authSettings Request authentication names. + * @param requestContentType Request content-type. + * @param responseContentType Response content-type. + * @param completionBlock The block will be executed when the request completed. + * + * @return The created session task. + */ +- (NSURLSessionTask*) requestWithPath: (NSString*) path + method: (NSString*) method + pathParams: (NSDictionary *) pathParams + queryParams: (NSDictionary*) queryParams + formParams: (NSDictionary *) formParams + files: (NSDictionary *) files + body: (id) body + headerParams: (NSDictionary*) headerParams + authSettings: (NSArray *) authSettings + requestContentType: (NSString*) requestContentType + responseContentType: (NSString*) responseContentType + responseType: (NSString *) responseType + completionBlock: (void (^)(id, NSError *))completionBlock; + +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAIApiClient.m b/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAIApiClient.m new file mode 100644 index 000000000000..bcbd477d298e --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAIApiClient.m @@ -0,0 +1,376 @@ + +#import "OAILogger.h" +#import "OAIApiClient.h" +#import "OAIJSONRequestSerializer.h" +#import "OAIQueryParamCollection.h" +#import "OAIDefaultConfiguration.h" + +NSString *const OAIResponseObjectErrorKey = @"OAIResponseObject"; + +static NSString * const kOAIContentDispositionKey = @"Content-Disposition"; + +static NSDictionary * OAI__headerFieldsForResponse(NSURLResponse *response) { + if(![response isKindOfClass:[NSHTTPURLResponse class]]) { + return nil; + } + return ((NSHTTPURLResponse*)response).allHeaderFields; +} + +static NSString * OAI__fileNameForResponse(NSURLResponse *response) { + NSDictionary * headers = OAI__headerFieldsForResponse(response); + if(!headers[kOAIContentDispositionKey]) { + return [NSString stringWithFormat:@"%@", [[NSProcessInfo processInfo] globallyUniqueString]]; + } + NSString *pattern = @"filename=['\"]?([^'\"\\s]+)['\"]?"; + NSRegularExpression *regexp = [NSRegularExpression regularExpressionWithPattern:pattern options:NSRegularExpressionCaseInsensitive error:nil]; + NSString *contentDispositionHeader = headers[kOAIContentDispositionKey]; + NSTextCheckingResult *match = [regexp firstMatchInString:contentDispositionHeader options:0 range:NSMakeRange(0, [contentDispositionHeader length])]; + return [contentDispositionHeader substringWithRange:[match rangeAtIndex:1]]; +} + + +@interface OAIApiClient () + +@property (nonatomic, strong, readwrite) id configuration; + +@property (nonatomic, strong) NSArray* downloadTaskResponseTypes; + +@end + +@implementation OAIApiClient + +#pragma mark - Singleton Methods + ++ (instancetype) sharedClient { + static OAIApiClient *sharedClient = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + sharedClient = [[self alloc] init]; + }); + return sharedClient; +} + +#pragma mark - Initialize Methods + +- (instancetype)init { + return [self initWithConfiguration:[OAIDefaultConfiguration sharedConfig]]; +} + +- (instancetype)initWithBaseURL:(NSURL *)url { + return [self initWithBaseURL:url configuration:[OAIDefaultConfiguration sharedConfig]]; +} + +- (instancetype)initWithConfiguration:(id)configuration { + return [self initWithBaseURL:[NSURL URLWithString:configuration.host] configuration:configuration]; +} + +- (instancetype)initWithBaseURL:(NSURL *)url configuration:(id)configuration { + self = [super initWithBaseURL:url]; + if (self) { + _configuration = configuration; + _timeoutInterval = 60; + _responseDeserializer = [[OAIResponseDeserializer alloc] init]; + _sanitizer = [[OAISanitizer alloc] init]; + + _downloadTaskResponseTypes = @[@"NSURL*", @"NSURL"]; + + AFHTTPRequestSerializer* afhttpRequestSerializer = [AFHTTPRequestSerializer serializer]; + OAIJSONRequestSerializer * swgjsonRequestSerializer = [OAIJSONRequestSerializer serializer]; + _requestSerializerForContentType = @{kOAIApplicationJSONType : swgjsonRequestSerializer, + @"application/x-www-form-urlencoded": afhttpRequestSerializer, + @"multipart/form-data": afhttpRequestSerializer + }; + self.securityPolicy = [self createSecurityPolicy]; + self.responseSerializer = [AFHTTPResponseSerializer serializer]; + } + return self; +} + +#pragma mark - Task Methods + +- (NSURLSessionDataTask*) taskWithCompletionBlock: (NSURLRequest *)request completionBlock: (void (^)(id, NSError *))completionBlock { + + NSURLSessionDataTask *task = [self dataTaskWithRequest:request uploadProgress:nil downloadProgress:nil completionHandler:^(NSURLResponse * _Nonnull response, id _Nullable responseObject, NSError * _Nullable error) { + OAIDebugLogResponse(response, responseObject,request,error); + if(!error) { + completionBlock(responseObject, nil); + return; + } + NSMutableDictionary *userInfo = [error.userInfo mutableCopy]; + if (responseObject) { + // Add in the (parsed) response body. + userInfo[OAIResponseObjectErrorKey] = responseObject; + } + NSError *augmentedError = [error initWithDomain:error.domain code:error.code userInfo:userInfo]; + completionBlock(nil, augmentedError); + }]; + + return task; +} + +- (NSURLSessionDataTask*) downloadTaskWithCompletionBlock: (NSURLRequest *)request completionBlock: (void (^)(id, NSError *))completionBlock { + + __block NSString * tempFolderPath = [self.configuration.tempFolderPath copy]; + + NSURLSessionDataTask* task = [self dataTaskWithRequest:request uploadProgress:nil downloadProgress:nil completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) { + OAIDebugLogResponse(response, responseObject,request,error); + + if(error) { + NSMutableDictionary *userInfo = [error.userInfo mutableCopy]; + if (responseObject) { + userInfo[OAIResponseObjectErrorKey] = responseObject; + } + NSError *augmentedError = [error initWithDomain:error.domain code:error.code userInfo:userInfo]; + completionBlock(nil, augmentedError); + return; + } + + NSString *directory = tempFolderPath ?: NSTemporaryDirectory(); + NSString *filename = OAI__fileNameForResponse(response); + + NSString *filepath = [directory stringByAppendingPathComponent:filename]; + NSURL *file = [NSURL fileURLWithPath:filepath]; + + [responseObject writeToURL:file atomically:YES]; + + completionBlock(file, nil); + }]; + + return task; +} + +#pragma mark - Perform Request Methods + +- (NSURLSessionTask*) requestWithPath: (NSString*) path + method: (NSString*) method + pathParams: (NSDictionary *) pathParams + queryParams: (NSDictionary*) queryParams + formParams: (NSDictionary *) formParams + files: (NSDictionary *) files + body: (id) body + headerParams: (NSDictionary*) headerParams + authSettings: (NSArray *) authSettings + requestContentType: (NSString*) requestContentType + responseContentType: (NSString*) responseContentType + responseType: (NSString *) responseType + completionBlock: (void (^)(id, NSError *))completionBlock { + + AFHTTPRequestSerializer * requestSerializer = [self requestSerializerForRequestContentType:requestContentType]; + + __weak id sanitizer = self.sanitizer; + + // sanitize parameters + pathParams = [sanitizer sanitizeForSerialization:pathParams]; + queryParams = [sanitizer sanitizeForSerialization:queryParams]; + headerParams = [sanitizer sanitizeForSerialization:headerParams]; + formParams = [sanitizer sanitizeForSerialization:formParams]; + if(![body isKindOfClass:[NSData class]]) { + body = [sanitizer sanitizeForSerialization:body]; + } + + // auth setting + [self updateHeaderParams:&headerParams queryParams:&queryParams WithAuthSettings:authSettings]; + + NSMutableString *resourcePath = [NSMutableString stringWithString:path]; + [pathParams enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { + NSString * safeString = ([obj isKindOfClass:[NSString class]]) ? obj : [NSString stringWithFormat:@"%@", obj]; + safeString = OAIPercentEscapedStringFromString(safeString); + [resourcePath replaceCharactersInRange:[resourcePath rangeOfString:[NSString stringWithFormat:@"{%@}", key]] withString:safeString]; + }]; + + NSString* pathWithQueryParams = [self pathWithQueryParamsToString:resourcePath queryParams:queryParams]; + if ([pathWithQueryParams hasPrefix:@"/"]) { + pathWithQueryParams = [pathWithQueryParams substringFromIndex:1]; + } + + NSString* urlString = [[NSURL URLWithString:pathWithQueryParams relativeToURL:self.baseURL] absoluteString]; + + NSError *requestCreateError = nil; + NSMutableURLRequest * request = nil; + if (files.count > 0) { + request = [requestSerializer multipartFormRequestWithMethod:@"POST" URLString:urlString parameters:nil constructingBodyWithBlock:^(id formData) { + [formParams enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { + NSString *objString = [sanitizer parameterToString:obj]; + NSData *data = [objString dataUsingEncoding:NSUTF8StringEncoding]; + [formData appendPartWithFormData:data name:key]; + }]; + [files enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { + NSURL *filePath = (NSURL *)obj; + [formData appendPartWithFileURL:filePath name:key error:nil]; + }]; + } error:&requestCreateError]; + } + else { + if (formParams) { + request = [requestSerializer requestWithMethod:method URLString:urlString parameters:formParams error:&requestCreateError]; + } + if (body) { + request = [requestSerializer requestWithMethod:method URLString:urlString parameters:body error:&requestCreateError]; + } + } + if(!request) { + completionBlock(nil, requestCreateError); + return nil; + } + + if ([headerParams count] > 0){ + for(NSString * key in [headerParams keyEnumerator]){ + [request setValue:[headerParams valueForKey:key] forHTTPHeaderField:key]; + } + } + [requestSerializer setValue:responseContentType forHTTPHeaderField:@"Accept"]; + + [self postProcessRequest:request]; + + + NSURLSessionTask *task = nil; + + if ([self.downloadTaskResponseTypes containsObject:responseType]) { + task = [self downloadTaskWithCompletionBlock:request completionBlock:^(id data, NSError *error) { + completionBlock(data, error); + }]; + } else { + __weak typeof(self) weakSelf = self; + task = [self taskWithCompletionBlock:request completionBlock:^(id data, NSError *error) { + NSError * serializationError; + id response = [weakSelf.responseDeserializer deserialize:data class:responseType error:&serializationError]; + + if(!response && !error){ + error = serializationError; + } + completionBlock(response, error); + }]; + } + + [task resume]; + + return task; +} + +-(AFHTTPRequestSerializer *)requestSerializerForRequestContentType:(NSString *)requestContentType { + AFHTTPRequestSerializer * serializer = self.requestSerializerForContentType[requestContentType]; + if(!serializer) { + NSAssert(NO, @"Unsupported request content type %@", requestContentType); + serializer = [AFHTTPRequestSerializer serializer]; + } + serializer.timeoutInterval = self.timeoutInterval; + return serializer; +} + +//Added for easier override to modify request +-(void)postProcessRequest:(NSMutableURLRequest *)request { + +} + +#pragma mark - + +- (NSString*) pathWithQueryParamsToString:(NSString*) path queryParams:(NSDictionary*) queryParams { + if(queryParams.count == 0) { + return path; + } + NSString * separator = nil; + NSUInteger counter = 0; + + NSMutableString * requestUrl = [NSMutableString stringWithFormat:@"%@", path]; + + NSDictionary *separatorStyles = @{@"csv" : @",", + @"tsv" : @"\t", + @"pipes": @"|" + }; + for(NSString * key in [queryParams keyEnumerator]){ + if (counter == 0) { + separator = @"?"; + } else { + separator = @"&"; + } + id queryParam = [queryParams valueForKey:key]; + if(!queryParam) { + continue; + } + NSString *safeKey = OAIPercentEscapedStringFromString(key); + if ([queryParam isKindOfClass:[NSString class]]){ + [requestUrl appendString:[NSString stringWithFormat:@"%@%@=%@", separator, safeKey, OAIPercentEscapedStringFromString(queryParam)]]; + + } else if ([queryParam isKindOfClass:[OAIQueryParamCollection class]]){ + OAIQueryParamCollection * coll = (OAIQueryParamCollection*) queryParam; + NSArray* values = [coll values]; + NSString* format = [coll format]; + + if([format isEqualToString:@"multi"]) { + for(id obj in values) { + if (counter > 0) { + separator = @"&"; + } + NSString * safeValue = OAIPercentEscapedStringFromString([NSString stringWithFormat:@"%@",obj]); + [requestUrl appendString:[NSString stringWithFormat:@"%@%@=%@", separator, safeKey, safeValue]]; + counter += 1; + } + continue; + } + NSString * separatorStyle = separatorStyles[format]; + NSString * safeValue = OAIPercentEscapedStringFromString([values componentsJoinedByString:separatorStyle]); + [requestUrl appendString:[NSString stringWithFormat:@"%@%@=%@", separator, safeKey, safeValue]]; + } else { + NSString * safeValue = OAIPercentEscapedStringFromString([NSString stringWithFormat:@"%@",queryParam]); + [requestUrl appendString:[NSString stringWithFormat:@"%@%@=%@", separator, safeKey, safeValue]]; + } + counter += 1; + } + return requestUrl; +} + +/** + * Update header and query params based on authentication settings + */ +- (void) updateHeaderParams:(NSDictionary * *)headers queryParams:(NSDictionary * *)querys WithAuthSettings:(NSArray *)authSettings { + + if ([authSettings count] == 0) { + return; + } + + NSMutableDictionary *headersWithAuth = [NSMutableDictionary dictionaryWithDictionary:*headers]; + NSMutableDictionary *querysWithAuth = [NSMutableDictionary dictionaryWithDictionary:*querys]; + + id config = self.configuration; + for (NSString *auth in authSettings) { + NSDictionary *authSetting = config.authSettings[auth]; + + if(!authSetting) { // auth setting is set only if the key is non-empty + continue; + } + NSString *type = authSetting[@"in"]; + NSString *key = authSetting[@"key"]; + NSString *value = authSetting[@"value"]; + if ([type isEqualToString:@"header"] && [key length] > 0 ) { + headersWithAuth[key] = value; + } else if ([type isEqualToString:@"query"] && [key length] != 0) { + querysWithAuth[key] = value; + } + } + + *headers = [NSDictionary dictionaryWithDictionary:headersWithAuth]; + *querys = [NSDictionary dictionaryWithDictionary:querysWithAuth]; +} + +- (AFSecurityPolicy *) createSecurityPolicy { + AFSecurityPolicy *securityPolicy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeNone]; + + id config = self.configuration; + + if (config.sslCaCert) { + NSData *certData = [NSData dataWithContentsOfFile:config.sslCaCert]; + [securityPolicy setPinnedCertificates:[NSSet setWithObject:certData]]; + } + + if (config.verifySSL) { + [securityPolicy setAllowInvalidCertificates:NO]; + } + else { + [securityPolicy setAllowInvalidCertificates:YES]; + [securityPolicy setValidatesDomainName:NO]; + } + + return securityPolicy; +} + +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAIBasicAuthTokenProvider.h b/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAIBasicAuthTokenProvider.h new file mode 100644 index 000000000000..b67a39067e2f --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAIBasicAuthTokenProvider.h @@ -0,0 +1,14 @@ +/** The `OAIBasicAuthTokenProvider` class creates a basic auth token from username and password. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +#import + +@interface OAIBasicAuthTokenProvider : NSObject + ++ (NSString *)createBasicAuthTokenWithUsername:(NSString *)username password:(NSString *)password; + +@end \ No newline at end of file diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAIBasicAuthTokenProvider.m b/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAIBasicAuthTokenProvider.m new file mode 100644 index 000000000000..70afc93438a7 --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAIBasicAuthTokenProvider.m @@ -0,0 +1,19 @@ +#import "OAIBasicAuthTokenProvider.h" + +@implementation OAIBasicAuthTokenProvider + ++ (NSString *)createBasicAuthTokenWithUsername:(NSString *)username password:(NSString *)password { + + // return empty string if username and password are empty + if (username.length == 0 && password.length == 0){ + return @""; + } + + NSString *basicAuthCredentials = [NSString stringWithFormat:@"%@:%@", username, password]; + NSData *data = [basicAuthCredentials dataUsingEncoding:NSUTF8StringEncoding]; + basicAuthCredentials = [NSString stringWithFormat:@"Basic %@", [data base64EncodedStringWithOptions:0]]; + + return basicAuthCredentials; +} + +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAIConfiguration.h b/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAIConfiguration.h new file mode 100644 index 000000000000..deb69f5d5f0c --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAIConfiguration.h @@ -0,0 +1,89 @@ +#import + +@class OAILogger; + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +static NSString * const kOAIAPIVersion = @"1.0.0"; + +@protocol OAIConfiguration + +/** + * Api logger + */ +@property (readonly, nonatomic) OAILogger *logger; + +/** + * Base url + */ +@property (readonly, nonatomic) NSString *host; + +/** + * Api key values for Api Key type Authentication + */ +@property (readonly, nonatomic) NSDictionary *apiKey; + +/** + * Api key prefix values to be prepend to the respective api key + */ +@property (readonly, nonatomic) NSDictionary *apiKeyPrefix; + +/** + * Username for HTTP Basic Authentication + */ +@property (readonly, nonatomic) NSString *username; + +/** + * Password for HTTP Basic Authentication + */ +@property (readonly, nonatomic) NSString *password; + +/** + * Access token for OAuth + */ +@property (readonly, nonatomic) NSString *accessToken; + +/** + * Temp folder for file download + */ +@property (readonly, nonatomic) NSString *tempFolderPath; + +/** + * Debug switch, default false + */ +@property (readonly, nonatomic) BOOL debug; + +/** + * SSL/TLS verification + * Set this to NO to skip verifying SSL certificate when calling API from https server + */ +@property (readonly, nonatomic) BOOL verifySSL; + +/** + * SSL/TLS verification + * Set this to customize the certificate file to verify the peer + */ +@property (readonly, nonatomic) NSString *sslCaCert; + +/** + * Authentication Settings + */ +@property (readonly, nonatomic) NSDictionary *authSettings; + +/** +* Default headers for all services +*/ +@property (readonly, nonatomic, strong) NSDictionary *defaultHeaders; + +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAIDefaultConfiguration.h b/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAIDefaultConfiguration.h new file mode 100644 index 000000000000..245037abb978 --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAIDefaultConfiguration.h @@ -0,0 +1,171 @@ +#import +#import "OAIConfiguration.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +@class OAIApiClient; + +@interface OAIDefaultConfiguration : NSObject + + +/** + * Default api logger + */ +@property (nonatomic, strong) OAILogger * logger; + +/** + * Default base url + */ +@property (nonatomic) NSString *host; + +/** + * Api key values for Api Key type Authentication + * + * To add or remove api key, use `setApiKey:forApiKeyIdentifier:`. + */ +@property (readonly, nonatomic, strong) NSDictionary *apiKey; + +/** + * Api key prefix values to be prepend to the respective api key + * + * To add or remove prefix, use `setApiKeyPrefix:forApiKeyPrefixIdentifier:`. + */ +@property (readonly, nonatomic, strong) NSDictionary *apiKeyPrefix; + +/** + * Username for HTTP Basic Authentication + */ + @property (nonatomic) NSString *username; + +/** + * Password for HTTP Basic Authentication + */ +@property (nonatomic) NSString *password; + +/** + * Access token for OAuth + */ +@property (nonatomic) NSString *accessToken; + +/** + * Temp folder for file download + */ +@property (nonatomic) NSString *tempFolderPath; + +/** + * Debug switch, default false + */ +@property (nonatomic) BOOL debug; + +/** + * Gets configuration singleton instance + */ ++ (instancetype) sharedConfig; + +/** + * SSL/TLS verification + * Set this to NO to skip verifying SSL certificate when calling API from https server + */ +@property (nonatomic) BOOL verifySSL; + +/** + * SSL/TLS verification + * Set this to customize the certificate file to verify the peer + */ +@property (nonatomic) NSString *sslCaCert; + +/** + * The time zone to use for date serialization + */ +@property (nonatomic) NSTimeZone *serializationTimeZone; + +/** + * Sets API key + * + * To remove an apiKey for an identifier, just set the apiKey to nil. + * + * @param apiKey API key or token. + * @param identifier API key identifier (authentication schema). + * + */ +- (void) setApiKey:(NSString *)apiKey forApiKeyIdentifier:(NSString*)identifier; + +/** + * Removes api key + * + * @param identifier API key identifier. + */ +- (void) removeApiKey:(NSString *)identifier; + +/** + * Sets the prefix for API key + * + * @param prefix API key prefix. + * @param identifier API key identifier. + */ +- (void) setApiKeyPrefix:(NSString *)prefix forApiKeyPrefixIdentifier:(NSString *)identifier; + +/** + * Removes api key prefix + * + * @param identifier API key identifier. + */ +- (void) removeApiKeyPrefix:(NSString *)identifier; + +/** + * Gets API key (with prefix if set) + */ +- (NSString *) getApiKeyWithPrefix:(NSString *) key; + +/** + * Gets Basic Auth token + */ +- (NSString *) getBasicAuthToken; + +/** + * Gets OAuth access token + */ +- (NSString *) getAccessToken; + +/** + * Gets Authentication Settings + */ +- (NSDictionary *) authSettings; + +/** +* Default headers for all services +*/ +@property (readonly, nonatomic, strong) NSDictionary *defaultHeaders; + +/** +* Removes header from defaultHeaders +* +* @param key Header name. +*/ +-(void) removeDefaultHeaderForKey:(NSString*)key; + +/** +* Sets the header for key +* +* @param value Value for header name +* @param key Header name +*/ +-(void) setDefaultHeaderValue:(NSString*) value forKey:(NSString*)key; + +/** +* @param key Header key name. +*/ +-(NSString*) defaultHeaderForKey:(NSString*)key; + +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAIDefaultConfiguration.m b/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAIDefaultConfiguration.m new file mode 100644 index 000000000000..092a61581f38 --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAIDefaultConfiguration.m @@ -0,0 +1,152 @@ +#import "OAIDefaultConfiguration.h" +#import "OAIBasicAuthTokenProvider.h" +#import "OAILogger.h" + +@interface OAIDefaultConfiguration () + +@property (nonatomic, strong) NSMutableDictionary *mutableDefaultHeaders; +@property (nonatomic, strong) NSMutableDictionary *mutableApiKey; +@property (nonatomic, strong) NSMutableDictionary *mutableApiKeyPrefix; + +@end + +@implementation OAIDefaultConfiguration + +#pragma mark - Singleton Methods + ++ (instancetype) sharedConfig { + static OAIDefaultConfiguration *shardConfig = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + shardConfig = [[self alloc] init]; + }); + return shardConfig; +} + +#pragma mark - Initialize Methods + +- (instancetype) init { + self = [super init]; + if (self) { + _host = @"http://petstore.swagger.io/v2"; + _username = @""; + _password = @""; + _accessToken= @""; + _verifySSL = YES; + _mutableApiKey = [NSMutableDictionary dictionary]; + _mutableApiKeyPrefix = [NSMutableDictionary dictionary]; + _mutableDefaultHeaders = [NSMutableDictionary dictionary]; + + _logger = [OAILogger sharedLogger]; + } + return self; +} + +#pragma mark - Instance Methods + +- (NSString *) getApiKeyWithPrefix:(NSString *)key { + NSString *prefix = self.apiKeyPrefix[key]; + NSString *apiKey = self.apiKey[key]; + if (prefix && apiKey != (id)[NSNull null] && apiKey.length > 0) { // both api key prefix and api key are set + return [NSString stringWithFormat:@"%@ %@", prefix, apiKey]; + } + else if (apiKey != (id)[NSNull null] && apiKey.length > 0) { // only api key, no api key prefix + return [NSString stringWithFormat:@"%@", self.apiKey[key]]; + } + else { // return empty string if nothing is set + return @""; + } +} + +- (NSString *) getBasicAuthToken { + + NSString *basicAuthToken = [OAIBasicAuthTokenProvider createBasicAuthTokenWithUsername:self.username password:self.password]; + return basicAuthToken; +} + +- (NSString *) getAccessToken { + if (self.accessToken.length == 0) { // token not set, return empty string + return @""; + } else { + return [NSString stringWithFormat:@"Bearer %@", self.accessToken]; + } +} + +#pragma mark - Setter Methods + +- (void) setApiKey:(NSString *)apiKey forApiKeyIdentifier:(NSString *)identifier { + [self.mutableApiKey setValue:apiKey forKey:identifier]; +} + +- (void) removeApiKey:(NSString *)identifier { + [self.mutableApiKey removeObjectForKey:identifier]; +} + +- (void) setApiKeyPrefix:(NSString *)prefix forApiKeyPrefixIdentifier:(NSString *)identifier { + [self.mutableApiKeyPrefix setValue:prefix forKey:identifier]; +} + +- (void) removeApiKeyPrefix:(NSString *)identifier { + [self.mutableApiKeyPrefix removeObjectForKey:identifier]; +} + +#pragma mark - Getter Methods + +- (NSDictionary *) apiKey { + return [NSDictionary dictionaryWithDictionary:self.mutableApiKey]; +} + +- (NSDictionary *) apiKeyPrefix { + return [NSDictionary dictionaryWithDictionary:self.mutableApiKeyPrefix]; +} + +#pragma mark - + +- (NSDictionary *) authSettings { + return @{ + @"api_key": + @{ + @"type": @"api_key", + @"in": @"header", + @"key": @"api_key", + @"value": [self getApiKeyWithPrefix:@"api_key"] + }, + @"petstore_auth": + @{ + @"type": @"oauth", + @"in": @"header", + @"key": @"Authorization", + @"value": [self getAccessToken] + }, + }; +} + +-(BOOL)debug { + return self.logger.isEnabled; +} + +-(void)setDebug:(BOOL)debug { + self.logger.enabled = debug; +} + +- (void)setDefaultHeaderValue:(NSString *)value forKey:(NSString *)key { + if(!value) { + [self.mutableDefaultHeaders removeObjectForKey:key]; + return; + } + self.mutableDefaultHeaders[key] = value; +} + +-(void) removeDefaultHeaderForKey:(NSString*)key { + [self.mutableDefaultHeaders removeObjectForKey:key]; +} + +- (NSString *)defaultHeaderForKey:(NSString *)key { + return self.mutableDefaultHeaders[key]; +} + +- (NSDictionary *)defaultHeaders { + return [self.mutableDefaultHeaders copy]; +} + +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAIJSONRequestSerializer.h b/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAIJSONRequestSerializer.h new file mode 100644 index 000000000000..8cf3949a5b06 --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAIJSONRequestSerializer.h @@ -0,0 +1,18 @@ +#import +#import + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +@interface OAIJSONRequestSerializer : AFJSONRequestSerializer +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAIJSONRequestSerializer.m b/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAIJSONRequestSerializer.m new file mode 100644 index 000000000000..644f07c174b9 --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAIJSONRequestSerializer.m @@ -0,0 +1,37 @@ +#import "OAIJSONRequestSerializer.h" + +@implementation OAIJSONRequestSerializer + +/// +/// When customize a request serializer, +/// the serializer must conform the protocol `AFURLRequestSerialization` +/// and implements the protocol method `requestBySerializingRequest:withParameters:error:` +/// +/// @param request The original request. +/// @param parameters The parameters to be encoded. +/// @param error The error that occurred while attempting to encode the request parameters. +/// +/// @return A serialized request. +/// +- (NSURLRequest *)requestBySerializingRequest:(NSURLRequest *)request + withParameters:(id)parameters + error:(NSError *__autoreleasing *)error +{ + if (!parameters) { + return request; + } + // If the body data which will be serialized isn't NSArray or NSDictionary + // then put the data in the http request body directly. + if ([parameters isKindOfClass:[NSArray class]] || [parameters isKindOfClass:[NSDictionary class]]) { + return [super requestBySerializingRequest:request withParameters:parameters error:error]; + } + NSMutableURLRequest *mutableRequest = [request mutableCopy]; + if([parameters isKindOfClass:[NSData class]]) { + [mutableRequest setHTTPBody:parameters]; + } else { + [mutableRequest setHTTPBody:[parameters dataUsingEncoding:self.stringEncoding]]; + } + return mutableRequest; +} + +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAILogger.h b/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAILogger.h new file mode 100644 index 000000000000..1dcf393b8848 --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAILogger.h @@ -0,0 +1,61 @@ +#import + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +#ifndef OAIDebugLogResponse +#define OAIDebugLogResponse(response, responseObject,request, error) [[OAILogger sharedLogger] logResponse:response responseObject:responseObject request:request error:error]; +#endif + +/** + * Log debug message macro + */ +#ifndef OAIDebugLog +#define OAIDebugLog(format, ...) [[OAILogger sharedLogger] debugLog:[NSString stringWithFormat:@"%s", __PRETTY_FUNCTION__] message: format, ##__VA_ARGS__]; +#endif + +@interface OAILogger : NSObject + ++(instancetype)sharedLogger; + +/** + * Enabled switch, default NO - default set by OAIConfiguration debug property + */ +@property (nonatomic, assign, getter=isEnabled) BOOL enabled; + +/** + * Debug file location, default log in console + */ +@property (nonatomic, strong) NSString *loggingFile; + +/** + * Log file handler, this property is used by sdk internally. + */ +@property (nonatomic, strong, readonly) NSFileHandle *loggingFileHandler; + +/** + * Log debug message + */ +-(void)debugLog:(NSString *)method message:(NSString *)format, ...; + +/** + * Logs request and response + * + * @param response NSURLResponse for the HTTP request. + * @param responseObject response object of the HTTP request. + * @param request The HTTP request. + * @param error The error of the HTTP request. + */ +- (void)logResponse:(NSURLResponse *)response responseObject:(id)responseObject request:(NSURLRequest *)request error:(NSError *)error; + +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAILogger.m b/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAILogger.m new file mode 100644 index 000000000000..42b950681ad0 --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAILogger.m @@ -0,0 +1,73 @@ +#import "OAILogger.h" + +@interface OAILogger () + +@end + +@implementation OAILogger + ++ (instancetype) sharedLogger { + static OAILogger *shardLogger = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + shardLogger = [[self alloc] init]; + }); + return shardLogger; +} + +#pragma mark - Log Methods + +- (void)debugLog:(NSString *)method message:(NSString *)format, ... { + if (!self.isEnabled) { + return; + } + + NSMutableString *message = [NSMutableString stringWithCapacity:1]; + + if (method) { + [message appendFormat:@"%@: ", method]; + } + + va_list args; + va_start(args, format); + + [message appendString:[[NSString alloc] initWithFormat:format arguments:args]]; + + // If set logging file handler, log into file, + // otherwise log into console. + if (self.loggingFileHandler) { + [self.loggingFileHandler seekToEndOfFile]; + [self.loggingFileHandler writeData:[message dataUsingEncoding:NSUTF8StringEncoding]]; + } else { + NSLog(@"%@", message); + } + + va_end(args); +} + +- (void)logResponse:(NSURLResponse *)response responseObject:(id)responseObject request:(NSURLRequest *)request error:(NSError *)error { + NSString *message = [NSString stringWithFormat:@"\n[DEBUG] HTTP request body \n~BEGIN~\n %@\n~END~\n"\ + "[DEBUG] HTTP response body \n~BEGIN~\n %@\n~END~\n", + [[NSString alloc] initWithData:request.HTTPBody encoding:NSUTF8StringEncoding], + responseObject]; + + OAIDebugLog(message); +} + +- (void) setLoggingFile:(NSString *)loggingFile { + if(_loggingFile == loggingFile) { + return; + } + // close old file handler + if ([self.loggingFileHandler isKindOfClass:[NSFileHandle class]]) { + [self.loggingFileHandler closeFile]; + } + _loggingFile = loggingFile; + _loggingFileHandler = [NSFileHandle fileHandleForWritingAtPath:_loggingFile]; + if (_loggingFileHandler == nil) { + [[NSFileManager defaultManager] createFileAtPath:_loggingFile contents:nil attributes:nil]; + _loggingFileHandler = [NSFileHandle fileHandleForWritingAtPath:_loggingFile]; + } +} + +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAIObject.h b/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAIObject.h new file mode 100644 index 000000000000..bf641adfb7ae --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAIObject.h @@ -0,0 +1,19 @@ +#import +#import + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +@interface OAIObject : JSONModel + +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAIObject.m b/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAIObject.m new file mode 100644 index 000000000000..fd31d41df3ef --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAIObject.m @@ -0,0 +1,42 @@ +#import "OAIObject.h" + +@implementation OAIObject + +/** + * Workaround for JSONModel multithreading issues + * https://github.com/icanzilb/JSONModel/issues/441 + */ +- (instancetype)initWithDictionary:(NSDictionary *)dict error:(NSError **)err { + static NSMutableSet *classNames; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + classNames = [NSMutableSet new]; + }); + + BOOL initSync; + @synchronized([self class]) + { + NSString *className = NSStringFromClass([self class]); + initSync = ![classNames containsObject:className]; + if(initSync) + { + [classNames addObject:className]; + self = [super initWithDictionary:dict error:err]; + } + } + if(!initSync) + { + self = [super initWithDictionary:dict error:err]; + } + return self; +} + +/** + * Gets the string presentation of the object. + * This method will be called when logging model object using `NSLog`. + */ +- (NSString *)description { + return [[self toDictionary] description]; +} + +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAIQueryParamCollection.h b/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAIQueryParamCollection.h new file mode 100644 index 000000000000..d8e0c05cb91b --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAIQueryParamCollection.h @@ -0,0 +1,24 @@ +#import + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +@interface OAIQueryParamCollection : NSObject + +@property(nonatomic, readonly) NSArray* values; +@property(nonatomic, readonly) NSString* format; + +- (id) initWithValuesAndFormat: (NSArray*) values + format: (NSString*) format; + +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAIQueryParamCollection.m b/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAIQueryParamCollection.m new file mode 100644 index 000000000000..fba39676e823 --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAIQueryParamCollection.m @@ -0,0 +1,20 @@ +#import "OAIQueryParamCollection.h" + +@implementation OAIQueryParamCollection + +@synthesize values = _values; +@synthesize format = _format; + +- (id)initWithValuesAndFormat:(NSArray *)values + format:(NSString *)format { + + self = [super init]; + if (self) { + _values = values; + _format = format; + } + + return self; +} + +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAIResponseDeserializer.h b/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAIResponseDeserializer.h new file mode 100644 index 000000000000..be55731603b4 --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAIResponseDeserializer.h @@ -0,0 +1,57 @@ +#import + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +/** + * A key for deserialization ErrorDomain + */ +extern NSString *const OAIDeserializationErrorDomainKey; + +/** + * Code for deserialization type mismatch error + */ +extern NSInteger const OAITypeMismatchErrorCode; + +/** + * Code for deserialization empty value error + */ +extern NSInteger const OAIEmptyValueOccurredErrorCode; + +/** + * Error code for unknown response + */ +extern NSInteger const OAIUnknownResponseObjectErrorCode; + +@protocol OAIResponseDeserializer + +/** + * Deserializes the given data to Objective-C object. + * + * @param data The data will be deserialized. + * @param className The type of objective-c object. + * @param error The error + */ +- (id) deserialize:(id) data class:(NSString *) className error:(NSError**)error; + +@end + +@interface OAIResponseDeserializer : NSObject + +/** + * If a null value occurs in dictionary or array if set to YES whole response will be invalid else will be ignored + * @default NO + */ +@property (nonatomic, assign) BOOL treatNullAsError; + +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAIResponseDeserializer.m b/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAIResponseDeserializer.m new file mode 100644 index 000000000000..46ffcb25eee9 --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAIResponseDeserializer.m @@ -0,0 +1,247 @@ +#import "OAIResponseDeserializer.h" +#import +#import + +NSString *const OAIDeserializationErrorDomainKey = @"OAIDeserializationErrorDomainKey"; + +NSInteger const OAITypeMismatchErrorCode = 143553; + +NSInteger const OAIEmptyValueOccurredErrorCode = 143509; + +NSInteger const OAIUnknownResponseObjectErrorCode = 143528; + + +@interface OAIResponseDeserializer () + +@property (nonatomic, strong) NSNumberFormatter* numberFormatter; +@property (nonatomic, strong) NSArray *primitiveTypes; +@property (nonatomic, strong) NSArray *basicReturnTypes; +@property (nonatomic, strong) NSArray *dataReturnTypes; + +@property (nonatomic, strong) NSRegularExpression* arrayOfModelsPatExpression; +@property (nonatomic, strong) NSRegularExpression* arrayOfPrimitivesPatExpression; +@property (nonatomic, strong) NSRegularExpression* dictPatExpression; +@property (nonatomic, strong) NSRegularExpression* dictModelsPatExpression; + +@end + +@implementation OAIResponseDeserializer + +- (instancetype)init { + self = [super init]; + if (self) { + NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init]; + formatter.numberStyle = NSNumberFormatterDecimalStyle; + _numberFormatter = formatter; + _primitiveTypes = @[@"NSString", @"NSDate", @"NSNumber"]; + _basicReturnTypes = @[@"NSObject", @"id"]; + _dataReturnTypes = @[@"NSData"]; + + _arrayOfModelsPatExpression = [NSRegularExpression regularExpressionWithPattern:@"NSArray<(.+)>" + options:NSRegularExpressionCaseInsensitive + error:nil]; + _arrayOfPrimitivesPatExpression = [NSRegularExpression regularExpressionWithPattern:@"NSArray\\* /\\* (.+) \\*/" + options:NSRegularExpressionCaseInsensitive + error:nil]; + _dictPatExpression = [NSRegularExpression regularExpressionWithPattern:@"NSDictionary\\* /\\* (.+?), (.+) \\*/" + options:NSRegularExpressionCaseInsensitive + error:nil]; + _dictModelsPatExpression = [NSRegularExpression regularExpressionWithPattern:@"NSDictionary\\<(.+?), (.+)*\\>" + options:NSRegularExpressionCaseInsensitive + error:nil]; + } + return self; +} + +#pragma mark - Deserialize methods + +- (id) deserialize:(id) data class:(NSString *) className error:(NSError **) error { + if (!data || !className) { + return nil; + } + + if ([className hasSuffix:@"*"]) { + className = [className substringToIndex:[className length] - 1]; + } + if([self.dataReturnTypes containsObject:className]) { + return data; + } + id jsonData = nil; + if([data isKindOfClass:[NSData class]]) { + jsonData = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:error]; + } else { + jsonData = data; + } + if(!jsonData) { + jsonData = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; + } else if([jsonData isKindOfClass:[NSNull class]]) { + return nil; + } + + // pure object + if ([self.basicReturnTypes containsObject:className]) { + return jsonData; + } + + // primitives + if ([self.primitiveTypes containsObject:className]) { + return [self deserializePrimitiveValue:jsonData class:className error:error]; + } + + NSTextCheckingResult *match = nil; + NSRange range = NSMakeRange(0, [className length]); + // list of models + match = [self.arrayOfModelsPatExpression firstMatchInString:className options:0 range:range]; + if (match) { + NSString *innerType = [className substringWithRange:[match rangeAtIndex:1]]; + return [self deserializeArrayValue:jsonData innerType:innerType error:error]; + } + + // list of primitives + match = [self.arrayOfPrimitivesPatExpression firstMatchInString:className options:0 range:range]; + if (match) { + NSString *innerType = [className substringWithRange:[match rangeAtIndex:1]]; + return [self deserializeArrayValue:jsonData innerType:innerType error:error]; + } + + // map + match = [self.dictPatExpression firstMatchInString:className options:0 range:range]; + if (match) { + NSString *valueType = [className substringWithRange:[match rangeAtIndex:2]]; + return [self deserializeDictionaryValue:jsonData valueType:valueType error:error]; + } + + match = [self.dictModelsPatExpression firstMatchInString:className options:0 range:range]; + if (match) { + NSString *valueType = [className substringWithRange:[match rangeAtIndex:2]]; + return [self deserializeDictionaryValue:jsonData valueType:valueType error:error]; + } + + // model + Class ModelClass = NSClassFromString(className); + if ([ModelClass instancesRespondToSelector:@selector(initWithDictionary:error:)]) { + return [(JSONModel *) [ModelClass alloc] initWithDictionary:jsonData error:error]; + } + + if(error) { + *error = [self unknownResponseErrorWithExpectedType:className data:jsonData]; + } + return nil; +} + +- (id) deserializeDictionaryValue:(id) data valueType:(NSString *) valueType error:(NSError**)error { + if(![data isKindOfClass: [NSDictionary class]]) { + if(error) { + *error = [self typeMismatchErrorWithExpectedType:NSStringFromClass([NSDictionary class]) data:data]; + } + return nil; + } + __block NSMutableDictionary *resultDict = [NSMutableDictionary dictionaryWithCapacity:[data count]]; + for (id key in [data allKeys]) { + id obj = [data valueForKey:key]; + id dicObj = [self deserialize:obj class:valueType error:error]; + if(dicObj) { + [resultDict setValue:dicObj forKey:key]; + } else if([obj isKindOfClass:[NSNull class]]) { + if(self.treatNullAsError) { + if (error) { + *error = [self emptyValueOccurredError]; + } + resultDict = nil; + break; + } + } else { + resultDict = nil; + break; + } + } + return resultDict; +} + +- (id) deserializeArrayValue:(id) data innerType:(NSString *) innerType error:(NSError**)error { + if(![data isKindOfClass: [NSArray class]]) { + if(error) { + *error = [self typeMismatchErrorWithExpectedType:NSStringFromClass([NSArray class]) data:data]; + } + return nil; + } + NSMutableArray* resultArray = [NSMutableArray arrayWithCapacity:[data count]]; + for (id obj in data) { + id arrObj = [self deserialize:obj class:innerType error:error]; + if(arrObj) { + [resultArray addObject:arrObj]; + } else if([obj isKindOfClass:[NSNull class]]) { + if(self.treatNullAsError) { + if (error) { + *error = [self emptyValueOccurredError]; + } + resultArray = nil; + break; + } + } else { + resultArray = nil; + break; + } + } + return resultArray; +}; + +- (id) deserializePrimitiveValue:(id) data class:(NSString *) className error:(NSError**)error { + if ([className isEqualToString:@"NSString"]) { + return [NSString stringWithFormat:@"%@",data]; + } + else if ([className isEqualToString:@"NSDate"]) { + return [self deserializeDateValue:data error:error]; + } + else if ([className isEqualToString:@"NSNumber"]) { + // NSNumber from NSNumber + if ([data isKindOfClass:[NSNumber class]]) { + return data; + } + else if ([data isKindOfClass:[NSString class]]) { + // NSNumber (NSCFBoolean) from NSString + if ([[data lowercaseString] isEqualToString:@"true"] || [[data lowercaseString] isEqualToString:@"false"]) { + return @([data boolValue]); + // NSNumber from NSString + } else { + NSNumber* formattedValue = [self.numberFormatter numberFromString:data]; + if(!formattedValue && [data length] > 0 && error) { + *error = [self typeMismatchErrorWithExpectedType:className data:data]; + } + return formattedValue; + } + } + } + if(error) { + *error = [self typeMismatchErrorWithExpectedType:className data:data]; + } + return nil; +} + +- (id) deserializeDateValue:(id) data error:(NSError**)error { + NSDate *date =[NSDate dateWithISO8601String:data]; + if(!date && [data length] > 0 && error) { + *error = [self typeMismatchErrorWithExpectedType:NSStringFromClass([NSDate class]) data:data]; + } + return date; +}; + +-(NSError *)typeMismatchErrorWithExpectedType:(NSString *)expected data:(id)data { + NSString * message = [NSString stringWithFormat:NSLocalizedString(@"Received response [%@] is not an object of type %@",nil),data, expected]; + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : message}; + return [NSError errorWithDomain:OAIDeserializationErrorDomainKey code:OAITypeMismatchErrorCode userInfo:userInfo]; +} + +-(NSError *)emptyValueOccurredError { + NSString * message = NSLocalizedString(@"Received response contains null value in dictionary or array response",nil); + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : message}; + return [NSError errorWithDomain:OAIDeserializationErrorDomainKey code:OAIEmptyValueOccurredErrorCode userInfo:userInfo]; +} + +-(NSError *)unknownResponseErrorWithExpectedType:(NSString *)expected data:(id)data { + NSString * message = [NSString stringWithFormat:NSLocalizedString(@"Unknown response expected type %@ [response: %@]",nil),expected,data]; + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : message}; + return [NSError errorWithDomain:OAIDeserializationErrorDomainKey code:OAIUnknownResponseObjectErrorCode userInfo:userInfo]; +} + +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAISanitizer.h b/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAISanitizer.h new file mode 100644 index 000000000000..4371c7e694f1 --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAISanitizer.h @@ -0,0 +1,63 @@ +#import + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +extern NSString * OAIPercentEscapedStringFromString(NSString *string); + +extern NSString * const kOAIApplicationJSONType; + +@protocol OAISanitizer + +/** + * Sanitize object for request + * + * @param object The query/path/header/form/body param to be sanitized. + */ +- (id) sanitizeForSerialization:(id) object; + +/** + * Convert parameter to NSString + */ +- (NSString *) parameterToString: (id) param; + +/** + * Convert date to NSString + */ ++ (NSString *)dateToString:(id)date; + +/** + * Detects Accept header from accepts NSArray + * + * @param accepts NSArray of header + * + * @return The Accept header + */ +-(NSString *) selectHeaderAccept:(NSArray *)accepts; + +/** + * Detects Content-Type header from contentTypes NSArray + * + * @param contentTypes NSArray of header + * + * @return The Content-Type header + */ +-(NSString *) selectHeaderContentType:(NSArray *)contentTypes; + +@end + +@interface OAISanitizer : NSObject + + + +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAISanitizer.m b/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAISanitizer.m new file mode 100644 index 000000000000..cbc3f6628108 --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Core/OAISanitizer.m @@ -0,0 +1,170 @@ +#import "OAISanitizer.h" +#import "OAIObject.h" +#import "OAIQueryParamCollection.h" +#import "OAIDefaultConfiguration.h" +#import + +NSString * const kOAIApplicationJSONType = @"application/json"; + +NSString * OAIPercentEscapedStringFromString(NSString *string) { + static NSString * const kOAICharactersGeneralDelimitersToEncode = @":#[]@"; + static NSString * const kOAICharactersSubDelimitersToEncode = @"!$&'()*+,;="; + + NSMutableCharacterSet * allowedCharacterSet = [[NSCharacterSet URLQueryAllowedCharacterSet] mutableCopy]; + [allowedCharacterSet removeCharactersInString:[kOAICharactersGeneralDelimitersToEncode stringByAppendingString:kOAICharactersSubDelimitersToEncode]]; + + static NSUInteger const batchSize = 50; + + NSUInteger index = 0; + NSMutableString *escaped = @"".mutableCopy; + + while (index < string.length) { + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wgnu" + NSUInteger length = MIN(string.length - index, batchSize); + #pragma GCC diagnostic pop + NSRange range = NSMakeRange(index, length); + + // To avoid breaking up character sequences such as 👴🏻👮🏽 + range = [string rangeOfComposedCharacterSequencesForRange:range]; + + NSString *substring = [string substringWithRange:range]; + NSString *encoded = [substring stringByAddingPercentEncodingWithAllowedCharacters:allowedCharacterSet]; + [escaped appendString:encoded]; + + index += range.length; + } + + return escaped; +} + +@interface OAISanitizer () + +@property (nonatomic, strong) NSRegularExpression* jsonHeaderTypeExpression; + +@end + +@implementation OAISanitizer + +-(instancetype)init { + self = [super init]; + if ( !self ) { + return nil; + } + _jsonHeaderTypeExpression = [NSRegularExpression regularExpressionWithPattern:@"(.*)application(.*)json(.*)" options:NSRegularExpressionCaseInsensitive error:nil]; + return self; +} + + +- (id) sanitizeForSerialization:(id) object { + if (object == nil) { + return nil; + } + else if ([object isKindOfClass:[NSString class]] || [object isKindOfClass:[NSNumber class]] || [object isKindOfClass:[OAIQueryParamCollection class]]) { + return object; + } + else if ([object isKindOfClass:[NSDate class]]) { + return [OAISanitizer dateToString:object]; + } + else if ([object isKindOfClass:[NSArray class]]) { + NSArray *objectArray = object; + NSMutableArray *sanitizedObjs = [NSMutableArray arrayWithCapacity:[objectArray count]]; + [object enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { + id sanitizedObj = [self sanitizeForSerialization:obj]; + if (sanitizedObj) { + [sanitizedObjs addObject:sanitizedObj]; + } + }]; + return sanitizedObjs; + } + else if ([object isKindOfClass:[NSDictionary class]]) { + NSDictionary *objectDict = object; + NSMutableDictionary *sanitizedObjs = [NSMutableDictionary dictionaryWithCapacity:[objectDict count]]; + [object enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { + id sanitizedObj = [self sanitizeForSerialization:obj]; + if (sanitizedObj) { + sanitizedObjs[key] = sanitizedObj; + } + }]; + return sanitizedObjs; + } + else if ([object isKindOfClass:[OAIObject class]]) { + return [object toDictionary]; + } + else { + NSException *e = [NSException + exceptionWithName:@"InvalidObjectArgumentException" + reason:[NSString stringWithFormat:@"*** The argument object: %@ is invalid", object] + userInfo:nil]; + @throw e; + } +} + +- (NSString *) parameterToString:(id)param { + if ([param isKindOfClass:[NSString class]]) { + return param; + } + else if ([param isKindOfClass:[NSNumber class]]) { + return [param stringValue]; + } + else if ([param isKindOfClass:[NSDate class]]) { + return [OAISanitizer dateToString:param]; + } + else if ([param isKindOfClass:[NSArray class]]) { + NSMutableArray *mutableParam = [NSMutableArray array]; + [param enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { + [mutableParam addObject:[self parameterToString:obj]]; + }]; + return [mutableParam componentsJoinedByString:@","]; + } + else { + NSException *e = [NSException + exceptionWithName:@"InvalidObjectArgumentException" + reason:[NSString stringWithFormat:@"*** The argument object: %@ is invalid", param] + userInfo:nil]; + @throw e; + } +} + ++ (NSString *)dateToString:(id)date { + NSTimeZone* timeZone = [OAIDefaultConfiguration sharedConfig].serializationTimeZone; + return [date ISO8601StringWithTimeZone:timeZone usingCalendar:nil]; +} + +#pragma mark - Utility Methods + +/* + * Detect `Accept` from accepts + */ +- (NSString *) selectHeaderAccept:(NSArray *)accepts { + if (accepts.count == 0) { + return @""; + } + NSMutableArray *lowerAccepts = [[NSMutableArray alloc] initWithCapacity:[accepts count]]; + for (NSString *string in accepts) { + if ([self.jsonHeaderTypeExpression matchesInString:string options:0 range:NSMakeRange(0, [string length])].count > 0) { + return kOAIApplicationJSONType; + } + [lowerAccepts addObject:[string lowercaseString]]; + } + return [lowerAccepts componentsJoinedByString:@", "]; +} + +/* + * Detect `Content-Type` from contentTypes + */ +- (NSString *) selectHeaderContentType:(NSArray *)contentTypes { + if (contentTypes.count == 0) { + return kOAIApplicationJSONType; + } + NSMutableArray *lowerContentTypes = [[NSMutableArray alloc] initWithCapacity:[contentTypes count]]; + for (NSString *string in contentTypes) { + if([self.jsonHeaderTypeExpression matchesInString:string options:0 range:NSMakeRange(0, [string length])].count > 0){ + return kOAIApplicationJSONType; + } + [lowerContentTypes addObject:[string lowercaseString]]; + } + return [lowerContentTypes firstObject]; +} + +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAICategory.h b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAICategory.h new file mode 100644 index 000000000000..77c32664e9a7 --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAICategory.h @@ -0,0 +1,30 @@ +#import +#import "OAIObject.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + + + + +@protocol OAICategory +@end + +@interface OAICategory : OAIObject + + +@property(nonatomic) NSNumber* _id; + +@property(nonatomic) NSString* name; + +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAICategory.m b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAICategory.m new file mode 100644 index 000000000000..88e99b348104 --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAICategory.m @@ -0,0 +1,34 @@ +#import "OAICategory.h" + +@implementation OAICategory + +- (instancetype)init { + self = [super init]; + if (self) { + // initialize property's default value, if any + + } + return self; +} + + +/** + * Maps json key to property name. + * This method is used by `JSONModel`. + */ ++ (JSONKeyMapper *)keyMapper { + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"_id": @"id", @"name": @"name" }]; +} + +/** + * Indicates whether the property with the given name is optional. + * If `propertyName` is optional, then return `YES`, otherwise return `NO`. + * This method is used by `JSONModel`. + */ ++ (BOOL)propertyIsOptional:(NSString *)propertyName { + + NSArray *optionalProperties = @[@"_id", @"name"]; + return [optionalProperties containsObject:propertyName]; +} + +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAICategoryManagedObject.h b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAICategoryManagedObject.h new file mode 100644 index 000000000000..71427a7ccc0d --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAICategoryManagedObject.h @@ -0,0 +1,34 @@ +#import +#import + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + + + +NS_ASSUME_NONNULL_BEGIN + +@interface OAICategoryManagedObject : NSManagedObject + + +@property (nullable, nonatomic, retain) NSNumber* _id; + +@property (nullable, nonatomic, retain) NSString* name; +@end + +@interface OAICategoryManagedObject (GeneratedAccessors) + +@end + + +NS_ASSUME_NONNULL_END diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAICategoryManagedObject.m b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAICategoryManagedObject.m new file mode 100644 index 000000000000..12f45feefa1e --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAICategoryManagedObject.m @@ -0,0 +1,12 @@ +#import "OAICategoryManagedObject.h" + +/** +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +@implementation OAICategoryManagedObject + +@dynamic _id; +@dynamic name; +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAICategoryManagedObjectBuilder.h b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAICategoryManagedObjectBuilder.h new file mode 100644 index 000000000000..b479c3a5896e --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAICategoryManagedObjectBuilder.h @@ -0,0 +1,35 @@ +#import +#import + + +#import "OAICategoryManagedObject.h" +#import "OAICategory.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +@interface OAICategoryManagedObjectBuilder : NSObject + + + +-(OAICategoryManagedObject*)createNewOAICategoryManagedObjectInContext:(NSManagedObjectContext*)context; + +-(OAICategoryManagedObject*)OAICategoryManagedObjectFromOAICategory:(OAICategory*)object context:(NSManagedObjectContext*)context; + +-(void)updateOAICategoryManagedObject:(OAICategoryManagedObject*)object withOAICategory:(OAICategory*)object2; + +-(OAICategory*)OAICategoryFromOAICategoryManagedObject:(OAICategoryManagedObject*)obj; + +-(void)updateOAICategory:(OAICategory*)object withOAICategoryManagedObject:(OAICategoryManagedObject*)object2; + +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAICategoryManagedObjectBuilder.m b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAICategoryManagedObjectBuilder.m new file mode 100644 index 000000000000..2c2a4fbfd1a5 --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAICategoryManagedObjectBuilder.m @@ -0,0 +1,55 @@ + + +#import "OAICategoryManagedObjectBuilder.h" + +/** +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + +@implementation OAICategoryManagedObjectBuilder + +-(instancetype)init { + self = [super init]; + if (self != nil) { + } + return self; +} + +-(OAICategoryManagedObject*)createNewOAICategoryManagedObjectInContext:(NSManagedObjectContext*)context { + OAICategoryManagedObject *managedObject = [NSEntityDescription insertNewObjectForEntityForName:NSStringFromClass([OAICategoryManagedObject class]) inManagedObjectContext:context]; + return managedObject; +} + +-(OAICategoryManagedObject*)OAICategoryManagedObjectFromOAICategory:(OAICategory*)object context:(NSManagedObjectContext*)context { + OAICategoryManagedObject* newOAICategory = [self createNewOAICategoryManagedObjectInContext:context]; + [self updateOAICategoryManagedObject:newOAICategory withOAICategory:object]; + return newOAICategory; +} + +-(void)updateOAICategoryManagedObject:(OAICategoryManagedObject*)managedObject withOAICategory:(OAICategory*)object { + if(!managedObject || !object) { + return; + } + NSManagedObjectContext* context = managedObject.managedObjectContext; + managedObject._id = [object._id copy]; + managedObject.name = [object.name copy]; + +} + +-(OAICategory*)OAICategoryFromOAICategoryManagedObject:(OAICategoryManagedObject*)obj { + if(!obj) { + return nil; + } + OAICategory* newOAICategory = [[OAICategory alloc] init]; + [self updateOAICategory:newOAICategory withOAICategoryManagedObject:obj]; + return newOAICategory; +} + +-(void)updateOAICategory:(OAICategory*)newOAICategory withOAICategoryManagedObject:(OAICategoryManagedObject*)obj { + newOAICategory._id = [obj._id copy]; + newOAICategory.name = [obj.name copy]; +} + +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIInlineObject.h b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIInlineObject.h new file mode 100644 index 000000000000..95cd527e6f98 --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIInlineObject.h @@ -0,0 +1,32 @@ +#import +#import "OAIObject.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + + + + +@protocol OAIInlineObject +@end + +@interface OAIInlineObject : OAIObject + +/* Updated name of the pet [optional] + */ +@property(nonatomic) NSString* name; +/* Updated status of the pet [optional] + */ +@property(nonatomic) NSString* status; + +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIInlineObject.m b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIInlineObject.m new file mode 100644 index 000000000000..390eb3d9c530 --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIInlineObject.m @@ -0,0 +1,34 @@ +#import "OAIInlineObject.h" + +@implementation OAIInlineObject + +- (instancetype)init { + self = [super init]; + if (self) { + // initialize property's default value, if any + + } + return self; +} + + +/** + * Maps json key to property name. + * This method is used by `JSONModel`. + */ ++ (JSONKeyMapper *)keyMapper { + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"name": @"name", @"status": @"status" }]; +} + +/** + * Indicates whether the property with the given name is optional. + * If `propertyName` is optional, then return `YES`, otherwise return `NO`. + * This method is used by `JSONModel`. + */ ++ (BOOL)propertyIsOptional:(NSString *)propertyName { + + NSArray *optionalProperties = @[@"name", @"status"]; + return [optionalProperties containsObject:propertyName]; +} + +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIInlineObject1.h b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIInlineObject1.h new file mode 100644 index 000000000000..fe5e4fb4d834 --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIInlineObject1.h @@ -0,0 +1,32 @@ +#import +#import "OAIObject.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + + + + +@protocol OAIInlineObject1 +@end + +@interface OAIInlineObject1 : OAIObject + +/* Additional data to pass to server [optional] + */ +@property(nonatomic) NSString* additionalMetadata; +/* file to upload [optional] + */ +@property(nonatomic) NSURL* file; + +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIInlineObject1.m b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIInlineObject1.m new file mode 100644 index 000000000000..f4dc0358c634 --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIInlineObject1.m @@ -0,0 +1,34 @@ +#import "OAIInlineObject1.h" + +@implementation OAIInlineObject1 + +- (instancetype)init { + self = [super init]; + if (self) { + // initialize property's default value, if any + + } + return self; +} + + +/** + * Maps json key to property name. + * This method is used by `JSONModel`. + */ ++ (JSONKeyMapper *)keyMapper { + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"additionalMetadata": @"additionalMetadata", @"file": @"file" }]; +} + +/** + * Indicates whether the property with the given name is optional. + * If `propertyName` is optional, then return `YES`, otherwise return `NO`. + * This method is used by `JSONModel`. + */ ++ (BOOL)propertyIsOptional:(NSString *)propertyName { + + NSArray *optionalProperties = @[@"additionalMetadata", @"file"]; + return [optionalProperties containsObject:propertyName]; +} + +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIInlineObject1ManagedObject.h b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIInlineObject1ManagedObject.h new file mode 100644 index 000000000000..5cf30be10bc4 --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIInlineObject1ManagedObject.h @@ -0,0 +1,36 @@ +#import +#import + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + + + +NS_ASSUME_NONNULL_BEGIN + +@interface OAIInlineObject1ManagedObject : NSManagedObject + +/* Additional data to pass to server [optional] + */ +@property (nullable, nonatomic, retain) NSString* additionalMetadata; +/* file to upload [optional] + */ +@property (nullable, nonatomic, retain) NSURL* file; +@end + +@interface OAIInlineObject1ManagedObject (GeneratedAccessors) + +@end + + +NS_ASSUME_NONNULL_END diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIInlineObject1ManagedObject.m b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIInlineObject1ManagedObject.m new file mode 100644 index 000000000000..ab9bad568f98 --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIInlineObject1ManagedObject.m @@ -0,0 +1,12 @@ +#import "OAIInlineObject1ManagedObject.h" + +/** +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +@implementation OAIInlineObject1ManagedObject + +@dynamic additionalMetadata; +@dynamic file; +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIInlineObject1ManagedObjectBuilder.h b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIInlineObject1ManagedObjectBuilder.h new file mode 100644 index 000000000000..480a76ec638a --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIInlineObject1ManagedObjectBuilder.h @@ -0,0 +1,35 @@ +#import +#import + + +#import "OAIInlineObject1ManagedObject.h" +#import "OAIInlineObject1.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +@interface OAIInlineObject1ManagedObjectBuilder : NSObject + + + +-(OAIInlineObject1ManagedObject*)createNewOAIInlineObject1ManagedObjectInContext:(NSManagedObjectContext*)context; + +-(OAIInlineObject1ManagedObject*)OAIInlineObject1ManagedObjectFromOAIInlineObject1:(OAIInlineObject1*)object context:(NSManagedObjectContext*)context; + +-(void)updateOAIInlineObject1ManagedObject:(OAIInlineObject1ManagedObject*)object withOAIInlineObject1:(OAIInlineObject1*)object2; + +-(OAIInlineObject1*)OAIInlineObject1FromOAIInlineObject1ManagedObject:(OAIInlineObject1ManagedObject*)obj; + +-(void)updateOAIInlineObject1:(OAIInlineObject1*)object withOAIInlineObject1ManagedObject:(OAIInlineObject1ManagedObject*)object2; + +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIInlineObject1ManagedObjectBuilder.m b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIInlineObject1ManagedObjectBuilder.m new file mode 100644 index 000000000000..a0772b56b624 --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIInlineObject1ManagedObjectBuilder.m @@ -0,0 +1,55 @@ + + +#import "OAIInlineObject1ManagedObjectBuilder.h" + +/** +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + +@implementation OAIInlineObject1ManagedObjectBuilder + +-(instancetype)init { + self = [super init]; + if (self != nil) { + } + return self; +} + +-(OAIInlineObject1ManagedObject*)createNewOAIInlineObject1ManagedObjectInContext:(NSManagedObjectContext*)context { + OAIInlineObject1ManagedObject *managedObject = [NSEntityDescription insertNewObjectForEntityForName:NSStringFromClass([OAIInlineObject1ManagedObject class]) inManagedObjectContext:context]; + return managedObject; +} + +-(OAIInlineObject1ManagedObject*)OAIInlineObject1ManagedObjectFromOAIInlineObject1:(OAIInlineObject1*)object context:(NSManagedObjectContext*)context { + OAIInlineObject1ManagedObject* newOAIInlineObject1 = [self createNewOAIInlineObject1ManagedObjectInContext:context]; + [self updateOAIInlineObject1ManagedObject:newOAIInlineObject1 withOAIInlineObject1:object]; + return newOAIInlineObject1; +} + +-(void)updateOAIInlineObject1ManagedObject:(OAIInlineObject1ManagedObject*)managedObject withOAIInlineObject1:(OAIInlineObject1*)object { + if(!managedObject || !object) { + return; + } + NSManagedObjectContext* context = managedObject.managedObjectContext; + managedObject.additionalMetadata = [object.additionalMetadata copy]; + managedObject.file = [object.file copy]; + +} + +-(OAIInlineObject1*)OAIInlineObject1FromOAIInlineObject1ManagedObject:(OAIInlineObject1ManagedObject*)obj { + if(!obj) { + return nil; + } + OAIInlineObject1* newOAIInlineObject1 = [[OAIInlineObject1 alloc] init]; + [self updateOAIInlineObject1:newOAIInlineObject1 withOAIInlineObject1ManagedObject:obj]; + return newOAIInlineObject1; +} + +-(void)updateOAIInlineObject1:(OAIInlineObject1*)newOAIInlineObject1 withOAIInlineObject1ManagedObject:(OAIInlineObject1ManagedObject*)obj { + newOAIInlineObject1.additionalMetadata = [obj.additionalMetadata copy]; + newOAIInlineObject1.file = [obj.file copy]; +} + +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIInlineObjectManagedObject.h b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIInlineObjectManagedObject.h new file mode 100644 index 000000000000..3d31462686da --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIInlineObjectManagedObject.h @@ -0,0 +1,36 @@ +#import +#import + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + + + +NS_ASSUME_NONNULL_BEGIN + +@interface OAIInlineObjectManagedObject : NSManagedObject + +/* Updated name of the pet [optional] + */ +@property (nullable, nonatomic, retain) NSString* name; +/* Updated status of the pet [optional] + */ +@property (nullable, nonatomic, retain) NSString* status; +@end + +@interface OAIInlineObjectManagedObject (GeneratedAccessors) + +@end + + +NS_ASSUME_NONNULL_END diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIInlineObjectManagedObject.m b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIInlineObjectManagedObject.m new file mode 100644 index 000000000000..82d215ff6093 --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIInlineObjectManagedObject.m @@ -0,0 +1,12 @@ +#import "OAIInlineObjectManagedObject.h" + +/** +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +@implementation OAIInlineObjectManagedObject + +@dynamic name; +@dynamic status; +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIInlineObjectManagedObjectBuilder.h b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIInlineObjectManagedObjectBuilder.h new file mode 100644 index 000000000000..b5ef8e9c4e18 --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIInlineObjectManagedObjectBuilder.h @@ -0,0 +1,35 @@ +#import +#import + + +#import "OAIInlineObjectManagedObject.h" +#import "OAIInlineObject.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +@interface OAIInlineObjectManagedObjectBuilder : NSObject + + + +-(OAIInlineObjectManagedObject*)createNewOAIInlineObjectManagedObjectInContext:(NSManagedObjectContext*)context; + +-(OAIInlineObjectManagedObject*)OAIInlineObjectManagedObjectFromOAIInlineObject:(OAIInlineObject*)object context:(NSManagedObjectContext*)context; + +-(void)updateOAIInlineObjectManagedObject:(OAIInlineObjectManagedObject*)object withOAIInlineObject:(OAIInlineObject*)object2; + +-(OAIInlineObject*)OAIInlineObjectFromOAIInlineObjectManagedObject:(OAIInlineObjectManagedObject*)obj; + +-(void)updateOAIInlineObject:(OAIInlineObject*)object withOAIInlineObjectManagedObject:(OAIInlineObjectManagedObject*)object2; + +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIInlineObjectManagedObjectBuilder.m b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIInlineObjectManagedObjectBuilder.m new file mode 100644 index 000000000000..b8a1523afd08 --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIInlineObjectManagedObjectBuilder.m @@ -0,0 +1,55 @@ + + +#import "OAIInlineObjectManagedObjectBuilder.h" + +/** +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + +@implementation OAIInlineObjectManagedObjectBuilder + +-(instancetype)init { + self = [super init]; + if (self != nil) { + } + return self; +} + +-(OAIInlineObjectManagedObject*)createNewOAIInlineObjectManagedObjectInContext:(NSManagedObjectContext*)context { + OAIInlineObjectManagedObject *managedObject = [NSEntityDescription insertNewObjectForEntityForName:NSStringFromClass([OAIInlineObjectManagedObject class]) inManagedObjectContext:context]; + return managedObject; +} + +-(OAIInlineObjectManagedObject*)OAIInlineObjectManagedObjectFromOAIInlineObject:(OAIInlineObject*)object context:(NSManagedObjectContext*)context { + OAIInlineObjectManagedObject* newOAIInlineObject = [self createNewOAIInlineObjectManagedObjectInContext:context]; + [self updateOAIInlineObjectManagedObject:newOAIInlineObject withOAIInlineObject:object]; + return newOAIInlineObject; +} + +-(void)updateOAIInlineObjectManagedObject:(OAIInlineObjectManagedObject*)managedObject withOAIInlineObject:(OAIInlineObject*)object { + if(!managedObject || !object) { + return; + } + NSManagedObjectContext* context = managedObject.managedObjectContext; + managedObject.name = [object.name copy]; + managedObject.status = [object.status copy]; + +} + +-(OAIInlineObject*)OAIInlineObjectFromOAIInlineObjectManagedObject:(OAIInlineObjectManagedObject*)obj { + if(!obj) { + return nil; + } + OAIInlineObject* newOAIInlineObject = [[OAIInlineObject alloc] init]; + [self updateOAIInlineObject:newOAIInlineObject withOAIInlineObjectManagedObject:obj]; + return newOAIInlineObject; +} + +-(void)updateOAIInlineObject:(OAIInlineObject*)newOAIInlineObject withOAIInlineObjectManagedObject:(OAIInlineObjectManagedObject*)obj { + newOAIInlineObject.name = [obj.name copy]; + newOAIInlineObject.status = [obj.status copy]; +} + +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIModel.xcdatamodeld/.xccurrentversion b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIModel.xcdatamodeld/.xccurrentversion new file mode 100644 index 000000000000..bbfcdeab04cc --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIModel.xcdatamodeld/.xccurrentversion @@ -0,0 +1,8 @@ + + + + + _XCCurrentVersionName + OAIModel.xcdatamodel + + diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIModel.xcdatamodeld/OAIModel.xcdatamodel/contents b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIModel.xcdatamodeld/OAIModel.xcdatamodel/contents new file mode 100644 index 000000000000..af3206db2fb5 --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIModel.xcdatamodeld/OAIModel.xcdatamodel/contents @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIOrder.h b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIOrder.h new file mode 100644 index 000000000000..688feb5e74d0 --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIOrder.h @@ -0,0 +1,39 @@ +#import +#import "OAIObject.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + + + + +@protocol OAIOrder +@end + +@interface OAIOrder : OAIObject + + +@property(nonatomic) NSNumber* _id; + +@property(nonatomic) NSNumber* petId; + +@property(nonatomic) NSNumber* quantity; + +@property(nonatomic) NSDate* shipDate; +/* Order Status [optional] + */ +@property(nonatomic) NSString* status; + +@property(nonatomic) NSNumber* complete; + +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIOrder.m b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIOrder.m new file mode 100644 index 000000000000..5d34737e7c3d --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIOrder.m @@ -0,0 +1,34 @@ +#import "OAIOrder.h" + +@implementation OAIOrder + +- (instancetype)init { + self = [super init]; + if (self) { + // initialize property's default value, if any + + } + return self; +} + + +/** + * Maps json key to property name. + * This method is used by `JSONModel`. + */ ++ (JSONKeyMapper *)keyMapper { + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"_id": @"id", @"petId": @"petId", @"quantity": @"quantity", @"shipDate": @"shipDate", @"status": @"status", @"complete": @"complete" }]; +} + +/** + * Indicates whether the property with the given name is optional. + * If `propertyName` is optional, then return `YES`, otherwise return `NO`. + * This method is used by `JSONModel`. + */ ++ (BOOL)propertyIsOptional:(NSString *)propertyName { + + NSArray *optionalProperties = @[@"_id", @"petId", @"quantity", @"shipDate", @"status", @"complete"]; + return [optionalProperties containsObject:propertyName]; +} + +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIOrderManagedObject.h b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIOrderManagedObject.h new file mode 100644 index 000000000000..7df7be6d7a80 --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIOrderManagedObject.h @@ -0,0 +1,43 @@ +#import +#import + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + + + +NS_ASSUME_NONNULL_BEGIN + +@interface OAIOrderManagedObject : NSManagedObject + + +@property (nullable, nonatomic, retain) NSNumber* _id; + +@property (nullable, nonatomic, retain) NSNumber* petId; + +@property (nullable, nonatomic, retain) NSNumber* quantity; + +@property (nullable, nonatomic, retain) NSDate* shipDate; +/* Order Status [optional] + */ +@property (nullable, nonatomic, retain) NSString* status; + +@property (nullable, nonatomic, retain) NSNumber* complete; +@end + +@interface OAIOrderManagedObject (GeneratedAccessors) + +@end + + +NS_ASSUME_NONNULL_END diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIOrderManagedObject.m b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIOrderManagedObject.m new file mode 100644 index 000000000000..1f1e99ee84cf --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIOrderManagedObject.m @@ -0,0 +1,16 @@ +#import "OAIOrderManagedObject.h" + +/** +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +@implementation OAIOrderManagedObject + +@dynamic _id; +@dynamic petId; +@dynamic quantity; +@dynamic shipDate; +@dynamic status; +@dynamic complete; +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIOrderManagedObjectBuilder.h b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIOrderManagedObjectBuilder.h new file mode 100644 index 000000000000..c61bebec6664 --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIOrderManagedObjectBuilder.h @@ -0,0 +1,35 @@ +#import +#import + + +#import "OAIOrderManagedObject.h" +#import "OAIOrder.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +@interface OAIOrderManagedObjectBuilder : NSObject + + + +-(OAIOrderManagedObject*)createNewOAIOrderManagedObjectInContext:(NSManagedObjectContext*)context; + +-(OAIOrderManagedObject*)OAIOrderManagedObjectFromOAIOrder:(OAIOrder*)object context:(NSManagedObjectContext*)context; + +-(void)updateOAIOrderManagedObject:(OAIOrderManagedObject*)object withOAIOrder:(OAIOrder*)object2; + +-(OAIOrder*)OAIOrderFromOAIOrderManagedObject:(OAIOrderManagedObject*)obj; + +-(void)updateOAIOrder:(OAIOrder*)object withOAIOrderManagedObject:(OAIOrderManagedObject*)object2; + +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIOrderManagedObjectBuilder.m b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIOrderManagedObjectBuilder.m new file mode 100644 index 000000000000..321e151c606a --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIOrderManagedObjectBuilder.m @@ -0,0 +1,63 @@ + + +#import "OAIOrderManagedObjectBuilder.h" + +/** +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + +@implementation OAIOrderManagedObjectBuilder + +-(instancetype)init { + self = [super init]; + if (self != nil) { + } + return self; +} + +-(OAIOrderManagedObject*)createNewOAIOrderManagedObjectInContext:(NSManagedObjectContext*)context { + OAIOrderManagedObject *managedObject = [NSEntityDescription insertNewObjectForEntityForName:NSStringFromClass([OAIOrderManagedObject class]) inManagedObjectContext:context]; + return managedObject; +} + +-(OAIOrderManagedObject*)OAIOrderManagedObjectFromOAIOrder:(OAIOrder*)object context:(NSManagedObjectContext*)context { + OAIOrderManagedObject* newOAIOrder = [self createNewOAIOrderManagedObjectInContext:context]; + [self updateOAIOrderManagedObject:newOAIOrder withOAIOrder:object]; + return newOAIOrder; +} + +-(void)updateOAIOrderManagedObject:(OAIOrderManagedObject*)managedObject withOAIOrder:(OAIOrder*)object { + if(!managedObject || !object) { + return; + } + NSManagedObjectContext* context = managedObject.managedObjectContext; + managedObject._id = [object._id copy]; + managedObject.petId = [object.petId copy]; + managedObject.quantity = [object.quantity copy]; + managedObject.shipDate = [object.shipDate copy]; + managedObject.status = [object.status copy]; + managedObject.complete = [object.complete copy]; + +} + +-(OAIOrder*)OAIOrderFromOAIOrderManagedObject:(OAIOrderManagedObject*)obj { + if(!obj) { + return nil; + } + OAIOrder* newOAIOrder = [[OAIOrder alloc] init]; + [self updateOAIOrder:newOAIOrder withOAIOrderManagedObject:obj]; + return newOAIOrder; +} + +-(void)updateOAIOrder:(OAIOrder*)newOAIOrder withOAIOrderManagedObject:(OAIOrderManagedObject*)obj { + newOAIOrder._id = [obj._id copy]; + newOAIOrder.petId = [obj.petId copy]; + newOAIOrder.quantity = [obj.quantity copy]; + newOAIOrder.shipDate = [obj.shipDate copy]; + newOAIOrder.status = [obj.status copy]; + newOAIOrder.complete = [obj.complete copy]; +} + +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIPet.h b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIPet.h new file mode 100644 index 000000000000..bb36127b6157 --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIPet.h @@ -0,0 +1,45 @@ +#import +#import "OAIObject.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +#import "OAICategory.h" +#import "OAITag.h" +@protocol OAICategory; +@class OAICategory; +@protocol OAITag; +@class OAITag; + + + +@protocol OAIPet +@end + +@interface OAIPet : OAIObject + + +@property(nonatomic) NSNumber* _id; + +@property(nonatomic) OAICategory* category; + +@property(nonatomic) NSString* name; + +@property(nonatomic) NSArray* photoUrls; + +@property(nonatomic) NSArray* tags; +/* pet status in the store [optional] + */ +@property(nonatomic) NSString* status; + +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIPet.m b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIPet.m new file mode 100644 index 000000000000..8a7038881533 --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIPet.m @@ -0,0 +1,34 @@ +#import "OAIPet.h" + +@implementation OAIPet + +- (instancetype)init { + self = [super init]; + if (self) { + // initialize property's default value, if any + + } + return self; +} + + +/** + * Maps json key to property name. + * This method is used by `JSONModel`. + */ ++ (JSONKeyMapper *)keyMapper { + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"_id": @"id", @"category": @"category", @"name": @"name", @"photoUrls": @"photoUrls", @"tags": @"tags", @"status": @"status" }]; +} + +/** + * Indicates whether the property with the given name is optional. + * If `propertyName` is optional, then return `YES`, otherwise return `NO`. + * This method is used by `JSONModel`. + */ ++ (BOOL)propertyIsOptional:(NSString *)propertyName { + + NSArray *optionalProperties = @[@"_id", @"category", @"tags", @"status"]; + return [optionalProperties containsObject:propertyName]; +} + +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIPetManagedObject.h b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIPetManagedObject.h new file mode 100644 index 000000000000..65fe3258dc30 --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIPetManagedObject.h @@ -0,0 +1,49 @@ +#import +#import + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +#import "OAICategoryManagedObject.h" +#import "OAITagManagedObject.h" + + +NS_ASSUME_NONNULL_BEGIN + +@interface OAIPetManagedObject : NSManagedObject + + +@property (nullable, nonatomic, retain) NSNumber* _id; + +@property (nullable, nonatomic, retain) OAICategoryManagedObject* category; + +@property (nullable, nonatomic, retain) NSString* name; + +@property (nullable, nonatomic, retain) NSArray* photoUrls; + +@property (nullable, nonatomic, retain) NSOrderedSet* tags; +/* pet status in the store [optional] + */ +@property (nullable, nonatomic, retain) NSString* status; +@end + +@interface OAIPetManagedObject (GeneratedAccessors) +- (void)addTagsObject:(OAITagManagedObject *)value; +- (void)removeTagsObject:(OAITagManagedObject *)value; +- (void)addTags:(NSOrderedSet *)values; +- (void)removeTags:(NSOrderedSet *)values; + +@end + + +NS_ASSUME_NONNULL_END diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIPetManagedObject.m b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIPetManagedObject.m new file mode 100644 index 000000000000..51c08c685aaa --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIPetManagedObject.m @@ -0,0 +1,16 @@ +#import "OAIPetManagedObject.h" + +/** +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +@implementation OAIPetManagedObject + +@dynamic _id; +@dynamic category; +@dynamic name; +@dynamic photoUrls; +@dynamic tags; +@dynamic status; +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIPetManagedObjectBuilder.h b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIPetManagedObjectBuilder.h new file mode 100644 index 000000000000..9cd8b3b44e08 --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIPetManagedObjectBuilder.h @@ -0,0 +1,39 @@ +#import +#import + +#import "OAICategoryManagedObjectBuilder.h" +#import "OAITagManagedObjectBuilder.h" + +#import "OAIPetManagedObject.h" +#import "OAIPet.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +@interface OAIPetManagedObjectBuilder : NSObject + +@property (nonatomic, strong) OAICategoryManagedObjectBuilder * categoryBuilder; +@property (nonatomic, strong) OAITagManagedObjectBuilder * tagsBuilder; + + +-(OAIPetManagedObject*)createNewOAIPetManagedObjectInContext:(NSManagedObjectContext*)context; + +-(OAIPetManagedObject*)OAIPetManagedObjectFromOAIPet:(OAIPet*)object context:(NSManagedObjectContext*)context; + +-(void)updateOAIPetManagedObject:(OAIPetManagedObject*)object withOAIPet:(OAIPet*)object2; + +-(OAIPet*)OAIPetFromOAIPetManagedObject:(OAIPetManagedObject*)obj; + +-(void)updateOAIPet:(OAIPet*)object withOAIPetManagedObject:(OAIPetManagedObject*)object2; + +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIPetManagedObjectBuilder.m b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIPetManagedObjectBuilder.m new file mode 100644 index 000000000000..9d71af644f89 --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIPetManagedObjectBuilder.m @@ -0,0 +1,90 @@ + + +#import "OAIPetManagedObjectBuilder.h" + +/** +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + +@implementation OAIPetManagedObjectBuilder + +-(instancetype)init { + self = [super init]; + if (self != nil) { + _categoryBuilder = [[OAICategoryManagedObjectBuilder alloc] init]; + _tagsBuilder = [[OAITagManagedObjectBuilder alloc] init]; + } + return self; +} + +-(OAIPetManagedObject*)createNewOAIPetManagedObjectInContext:(NSManagedObjectContext*)context { + OAIPetManagedObject *managedObject = [NSEntityDescription insertNewObjectForEntityForName:NSStringFromClass([OAIPetManagedObject class]) inManagedObjectContext:context]; + return managedObject; +} + +-(OAIPetManagedObject*)OAIPetManagedObjectFromOAIPet:(OAIPet*)object context:(NSManagedObjectContext*)context { + OAIPetManagedObject* newOAIPet = [self createNewOAIPetManagedObjectInContext:context]; + [self updateOAIPetManagedObject:newOAIPet withOAIPet:object]; + return newOAIPet; +} + +-(void)updateOAIPetManagedObject:(OAIPetManagedObject*)managedObject withOAIPet:(OAIPet*)object { + if(!managedObject || !object) { + return; + } + NSManagedObjectContext* context = managedObject.managedObjectContext; + managedObject._id = [object._id copy]; + + if(!managedObject.category) { + managedObject.category = [self.categoryBuilder OAICategoryManagedObjectFromOAICategory:object.category context:managedObject.managedObjectContext]; + } else { + [self.categoryBuilder updateOAICategoryManagedObject:managedObject.category withOAICategory:object.category]; + } + managedObject.name = [object.name copy]; + managedObject.photoUrls = [object.photoUrls copy]; + if(managedObject.tags) { + for (id object in managedObject.tags) { + [context deleteObject:object]; + } + } + if(object.tags) { + NSMutableOrderedSet * convertedObjs = [NSMutableOrderedSet orderedSet]; + for (id innerObject in object.tags) { + id convertedObj = [self.tagsBuilder OAITagManagedObjectFromOAITag:innerObject context:managedObject.managedObjectContext]; + [convertedObjs addObject:convertedObj]; + } + managedObject.tags = convertedObjs; + } + managedObject.status = [object.status copy]; + +} + +-(OAIPet*)OAIPetFromOAIPetManagedObject:(OAIPetManagedObject*)obj { + if(!obj) { + return nil; + } + OAIPet* newOAIPet = [[OAIPet alloc] init]; + [self updateOAIPet:newOAIPet withOAIPetManagedObject:obj]; + return newOAIPet; +} + +-(void)updateOAIPet:(OAIPet*)newOAIPet withOAIPetManagedObject:(OAIPetManagedObject*)obj { + newOAIPet._id = [obj._id copy]; + newOAIPet.category = [self.categoryBuilder OAICategoryFromOAICategoryManagedObject:obj.category]; + newOAIPet.name = [obj.name copy]; + newOAIPet.photoUrls = [obj.photoUrls copy]; + if(obj.tags != nil) { + NSMutableArray* convertedObjs = [NSMutableArray array]; + for (id innerObject in obj.tags) { + id convertedObj = [self.tagsBuilder OAITagFromOAITagManagedObject:innerObject]; + [convertedObjs addObject:convertedObj]; + } + newOAIPet.tags = (NSArray*)convertedObjs; + } + + newOAIPet.status = [obj.status copy]; +} + +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAITag.h b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAITag.h new file mode 100644 index 000000000000..8e77a63103d9 --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAITag.h @@ -0,0 +1,30 @@ +#import +#import "OAIObject.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + + + + +@protocol OAITag +@end + +@interface OAITag : OAIObject + + +@property(nonatomic) NSNumber* _id; + +@property(nonatomic) NSString* name; + +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAITag.m b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAITag.m new file mode 100644 index 000000000000..75a9b3f1281b --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAITag.m @@ -0,0 +1,34 @@ +#import "OAITag.h" + +@implementation OAITag + +- (instancetype)init { + self = [super init]; + if (self) { + // initialize property's default value, if any + + } + return self; +} + + +/** + * Maps json key to property name. + * This method is used by `JSONModel`. + */ ++ (JSONKeyMapper *)keyMapper { + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"_id": @"id", @"name": @"name" }]; +} + +/** + * Indicates whether the property with the given name is optional. + * If `propertyName` is optional, then return `YES`, otherwise return `NO`. + * This method is used by `JSONModel`. + */ ++ (BOOL)propertyIsOptional:(NSString *)propertyName { + + NSArray *optionalProperties = @[@"_id", @"name"]; + return [optionalProperties containsObject:propertyName]; +} + +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAITagManagedObject.h b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAITagManagedObject.h new file mode 100644 index 000000000000..0a22e2070857 --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAITagManagedObject.h @@ -0,0 +1,34 @@ +#import +#import + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + + + +NS_ASSUME_NONNULL_BEGIN + +@interface OAITagManagedObject : NSManagedObject + + +@property (nullable, nonatomic, retain) NSNumber* _id; + +@property (nullable, nonatomic, retain) NSString* name; +@end + +@interface OAITagManagedObject (GeneratedAccessors) + +@end + + +NS_ASSUME_NONNULL_END diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAITagManagedObject.m b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAITagManagedObject.m new file mode 100644 index 000000000000..9890db412f3a --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAITagManagedObject.m @@ -0,0 +1,12 @@ +#import "OAITagManagedObject.h" + +/** +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +@implementation OAITagManagedObject + +@dynamic _id; +@dynamic name; +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAITagManagedObjectBuilder.h b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAITagManagedObjectBuilder.h new file mode 100644 index 000000000000..27526663392e --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAITagManagedObjectBuilder.h @@ -0,0 +1,35 @@ +#import +#import + + +#import "OAITagManagedObject.h" +#import "OAITag.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +@interface OAITagManagedObjectBuilder : NSObject + + + +-(OAITagManagedObject*)createNewOAITagManagedObjectInContext:(NSManagedObjectContext*)context; + +-(OAITagManagedObject*)OAITagManagedObjectFromOAITag:(OAITag*)object context:(NSManagedObjectContext*)context; + +-(void)updateOAITagManagedObject:(OAITagManagedObject*)object withOAITag:(OAITag*)object2; + +-(OAITag*)OAITagFromOAITagManagedObject:(OAITagManagedObject*)obj; + +-(void)updateOAITag:(OAITag*)object withOAITagManagedObject:(OAITagManagedObject*)object2; + +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAITagManagedObjectBuilder.m b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAITagManagedObjectBuilder.m new file mode 100644 index 000000000000..70bc8455541a --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAITagManagedObjectBuilder.m @@ -0,0 +1,55 @@ + + +#import "OAITagManagedObjectBuilder.h" + +/** +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + +@implementation OAITagManagedObjectBuilder + +-(instancetype)init { + self = [super init]; + if (self != nil) { + } + return self; +} + +-(OAITagManagedObject*)createNewOAITagManagedObjectInContext:(NSManagedObjectContext*)context { + OAITagManagedObject *managedObject = [NSEntityDescription insertNewObjectForEntityForName:NSStringFromClass([OAITagManagedObject class]) inManagedObjectContext:context]; + return managedObject; +} + +-(OAITagManagedObject*)OAITagManagedObjectFromOAITag:(OAITag*)object context:(NSManagedObjectContext*)context { + OAITagManagedObject* newOAITag = [self createNewOAITagManagedObjectInContext:context]; + [self updateOAITagManagedObject:newOAITag withOAITag:object]; + return newOAITag; +} + +-(void)updateOAITagManagedObject:(OAITagManagedObject*)managedObject withOAITag:(OAITag*)object { + if(!managedObject || !object) { + return; + } + NSManagedObjectContext* context = managedObject.managedObjectContext; + managedObject._id = [object._id copy]; + managedObject.name = [object.name copy]; + +} + +-(OAITag*)OAITagFromOAITagManagedObject:(OAITagManagedObject*)obj { + if(!obj) { + return nil; + } + OAITag* newOAITag = [[OAITag alloc] init]; + [self updateOAITag:newOAITag withOAITagManagedObject:obj]; + return newOAITag; +} + +-(void)updateOAITag:(OAITag*)newOAITag withOAITagManagedObject:(OAITagManagedObject*)obj { + newOAITag._id = [obj._id copy]; + newOAITag.name = [obj.name copy]; +} + +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIUser.h b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIUser.h new file mode 100644 index 000000000000..325ae6f0266c --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIUser.h @@ -0,0 +1,43 @@ +#import +#import "OAIObject.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + + + + +@protocol OAIUser +@end + +@interface OAIUser : OAIObject + + +@property(nonatomic) NSNumber* _id; + +@property(nonatomic) NSString* username; + +@property(nonatomic) NSString* firstName; + +@property(nonatomic) NSString* lastName; + +@property(nonatomic) NSString* email; + +@property(nonatomic) NSString* password; + +@property(nonatomic) NSString* phone; +/* User Status [optional] + */ +@property(nonatomic) NSNumber* userStatus; + +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIUser.m b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIUser.m new file mode 100644 index 000000000000..419c6f191cf6 --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIUser.m @@ -0,0 +1,34 @@ +#import "OAIUser.h" + +@implementation OAIUser + +- (instancetype)init { + self = [super init]; + if (self) { + // initialize property's default value, if any + + } + return self; +} + + +/** + * Maps json key to property name. + * This method is used by `JSONModel`. + */ ++ (JSONKeyMapper *)keyMapper { + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"_id": @"id", @"username": @"username", @"firstName": @"firstName", @"lastName": @"lastName", @"email": @"email", @"password": @"password", @"phone": @"phone", @"userStatus": @"userStatus" }]; +} + +/** + * Indicates whether the property with the given name is optional. + * If `propertyName` is optional, then return `YES`, otherwise return `NO`. + * This method is used by `JSONModel`. + */ ++ (BOOL)propertyIsOptional:(NSString *)propertyName { + + NSArray *optionalProperties = @[@"_id", @"username", @"firstName", @"lastName", @"email", @"password", @"phone", @"userStatus"]; + return [optionalProperties containsObject:propertyName]; +} + +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIUserManagedObject.h b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIUserManagedObject.h new file mode 100644 index 000000000000..db2e58a67983 --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIUserManagedObject.h @@ -0,0 +1,47 @@ +#import +#import + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + + + +NS_ASSUME_NONNULL_BEGIN + +@interface OAIUserManagedObject : NSManagedObject + + +@property (nullable, nonatomic, retain) NSNumber* _id; + +@property (nullable, nonatomic, retain) NSString* username; + +@property (nullable, nonatomic, retain) NSString* firstName; + +@property (nullable, nonatomic, retain) NSString* lastName; + +@property (nullable, nonatomic, retain) NSString* email; + +@property (nullable, nonatomic, retain) NSString* password; + +@property (nullable, nonatomic, retain) NSString* phone; +/* User Status [optional] + */ +@property (nullable, nonatomic, retain) NSNumber* userStatus; +@end + +@interface OAIUserManagedObject (GeneratedAccessors) + +@end + + +NS_ASSUME_NONNULL_END diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIUserManagedObject.m b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIUserManagedObject.m new file mode 100644 index 000000000000..07b7cfc1a71f --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIUserManagedObject.m @@ -0,0 +1,18 @@ +#import "OAIUserManagedObject.h" + +/** +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +@implementation OAIUserManagedObject + +@dynamic _id; +@dynamic username; +@dynamic firstName; +@dynamic lastName; +@dynamic email; +@dynamic password; +@dynamic phone; +@dynamic userStatus; +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIUserManagedObjectBuilder.h b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIUserManagedObjectBuilder.h new file mode 100644 index 000000000000..34511089eff8 --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIUserManagedObjectBuilder.h @@ -0,0 +1,35 @@ +#import +#import + + +#import "OAIUserManagedObject.h" +#import "OAIUser.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +@interface OAIUserManagedObjectBuilder : NSObject + + + +-(OAIUserManagedObject*)createNewOAIUserManagedObjectInContext:(NSManagedObjectContext*)context; + +-(OAIUserManagedObject*)OAIUserManagedObjectFromOAIUser:(OAIUser*)object context:(NSManagedObjectContext*)context; + +-(void)updateOAIUserManagedObject:(OAIUserManagedObject*)object withOAIUser:(OAIUser*)object2; + +-(OAIUser*)OAIUserFromOAIUserManagedObject:(OAIUserManagedObject*)obj; + +-(void)updateOAIUser:(OAIUser*)object withOAIUserManagedObject:(OAIUserManagedObject*)object2; + +@end diff --git a/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIUserManagedObjectBuilder.m b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIUserManagedObjectBuilder.m new file mode 100644 index 000000000000..c358910601df --- /dev/null +++ b/samples/client/petstore/objc/core-data/OpenAPIClient/Model/OAIUserManagedObjectBuilder.m @@ -0,0 +1,67 @@ + + +#import "OAIUserManagedObjectBuilder.h" + +/** +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + +@implementation OAIUserManagedObjectBuilder + +-(instancetype)init { + self = [super init]; + if (self != nil) { + } + return self; +} + +-(OAIUserManagedObject*)createNewOAIUserManagedObjectInContext:(NSManagedObjectContext*)context { + OAIUserManagedObject *managedObject = [NSEntityDescription insertNewObjectForEntityForName:NSStringFromClass([OAIUserManagedObject class]) inManagedObjectContext:context]; + return managedObject; +} + +-(OAIUserManagedObject*)OAIUserManagedObjectFromOAIUser:(OAIUser*)object context:(NSManagedObjectContext*)context { + OAIUserManagedObject* newOAIUser = [self createNewOAIUserManagedObjectInContext:context]; + [self updateOAIUserManagedObject:newOAIUser withOAIUser:object]; + return newOAIUser; +} + +-(void)updateOAIUserManagedObject:(OAIUserManagedObject*)managedObject withOAIUser:(OAIUser*)object { + if(!managedObject || !object) { + return; + } + NSManagedObjectContext* context = managedObject.managedObjectContext; + managedObject._id = [object._id copy]; + managedObject.username = [object.username copy]; + managedObject.firstName = [object.firstName copy]; + managedObject.lastName = [object.lastName copy]; + managedObject.email = [object.email copy]; + managedObject.password = [object.password copy]; + managedObject.phone = [object.phone copy]; + managedObject.userStatus = [object.userStatus copy]; + +} + +-(OAIUser*)OAIUserFromOAIUserManagedObject:(OAIUserManagedObject*)obj { + if(!obj) { + return nil; + } + OAIUser* newOAIUser = [[OAIUser alloc] init]; + [self updateOAIUser:newOAIUser withOAIUserManagedObject:obj]; + return newOAIUser; +} + +-(void)updateOAIUser:(OAIUser*)newOAIUser withOAIUserManagedObject:(OAIUserManagedObject*)obj { + newOAIUser._id = [obj._id copy]; + newOAIUser.username = [obj.username copy]; + newOAIUser.firstName = [obj.firstName copy]; + newOAIUser.lastName = [obj.lastName copy]; + newOAIUser.email = [obj.email copy]; + newOAIUser.password = [obj.password copy]; + newOAIUser.phone = [obj.phone copy]; + newOAIUser.userStatus = [obj.userStatus copy]; +} + +@end diff --git a/samples/client/petstore/objc/core-data/README.md b/samples/client/petstore/objc/core-data/README.md index 10694bd5135b..73f2e2c12169 100644 --- a/samples/client/petstore/objc/core-data/README.md +++ b/samples/client/petstore/objc/core-data/README.md @@ -1,4 +1,4 @@ -# SwaggerClient +# OpenAPIClient This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters @@ -18,7 +18,7 @@ The SDK requires [**ARC (Automatic Reference Counting)**](http://stackoverflow.c Add the following to the Podfile: ```ruby -pod 'SwaggerClient', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' +pod 'OpenAPIClient', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' ``` To specify a particular branch, append `, :branch => 'branch-name-here'` @@ -27,10 +27,10 @@ To specify a particular commit, append `, :commit => '11aa22'` ### Install from local path using [CocoaPods](https://cocoapods.org/) -Put the SDK under your project folder (e.g. /path/to/objc_project/Vendor/SwaggerClient) and then add the following to the Podfile: +Put the SDK under your project folder (e.g. /path/to/objc_project/Vendor/OpenAPIClient) and then add the following to the Podfile: ```ruby -pod 'SwaggerClient', :path => 'Vendor/SwaggerClient' +pod 'OpenAPIClient', :path => 'Vendor/OpenAPIClient' ``` ### Usage @@ -38,18 +38,20 @@ pod 'SwaggerClient', :path => 'Vendor/SwaggerClient' Import the following: ```objc -#import -#import +#import +#import // load models -#import -#import -#import -#import -#import +#import +#import +#import +#import +#import +#import +#import // load API classes for accessing endpoints -#import -#import -#import +#import +#import +#import ``` @@ -63,15 +65,15 @@ Please follow the [installation procedure](#installation--usage) and then run th ```objc -SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; +OAIDefaultConfiguration *apiConfig = [OAIDefaultConfiguration sharedConfig]; // Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; -SWGPet* *pet = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional) +OAIPet* *pet = [[OAIPet alloc] init]; // Pet object that needs to be added to the store (optional) -SWGPetApi *apiInstance = [[SWGPetApi alloc] init]; +OAIPetApi *apiInstance = [[OAIPetApi alloc] init]; // Add a new pet to the store [apiInstance addPetWithPet:pet @@ -89,35 +91,37 @@ All URIs are relative to *http://petstore.swagger.io/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*SWGPetApi* | [**addPet**](docs/SWGPetApi.md#addpet) | **POST** /pet | Add a new pet to the store -*SWGPetApi* | [**deletePet**](docs/SWGPetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet -*SWGPetApi* | [**findPetsByStatus**](docs/SWGPetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status -*SWGPetApi* | [**findPetsByTags**](docs/SWGPetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags -*SWGPetApi* | [**getPetById**](docs/SWGPetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID -*SWGPetApi* | [**updatePet**](docs/SWGPetApi.md#updatepet) | **PUT** /pet | Update an existing pet -*SWGPetApi* | [**updatePetWithForm**](docs/SWGPetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data -*SWGPetApi* | [**uploadFile**](docs/SWGPetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image -*SWGStoreApi* | [**deleteOrder**](docs/SWGStoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID -*SWGStoreApi* | [**getInventory**](docs/SWGStoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -*SWGStoreApi* | [**getOrderById**](docs/SWGStoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID -*SWGStoreApi* | [**placeOrder**](docs/SWGStoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet -*SWGUserApi* | [**createUser**](docs/SWGUserApi.md#createuser) | **POST** /user | Create user -*SWGUserApi* | [**createUsersWithArrayInput**](docs/SWGUserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array -*SWGUserApi* | [**createUsersWithListInput**](docs/SWGUserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array -*SWGUserApi* | [**deleteUser**](docs/SWGUserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user -*SWGUserApi* | [**getUserByName**](docs/SWGUserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name -*SWGUserApi* | [**loginUser**](docs/SWGUserApi.md#loginuser) | **GET** /user/login | Logs user into the system -*SWGUserApi* | [**logoutUser**](docs/SWGUserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session -*SWGUserApi* | [**updateUser**](docs/SWGUserApi.md#updateuser) | **PUT** /user/{username} | Updated user +*OAIPetApi* | [**addPet**](docs/OAIPetApi.md#addpet) | **POST** /pet | Add a new pet to the store +*OAIPetApi* | [**deletePet**](docs/OAIPetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +*OAIPetApi* | [**findPetsByStatus**](docs/OAIPetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +*OAIPetApi* | [**findPetsByTags**](docs/OAIPetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +*OAIPetApi* | [**getPetById**](docs/OAIPetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +*OAIPetApi* | [**updatePet**](docs/OAIPetApi.md#updatepet) | **PUT** /pet | Update an existing pet +*OAIPetApi* | [**updatePetWithForm**](docs/OAIPetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +*OAIPetApi* | [**uploadFile**](docs/OAIPetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +*OAIStoreApi* | [**deleteOrder**](docs/OAIStoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*OAIStoreApi* | [**getInventory**](docs/OAIStoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +*OAIStoreApi* | [**getOrderById**](docs/OAIStoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +*OAIStoreApi* | [**placeOrder**](docs/OAIStoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet +*OAIUserApi* | [**createUser**](docs/OAIUserApi.md#createuser) | **POST** /user | Create user +*OAIUserApi* | [**createUsersWithArrayInput**](docs/OAIUserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +*OAIUserApi* | [**createUsersWithListInput**](docs/OAIUserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +*OAIUserApi* | [**deleteUser**](docs/OAIUserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +*OAIUserApi* | [**getUserByName**](docs/OAIUserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +*OAIUserApi* | [**loginUser**](docs/OAIUserApi.md#loginuser) | **GET** /user/login | Logs user into the system +*OAIUserApi* | [**logoutUser**](docs/OAIUserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +*OAIUserApi* | [**updateUser**](docs/OAIUserApi.md#updateuser) | **PUT** /user/{username} | Updated user ## Documentation For Models - - [SWGCategory](docs/SWGCategory.md) - - [SWGOrder](docs/SWGOrder.md) - - [SWGPet](docs/SWGPet.md) - - [SWGTag](docs/SWGTag.md) - - [SWGUser](docs/SWGUser.md) + - [OAICategory](docs/OAICategory.md) + - [OAIInlineObject](docs/OAIInlineObject.md) + - [OAIInlineObject1](docs/OAIInlineObject1.md) + - [OAIOrder](docs/OAIOrder.md) + - [OAIPet](docs/OAIPet.md) + - [OAITag](docs/OAITag.md) + - [OAIUser](docs/OAIUser.md) ## Documentation For Authorization diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.h b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.h index 3783ee23362b..2753fa80578b 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.h @@ -6,7 +6,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -26,12 +26,12 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// Add a new pet to the store /// /// -/// @param pet Pet object that needs to be added to the store (optional) +/// @param body Pet object that needs to be added to the store (optional) /// /// code:405 message:"Invalid input" /// /// @return void --(NSURLSessionTask*) addPetWithPet: (SWGPet*) pet +-(NSURLSessionTask*) addPetWithBody: (SWGPet*) body completionHandler: (void (^)(NSError* error)) handler; @@ -92,14 +92,14 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// Update an existing pet /// /// -/// @param pet Pet object that needs to be added to the store (optional) +/// @param body Pet object that needs to be added to the store (optional) /// /// code:400 message:"Invalid ID supplied", /// code:404 message:"Pet not found", /// code:405 message:"Validation exception" /// /// @return void --(NSURLSessionTask*) updatePetWithPet: (SWGPet*) pet +-(NSURLSessionTask*) updatePetWithBody: (SWGPet*) body completionHandler: (void (^)(NSError* error)) handler; diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.m b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.m index e57006827b99..49f8d5bc3078 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.m +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.m @@ -52,11 +52,11 @@ -(NSDictionary *)defaultHeaders { /// /// Add a new pet to the store /// -/// @param pet Pet object that needs to be added to the store (optional) +/// @param body Pet object that needs to be added to the store (optional) /// /// @returns void /// --(NSURLSessionTask*) addPetWithPet: (SWGPet*) pet +-(NSURLSessionTask*) addPetWithBody: (SWGPet*) body completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"]; @@ -83,7 +83,7 @@ -(NSURLSessionTask*) addPetWithPet: (SWGPet*) pet id bodyParam = nil; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - bodyParam = pet; + bodyParam = body; return [self.apiClient requestWithPath: resourcePath method: @"POST" @@ -193,7 +193,7 @@ -(NSURLSessionTask*) findPetsByStatusWithStatus: (NSArray*) status NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; if (status != nil) { - queryParams[@"status"] = [[SWGQueryParamCollection alloc] initWithValuesAndFormat: status format: @"csv"]; + queryParams[@"status"] = [[SWGQueryParamCollection alloc] initWithValuesAndFormat: status format: @"multi"]; } NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; [headerParams addEntriesFromDictionary:self.defaultHeaders]; @@ -250,7 +250,7 @@ -(NSURLSessionTask*) findPetsByTagsWithTags: (NSArray*) tags NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; if (tags != nil) { - queryParams[@"tags"] = [[SWGQueryParamCollection alloc] initWithValuesAndFormat: tags format: @"csv"]; + queryParams[@"tags"] = [[SWGQueryParamCollection alloc] initWithValuesAndFormat: tags format: @"multi"]; } NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; [headerParams addEntriesFromDictionary:self.defaultHeaders]; @@ -363,11 +363,11 @@ -(NSURLSessionTask*) getPetByIdWithPetId: (NSNumber*) petId /// /// Update an existing pet /// -/// @param pet Pet object that needs to be added to the store (optional) +/// @param body Pet object that needs to be added to the store (optional) /// /// @returns void /// --(NSURLSessionTask*) updatePetWithPet: (SWGPet*) pet +-(NSURLSessionTask*) updatePetWithBody: (SWGPet*) body completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"]; @@ -394,7 +394,7 @@ -(NSURLSessionTask*) updatePetWithPet: (SWGPet*) pet id bodyParam = nil; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - bodyParam = pet; + bodyParam = body; return [self.apiClient requestWithPath: resourcePath method: @"PUT" diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.h b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.h index d578190189c1..52bc78432754 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.h @@ -6,7 +6,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -64,13 +64,13 @@ extern NSInteger kSWGStoreApiMissingParamErrorCode; /// Place an order for a pet /// /// -/// @param order order placed for purchasing the pet (optional) +/// @param body order placed for purchasing the pet (optional) /// /// code:200 message:"successful operation", /// code:400 message:"Invalid Order" /// /// @return SWGOrder* --(NSURLSessionTask*) placeOrderWithOrder: (SWGOrder*) order +-(NSURLSessionTask*) placeOrderWithBody: (SWGOrder*) body completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler; diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.m b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.m index 4231e138bdaf..7d102a5c0d56 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.m +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.m @@ -240,11 +240,11 @@ -(NSURLSessionTask*) getOrderByIdWithOrderId: (NSString*) orderId /// /// Place an order for a pet /// -/// @param order order placed for purchasing the pet (optional) +/// @param body order placed for purchasing the pet (optional) /// /// @returns SWGOrder* /// --(NSURLSessionTask*) placeOrderWithOrder: (SWGOrder*) order +-(NSURLSessionTask*) placeOrderWithBody: (SWGOrder*) body completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/order"]; @@ -271,7 +271,7 @@ -(NSURLSessionTask*) placeOrderWithOrder: (SWGOrder*) order id bodyParam = nil; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - bodyParam = order; + bodyParam = body; return [self.apiClient requestWithPath: resourcePath method: @"POST" diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.h b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.h index 5e0b6bbc8d83..63d35eb8960b 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.h @@ -6,7 +6,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -26,36 +26,36 @@ extern NSInteger kSWGUserApiMissingParamErrorCode; /// Create user /// This can only be done by the logged in user. /// -/// @param user Created user object (optional) +/// @param body Created user object (optional) /// /// code:0 message:"successful operation" /// /// @return void --(NSURLSessionTask*) createUserWithUser: (SWGUser*) user +-(NSURLSessionTask*) createUserWithBody: (SWGUser*) body completionHandler: (void (^)(NSError* error)) handler; /// Creates list of users with given input array /// /// -/// @param user List of user object (optional) +/// @param body List of user object (optional) /// /// code:0 message:"successful operation" /// /// @return void --(NSURLSessionTask*) createUsersWithArrayInputWithUser: (NSArray*) user +-(NSURLSessionTask*) createUsersWithArrayInputWithBody: (NSArray*) body completionHandler: (void (^)(NSError* error)) handler; /// Creates list of users with given input array /// /// -/// @param user List of user object (optional) +/// @param body List of user object (optional) /// /// code:0 message:"successful operation" /// /// @return void --(NSURLSessionTask*) createUsersWithListInputWithUser: (NSArray*) user +-(NSURLSessionTask*) createUsersWithListInputWithBody: (NSArray*) body completionHandler: (void (^)(NSError* error)) handler; @@ -116,14 +116,14 @@ extern NSInteger kSWGUserApiMissingParamErrorCode; /// This can only be done by the logged in user. /// /// @param username name that need to be deleted -/// @param user Updated user object (optional) +/// @param body Updated user object (optional) /// /// code:400 message:"Invalid user supplied", /// code:404 message:"User not found" /// /// @return void -(NSURLSessionTask*) updateUserWithUsername: (NSString*) username - user: (SWGUser*) user + body: (SWGUser*) body completionHandler: (void (^)(NSError* error)) handler; diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.m b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.m index 6ba11b3a44a1..da0d9cb68314 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.m +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.m @@ -52,11 +52,11 @@ -(NSDictionary *)defaultHeaders { /// /// Create user /// This can only be done by the logged in user. -/// @param user Created user object (optional) +/// @param body Created user object (optional) /// /// @returns void /// --(NSURLSessionTask*) createUserWithUser: (SWGUser*) user +-(NSURLSessionTask*) createUserWithBody: (SWGUser*) body completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user"]; @@ -83,7 +83,7 @@ -(NSURLSessionTask*) createUserWithUser: (SWGUser*) user id bodyParam = nil; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - bodyParam = user; + bodyParam = body; return [self.apiClient requestWithPath: resourcePath method: @"POST" @@ -107,11 +107,11 @@ -(NSURLSessionTask*) createUserWithUser: (SWGUser*) user /// /// Creates list of users with given input array /// -/// @param user List of user object (optional) +/// @param body List of user object (optional) /// /// @returns void /// --(NSURLSessionTask*) createUsersWithArrayInputWithUser: (NSArray*) user +-(NSURLSessionTask*) createUsersWithArrayInputWithBody: (NSArray*) body completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/createWithArray"]; @@ -138,7 +138,7 @@ -(NSURLSessionTask*) createUsersWithArrayInputWithUser: (NSArray*) user id bodyParam = nil; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - bodyParam = user; + bodyParam = body; return [self.apiClient requestWithPath: resourcePath method: @"POST" @@ -162,11 +162,11 @@ -(NSURLSessionTask*) createUsersWithArrayInputWithUser: (NSArray*) user /// /// Creates list of users with given input array /// -/// @param user List of user object (optional) +/// @param body List of user object (optional) /// /// @returns void /// --(NSURLSessionTask*) createUsersWithListInputWithUser: (NSArray*) user +-(NSURLSessionTask*) createUsersWithListInputWithBody: (NSArray*) body completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/createWithList"]; @@ -193,7 +193,7 @@ -(NSURLSessionTask*) createUsersWithListInputWithUser: (NSArray*) user id bodyParam = nil; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - bodyParam = user; + bodyParam = body; return [self.apiClient requestWithPath: resourcePath method: @"POST" @@ -470,12 +470,12 @@ -(NSURLSessionTask*) logoutUserWithCompletionHandler: /// This can only be done by the logged in user. /// @param username name that need to be deleted /// -/// @param user Updated user object (optional) +/// @param body Updated user object (optional) /// /// @returns void /// -(NSURLSessionTask*) updateUserWithUsername: (NSString*) username - user: (SWGUser*) user + body: (SWGUser*) body completionHandler: (void (^)(NSError* error)) handler { // verify the required parameter 'username' is set if (username == nil) { @@ -516,7 +516,7 @@ -(NSURLSessionTask*) updateUserWithUsername: (NSString*) username id bodyParam = nil; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - bodyParam = user; + bodyParam = body; return [self.apiClient requestWithPath: resourcePath method: @"PUT" diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/JSONValueTransformer+ISO8601.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/JSONValueTransformer+ISO8601.h index 3925ca3728f8..5179ca2e99b8 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/JSONValueTransformer+ISO8601.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/JSONValueTransformer+ISO8601.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApi.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApi.h index 2ac4a2cdc785..6c0396f0cac5 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApi.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApi.h @@ -6,7 +6,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.h index 844893553809..04558b3d0a05 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.h @@ -7,7 +7,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGConfiguration.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGConfiguration.h index 1c3c741442de..f6b12de5c5c3 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGConfiguration.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGConfiguration.h @@ -6,7 +6,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.h index 24d89beeb61e..e141e0d092d5 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -93,7 +93,7 @@ /** * Sets API key * - * To remove a apiKey for an identifier, just set the apiKey to nil. + * To remove an apiKey for an identifier, just set the apiKey to nil. * * @param apiKey API key or token. * @param identifier API key identifier (authentication schema). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGJSONRequestSerializer.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGJSONRequestSerializer.h index 500664a38c51..943ab1323133 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGJSONRequestSerializer.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGJSONRequestSerializer.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGLogger.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGLogger.h index bb3cb672c3eb..23f57acd7b8a 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGLogger.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGLogger.h @@ -4,7 +4,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGObject.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGObject.h index 047f52c2bb5f..7d7112c5976a 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGObject.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGObject.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGQueryParamCollection.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGQueryParamCollection.h index 2fd7c6dbec8b..4bd35d86f352 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGQueryParamCollection.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGQueryParamCollection.h @@ -4,7 +4,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGResponseDeserializer.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGResponseDeserializer.h index e51705deb256..68f83704f495 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGResponseDeserializer.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGResponseDeserializer.h @@ -4,7 +4,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -49,7 +49,7 @@ extern NSInteger const SWGUnknownResponseObjectErrorCode; @interface SWGResponseDeserializer : NSObject /** - * If an null value occurs in dictionary or array if set to YES whole response will be invalid else will be ignored + * If a null value occurs in dictionary or array if set to YES whole response will be invalid else will be ignored * @default NO */ @property (nonatomic, assign) BOOL treatNullAsError; diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGSanitizer.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGSanitizer.h index 4a2bea99fd05..83853bec8cf0 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGSanitizer.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGSanitizer.h @@ -4,7 +4,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategory.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategory.h index efe582a11a46..31eb9e6b31ca 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategory.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategory.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObject.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObject.h index 087efd870ee2..8bcb655d0fbc 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObject.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObject.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObjectBuilder.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObjectBuilder.h index a99ae9176ff8..18863d14baf7 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObjectBuilder.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObjectBuilder.h @@ -9,7 +9,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrder.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrder.h index 11f27bdba3f8..5ea7a94cfcbe 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrder.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrder.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObject.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObject.h index 1b773bbdbeb3..05f83ca11fd6 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObject.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObject.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObjectBuilder.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObjectBuilder.h index 300e63b3a852..f67159446bc9 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObjectBuilder.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObjectBuilder.h @@ -9,7 +9,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPet.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPet.h index b3586e9ea821..4b3729193265 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPet.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPet.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObject.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObject.h index d4cd41870ebf..6ad378e95f76 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObject.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObject.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObjectBuilder.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObjectBuilder.h index dff2ad8447ea..112ba8bbff4f 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObjectBuilder.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObjectBuilder.h @@ -11,7 +11,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTag.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTag.h index 991526f5d5aa..cdcedfd916bb 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTag.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTag.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObject.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObject.h index a028b8ef62e7..a646e643d70c 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObject.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObject.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObjectBuilder.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObjectBuilder.h index 6c9db4e9fdaa..fe1abf098e0c 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObjectBuilder.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObjectBuilder.h @@ -9,7 +9,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUser.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUser.h index de28b05c42e2..7786883ed29c 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUser.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUser.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObject.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObject.h index ff3539edada6..89f0f4938d81 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObject.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObject.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObjectBuilder.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObjectBuilder.h index b35db434e03c..de1c284cde24 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObjectBuilder.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObjectBuilder.h @@ -9,7 +9,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/default/.openapi-generator/VERSION b/samples/client/petstore/objc/default/.openapi-generator/VERSION index 096bf47efe31..83a328a9227e 100644 --- a/samples/client/petstore/objc/default/.openapi-generator/VERSION +++ b/samples/client/petstore/objc/default/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.0-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/objc/default/OpenAPIClient/Api/OAIPetApi.h b/samples/client/petstore/objc/default/OpenAPIClient/Api/OAIPetApi.h new file mode 100644 index 000000000000..621435f54d42 --- /dev/null +++ b/samples/client/petstore/objc/default/OpenAPIClient/Api/OAIPetApi.h @@ -0,0 +1,139 @@ +#import +#import "OAIPet.h" +#import "OAIApi.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + + +@interface OAIPetApi: NSObject + +extern NSString* kOAIPetApiErrorDomain; +extern NSInteger kOAIPetApiMissingParamErrorCode; + +-(instancetype) initWithApiClient:(OAIApiClient *)apiClient NS_DESIGNATED_INITIALIZER; + +/// Add a new pet to the store +/// +/// +/// @param pet Pet object that needs to be added to the store (optional) +/// +/// code:405 message:"Invalid input" +/// +/// @return void +-(NSURLSessionTask*) addPetWithPet: (OAIPet*) pet + completionHandler: (void (^)(NSError* error)) handler; + + +/// Deletes a pet +/// +/// +/// @param petId Pet id to delete +/// @param apiKey (optional) +/// +/// code:400 message:"Invalid pet value" +/// +/// @return void +-(NSURLSessionTask*) deletePetWithPetId: (NSNumber*) petId + apiKey: (NSString*) apiKey + completionHandler: (void (^)(NSError* error)) handler; + + +/// Finds Pets by status +/// Multiple status values can be provided with comma separated strings +/// +/// @param status Status values that need to be considered for filter (optional) +/// +/// code:200 message:"successful operation", +/// code:400 message:"Invalid status value" +/// +/// @return NSArray* +-(NSURLSessionTask*) findPetsByStatusWithStatus: (NSArray*) status + completionHandler: (void (^)(NSArray* output, NSError* error)) handler; + + +/// Finds Pets by tags +/// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. +/// +/// @param tags Tags to filter by (optional) +/// +/// code:200 message:"successful operation", +/// code:400 message:"Invalid tag value" +/// +/// @return NSArray* +-(NSURLSessionTask*) findPetsByTagsWithTags: (NSArray*) tags + completionHandler: (void (^)(NSArray* output, NSError* error)) handler; + + +/// Find pet by ID +/// Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions +/// +/// @param petId ID of pet that needs to be fetched +/// +/// code:200 message:"successful operation", +/// code:400 message:"Invalid ID supplied", +/// code:404 message:"Pet not found" +/// +/// @return OAIPet* +-(NSURLSessionTask*) getPetByIdWithPetId: (NSNumber*) petId + completionHandler: (void (^)(OAIPet* output, NSError* error)) handler; + + +/// Update an existing pet +/// +/// +/// @param pet Pet object that needs to be added to the store (optional) +/// +/// code:400 message:"Invalid ID supplied", +/// code:404 message:"Pet not found", +/// code:405 message:"Validation exception" +/// +/// @return void +-(NSURLSessionTask*) updatePetWithPet: (OAIPet*) pet + completionHandler: (void (^)(NSError* error)) handler; + + +/// Updates a pet in the store with form data +/// +/// +/// @param petId ID of pet that needs to be updated +/// @param name Updated name of the pet (optional) +/// @param status Updated status of the pet (optional) +/// +/// code:405 message:"Invalid input" +/// +/// @return void +-(NSURLSessionTask*) updatePetWithFormWithPetId: (NSString*) petId + name: (NSString*) name + status: (NSString*) status + completionHandler: (void (^)(NSError* error)) handler; + + +/// uploads an image +/// +/// +/// @param petId ID of pet to update +/// @param additionalMetadata Additional data to pass to server (optional) +/// @param file file to upload (optional) +/// +/// code:0 message:"successful operation" +/// +/// @return void +-(NSURLSessionTask*) uploadFileWithPetId: (NSNumber*) petId + additionalMetadata: (NSString*) additionalMetadata + file: (NSURL*) file + completionHandler: (void (^)(NSError* error)) handler; + + + +@end diff --git a/samples/client/petstore/objc/default/OpenAPIClient/Api/OAIPetApi.m b/samples/client/petstore/objc/default/OpenAPIClient/Api/OAIPetApi.m new file mode 100644 index 000000000000..75d4c2a0f1fb --- /dev/null +++ b/samples/client/petstore/objc/default/OpenAPIClient/Api/OAIPetApi.m @@ -0,0 +1,578 @@ +#import "OAIPetApi.h" +#import "OAIQueryParamCollection.h" +#import "OAIApiClient.h" +#import "OAIPet.h" + + +@interface OAIPetApi () + +@property (nonatomic, strong, readwrite) NSMutableDictionary *mutableDefaultHeaders; + +@end + +@implementation OAIPetApi + +NSString* kOAIPetApiErrorDomain = @"OAIPetApiErrorDomain"; +NSInteger kOAIPetApiMissingParamErrorCode = 234513; + +@synthesize apiClient = _apiClient; + +#pragma mark - Initialize methods + +- (instancetype) init { + return [self initWithApiClient:[OAIApiClient sharedClient]]; +} + + +-(instancetype) initWithApiClient:(OAIApiClient *)apiClient { + self = [super init]; + if (self) { + _apiClient = apiClient; + _mutableDefaultHeaders = [NSMutableDictionary dictionary]; + } + return self; +} + +#pragma mark - + +-(NSString*) defaultHeaderForKey:(NSString*)key { + return self.mutableDefaultHeaders[key]; +} + +-(void) setDefaultHeaderValue:(NSString*) value forKey:(NSString*)key { + [self.mutableDefaultHeaders setValue:value forKey:key]; +} + +-(NSDictionary *)defaultHeaders { + return self.mutableDefaultHeaders; +} + +#pragma mark - Api Methods + +/// +/// Add a new pet to the store +/// +/// @param pet Pet object that needs to be added to the store (optional) +/// +/// @returns void +/// +-(NSURLSessionTask*) addPetWithPet: (OAIPet*) pet + completionHandler: (void (^)(NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/json", @"application/xml"]]; + + // Authentication setting + NSArray *authSettings = @[@"petstore_auth"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + bodyParam = pet; + + return [self.apiClient requestWithPath: resourcePath + method: @"POST" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: nil + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler(error); + } + }]; +} + +/// +/// Deletes a pet +/// +/// @param petId Pet id to delete +/// +/// @param apiKey (optional) +/// +/// @returns void +/// +-(NSURLSessionTask*) deletePetWithPetId: (NSNumber*) petId + apiKey: (NSString*) apiKey + completionHandler: (void (^)(NSError* error)) handler { + // verify the required parameter 'petId' is set + if (petId == nil) { + NSParameterAssert(petId); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"petId"] }; + NSError* error = [NSError errorWithDomain:kOAIPetApiErrorDomain code:kOAIPetApiMissingParamErrorCode userInfo:userInfo]; + handler(error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/{petId}"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + if (petId != nil) { + pathParams[@"petId"] = petId; + } + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + if (apiKey != nil) { + headerParams[@"api_key"] = apiKey; + } + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[@"petstore_auth"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"DELETE" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: nil + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler(error); + } + }]; +} + +/// +/// Finds Pets by status +/// Multiple status values can be provided with comma separated strings +/// @param status Status values that need to be considered for filter (optional) +/// +/// @returns NSArray* +/// +-(NSURLSessionTask*) findPetsByStatusWithStatus: (NSArray*) status + completionHandler: (void (^)(NSArray* output, NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/findByStatus"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + if (status != nil) { + queryParams[@"status"] = [[OAIQueryParamCollection alloc] initWithValuesAndFormat: status format: @"multi"]; + } + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[@"petstore_auth"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"NSArray*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((NSArray*)data, error); + } + }]; +} + +/// +/// Finds Pets by tags +/// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. +/// @param tags Tags to filter by (optional) +/// +/// @returns NSArray* +/// +-(NSURLSessionTask*) findPetsByTagsWithTags: (NSArray*) tags + completionHandler: (void (^)(NSArray* output, NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/findByTags"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + if (tags != nil) { + queryParams[@"tags"] = [[OAIQueryParamCollection alloc] initWithValuesAndFormat: tags format: @"multi"]; + } + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[@"petstore_auth"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"NSArray*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((NSArray*)data, error); + } + }]; +} + +/// +/// Find pet by ID +/// Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions +/// @param petId ID of pet that needs to be fetched +/// +/// @returns OAIPet* +/// +-(NSURLSessionTask*) getPetByIdWithPetId: (NSNumber*) petId + completionHandler: (void (^)(OAIPet* output, NSError* error)) handler { + // verify the required parameter 'petId' is set + if (petId == nil) { + NSParameterAssert(petId); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"petId"] }; + NSError* error = [NSError errorWithDomain:kOAIPetApiErrorDomain code:kOAIPetApiMissingParamErrorCode userInfo:userInfo]; + handler(nil, error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/{petId}"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + if (petId != nil) { + pathParams[@"petId"] = petId; + } + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[@"api_key", @"petstore_auth"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"OAIPet*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((OAIPet*)data, error); + } + }]; +} + +/// +/// Update an existing pet +/// +/// @param pet Pet object that needs to be added to the store (optional) +/// +/// @returns void +/// +-(NSURLSessionTask*) updatePetWithPet: (OAIPet*) pet + completionHandler: (void (^)(NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/json", @"application/xml"]]; + + // Authentication setting + NSArray *authSettings = @[@"petstore_auth"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + bodyParam = pet; + + return [self.apiClient requestWithPath: resourcePath + method: @"PUT" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: nil + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler(error); + } + }]; +} + +/// +/// Updates a pet in the store with form data +/// +/// @param petId ID of pet that needs to be updated +/// +/// @param name Updated name of the pet (optional) +/// +/// @param status Updated status of the pet (optional) +/// +/// @returns void +/// +-(NSURLSessionTask*) updatePetWithFormWithPetId: (NSString*) petId + name: (NSString*) name + status: (NSString*) status + completionHandler: (void (^)(NSError* error)) handler { + // verify the required parameter 'petId' is set + if (petId == nil) { + NSParameterAssert(petId); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"petId"] }; + NSError* error = [NSError errorWithDomain:kOAIPetApiErrorDomain code:kOAIPetApiMissingParamErrorCode userInfo:userInfo]; + handler(error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/{petId}"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + if (petId != nil) { + pathParams[@"petId"] = petId; + } + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/x-www-form-urlencoded"]]; + + // Authentication setting + NSArray *authSettings = @[@"petstore_auth"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + if (name) { + formParams[@"name"] = name; + } + if (status) { + formParams[@"status"] = status; + } + + return [self.apiClient requestWithPath: resourcePath + method: @"POST" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: nil + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler(error); + } + }]; +} + +/// +/// uploads an image +/// +/// @param petId ID of pet to update +/// +/// @param additionalMetadata Additional data to pass to server (optional) +/// +/// @param file file to upload (optional) +/// +/// @returns void +/// +-(NSURLSessionTask*) uploadFileWithPetId: (NSNumber*) petId + additionalMetadata: (NSString*) additionalMetadata + file: (NSURL*) file + completionHandler: (void (^)(NSError* error)) handler { + // verify the required parameter 'petId' is set + if (petId == nil) { + NSParameterAssert(petId); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"petId"] }; + NSError* error = [NSError errorWithDomain:kOAIPetApiErrorDomain code:kOAIPetApiMissingParamErrorCode userInfo:userInfo]; + handler(error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/{petId}/uploadImage"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + if (petId != nil) { + pathParams[@"petId"] = petId; + } + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"multipart/form-data"]]; + + // Authentication setting + NSArray *authSettings = @[@"petstore_auth"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + if (additionalMetadata) { + formParams[@"additionalMetadata"] = additionalMetadata; + } + localVarFiles[@"file"] = file; + + return [self.apiClient requestWithPath: resourcePath + method: @"POST" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: nil + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler(error); + } + }]; +} + + + +@end diff --git a/samples/client/petstore/objc/default/OpenAPIClient/Api/OAIStoreApi.h b/samples/client/petstore/objc/default/OpenAPIClient/Api/OAIStoreApi.h new file mode 100644 index 000000000000..4f9081984443 --- /dev/null +++ b/samples/client/petstore/objc/default/OpenAPIClient/Api/OAIStoreApi.h @@ -0,0 +1,78 @@ +#import +#import "OAIOrder.h" +#import "OAIApi.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + + +@interface OAIStoreApi: NSObject + +extern NSString* kOAIStoreApiErrorDomain; +extern NSInteger kOAIStoreApiMissingParamErrorCode; + +-(instancetype) initWithApiClient:(OAIApiClient *)apiClient NS_DESIGNATED_INITIALIZER; + +/// Delete purchase order by ID +/// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors +/// +/// @param orderId ID of the order that needs to be deleted +/// +/// code:400 message:"Invalid ID supplied", +/// code:404 message:"Order not found" +/// +/// @return void +-(NSURLSessionTask*) deleteOrderWithOrderId: (NSString*) orderId + completionHandler: (void (^)(NSError* error)) handler; + + +/// Returns pet inventories by status +/// Returns a map of status codes to quantities +/// +/// +/// code:200 message:"successful operation" +/// +/// @return NSDictionary* +-(NSURLSessionTask*) getInventoryWithCompletionHandler: + (void (^)(NSDictionary* output, NSError* error)) handler; + + +/// Find purchase order by ID +/// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions +/// +/// @param orderId ID of pet that needs to be fetched +/// +/// code:200 message:"successful operation", +/// code:400 message:"Invalid ID supplied", +/// code:404 message:"Order not found" +/// +/// @return OAIOrder* +-(NSURLSessionTask*) getOrderByIdWithOrderId: (NSString*) orderId + completionHandler: (void (^)(OAIOrder* output, NSError* error)) handler; + + +/// Place an order for a pet +/// +/// +/// @param order order placed for purchasing the pet (optional) +/// +/// code:200 message:"successful operation", +/// code:400 message:"Invalid Order" +/// +/// @return OAIOrder* +-(NSURLSessionTask*) placeOrderWithOrder: (OAIOrder*) order + completionHandler: (void (^)(OAIOrder* output, NSError* error)) handler; + + + +@end diff --git a/samples/client/petstore/objc/default/OpenAPIClient/Api/OAIStoreApi.m b/samples/client/petstore/objc/default/OpenAPIClient/Api/OAIStoreApi.m new file mode 100644 index 000000000000..4a164d26226e --- /dev/null +++ b/samples/client/petstore/objc/default/OpenAPIClient/Api/OAIStoreApi.m @@ -0,0 +1,297 @@ +#import "OAIStoreApi.h" +#import "OAIQueryParamCollection.h" +#import "OAIApiClient.h" +#import "OAIOrder.h" + + +@interface OAIStoreApi () + +@property (nonatomic, strong, readwrite) NSMutableDictionary *mutableDefaultHeaders; + +@end + +@implementation OAIStoreApi + +NSString* kOAIStoreApiErrorDomain = @"OAIStoreApiErrorDomain"; +NSInteger kOAIStoreApiMissingParamErrorCode = 234513; + +@synthesize apiClient = _apiClient; + +#pragma mark - Initialize methods + +- (instancetype) init { + return [self initWithApiClient:[OAIApiClient sharedClient]]; +} + + +-(instancetype) initWithApiClient:(OAIApiClient *)apiClient { + self = [super init]; + if (self) { + _apiClient = apiClient; + _mutableDefaultHeaders = [NSMutableDictionary dictionary]; + } + return self; +} + +#pragma mark - + +-(NSString*) defaultHeaderForKey:(NSString*)key { + return self.mutableDefaultHeaders[key]; +} + +-(void) setDefaultHeaderValue:(NSString*) value forKey:(NSString*)key { + [self.mutableDefaultHeaders setValue:value forKey:key]; +} + +-(NSDictionary *)defaultHeaders { + return self.mutableDefaultHeaders; +} + +#pragma mark - Api Methods + +/// +/// Delete purchase order by ID +/// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors +/// @param orderId ID of the order that needs to be deleted +/// +/// @returns void +/// +-(NSURLSessionTask*) deleteOrderWithOrderId: (NSString*) orderId + completionHandler: (void (^)(NSError* error)) handler { + // verify the required parameter 'orderId' is set + if (orderId == nil) { + NSParameterAssert(orderId); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"orderId"] }; + NSError* error = [NSError errorWithDomain:kOAIStoreApiErrorDomain code:kOAIStoreApiMissingParamErrorCode userInfo:userInfo]; + handler(error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/order/{orderId}"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + if (orderId != nil) { + pathParams[@"orderId"] = orderId; + } + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"DELETE" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: nil + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler(error); + } + }]; +} + +/// +/// Returns pet inventories by status +/// Returns a map of status codes to quantities +/// @returns NSDictionary* +/// +-(NSURLSessionTask*) getInventoryWithCompletionHandler: + (void (^)(NSDictionary* output, NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/inventory"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[@"api_key"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"NSDictionary*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((NSDictionary*)data, error); + } + }]; +} + +/// +/// Find purchase order by ID +/// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions +/// @param orderId ID of pet that needs to be fetched +/// +/// @returns OAIOrder* +/// +-(NSURLSessionTask*) getOrderByIdWithOrderId: (NSString*) orderId + completionHandler: (void (^)(OAIOrder* output, NSError* error)) handler { + // verify the required parameter 'orderId' is set + if (orderId == nil) { + NSParameterAssert(orderId); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"orderId"] }; + NSError* error = [NSError errorWithDomain:kOAIStoreApiErrorDomain code:kOAIStoreApiMissingParamErrorCode userInfo:userInfo]; + handler(nil, error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/order/{orderId}"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + if (orderId != nil) { + pathParams[@"orderId"] = orderId; + } + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"OAIOrder*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((OAIOrder*)data, error); + } + }]; +} + +/// +/// Place an order for a pet +/// +/// @param order order placed for purchasing the pet (optional) +/// +/// @returns OAIOrder* +/// +-(NSURLSessionTask*) placeOrderWithOrder: (OAIOrder*) order + completionHandler: (void (^)(OAIOrder* output, NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/order"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/json"]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + bodyParam = order; + + return [self.apiClient requestWithPath: resourcePath + method: @"POST" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"OAIOrder*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((OAIOrder*)data, error); + } + }]; +} + + + +@end diff --git a/samples/client/petstore/objc/default/OpenAPIClient/Api/OAIUserApi.h b/samples/client/petstore/objc/default/OpenAPIClient/Api/OAIUserApi.h new file mode 100644 index 000000000000..d2103d4a06fb --- /dev/null +++ b/samples/client/petstore/objc/default/OpenAPIClient/Api/OAIUserApi.h @@ -0,0 +1,131 @@ +#import +#import "OAIUser.h" +#import "OAIApi.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + + +@interface OAIUserApi: NSObject + +extern NSString* kOAIUserApiErrorDomain; +extern NSInteger kOAIUserApiMissingParamErrorCode; + +-(instancetype) initWithApiClient:(OAIApiClient *)apiClient NS_DESIGNATED_INITIALIZER; + +/// Create user +/// This can only be done by the logged in user. +/// +/// @param user Created user object (optional) +/// +/// code:0 message:"successful operation" +/// +/// @return void +-(NSURLSessionTask*) createUserWithUser: (OAIUser*) user + completionHandler: (void (^)(NSError* error)) handler; + + +/// Creates list of users with given input array +/// +/// +/// @param user List of user object (optional) +/// +/// code:0 message:"successful operation" +/// +/// @return void +-(NSURLSessionTask*) createUsersWithArrayInputWithUser: (NSArray*) user + completionHandler: (void (^)(NSError* error)) handler; + + +/// Creates list of users with given input array +/// +/// +/// @param user List of user object (optional) +/// +/// code:0 message:"successful operation" +/// +/// @return void +-(NSURLSessionTask*) createUsersWithListInputWithUser: (NSArray*) user + completionHandler: (void (^)(NSError* error)) handler; + + +/// Delete user +/// This can only be done by the logged in user. +/// +/// @param username The name that needs to be deleted +/// +/// code:400 message:"Invalid username supplied", +/// code:404 message:"User not found" +/// +/// @return void +-(NSURLSessionTask*) deleteUserWithUsername: (NSString*) username + completionHandler: (void (^)(NSError* error)) handler; + + +/// Get user by user name +/// +/// +/// @param username The name that needs to be fetched. Use user1 for testing. +/// +/// code:200 message:"successful operation", +/// code:400 message:"Invalid username supplied", +/// code:404 message:"User not found" +/// +/// @return OAIUser* +-(NSURLSessionTask*) getUserByNameWithUsername: (NSString*) username + completionHandler: (void (^)(OAIUser* output, NSError* error)) handler; + + +/// Logs user into the system +/// +/// +/// @param username The user name for login (optional) +/// @param password The password for login in clear text (optional) +/// +/// code:200 message:"successful operation", +/// code:400 message:"Invalid username/password supplied" +/// +/// @return NSString* +-(NSURLSessionTask*) loginUserWithUsername: (NSString*) username + password: (NSString*) password + completionHandler: (void (^)(NSString* output, NSError* error)) handler; + + +/// Logs out current logged in user session +/// +/// +/// +/// code:0 message:"successful operation" +/// +/// @return void +-(NSURLSessionTask*) logoutUserWithCompletionHandler: + (void (^)(NSError* error)) handler; + + +/// Updated user +/// This can only be done by the logged in user. +/// +/// @param username name that need to be deleted +/// @param user Updated user object (optional) +/// +/// code:400 message:"Invalid user supplied", +/// code:404 message:"User not found" +/// +/// @return void +-(NSURLSessionTask*) updateUserWithUsername: (NSString*) username + user: (OAIUser*) user + completionHandler: (void (^)(NSError* error)) handler; + + + +@end diff --git a/samples/client/petstore/objc/default/OpenAPIClient/Api/OAIUserApi.m b/samples/client/petstore/objc/default/OpenAPIClient/Api/OAIUserApi.m new file mode 100644 index 000000000000..0a6f5a493bdd --- /dev/null +++ b/samples/client/petstore/objc/default/OpenAPIClient/Api/OAIUserApi.m @@ -0,0 +1,542 @@ +#import "OAIUserApi.h" +#import "OAIQueryParamCollection.h" +#import "OAIApiClient.h" +#import "OAIUser.h" + + +@interface OAIUserApi () + +@property (nonatomic, strong, readwrite) NSMutableDictionary *mutableDefaultHeaders; + +@end + +@implementation OAIUserApi + +NSString* kOAIUserApiErrorDomain = @"OAIUserApiErrorDomain"; +NSInteger kOAIUserApiMissingParamErrorCode = 234513; + +@synthesize apiClient = _apiClient; + +#pragma mark - Initialize methods + +- (instancetype) init { + return [self initWithApiClient:[OAIApiClient sharedClient]]; +} + + +-(instancetype) initWithApiClient:(OAIApiClient *)apiClient { + self = [super init]; + if (self) { + _apiClient = apiClient; + _mutableDefaultHeaders = [NSMutableDictionary dictionary]; + } + return self; +} + +#pragma mark - + +-(NSString*) defaultHeaderForKey:(NSString*)key { + return self.mutableDefaultHeaders[key]; +} + +-(void) setDefaultHeaderValue:(NSString*) value forKey:(NSString*)key { + [self.mutableDefaultHeaders setValue:value forKey:key]; +} + +-(NSDictionary *)defaultHeaders { + return self.mutableDefaultHeaders; +} + +#pragma mark - Api Methods + +/// +/// Create user +/// This can only be done by the logged in user. +/// @param user Created user object (optional) +/// +/// @returns void +/// +-(NSURLSessionTask*) createUserWithUser: (OAIUser*) user + completionHandler: (void (^)(NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/json"]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + bodyParam = user; + + return [self.apiClient requestWithPath: resourcePath + method: @"POST" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: nil + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler(error); + } + }]; +} + +/// +/// Creates list of users with given input array +/// +/// @param user List of user object (optional) +/// +/// @returns void +/// +-(NSURLSessionTask*) createUsersWithArrayInputWithUser: (NSArray*) user + completionHandler: (void (^)(NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/createWithArray"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/json"]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + bodyParam = user; + + return [self.apiClient requestWithPath: resourcePath + method: @"POST" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: nil + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler(error); + } + }]; +} + +/// +/// Creates list of users with given input array +/// +/// @param user List of user object (optional) +/// +/// @returns void +/// +-(NSURLSessionTask*) createUsersWithListInputWithUser: (NSArray*) user + completionHandler: (void (^)(NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/createWithList"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/json"]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + bodyParam = user; + + return [self.apiClient requestWithPath: resourcePath + method: @"POST" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: nil + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler(error); + } + }]; +} + +/// +/// Delete user +/// This can only be done by the logged in user. +/// @param username The name that needs to be deleted +/// +/// @returns void +/// +-(NSURLSessionTask*) deleteUserWithUsername: (NSString*) username + completionHandler: (void (^)(NSError* error)) handler { + // verify the required parameter 'username' is set + if (username == nil) { + NSParameterAssert(username); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"username"] }; + NSError* error = [NSError errorWithDomain:kOAIUserApiErrorDomain code:kOAIUserApiMissingParamErrorCode userInfo:userInfo]; + handler(error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/{username}"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + if (username != nil) { + pathParams[@"username"] = username; + } + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"DELETE" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: nil + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler(error); + } + }]; +} + +/// +/// Get user by user name +/// +/// @param username The name that needs to be fetched. Use user1 for testing. +/// +/// @returns OAIUser* +/// +-(NSURLSessionTask*) getUserByNameWithUsername: (NSString*) username + completionHandler: (void (^)(OAIUser* output, NSError* error)) handler { + // verify the required parameter 'username' is set + if (username == nil) { + NSParameterAssert(username); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"username"] }; + NSError* error = [NSError errorWithDomain:kOAIUserApiErrorDomain code:kOAIUserApiMissingParamErrorCode userInfo:userInfo]; + handler(nil, error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/{username}"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + if (username != nil) { + pathParams[@"username"] = username; + } + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"OAIUser*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((OAIUser*)data, error); + } + }]; +} + +/// +/// Logs user into the system +/// +/// @param username The user name for login (optional) +/// +/// @param password The password for login in clear text (optional) +/// +/// @returns NSString* +/// +-(NSURLSessionTask*) loginUserWithUsername: (NSString*) username + password: (NSString*) password + completionHandler: (void (^)(NSString* output, NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/login"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + if (username != nil) { + queryParams[@"username"] = username; + } + if (password != nil) { + queryParams[@"password"] = password; + } + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"NSString*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((NSString*)data, error); + } + }]; +} + +/// +/// Logs out current logged in user session +/// +/// @returns void +/// +-(NSURLSessionTask*) logoutUserWithCompletionHandler: + (void (^)(NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/logout"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: nil + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler(error); + } + }]; +} + +/// +/// Updated user +/// This can only be done by the logged in user. +/// @param username name that need to be deleted +/// +/// @param user Updated user object (optional) +/// +/// @returns void +/// +-(NSURLSessionTask*) updateUserWithUsername: (NSString*) username + user: (OAIUser*) user + completionHandler: (void (^)(NSError* error)) handler { + // verify the required parameter 'username' is set + if (username == nil) { + NSParameterAssert(username); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"username"] }; + NSError* error = [NSError errorWithDomain:kOAIUserApiErrorDomain code:kOAIUserApiMissingParamErrorCode userInfo:userInfo]; + handler(error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/{username}"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + if (username != nil) { + pathParams[@"username"] = username; + } + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/json"]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + bodyParam = user; + + return [self.apiClient requestWithPath: resourcePath + method: @"PUT" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: nil + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler(error); + } + }]; +} + + + +@end diff --git a/samples/client/petstore/objc/default/OpenAPIClient/Core/JSONValueTransformer+ISO8601.h b/samples/client/petstore/objc/default/OpenAPIClient/Core/JSONValueTransformer+ISO8601.h new file mode 100644 index 000000000000..5179ca2e99b8 --- /dev/null +++ b/samples/client/petstore/objc/default/OpenAPIClient/Core/JSONValueTransformer+ISO8601.h @@ -0,0 +1,19 @@ +#import +#import + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +@interface JSONValueTransformer (ISO8601) + +@end diff --git a/samples/client/petstore/objc/default/OpenAPIClient/Core/JSONValueTransformer+ISO8601.m b/samples/client/petstore/objc/default/OpenAPIClient/Core/JSONValueTransformer+ISO8601.m new file mode 100644 index 000000000000..61ae254a8aa0 --- /dev/null +++ b/samples/client/petstore/objc/default/OpenAPIClient/Core/JSONValueTransformer+ISO8601.m @@ -0,0 +1,17 @@ +#import +#import "JSONValueTransformer+ISO8601.h" +#import "OAISanitizer.h" + +@implementation JSONValueTransformer (ISO8601) + +- (NSDate *) NSDateFromNSString:(NSString *)string +{ + return [NSDate dateWithISO8601String:string]; +} + +- (NSString *)JSONObjectFromNSDate:(NSDate *)date +{ + return [OAISanitizer dateToString:date]; +} + +@end diff --git a/samples/client/petstore/objc/default/OpenAPIClient/Core/OAIApi.h b/samples/client/petstore/objc/default/OpenAPIClient/Core/OAIApi.h new file mode 100644 index 000000000000..91302b6736d1 --- /dev/null +++ b/samples/client/petstore/objc/default/OpenAPIClient/Core/OAIApi.h @@ -0,0 +1,29 @@ +#import + +@class OAIApiClient; + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +@protocol OAIApi + +@property(readonly, nonatomic, strong) OAIApiClient *apiClient; + +-(instancetype) initWithApiClient:(OAIApiClient *)apiClient; + +-(void) setDefaultHeaderValue:(NSString*) value forKey:(NSString*)key; +-(NSString*) defaultHeaderForKey:(NSString*)key; + +-(NSDictionary *)defaultHeaders; + +@end diff --git a/samples/client/petstore/objc/default/OpenAPIClient/Core/OAIApiClient.h b/samples/client/petstore/objc/default/OpenAPIClient/Core/OAIApiClient.h new file mode 100644 index 000000000000..33301dd2f58d --- /dev/null +++ b/samples/client/petstore/objc/default/OpenAPIClient/Core/OAIApiClient.h @@ -0,0 +1,121 @@ +#import +#import "OAIConfiguration.h" +#import "OAIResponseDeserializer.h" +#import "OAISanitizer.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +/** + * A key for `NSError` user info dictionaries. + * + * The corresponding value is the parsed response body for an HTTP error. + */ +extern NSString *const OAIResponseObjectErrorKey; + + +@interface OAIApiClient : AFHTTPSessionManager + +@property (nonatomic, strong, readonly) id configuration; + +@property(nonatomic, assign) NSTimeInterval timeoutInterval; + +@property(nonatomic, strong) id responseDeserializer; + +@property(nonatomic, strong) id sanitizer; + +/** + * Gets if the client is unreachable + * + * @return The client offline state + */ ++(BOOL) getOfflineState; + +/** + * Sets the client reachability, this may be overridden by the reachability manager if reachability changes + * + * @param status The client reachability status. + */ ++(void) setReachabilityStatus:(AFNetworkReachabilityStatus) status; + +/** + * Gets the client reachability + * + * @return The client reachability. + */ ++(AFNetworkReachabilityStatus) getReachabilityStatus; + +@property (nonatomic, strong) NSDictionary< NSString *, AFHTTPRequestSerializer *>* requestSerializerForContentType; + +/** + * Gets client singleton instance + */ ++ (instancetype) sharedClient; + + +/** + * Updates header parameters and query parameters for authentication + * + * @param headers The header parameter will be updated, passed by pointer to pointer. + * @param querys The query parameters will be updated, passed by pointer to pointer. + * @param authSettings The authentication names NSArray. + */ +- (void) updateHeaderParams:(NSDictionary **)headers queryParams:(NSDictionary **)querys WithAuthSettings:(NSArray *)authSettings; + + +/** + * Initializes the session manager with a configuration. + * + * @param configuration The configuration implementation + */ +- (instancetype)initWithConfiguration:(id)configuration; + +/** +* Initializes the session manager with a configuration and url +* +* @param url The base url +* @param configuration The configuration implementation +*/ +- (instancetype)initWithBaseURL:(NSURL *)url configuration:(id)configuration; + +/** + * Performs request + * + * @param path Request url. + * @param method Request method. + * @param pathParams Request path parameters. + * @param queryParams Request query parameters. + * @param body Request body. + * @param headerParams Request header parameters. + * @param authSettings Request authentication names. + * @param requestContentType Request content-type. + * @param responseContentType Response content-type. + * @param completionBlock The block will be executed when the request completed. + * + * @return The created session task. + */ +- (NSURLSessionTask*) requestWithPath: (NSString*) path + method: (NSString*) method + pathParams: (NSDictionary *) pathParams + queryParams: (NSDictionary*) queryParams + formParams: (NSDictionary *) formParams + files: (NSDictionary *) files + body: (id) body + headerParams: (NSDictionary*) headerParams + authSettings: (NSArray *) authSettings + requestContentType: (NSString*) requestContentType + responseContentType: (NSString*) responseContentType + responseType: (NSString *) responseType + completionBlock: (void (^)(id, NSError *))completionBlock; + +@end diff --git a/samples/client/petstore/objc/default/OpenAPIClient/Core/OAIApiClient.m b/samples/client/petstore/objc/default/OpenAPIClient/Core/OAIApiClient.m new file mode 100644 index 000000000000..bcbd477d298e --- /dev/null +++ b/samples/client/petstore/objc/default/OpenAPIClient/Core/OAIApiClient.m @@ -0,0 +1,376 @@ + +#import "OAILogger.h" +#import "OAIApiClient.h" +#import "OAIJSONRequestSerializer.h" +#import "OAIQueryParamCollection.h" +#import "OAIDefaultConfiguration.h" + +NSString *const OAIResponseObjectErrorKey = @"OAIResponseObject"; + +static NSString * const kOAIContentDispositionKey = @"Content-Disposition"; + +static NSDictionary * OAI__headerFieldsForResponse(NSURLResponse *response) { + if(![response isKindOfClass:[NSHTTPURLResponse class]]) { + return nil; + } + return ((NSHTTPURLResponse*)response).allHeaderFields; +} + +static NSString * OAI__fileNameForResponse(NSURLResponse *response) { + NSDictionary * headers = OAI__headerFieldsForResponse(response); + if(!headers[kOAIContentDispositionKey]) { + return [NSString stringWithFormat:@"%@", [[NSProcessInfo processInfo] globallyUniqueString]]; + } + NSString *pattern = @"filename=['\"]?([^'\"\\s]+)['\"]?"; + NSRegularExpression *regexp = [NSRegularExpression regularExpressionWithPattern:pattern options:NSRegularExpressionCaseInsensitive error:nil]; + NSString *contentDispositionHeader = headers[kOAIContentDispositionKey]; + NSTextCheckingResult *match = [regexp firstMatchInString:contentDispositionHeader options:0 range:NSMakeRange(0, [contentDispositionHeader length])]; + return [contentDispositionHeader substringWithRange:[match rangeAtIndex:1]]; +} + + +@interface OAIApiClient () + +@property (nonatomic, strong, readwrite) id configuration; + +@property (nonatomic, strong) NSArray* downloadTaskResponseTypes; + +@end + +@implementation OAIApiClient + +#pragma mark - Singleton Methods + ++ (instancetype) sharedClient { + static OAIApiClient *sharedClient = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + sharedClient = [[self alloc] init]; + }); + return sharedClient; +} + +#pragma mark - Initialize Methods + +- (instancetype)init { + return [self initWithConfiguration:[OAIDefaultConfiguration sharedConfig]]; +} + +- (instancetype)initWithBaseURL:(NSURL *)url { + return [self initWithBaseURL:url configuration:[OAIDefaultConfiguration sharedConfig]]; +} + +- (instancetype)initWithConfiguration:(id)configuration { + return [self initWithBaseURL:[NSURL URLWithString:configuration.host] configuration:configuration]; +} + +- (instancetype)initWithBaseURL:(NSURL *)url configuration:(id)configuration { + self = [super initWithBaseURL:url]; + if (self) { + _configuration = configuration; + _timeoutInterval = 60; + _responseDeserializer = [[OAIResponseDeserializer alloc] init]; + _sanitizer = [[OAISanitizer alloc] init]; + + _downloadTaskResponseTypes = @[@"NSURL*", @"NSURL"]; + + AFHTTPRequestSerializer* afhttpRequestSerializer = [AFHTTPRequestSerializer serializer]; + OAIJSONRequestSerializer * swgjsonRequestSerializer = [OAIJSONRequestSerializer serializer]; + _requestSerializerForContentType = @{kOAIApplicationJSONType : swgjsonRequestSerializer, + @"application/x-www-form-urlencoded": afhttpRequestSerializer, + @"multipart/form-data": afhttpRequestSerializer + }; + self.securityPolicy = [self createSecurityPolicy]; + self.responseSerializer = [AFHTTPResponseSerializer serializer]; + } + return self; +} + +#pragma mark - Task Methods + +- (NSURLSessionDataTask*) taskWithCompletionBlock: (NSURLRequest *)request completionBlock: (void (^)(id, NSError *))completionBlock { + + NSURLSessionDataTask *task = [self dataTaskWithRequest:request uploadProgress:nil downloadProgress:nil completionHandler:^(NSURLResponse * _Nonnull response, id _Nullable responseObject, NSError * _Nullable error) { + OAIDebugLogResponse(response, responseObject,request,error); + if(!error) { + completionBlock(responseObject, nil); + return; + } + NSMutableDictionary *userInfo = [error.userInfo mutableCopy]; + if (responseObject) { + // Add in the (parsed) response body. + userInfo[OAIResponseObjectErrorKey] = responseObject; + } + NSError *augmentedError = [error initWithDomain:error.domain code:error.code userInfo:userInfo]; + completionBlock(nil, augmentedError); + }]; + + return task; +} + +- (NSURLSessionDataTask*) downloadTaskWithCompletionBlock: (NSURLRequest *)request completionBlock: (void (^)(id, NSError *))completionBlock { + + __block NSString * tempFolderPath = [self.configuration.tempFolderPath copy]; + + NSURLSessionDataTask* task = [self dataTaskWithRequest:request uploadProgress:nil downloadProgress:nil completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) { + OAIDebugLogResponse(response, responseObject,request,error); + + if(error) { + NSMutableDictionary *userInfo = [error.userInfo mutableCopy]; + if (responseObject) { + userInfo[OAIResponseObjectErrorKey] = responseObject; + } + NSError *augmentedError = [error initWithDomain:error.domain code:error.code userInfo:userInfo]; + completionBlock(nil, augmentedError); + return; + } + + NSString *directory = tempFolderPath ?: NSTemporaryDirectory(); + NSString *filename = OAI__fileNameForResponse(response); + + NSString *filepath = [directory stringByAppendingPathComponent:filename]; + NSURL *file = [NSURL fileURLWithPath:filepath]; + + [responseObject writeToURL:file atomically:YES]; + + completionBlock(file, nil); + }]; + + return task; +} + +#pragma mark - Perform Request Methods + +- (NSURLSessionTask*) requestWithPath: (NSString*) path + method: (NSString*) method + pathParams: (NSDictionary *) pathParams + queryParams: (NSDictionary*) queryParams + formParams: (NSDictionary *) formParams + files: (NSDictionary *) files + body: (id) body + headerParams: (NSDictionary*) headerParams + authSettings: (NSArray *) authSettings + requestContentType: (NSString*) requestContentType + responseContentType: (NSString*) responseContentType + responseType: (NSString *) responseType + completionBlock: (void (^)(id, NSError *))completionBlock { + + AFHTTPRequestSerializer * requestSerializer = [self requestSerializerForRequestContentType:requestContentType]; + + __weak id sanitizer = self.sanitizer; + + // sanitize parameters + pathParams = [sanitizer sanitizeForSerialization:pathParams]; + queryParams = [sanitizer sanitizeForSerialization:queryParams]; + headerParams = [sanitizer sanitizeForSerialization:headerParams]; + formParams = [sanitizer sanitizeForSerialization:formParams]; + if(![body isKindOfClass:[NSData class]]) { + body = [sanitizer sanitizeForSerialization:body]; + } + + // auth setting + [self updateHeaderParams:&headerParams queryParams:&queryParams WithAuthSettings:authSettings]; + + NSMutableString *resourcePath = [NSMutableString stringWithString:path]; + [pathParams enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { + NSString * safeString = ([obj isKindOfClass:[NSString class]]) ? obj : [NSString stringWithFormat:@"%@", obj]; + safeString = OAIPercentEscapedStringFromString(safeString); + [resourcePath replaceCharactersInRange:[resourcePath rangeOfString:[NSString stringWithFormat:@"{%@}", key]] withString:safeString]; + }]; + + NSString* pathWithQueryParams = [self pathWithQueryParamsToString:resourcePath queryParams:queryParams]; + if ([pathWithQueryParams hasPrefix:@"/"]) { + pathWithQueryParams = [pathWithQueryParams substringFromIndex:1]; + } + + NSString* urlString = [[NSURL URLWithString:pathWithQueryParams relativeToURL:self.baseURL] absoluteString]; + + NSError *requestCreateError = nil; + NSMutableURLRequest * request = nil; + if (files.count > 0) { + request = [requestSerializer multipartFormRequestWithMethod:@"POST" URLString:urlString parameters:nil constructingBodyWithBlock:^(id formData) { + [formParams enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { + NSString *objString = [sanitizer parameterToString:obj]; + NSData *data = [objString dataUsingEncoding:NSUTF8StringEncoding]; + [formData appendPartWithFormData:data name:key]; + }]; + [files enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { + NSURL *filePath = (NSURL *)obj; + [formData appendPartWithFileURL:filePath name:key error:nil]; + }]; + } error:&requestCreateError]; + } + else { + if (formParams) { + request = [requestSerializer requestWithMethod:method URLString:urlString parameters:formParams error:&requestCreateError]; + } + if (body) { + request = [requestSerializer requestWithMethod:method URLString:urlString parameters:body error:&requestCreateError]; + } + } + if(!request) { + completionBlock(nil, requestCreateError); + return nil; + } + + if ([headerParams count] > 0){ + for(NSString * key in [headerParams keyEnumerator]){ + [request setValue:[headerParams valueForKey:key] forHTTPHeaderField:key]; + } + } + [requestSerializer setValue:responseContentType forHTTPHeaderField:@"Accept"]; + + [self postProcessRequest:request]; + + + NSURLSessionTask *task = nil; + + if ([self.downloadTaskResponseTypes containsObject:responseType]) { + task = [self downloadTaskWithCompletionBlock:request completionBlock:^(id data, NSError *error) { + completionBlock(data, error); + }]; + } else { + __weak typeof(self) weakSelf = self; + task = [self taskWithCompletionBlock:request completionBlock:^(id data, NSError *error) { + NSError * serializationError; + id response = [weakSelf.responseDeserializer deserialize:data class:responseType error:&serializationError]; + + if(!response && !error){ + error = serializationError; + } + completionBlock(response, error); + }]; + } + + [task resume]; + + return task; +} + +-(AFHTTPRequestSerializer *)requestSerializerForRequestContentType:(NSString *)requestContentType { + AFHTTPRequestSerializer * serializer = self.requestSerializerForContentType[requestContentType]; + if(!serializer) { + NSAssert(NO, @"Unsupported request content type %@", requestContentType); + serializer = [AFHTTPRequestSerializer serializer]; + } + serializer.timeoutInterval = self.timeoutInterval; + return serializer; +} + +//Added for easier override to modify request +-(void)postProcessRequest:(NSMutableURLRequest *)request { + +} + +#pragma mark - + +- (NSString*) pathWithQueryParamsToString:(NSString*) path queryParams:(NSDictionary*) queryParams { + if(queryParams.count == 0) { + return path; + } + NSString * separator = nil; + NSUInteger counter = 0; + + NSMutableString * requestUrl = [NSMutableString stringWithFormat:@"%@", path]; + + NSDictionary *separatorStyles = @{@"csv" : @",", + @"tsv" : @"\t", + @"pipes": @"|" + }; + for(NSString * key in [queryParams keyEnumerator]){ + if (counter == 0) { + separator = @"?"; + } else { + separator = @"&"; + } + id queryParam = [queryParams valueForKey:key]; + if(!queryParam) { + continue; + } + NSString *safeKey = OAIPercentEscapedStringFromString(key); + if ([queryParam isKindOfClass:[NSString class]]){ + [requestUrl appendString:[NSString stringWithFormat:@"%@%@=%@", separator, safeKey, OAIPercentEscapedStringFromString(queryParam)]]; + + } else if ([queryParam isKindOfClass:[OAIQueryParamCollection class]]){ + OAIQueryParamCollection * coll = (OAIQueryParamCollection*) queryParam; + NSArray* values = [coll values]; + NSString* format = [coll format]; + + if([format isEqualToString:@"multi"]) { + for(id obj in values) { + if (counter > 0) { + separator = @"&"; + } + NSString * safeValue = OAIPercentEscapedStringFromString([NSString stringWithFormat:@"%@",obj]); + [requestUrl appendString:[NSString stringWithFormat:@"%@%@=%@", separator, safeKey, safeValue]]; + counter += 1; + } + continue; + } + NSString * separatorStyle = separatorStyles[format]; + NSString * safeValue = OAIPercentEscapedStringFromString([values componentsJoinedByString:separatorStyle]); + [requestUrl appendString:[NSString stringWithFormat:@"%@%@=%@", separator, safeKey, safeValue]]; + } else { + NSString * safeValue = OAIPercentEscapedStringFromString([NSString stringWithFormat:@"%@",queryParam]); + [requestUrl appendString:[NSString stringWithFormat:@"%@%@=%@", separator, safeKey, safeValue]]; + } + counter += 1; + } + return requestUrl; +} + +/** + * Update header and query params based on authentication settings + */ +- (void) updateHeaderParams:(NSDictionary * *)headers queryParams:(NSDictionary * *)querys WithAuthSettings:(NSArray *)authSettings { + + if ([authSettings count] == 0) { + return; + } + + NSMutableDictionary *headersWithAuth = [NSMutableDictionary dictionaryWithDictionary:*headers]; + NSMutableDictionary *querysWithAuth = [NSMutableDictionary dictionaryWithDictionary:*querys]; + + id config = self.configuration; + for (NSString *auth in authSettings) { + NSDictionary *authSetting = config.authSettings[auth]; + + if(!authSetting) { // auth setting is set only if the key is non-empty + continue; + } + NSString *type = authSetting[@"in"]; + NSString *key = authSetting[@"key"]; + NSString *value = authSetting[@"value"]; + if ([type isEqualToString:@"header"] && [key length] > 0 ) { + headersWithAuth[key] = value; + } else if ([type isEqualToString:@"query"] && [key length] != 0) { + querysWithAuth[key] = value; + } + } + + *headers = [NSDictionary dictionaryWithDictionary:headersWithAuth]; + *querys = [NSDictionary dictionaryWithDictionary:querysWithAuth]; +} + +- (AFSecurityPolicy *) createSecurityPolicy { + AFSecurityPolicy *securityPolicy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeNone]; + + id config = self.configuration; + + if (config.sslCaCert) { + NSData *certData = [NSData dataWithContentsOfFile:config.sslCaCert]; + [securityPolicy setPinnedCertificates:[NSSet setWithObject:certData]]; + } + + if (config.verifySSL) { + [securityPolicy setAllowInvalidCertificates:NO]; + } + else { + [securityPolicy setAllowInvalidCertificates:YES]; + [securityPolicy setValidatesDomainName:NO]; + } + + return securityPolicy; +} + +@end diff --git a/samples/client/petstore/objc/default/OpenAPIClient/Core/OAIBasicAuthTokenProvider.h b/samples/client/petstore/objc/default/OpenAPIClient/Core/OAIBasicAuthTokenProvider.h new file mode 100644 index 000000000000..b67a39067e2f --- /dev/null +++ b/samples/client/petstore/objc/default/OpenAPIClient/Core/OAIBasicAuthTokenProvider.h @@ -0,0 +1,14 @@ +/** The `OAIBasicAuthTokenProvider` class creates a basic auth token from username and password. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +#import + +@interface OAIBasicAuthTokenProvider : NSObject + ++ (NSString *)createBasicAuthTokenWithUsername:(NSString *)username password:(NSString *)password; + +@end \ No newline at end of file diff --git a/samples/client/petstore/objc/default/OpenAPIClient/Core/OAIBasicAuthTokenProvider.m b/samples/client/petstore/objc/default/OpenAPIClient/Core/OAIBasicAuthTokenProvider.m new file mode 100644 index 000000000000..70afc93438a7 --- /dev/null +++ b/samples/client/petstore/objc/default/OpenAPIClient/Core/OAIBasicAuthTokenProvider.m @@ -0,0 +1,19 @@ +#import "OAIBasicAuthTokenProvider.h" + +@implementation OAIBasicAuthTokenProvider + ++ (NSString *)createBasicAuthTokenWithUsername:(NSString *)username password:(NSString *)password { + + // return empty string if username and password are empty + if (username.length == 0 && password.length == 0){ + return @""; + } + + NSString *basicAuthCredentials = [NSString stringWithFormat:@"%@:%@", username, password]; + NSData *data = [basicAuthCredentials dataUsingEncoding:NSUTF8StringEncoding]; + basicAuthCredentials = [NSString stringWithFormat:@"Basic %@", [data base64EncodedStringWithOptions:0]]; + + return basicAuthCredentials; +} + +@end diff --git a/samples/client/petstore/objc/default/OpenAPIClient/Core/OAIConfiguration.h b/samples/client/petstore/objc/default/OpenAPIClient/Core/OAIConfiguration.h new file mode 100644 index 000000000000..deb69f5d5f0c --- /dev/null +++ b/samples/client/petstore/objc/default/OpenAPIClient/Core/OAIConfiguration.h @@ -0,0 +1,89 @@ +#import + +@class OAILogger; + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +static NSString * const kOAIAPIVersion = @"1.0.0"; + +@protocol OAIConfiguration + +/** + * Api logger + */ +@property (readonly, nonatomic) OAILogger *logger; + +/** + * Base url + */ +@property (readonly, nonatomic) NSString *host; + +/** + * Api key values for Api Key type Authentication + */ +@property (readonly, nonatomic) NSDictionary *apiKey; + +/** + * Api key prefix values to be prepend to the respective api key + */ +@property (readonly, nonatomic) NSDictionary *apiKeyPrefix; + +/** + * Username for HTTP Basic Authentication + */ +@property (readonly, nonatomic) NSString *username; + +/** + * Password for HTTP Basic Authentication + */ +@property (readonly, nonatomic) NSString *password; + +/** + * Access token for OAuth + */ +@property (readonly, nonatomic) NSString *accessToken; + +/** + * Temp folder for file download + */ +@property (readonly, nonatomic) NSString *tempFolderPath; + +/** + * Debug switch, default false + */ +@property (readonly, nonatomic) BOOL debug; + +/** + * SSL/TLS verification + * Set this to NO to skip verifying SSL certificate when calling API from https server + */ +@property (readonly, nonatomic) BOOL verifySSL; + +/** + * SSL/TLS verification + * Set this to customize the certificate file to verify the peer + */ +@property (readonly, nonatomic) NSString *sslCaCert; + +/** + * Authentication Settings + */ +@property (readonly, nonatomic) NSDictionary *authSettings; + +/** +* Default headers for all services +*/ +@property (readonly, nonatomic, strong) NSDictionary *defaultHeaders; + +@end diff --git a/samples/client/petstore/objc/default/OpenAPIClient/Core/OAIDefaultConfiguration.h b/samples/client/petstore/objc/default/OpenAPIClient/Core/OAIDefaultConfiguration.h new file mode 100644 index 000000000000..245037abb978 --- /dev/null +++ b/samples/client/petstore/objc/default/OpenAPIClient/Core/OAIDefaultConfiguration.h @@ -0,0 +1,171 @@ +#import +#import "OAIConfiguration.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +@class OAIApiClient; + +@interface OAIDefaultConfiguration : NSObject + + +/** + * Default api logger + */ +@property (nonatomic, strong) OAILogger * logger; + +/** + * Default base url + */ +@property (nonatomic) NSString *host; + +/** + * Api key values for Api Key type Authentication + * + * To add or remove api key, use `setApiKey:forApiKeyIdentifier:`. + */ +@property (readonly, nonatomic, strong) NSDictionary *apiKey; + +/** + * Api key prefix values to be prepend to the respective api key + * + * To add or remove prefix, use `setApiKeyPrefix:forApiKeyPrefixIdentifier:`. + */ +@property (readonly, nonatomic, strong) NSDictionary *apiKeyPrefix; + +/** + * Username for HTTP Basic Authentication + */ + @property (nonatomic) NSString *username; + +/** + * Password for HTTP Basic Authentication + */ +@property (nonatomic) NSString *password; + +/** + * Access token for OAuth + */ +@property (nonatomic) NSString *accessToken; + +/** + * Temp folder for file download + */ +@property (nonatomic) NSString *tempFolderPath; + +/** + * Debug switch, default false + */ +@property (nonatomic) BOOL debug; + +/** + * Gets configuration singleton instance + */ ++ (instancetype) sharedConfig; + +/** + * SSL/TLS verification + * Set this to NO to skip verifying SSL certificate when calling API from https server + */ +@property (nonatomic) BOOL verifySSL; + +/** + * SSL/TLS verification + * Set this to customize the certificate file to verify the peer + */ +@property (nonatomic) NSString *sslCaCert; + +/** + * The time zone to use for date serialization + */ +@property (nonatomic) NSTimeZone *serializationTimeZone; + +/** + * Sets API key + * + * To remove an apiKey for an identifier, just set the apiKey to nil. + * + * @param apiKey API key or token. + * @param identifier API key identifier (authentication schema). + * + */ +- (void) setApiKey:(NSString *)apiKey forApiKeyIdentifier:(NSString*)identifier; + +/** + * Removes api key + * + * @param identifier API key identifier. + */ +- (void) removeApiKey:(NSString *)identifier; + +/** + * Sets the prefix for API key + * + * @param prefix API key prefix. + * @param identifier API key identifier. + */ +- (void) setApiKeyPrefix:(NSString *)prefix forApiKeyPrefixIdentifier:(NSString *)identifier; + +/** + * Removes api key prefix + * + * @param identifier API key identifier. + */ +- (void) removeApiKeyPrefix:(NSString *)identifier; + +/** + * Gets API key (with prefix if set) + */ +- (NSString *) getApiKeyWithPrefix:(NSString *) key; + +/** + * Gets Basic Auth token + */ +- (NSString *) getBasicAuthToken; + +/** + * Gets OAuth access token + */ +- (NSString *) getAccessToken; + +/** + * Gets Authentication Settings + */ +- (NSDictionary *) authSettings; + +/** +* Default headers for all services +*/ +@property (readonly, nonatomic, strong) NSDictionary *defaultHeaders; + +/** +* Removes header from defaultHeaders +* +* @param key Header name. +*/ +-(void) removeDefaultHeaderForKey:(NSString*)key; + +/** +* Sets the header for key +* +* @param value Value for header name +* @param key Header name +*/ +-(void) setDefaultHeaderValue:(NSString*) value forKey:(NSString*)key; + +/** +* @param key Header key name. +*/ +-(NSString*) defaultHeaderForKey:(NSString*)key; + +@end diff --git a/samples/client/petstore/objc/default/OpenAPIClient/Core/OAIDefaultConfiguration.m b/samples/client/petstore/objc/default/OpenAPIClient/Core/OAIDefaultConfiguration.m new file mode 100644 index 000000000000..092a61581f38 --- /dev/null +++ b/samples/client/petstore/objc/default/OpenAPIClient/Core/OAIDefaultConfiguration.m @@ -0,0 +1,152 @@ +#import "OAIDefaultConfiguration.h" +#import "OAIBasicAuthTokenProvider.h" +#import "OAILogger.h" + +@interface OAIDefaultConfiguration () + +@property (nonatomic, strong) NSMutableDictionary *mutableDefaultHeaders; +@property (nonatomic, strong) NSMutableDictionary *mutableApiKey; +@property (nonatomic, strong) NSMutableDictionary *mutableApiKeyPrefix; + +@end + +@implementation OAIDefaultConfiguration + +#pragma mark - Singleton Methods + ++ (instancetype) sharedConfig { + static OAIDefaultConfiguration *shardConfig = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + shardConfig = [[self alloc] init]; + }); + return shardConfig; +} + +#pragma mark - Initialize Methods + +- (instancetype) init { + self = [super init]; + if (self) { + _host = @"http://petstore.swagger.io/v2"; + _username = @""; + _password = @""; + _accessToken= @""; + _verifySSL = YES; + _mutableApiKey = [NSMutableDictionary dictionary]; + _mutableApiKeyPrefix = [NSMutableDictionary dictionary]; + _mutableDefaultHeaders = [NSMutableDictionary dictionary]; + + _logger = [OAILogger sharedLogger]; + } + return self; +} + +#pragma mark - Instance Methods + +- (NSString *) getApiKeyWithPrefix:(NSString *)key { + NSString *prefix = self.apiKeyPrefix[key]; + NSString *apiKey = self.apiKey[key]; + if (prefix && apiKey != (id)[NSNull null] && apiKey.length > 0) { // both api key prefix and api key are set + return [NSString stringWithFormat:@"%@ %@", prefix, apiKey]; + } + else if (apiKey != (id)[NSNull null] && apiKey.length > 0) { // only api key, no api key prefix + return [NSString stringWithFormat:@"%@", self.apiKey[key]]; + } + else { // return empty string if nothing is set + return @""; + } +} + +- (NSString *) getBasicAuthToken { + + NSString *basicAuthToken = [OAIBasicAuthTokenProvider createBasicAuthTokenWithUsername:self.username password:self.password]; + return basicAuthToken; +} + +- (NSString *) getAccessToken { + if (self.accessToken.length == 0) { // token not set, return empty string + return @""; + } else { + return [NSString stringWithFormat:@"Bearer %@", self.accessToken]; + } +} + +#pragma mark - Setter Methods + +- (void) setApiKey:(NSString *)apiKey forApiKeyIdentifier:(NSString *)identifier { + [self.mutableApiKey setValue:apiKey forKey:identifier]; +} + +- (void) removeApiKey:(NSString *)identifier { + [self.mutableApiKey removeObjectForKey:identifier]; +} + +- (void) setApiKeyPrefix:(NSString *)prefix forApiKeyPrefixIdentifier:(NSString *)identifier { + [self.mutableApiKeyPrefix setValue:prefix forKey:identifier]; +} + +- (void) removeApiKeyPrefix:(NSString *)identifier { + [self.mutableApiKeyPrefix removeObjectForKey:identifier]; +} + +#pragma mark - Getter Methods + +- (NSDictionary *) apiKey { + return [NSDictionary dictionaryWithDictionary:self.mutableApiKey]; +} + +- (NSDictionary *) apiKeyPrefix { + return [NSDictionary dictionaryWithDictionary:self.mutableApiKeyPrefix]; +} + +#pragma mark - + +- (NSDictionary *) authSettings { + return @{ + @"api_key": + @{ + @"type": @"api_key", + @"in": @"header", + @"key": @"api_key", + @"value": [self getApiKeyWithPrefix:@"api_key"] + }, + @"petstore_auth": + @{ + @"type": @"oauth", + @"in": @"header", + @"key": @"Authorization", + @"value": [self getAccessToken] + }, + }; +} + +-(BOOL)debug { + return self.logger.isEnabled; +} + +-(void)setDebug:(BOOL)debug { + self.logger.enabled = debug; +} + +- (void)setDefaultHeaderValue:(NSString *)value forKey:(NSString *)key { + if(!value) { + [self.mutableDefaultHeaders removeObjectForKey:key]; + return; + } + self.mutableDefaultHeaders[key] = value; +} + +-(void) removeDefaultHeaderForKey:(NSString*)key { + [self.mutableDefaultHeaders removeObjectForKey:key]; +} + +- (NSString *)defaultHeaderForKey:(NSString *)key { + return self.mutableDefaultHeaders[key]; +} + +- (NSDictionary *)defaultHeaders { + return [self.mutableDefaultHeaders copy]; +} + +@end diff --git a/samples/client/petstore/objc/default/OpenAPIClient/Core/OAIJSONRequestSerializer.h b/samples/client/petstore/objc/default/OpenAPIClient/Core/OAIJSONRequestSerializer.h new file mode 100644 index 000000000000..8cf3949a5b06 --- /dev/null +++ b/samples/client/petstore/objc/default/OpenAPIClient/Core/OAIJSONRequestSerializer.h @@ -0,0 +1,18 @@ +#import +#import + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +@interface OAIJSONRequestSerializer : AFJSONRequestSerializer +@end diff --git a/samples/client/petstore/objc/default/OpenAPIClient/Core/OAIJSONRequestSerializer.m b/samples/client/petstore/objc/default/OpenAPIClient/Core/OAIJSONRequestSerializer.m new file mode 100644 index 000000000000..644f07c174b9 --- /dev/null +++ b/samples/client/petstore/objc/default/OpenAPIClient/Core/OAIJSONRequestSerializer.m @@ -0,0 +1,37 @@ +#import "OAIJSONRequestSerializer.h" + +@implementation OAIJSONRequestSerializer + +/// +/// When customize a request serializer, +/// the serializer must conform the protocol `AFURLRequestSerialization` +/// and implements the protocol method `requestBySerializingRequest:withParameters:error:` +/// +/// @param request The original request. +/// @param parameters The parameters to be encoded. +/// @param error The error that occurred while attempting to encode the request parameters. +/// +/// @return A serialized request. +/// +- (NSURLRequest *)requestBySerializingRequest:(NSURLRequest *)request + withParameters:(id)parameters + error:(NSError *__autoreleasing *)error +{ + if (!parameters) { + return request; + } + // If the body data which will be serialized isn't NSArray or NSDictionary + // then put the data in the http request body directly. + if ([parameters isKindOfClass:[NSArray class]] || [parameters isKindOfClass:[NSDictionary class]]) { + return [super requestBySerializingRequest:request withParameters:parameters error:error]; + } + NSMutableURLRequest *mutableRequest = [request mutableCopy]; + if([parameters isKindOfClass:[NSData class]]) { + [mutableRequest setHTTPBody:parameters]; + } else { + [mutableRequest setHTTPBody:[parameters dataUsingEncoding:self.stringEncoding]]; + } + return mutableRequest; +} + +@end diff --git a/samples/client/petstore/objc/default/OpenAPIClient/Core/OAILogger.h b/samples/client/petstore/objc/default/OpenAPIClient/Core/OAILogger.h new file mode 100644 index 000000000000..1dcf393b8848 --- /dev/null +++ b/samples/client/petstore/objc/default/OpenAPIClient/Core/OAILogger.h @@ -0,0 +1,61 @@ +#import + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +#ifndef OAIDebugLogResponse +#define OAIDebugLogResponse(response, responseObject,request, error) [[OAILogger sharedLogger] logResponse:response responseObject:responseObject request:request error:error]; +#endif + +/** + * Log debug message macro + */ +#ifndef OAIDebugLog +#define OAIDebugLog(format, ...) [[OAILogger sharedLogger] debugLog:[NSString stringWithFormat:@"%s", __PRETTY_FUNCTION__] message: format, ##__VA_ARGS__]; +#endif + +@interface OAILogger : NSObject + ++(instancetype)sharedLogger; + +/** + * Enabled switch, default NO - default set by OAIConfiguration debug property + */ +@property (nonatomic, assign, getter=isEnabled) BOOL enabled; + +/** + * Debug file location, default log in console + */ +@property (nonatomic, strong) NSString *loggingFile; + +/** + * Log file handler, this property is used by sdk internally. + */ +@property (nonatomic, strong, readonly) NSFileHandle *loggingFileHandler; + +/** + * Log debug message + */ +-(void)debugLog:(NSString *)method message:(NSString *)format, ...; + +/** + * Logs request and response + * + * @param response NSURLResponse for the HTTP request. + * @param responseObject response object of the HTTP request. + * @param request The HTTP request. + * @param error The error of the HTTP request. + */ +- (void)logResponse:(NSURLResponse *)response responseObject:(id)responseObject request:(NSURLRequest *)request error:(NSError *)error; + +@end diff --git a/samples/client/petstore/objc/default/OpenAPIClient/Core/OAILogger.m b/samples/client/petstore/objc/default/OpenAPIClient/Core/OAILogger.m new file mode 100644 index 000000000000..42b950681ad0 --- /dev/null +++ b/samples/client/petstore/objc/default/OpenAPIClient/Core/OAILogger.m @@ -0,0 +1,73 @@ +#import "OAILogger.h" + +@interface OAILogger () + +@end + +@implementation OAILogger + ++ (instancetype) sharedLogger { + static OAILogger *shardLogger = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + shardLogger = [[self alloc] init]; + }); + return shardLogger; +} + +#pragma mark - Log Methods + +- (void)debugLog:(NSString *)method message:(NSString *)format, ... { + if (!self.isEnabled) { + return; + } + + NSMutableString *message = [NSMutableString stringWithCapacity:1]; + + if (method) { + [message appendFormat:@"%@: ", method]; + } + + va_list args; + va_start(args, format); + + [message appendString:[[NSString alloc] initWithFormat:format arguments:args]]; + + // If set logging file handler, log into file, + // otherwise log into console. + if (self.loggingFileHandler) { + [self.loggingFileHandler seekToEndOfFile]; + [self.loggingFileHandler writeData:[message dataUsingEncoding:NSUTF8StringEncoding]]; + } else { + NSLog(@"%@", message); + } + + va_end(args); +} + +- (void)logResponse:(NSURLResponse *)response responseObject:(id)responseObject request:(NSURLRequest *)request error:(NSError *)error { + NSString *message = [NSString stringWithFormat:@"\n[DEBUG] HTTP request body \n~BEGIN~\n %@\n~END~\n"\ + "[DEBUG] HTTP response body \n~BEGIN~\n %@\n~END~\n", + [[NSString alloc] initWithData:request.HTTPBody encoding:NSUTF8StringEncoding], + responseObject]; + + OAIDebugLog(message); +} + +- (void) setLoggingFile:(NSString *)loggingFile { + if(_loggingFile == loggingFile) { + return; + } + // close old file handler + if ([self.loggingFileHandler isKindOfClass:[NSFileHandle class]]) { + [self.loggingFileHandler closeFile]; + } + _loggingFile = loggingFile; + _loggingFileHandler = [NSFileHandle fileHandleForWritingAtPath:_loggingFile]; + if (_loggingFileHandler == nil) { + [[NSFileManager defaultManager] createFileAtPath:_loggingFile contents:nil attributes:nil]; + _loggingFileHandler = [NSFileHandle fileHandleForWritingAtPath:_loggingFile]; + } +} + +@end diff --git a/samples/client/petstore/objc/default/OpenAPIClient/Core/OAIObject.h b/samples/client/petstore/objc/default/OpenAPIClient/Core/OAIObject.h new file mode 100644 index 000000000000..bf641adfb7ae --- /dev/null +++ b/samples/client/petstore/objc/default/OpenAPIClient/Core/OAIObject.h @@ -0,0 +1,19 @@ +#import +#import + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +@interface OAIObject : JSONModel + +@end diff --git a/samples/client/petstore/objc/default/OpenAPIClient/Core/OAIObject.m b/samples/client/petstore/objc/default/OpenAPIClient/Core/OAIObject.m new file mode 100644 index 000000000000..fd31d41df3ef --- /dev/null +++ b/samples/client/petstore/objc/default/OpenAPIClient/Core/OAIObject.m @@ -0,0 +1,42 @@ +#import "OAIObject.h" + +@implementation OAIObject + +/** + * Workaround for JSONModel multithreading issues + * https://github.com/icanzilb/JSONModel/issues/441 + */ +- (instancetype)initWithDictionary:(NSDictionary *)dict error:(NSError **)err { + static NSMutableSet *classNames; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + classNames = [NSMutableSet new]; + }); + + BOOL initSync; + @synchronized([self class]) + { + NSString *className = NSStringFromClass([self class]); + initSync = ![classNames containsObject:className]; + if(initSync) + { + [classNames addObject:className]; + self = [super initWithDictionary:dict error:err]; + } + } + if(!initSync) + { + self = [super initWithDictionary:dict error:err]; + } + return self; +} + +/** + * Gets the string presentation of the object. + * This method will be called when logging model object using `NSLog`. + */ +- (NSString *)description { + return [[self toDictionary] description]; +} + +@end diff --git a/samples/client/petstore/objc/default/OpenAPIClient/Core/OAIQueryParamCollection.h b/samples/client/petstore/objc/default/OpenAPIClient/Core/OAIQueryParamCollection.h new file mode 100644 index 000000000000..d8e0c05cb91b --- /dev/null +++ b/samples/client/petstore/objc/default/OpenAPIClient/Core/OAIQueryParamCollection.h @@ -0,0 +1,24 @@ +#import + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +@interface OAIQueryParamCollection : NSObject + +@property(nonatomic, readonly) NSArray* values; +@property(nonatomic, readonly) NSString* format; + +- (id) initWithValuesAndFormat: (NSArray*) values + format: (NSString*) format; + +@end diff --git a/samples/client/petstore/objc/default/OpenAPIClient/Core/OAIQueryParamCollection.m b/samples/client/petstore/objc/default/OpenAPIClient/Core/OAIQueryParamCollection.m new file mode 100644 index 000000000000..fba39676e823 --- /dev/null +++ b/samples/client/petstore/objc/default/OpenAPIClient/Core/OAIQueryParamCollection.m @@ -0,0 +1,20 @@ +#import "OAIQueryParamCollection.h" + +@implementation OAIQueryParamCollection + +@synthesize values = _values; +@synthesize format = _format; + +- (id)initWithValuesAndFormat:(NSArray *)values + format:(NSString *)format { + + self = [super init]; + if (self) { + _values = values; + _format = format; + } + + return self; +} + +@end diff --git a/samples/client/petstore/objc/default/OpenAPIClient/Core/OAIResponseDeserializer.h b/samples/client/petstore/objc/default/OpenAPIClient/Core/OAIResponseDeserializer.h new file mode 100644 index 000000000000..be55731603b4 --- /dev/null +++ b/samples/client/petstore/objc/default/OpenAPIClient/Core/OAIResponseDeserializer.h @@ -0,0 +1,57 @@ +#import + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +/** + * A key for deserialization ErrorDomain + */ +extern NSString *const OAIDeserializationErrorDomainKey; + +/** + * Code for deserialization type mismatch error + */ +extern NSInteger const OAITypeMismatchErrorCode; + +/** + * Code for deserialization empty value error + */ +extern NSInteger const OAIEmptyValueOccurredErrorCode; + +/** + * Error code for unknown response + */ +extern NSInteger const OAIUnknownResponseObjectErrorCode; + +@protocol OAIResponseDeserializer + +/** + * Deserializes the given data to Objective-C object. + * + * @param data The data will be deserialized. + * @param className The type of objective-c object. + * @param error The error + */ +- (id) deserialize:(id) data class:(NSString *) className error:(NSError**)error; + +@end + +@interface OAIResponseDeserializer : NSObject + +/** + * If a null value occurs in dictionary or array if set to YES whole response will be invalid else will be ignored + * @default NO + */ +@property (nonatomic, assign) BOOL treatNullAsError; + +@end diff --git a/samples/client/petstore/objc/default/OpenAPIClient/Core/OAIResponseDeserializer.m b/samples/client/petstore/objc/default/OpenAPIClient/Core/OAIResponseDeserializer.m new file mode 100644 index 000000000000..46ffcb25eee9 --- /dev/null +++ b/samples/client/petstore/objc/default/OpenAPIClient/Core/OAIResponseDeserializer.m @@ -0,0 +1,247 @@ +#import "OAIResponseDeserializer.h" +#import +#import + +NSString *const OAIDeserializationErrorDomainKey = @"OAIDeserializationErrorDomainKey"; + +NSInteger const OAITypeMismatchErrorCode = 143553; + +NSInteger const OAIEmptyValueOccurredErrorCode = 143509; + +NSInteger const OAIUnknownResponseObjectErrorCode = 143528; + + +@interface OAIResponseDeserializer () + +@property (nonatomic, strong) NSNumberFormatter* numberFormatter; +@property (nonatomic, strong) NSArray *primitiveTypes; +@property (nonatomic, strong) NSArray *basicReturnTypes; +@property (nonatomic, strong) NSArray *dataReturnTypes; + +@property (nonatomic, strong) NSRegularExpression* arrayOfModelsPatExpression; +@property (nonatomic, strong) NSRegularExpression* arrayOfPrimitivesPatExpression; +@property (nonatomic, strong) NSRegularExpression* dictPatExpression; +@property (nonatomic, strong) NSRegularExpression* dictModelsPatExpression; + +@end + +@implementation OAIResponseDeserializer + +- (instancetype)init { + self = [super init]; + if (self) { + NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init]; + formatter.numberStyle = NSNumberFormatterDecimalStyle; + _numberFormatter = formatter; + _primitiveTypes = @[@"NSString", @"NSDate", @"NSNumber"]; + _basicReturnTypes = @[@"NSObject", @"id"]; + _dataReturnTypes = @[@"NSData"]; + + _arrayOfModelsPatExpression = [NSRegularExpression regularExpressionWithPattern:@"NSArray<(.+)>" + options:NSRegularExpressionCaseInsensitive + error:nil]; + _arrayOfPrimitivesPatExpression = [NSRegularExpression regularExpressionWithPattern:@"NSArray\\* /\\* (.+) \\*/" + options:NSRegularExpressionCaseInsensitive + error:nil]; + _dictPatExpression = [NSRegularExpression regularExpressionWithPattern:@"NSDictionary\\* /\\* (.+?), (.+) \\*/" + options:NSRegularExpressionCaseInsensitive + error:nil]; + _dictModelsPatExpression = [NSRegularExpression regularExpressionWithPattern:@"NSDictionary\\<(.+?), (.+)*\\>" + options:NSRegularExpressionCaseInsensitive + error:nil]; + } + return self; +} + +#pragma mark - Deserialize methods + +- (id) deserialize:(id) data class:(NSString *) className error:(NSError **) error { + if (!data || !className) { + return nil; + } + + if ([className hasSuffix:@"*"]) { + className = [className substringToIndex:[className length] - 1]; + } + if([self.dataReturnTypes containsObject:className]) { + return data; + } + id jsonData = nil; + if([data isKindOfClass:[NSData class]]) { + jsonData = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:error]; + } else { + jsonData = data; + } + if(!jsonData) { + jsonData = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; + } else if([jsonData isKindOfClass:[NSNull class]]) { + return nil; + } + + // pure object + if ([self.basicReturnTypes containsObject:className]) { + return jsonData; + } + + // primitives + if ([self.primitiveTypes containsObject:className]) { + return [self deserializePrimitiveValue:jsonData class:className error:error]; + } + + NSTextCheckingResult *match = nil; + NSRange range = NSMakeRange(0, [className length]); + // list of models + match = [self.arrayOfModelsPatExpression firstMatchInString:className options:0 range:range]; + if (match) { + NSString *innerType = [className substringWithRange:[match rangeAtIndex:1]]; + return [self deserializeArrayValue:jsonData innerType:innerType error:error]; + } + + // list of primitives + match = [self.arrayOfPrimitivesPatExpression firstMatchInString:className options:0 range:range]; + if (match) { + NSString *innerType = [className substringWithRange:[match rangeAtIndex:1]]; + return [self deserializeArrayValue:jsonData innerType:innerType error:error]; + } + + // map + match = [self.dictPatExpression firstMatchInString:className options:0 range:range]; + if (match) { + NSString *valueType = [className substringWithRange:[match rangeAtIndex:2]]; + return [self deserializeDictionaryValue:jsonData valueType:valueType error:error]; + } + + match = [self.dictModelsPatExpression firstMatchInString:className options:0 range:range]; + if (match) { + NSString *valueType = [className substringWithRange:[match rangeAtIndex:2]]; + return [self deserializeDictionaryValue:jsonData valueType:valueType error:error]; + } + + // model + Class ModelClass = NSClassFromString(className); + if ([ModelClass instancesRespondToSelector:@selector(initWithDictionary:error:)]) { + return [(JSONModel *) [ModelClass alloc] initWithDictionary:jsonData error:error]; + } + + if(error) { + *error = [self unknownResponseErrorWithExpectedType:className data:jsonData]; + } + return nil; +} + +- (id) deserializeDictionaryValue:(id) data valueType:(NSString *) valueType error:(NSError**)error { + if(![data isKindOfClass: [NSDictionary class]]) { + if(error) { + *error = [self typeMismatchErrorWithExpectedType:NSStringFromClass([NSDictionary class]) data:data]; + } + return nil; + } + __block NSMutableDictionary *resultDict = [NSMutableDictionary dictionaryWithCapacity:[data count]]; + for (id key in [data allKeys]) { + id obj = [data valueForKey:key]; + id dicObj = [self deserialize:obj class:valueType error:error]; + if(dicObj) { + [resultDict setValue:dicObj forKey:key]; + } else if([obj isKindOfClass:[NSNull class]]) { + if(self.treatNullAsError) { + if (error) { + *error = [self emptyValueOccurredError]; + } + resultDict = nil; + break; + } + } else { + resultDict = nil; + break; + } + } + return resultDict; +} + +- (id) deserializeArrayValue:(id) data innerType:(NSString *) innerType error:(NSError**)error { + if(![data isKindOfClass: [NSArray class]]) { + if(error) { + *error = [self typeMismatchErrorWithExpectedType:NSStringFromClass([NSArray class]) data:data]; + } + return nil; + } + NSMutableArray* resultArray = [NSMutableArray arrayWithCapacity:[data count]]; + for (id obj in data) { + id arrObj = [self deserialize:obj class:innerType error:error]; + if(arrObj) { + [resultArray addObject:arrObj]; + } else if([obj isKindOfClass:[NSNull class]]) { + if(self.treatNullAsError) { + if (error) { + *error = [self emptyValueOccurredError]; + } + resultArray = nil; + break; + } + } else { + resultArray = nil; + break; + } + } + return resultArray; +}; + +- (id) deserializePrimitiveValue:(id) data class:(NSString *) className error:(NSError**)error { + if ([className isEqualToString:@"NSString"]) { + return [NSString stringWithFormat:@"%@",data]; + } + else if ([className isEqualToString:@"NSDate"]) { + return [self deserializeDateValue:data error:error]; + } + else if ([className isEqualToString:@"NSNumber"]) { + // NSNumber from NSNumber + if ([data isKindOfClass:[NSNumber class]]) { + return data; + } + else if ([data isKindOfClass:[NSString class]]) { + // NSNumber (NSCFBoolean) from NSString + if ([[data lowercaseString] isEqualToString:@"true"] || [[data lowercaseString] isEqualToString:@"false"]) { + return @([data boolValue]); + // NSNumber from NSString + } else { + NSNumber* formattedValue = [self.numberFormatter numberFromString:data]; + if(!formattedValue && [data length] > 0 && error) { + *error = [self typeMismatchErrorWithExpectedType:className data:data]; + } + return formattedValue; + } + } + } + if(error) { + *error = [self typeMismatchErrorWithExpectedType:className data:data]; + } + return nil; +} + +- (id) deserializeDateValue:(id) data error:(NSError**)error { + NSDate *date =[NSDate dateWithISO8601String:data]; + if(!date && [data length] > 0 && error) { + *error = [self typeMismatchErrorWithExpectedType:NSStringFromClass([NSDate class]) data:data]; + } + return date; +}; + +-(NSError *)typeMismatchErrorWithExpectedType:(NSString *)expected data:(id)data { + NSString * message = [NSString stringWithFormat:NSLocalizedString(@"Received response [%@] is not an object of type %@",nil),data, expected]; + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : message}; + return [NSError errorWithDomain:OAIDeserializationErrorDomainKey code:OAITypeMismatchErrorCode userInfo:userInfo]; +} + +-(NSError *)emptyValueOccurredError { + NSString * message = NSLocalizedString(@"Received response contains null value in dictionary or array response",nil); + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : message}; + return [NSError errorWithDomain:OAIDeserializationErrorDomainKey code:OAIEmptyValueOccurredErrorCode userInfo:userInfo]; +} + +-(NSError *)unknownResponseErrorWithExpectedType:(NSString *)expected data:(id)data { + NSString * message = [NSString stringWithFormat:NSLocalizedString(@"Unknown response expected type %@ [response: %@]",nil),expected,data]; + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : message}; + return [NSError errorWithDomain:OAIDeserializationErrorDomainKey code:OAIUnknownResponseObjectErrorCode userInfo:userInfo]; +} + +@end diff --git a/samples/client/petstore/objc/default/OpenAPIClient/Core/OAISanitizer.h b/samples/client/petstore/objc/default/OpenAPIClient/Core/OAISanitizer.h new file mode 100644 index 000000000000..4371c7e694f1 --- /dev/null +++ b/samples/client/petstore/objc/default/OpenAPIClient/Core/OAISanitizer.h @@ -0,0 +1,63 @@ +#import + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +extern NSString * OAIPercentEscapedStringFromString(NSString *string); + +extern NSString * const kOAIApplicationJSONType; + +@protocol OAISanitizer + +/** + * Sanitize object for request + * + * @param object The query/path/header/form/body param to be sanitized. + */ +- (id) sanitizeForSerialization:(id) object; + +/** + * Convert parameter to NSString + */ +- (NSString *) parameterToString: (id) param; + +/** + * Convert date to NSString + */ ++ (NSString *)dateToString:(id)date; + +/** + * Detects Accept header from accepts NSArray + * + * @param accepts NSArray of header + * + * @return The Accept header + */ +-(NSString *) selectHeaderAccept:(NSArray *)accepts; + +/** + * Detects Content-Type header from contentTypes NSArray + * + * @param contentTypes NSArray of header + * + * @return The Content-Type header + */ +-(NSString *) selectHeaderContentType:(NSArray *)contentTypes; + +@end + +@interface OAISanitizer : NSObject + + + +@end diff --git a/samples/client/petstore/objc/default/OpenAPIClient/Core/OAISanitizer.m b/samples/client/petstore/objc/default/OpenAPIClient/Core/OAISanitizer.m new file mode 100644 index 000000000000..cbc3f6628108 --- /dev/null +++ b/samples/client/petstore/objc/default/OpenAPIClient/Core/OAISanitizer.m @@ -0,0 +1,170 @@ +#import "OAISanitizer.h" +#import "OAIObject.h" +#import "OAIQueryParamCollection.h" +#import "OAIDefaultConfiguration.h" +#import + +NSString * const kOAIApplicationJSONType = @"application/json"; + +NSString * OAIPercentEscapedStringFromString(NSString *string) { + static NSString * const kOAICharactersGeneralDelimitersToEncode = @":#[]@"; + static NSString * const kOAICharactersSubDelimitersToEncode = @"!$&'()*+,;="; + + NSMutableCharacterSet * allowedCharacterSet = [[NSCharacterSet URLQueryAllowedCharacterSet] mutableCopy]; + [allowedCharacterSet removeCharactersInString:[kOAICharactersGeneralDelimitersToEncode stringByAppendingString:kOAICharactersSubDelimitersToEncode]]; + + static NSUInteger const batchSize = 50; + + NSUInteger index = 0; + NSMutableString *escaped = @"".mutableCopy; + + while (index < string.length) { + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wgnu" + NSUInteger length = MIN(string.length - index, batchSize); + #pragma GCC diagnostic pop + NSRange range = NSMakeRange(index, length); + + // To avoid breaking up character sequences such as 👴🏻👮🏽 + range = [string rangeOfComposedCharacterSequencesForRange:range]; + + NSString *substring = [string substringWithRange:range]; + NSString *encoded = [substring stringByAddingPercentEncodingWithAllowedCharacters:allowedCharacterSet]; + [escaped appendString:encoded]; + + index += range.length; + } + + return escaped; +} + +@interface OAISanitizer () + +@property (nonatomic, strong) NSRegularExpression* jsonHeaderTypeExpression; + +@end + +@implementation OAISanitizer + +-(instancetype)init { + self = [super init]; + if ( !self ) { + return nil; + } + _jsonHeaderTypeExpression = [NSRegularExpression regularExpressionWithPattern:@"(.*)application(.*)json(.*)" options:NSRegularExpressionCaseInsensitive error:nil]; + return self; +} + + +- (id) sanitizeForSerialization:(id) object { + if (object == nil) { + return nil; + } + else if ([object isKindOfClass:[NSString class]] || [object isKindOfClass:[NSNumber class]] || [object isKindOfClass:[OAIQueryParamCollection class]]) { + return object; + } + else if ([object isKindOfClass:[NSDate class]]) { + return [OAISanitizer dateToString:object]; + } + else if ([object isKindOfClass:[NSArray class]]) { + NSArray *objectArray = object; + NSMutableArray *sanitizedObjs = [NSMutableArray arrayWithCapacity:[objectArray count]]; + [object enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { + id sanitizedObj = [self sanitizeForSerialization:obj]; + if (sanitizedObj) { + [sanitizedObjs addObject:sanitizedObj]; + } + }]; + return sanitizedObjs; + } + else if ([object isKindOfClass:[NSDictionary class]]) { + NSDictionary *objectDict = object; + NSMutableDictionary *sanitizedObjs = [NSMutableDictionary dictionaryWithCapacity:[objectDict count]]; + [object enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { + id sanitizedObj = [self sanitizeForSerialization:obj]; + if (sanitizedObj) { + sanitizedObjs[key] = sanitizedObj; + } + }]; + return sanitizedObjs; + } + else if ([object isKindOfClass:[OAIObject class]]) { + return [object toDictionary]; + } + else { + NSException *e = [NSException + exceptionWithName:@"InvalidObjectArgumentException" + reason:[NSString stringWithFormat:@"*** The argument object: %@ is invalid", object] + userInfo:nil]; + @throw e; + } +} + +- (NSString *) parameterToString:(id)param { + if ([param isKindOfClass:[NSString class]]) { + return param; + } + else if ([param isKindOfClass:[NSNumber class]]) { + return [param stringValue]; + } + else if ([param isKindOfClass:[NSDate class]]) { + return [OAISanitizer dateToString:param]; + } + else if ([param isKindOfClass:[NSArray class]]) { + NSMutableArray *mutableParam = [NSMutableArray array]; + [param enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { + [mutableParam addObject:[self parameterToString:obj]]; + }]; + return [mutableParam componentsJoinedByString:@","]; + } + else { + NSException *e = [NSException + exceptionWithName:@"InvalidObjectArgumentException" + reason:[NSString stringWithFormat:@"*** The argument object: %@ is invalid", param] + userInfo:nil]; + @throw e; + } +} + ++ (NSString *)dateToString:(id)date { + NSTimeZone* timeZone = [OAIDefaultConfiguration sharedConfig].serializationTimeZone; + return [date ISO8601StringWithTimeZone:timeZone usingCalendar:nil]; +} + +#pragma mark - Utility Methods + +/* + * Detect `Accept` from accepts + */ +- (NSString *) selectHeaderAccept:(NSArray *)accepts { + if (accepts.count == 0) { + return @""; + } + NSMutableArray *lowerAccepts = [[NSMutableArray alloc] initWithCapacity:[accepts count]]; + for (NSString *string in accepts) { + if ([self.jsonHeaderTypeExpression matchesInString:string options:0 range:NSMakeRange(0, [string length])].count > 0) { + return kOAIApplicationJSONType; + } + [lowerAccepts addObject:[string lowercaseString]]; + } + return [lowerAccepts componentsJoinedByString:@", "]; +} + +/* + * Detect `Content-Type` from contentTypes + */ +- (NSString *) selectHeaderContentType:(NSArray *)contentTypes { + if (contentTypes.count == 0) { + return kOAIApplicationJSONType; + } + NSMutableArray *lowerContentTypes = [[NSMutableArray alloc] initWithCapacity:[contentTypes count]]; + for (NSString *string in contentTypes) { + if([self.jsonHeaderTypeExpression matchesInString:string options:0 range:NSMakeRange(0, [string length])].count > 0){ + return kOAIApplicationJSONType; + } + [lowerContentTypes addObject:[string lowercaseString]]; + } + return [lowerContentTypes firstObject]; +} + +@end diff --git a/samples/client/petstore/objc/default/OpenAPIClient/Model/OAICategory.h b/samples/client/petstore/objc/default/OpenAPIClient/Model/OAICategory.h new file mode 100644 index 000000000000..77c32664e9a7 --- /dev/null +++ b/samples/client/petstore/objc/default/OpenAPIClient/Model/OAICategory.h @@ -0,0 +1,30 @@ +#import +#import "OAIObject.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + + + + +@protocol OAICategory +@end + +@interface OAICategory : OAIObject + + +@property(nonatomic) NSNumber* _id; + +@property(nonatomic) NSString* name; + +@end diff --git a/samples/client/petstore/objc/default/OpenAPIClient/Model/OAICategory.m b/samples/client/petstore/objc/default/OpenAPIClient/Model/OAICategory.m new file mode 100644 index 000000000000..88e99b348104 --- /dev/null +++ b/samples/client/petstore/objc/default/OpenAPIClient/Model/OAICategory.m @@ -0,0 +1,34 @@ +#import "OAICategory.h" + +@implementation OAICategory + +- (instancetype)init { + self = [super init]; + if (self) { + // initialize property's default value, if any + + } + return self; +} + + +/** + * Maps json key to property name. + * This method is used by `JSONModel`. + */ ++ (JSONKeyMapper *)keyMapper { + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"_id": @"id", @"name": @"name" }]; +} + +/** + * Indicates whether the property with the given name is optional. + * If `propertyName` is optional, then return `YES`, otherwise return `NO`. + * This method is used by `JSONModel`. + */ ++ (BOOL)propertyIsOptional:(NSString *)propertyName { + + NSArray *optionalProperties = @[@"_id", @"name"]; + return [optionalProperties containsObject:propertyName]; +} + +@end diff --git a/samples/client/petstore/objc/default/OpenAPIClient/Model/OAIInlineObject.h b/samples/client/petstore/objc/default/OpenAPIClient/Model/OAIInlineObject.h new file mode 100644 index 000000000000..95cd527e6f98 --- /dev/null +++ b/samples/client/petstore/objc/default/OpenAPIClient/Model/OAIInlineObject.h @@ -0,0 +1,32 @@ +#import +#import "OAIObject.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + + + + +@protocol OAIInlineObject +@end + +@interface OAIInlineObject : OAIObject + +/* Updated name of the pet [optional] + */ +@property(nonatomic) NSString* name; +/* Updated status of the pet [optional] + */ +@property(nonatomic) NSString* status; + +@end diff --git a/samples/client/petstore/objc/default/OpenAPIClient/Model/OAIInlineObject.m b/samples/client/petstore/objc/default/OpenAPIClient/Model/OAIInlineObject.m new file mode 100644 index 000000000000..390eb3d9c530 --- /dev/null +++ b/samples/client/petstore/objc/default/OpenAPIClient/Model/OAIInlineObject.m @@ -0,0 +1,34 @@ +#import "OAIInlineObject.h" + +@implementation OAIInlineObject + +- (instancetype)init { + self = [super init]; + if (self) { + // initialize property's default value, if any + + } + return self; +} + + +/** + * Maps json key to property name. + * This method is used by `JSONModel`. + */ ++ (JSONKeyMapper *)keyMapper { + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"name": @"name", @"status": @"status" }]; +} + +/** + * Indicates whether the property with the given name is optional. + * If `propertyName` is optional, then return `YES`, otherwise return `NO`. + * This method is used by `JSONModel`. + */ ++ (BOOL)propertyIsOptional:(NSString *)propertyName { + + NSArray *optionalProperties = @[@"name", @"status"]; + return [optionalProperties containsObject:propertyName]; +} + +@end diff --git a/samples/client/petstore/objc/default/OpenAPIClient/Model/OAIInlineObject1.h b/samples/client/petstore/objc/default/OpenAPIClient/Model/OAIInlineObject1.h new file mode 100644 index 000000000000..fe5e4fb4d834 --- /dev/null +++ b/samples/client/petstore/objc/default/OpenAPIClient/Model/OAIInlineObject1.h @@ -0,0 +1,32 @@ +#import +#import "OAIObject.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + + + + +@protocol OAIInlineObject1 +@end + +@interface OAIInlineObject1 : OAIObject + +/* Additional data to pass to server [optional] + */ +@property(nonatomic) NSString* additionalMetadata; +/* file to upload [optional] + */ +@property(nonatomic) NSURL* file; + +@end diff --git a/samples/client/petstore/objc/default/OpenAPIClient/Model/OAIInlineObject1.m b/samples/client/petstore/objc/default/OpenAPIClient/Model/OAIInlineObject1.m new file mode 100644 index 000000000000..f4dc0358c634 --- /dev/null +++ b/samples/client/petstore/objc/default/OpenAPIClient/Model/OAIInlineObject1.m @@ -0,0 +1,34 @@ +#import "OAIInlineObject1.h" + +@implementation OAIInlineObject1 + +- (instancetype)init { + self = [super init]; + if (self) { + // initialize property's default value, if any + + } + return self; +} + + +/** + * Maps json key to property name. + * This method is used by `JSONModel`. + */ ++ (JSONKeyMapper *)keyMapper { + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"additionalMetadata": @"additionalMetadata", @"file": @"file" }]; +} + +/** + * Indicates whether the property with the given name is optional. + * If `propertyName` is optional, then return `YES`, otherwise return `NO`. + * This method is used by `JSONModel`. + */ ++ (BOOL)propertyIsOptional:(NSString *)propertyName { + + NSArray *optionalProperties = @[@"additionalMetadata", @"file"]; + return [optionalProperties containsObject:propertyName]; +} + +@end diff --git a/samples/client/petstore/objc/default/OpenAPIClient/Model/OAIOrder.h b/samples/client/petstore/objc/default/OpenAPIClient/Model/OAIOrder.h new file mode 100644 index 000000000000..688feb5e74d0 --- /dev/null +++ b/samples/client/petstore/objc/default/OpenAPIClient/Model/OAIOrder.h @@ -0,0 +1,39 @@ +#import +#import "OAIObject.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + + + + +@protocol OAIOrder +@end + +@interface OAIOrder : OAIObject + + +@property(nonatomic) NSNumber* _id; + +@property(nonatomic) NSNumber* petId; + +@property(nonatomic) NSNumber* quantity; + +@property(nonatomic) NSDate* shipDate; +/* Order Status [optional] + */ +@property(nonatomic) NSString* status; + +@property(nonatomic) NSNumber* complete; + +@end diff --git a/samples/client/petstore/objc/default/OpenAPIClient/Model/OAIOrder.m b/samples/client/petstore/objc/default/OpenAPIClient/Model/OAIOrder.m new file mode 100644 index 000000000000..5d34737e7c3d --- /dev/null +++ b/samples/client/petstore/objc/default/OpenAPIClient/Model/OAIOrder.m @@ -0,0 +1,34 @@ +#import "OAIOrder.h" + +@implementation OAIOrder + +- (instancetype)init { + self = [super init]; + if (self) { + // initialize property's default value, if any + + } + return self; +} + + +/** + * Maps json key to property name. + * This method is used by `JSONModel`. + */ ++ (JSONKeyMapper *)keyMapper { + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"_id": @"id", @"petId": @"petId", @"quantity": @"quantity", @"shipDate": @"shipDate", @"status": @"status", @"complete": @"complete" }]; +} + +/** + * Indicates whether the property with the given name is optional. + * If `propertyName` is optional, then return `YES`, otherwise return `NO`. + * This method is used by `JSONModel`. + */ ++ (BOOL)propertyIsOptional:(NSString *)propertyName { + + NSArray *optionalProperties = @[@"_id", @"petId", @"quantity", @"shipDate", @"status", @"complete"]; + return [optionalProperties containsObject:propertyName]; +} + +@end diff --git a/samples/client/petstore/objc/default/OpenAPIClient/Model/OAIPet.h b/samples/client/petstore/objc/default/OpenAPIClient/Model/OAIPet.h new file mode 100644 index 000000000000..bb36127b6157 --- /dev/null +++ b/samples/client/petstore/objc/default/OpenAPIClient/Model/OAIPet.h @@ -0,0 +1,45 @@ +#import +#import "OAIObject.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +#import "OAICategory.h" +#import "OAITag.h" +@protocol OAICategory; +@class OAICategory; +@protocol OAITag; +@class OAITag; + + + +@protocol OAIPet +@end + +@interface OAIPet : OAIObject + + +@property(nonatomic) NSNumber* _id; + +@property(nonatomic) OAICategory* category; + +@property(nonatomic) NSString* name; + +@property(nonatomic) NSArray* photoUrls; + +@property(nonatomic) NSArray* tags; +/* pet status in the store [optional] + */ +@property(nonatomic) NSString* status; + +@end diff --git a/samples/client/petstore/objc/default/OpenAPIClient/Model/OAIPet.m b/samples/client/petstore/objc/default/OpenAPIClient/Model/OAIPet.m new file mode 100644 index 000000000000..8a7038881533 --- /dev/null +++ b/samples/client/petstore/objc/default/OpenAPIClient/Model/OAIPet.m @@ -0,0 +1,34 @@ +#import "OAIPet.h" + +@implementation OAIPet + +- (instancetype)init { + self = [super init]; + if (self) { + // initialize property's default value, if any + + } + return self; +} + + +/** + * Maps json key to property name. + * This method is used by `JSONModel`. + */ ++ (JSONKeyMapper *)keyMapper { + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"_id": @"id", @"category": @"category", @"name": @"name", @"photoUrls": @"photoUrls", @"tags": @"tags", @"status": @"status" }]; +} + +/** + * Indicates whether the property with the given name is optional. + * If `propertyName` is optional, then return `YES`, otherwise return `NO`. + * This method is used by `JSONModel`. + */ ++ (BOOL)propertyIsOptional:(NSString *)propertyName { + + NSArray *optionalProperties = @[@"_id", @"category", @"tags", @"status"]; + return [optionalProperties containsObject:propertyName]; +} + +@end diff --git a/samples/client/petstore/objc/default/OpenAPIClient/Model/OAITag.h b/samples/client/petstore/objc/default/OpenAPIClient/Model/OAITag.h new file mode 100644 index 000000000000..8e77a63103d9 --- /dev/null +++ b/samples/client/petstore/objc/default/OpenAPIClient/Model/OAITag.h @@ -0,0 +1,30 @@ +#import +#import "OAIObject.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + + + + +@protocol OAITag +@end + +@interface OAITag : OAIObject + + +@property(nonatomic) NSNumber* _id; + +@property(nonatomic) NSString* name; + +@end diff --git a/samples/client/petstore/objc/default/OpenAPIClient/Model/OAITag.m b/samples/client/petstore/objc/default/OpenAPIClient/Model/OAITag.m new file mode 100644 index 000000000000..75a9b3f1281b --- /dev/null +++ b/samples/client/petstore/objc/default/OpenAPIClient/Model/OAITag.m @@ -0,0 +1,34 @@ +#import "OAITag.h" + +@implementation OAITag + +- (instancetype)init { + self = [super init]; + if (self) { + // initialize property's default value, if any + + } + return self; +} + + +/** + * Maps json key to property name. + * This method is used by `JSONModel`. + */ ++ (JSONKeyMapper *)keyMapper { + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"_id": @"id", @"name": @"name" }]; +} + +/** + * Indicates whether the property with the given name is optional. + * If `propertyName` is optional, then return `YES`, otherwise return `NO`. + * This method is used by `JSONModel`. + */ ++ (BOOL)propertyIsOptional:(NSString *)propertyName { + + NSArray *optionalProperties = @[@"_id", @"name"]; + return [optionalProperties containsObject:propertyName]; +} + +@end diff --git a/samples/client/petstore/objc/default/OpenAPIClient/Model/OAIUser.h b/samples/client/petstore/objc/default/OpenAPIClient/Model/OAIUser.h new file mode 100644 index 000000000000..325ae6f0266c --- /dev/null +++ b/samples/client/petstore/objc/default/OpenAPIClient/Model/OAIUser.h @@ -0,0 +1,43 @@ +#import +#import "OAIObject.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + + + + +@protocol OAIUser +@end + +@interface OAIUser : OAIObject + + +@property(nonatomic) NSNumber* _id; + +@property(nonatomic) NSString* username; + +@property(nonatomic) NSString* firstName; + +@property(nonatomic) NSString* lastName; + +@property(nonatomic) NSString* email; + +@property(nonatomic) NSString* password; + +@property(nonatomic) NSString* phone; +/* User Status [optional] + */ +@property(nonatomic) NSNumber* userStatus; + +@end diff --git a/samples/client/petstore/objc/default/OpenAPIClient/Model/OAIUser.m b/samples/client/petstore/objc/default/OpenAPIClient/Model/OAIUser.m new file mode 100644 index 000000000000..419c6f191cf6 --- /dev/null +++ b/samples/client/petstore/objc/default/OpenAPIClient/Model/OAIUser.m @@ -0,0 +1,34 @@ +#import "OAIUser.h" + +@implementation OAIUser + +- (instancetype)init { + self = [super init]; + if (self) { + // initialize property's default value, if any + + } + return self; +} + + +/** + * Maps json key to property name. + * This method is used by `JSONModel`. + */ ++ (JSONKeyMapper *)keyMapper { + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"_id": @"id", @"username": @"username", @"firstName": @"firstName", @"lastName": @"lastName", @"email": @"email", @"password": @"password", @"phone": @"phone", @"userStatus": @"userStatus" }]; +} + +/** + * Indicates whether the property with the given name is optional. + * If `propertyName` is optional, then return `YES`, otherwise return `NO`. + * This method is used by `JSONModel`. + */ ++ (BOOL)propertyIsOptional:(NSString *)propertyName { + + NSArray *optionalProperties = @[@"_id", @"username", @"firstName", @"lastName", @"email", @"password", @"phone", @"userStatus"]; + return [optionalProperties containsObject:propertyName]; +} + +@end diff --git a/samples/client/petstore/objc/default/README.md b/samples/client/petstore/objc/default/README.md index 10694bd5135b..73f2e2c12169 100644 --- a/samples/client/petstore/objc/default/README.md +++ b/samples/client/petstore/objc/default/README.md @@ -1,4 +1,4 @@ -# SwaggerClient +# OpenAPIClient This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters @@ -18,7 +18,7 @@ The SDK requires [**ARC (Automatic Reference Counting)**](http://stackoverflow.c Add the following to the Podfile: ```ruby -pod 'SwaggerClient', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' +pod 'OpenAPIClient', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' ``` To specify a particular branch, append `, :branch => 'branch-name-here'` @@ -27,10 +27,10 @@ To specify a particular commit, append `, :commit => '11aa22'` ### Install from local path using [CocoaPods](https://cocoapods.org/) -Put the SDK under your project folder (e.g. /path/to/objc_project/Vendor/SwaggerClient) and then add the following to the Podfile: +Put the SDK under your project folder (e.g. /path/to/objc_project/Vendor/OpenAPIClient) and then add the following to the Podfile: ```ruby -pod 'SwaggerClient', :path => 'Vendor/SwaggerClient' +pod 'OpenAPIClient', :path => 'Vendor/OpenAPIClient' ``` ### Usage @@ -38,18 +38,20 @@ pod 'SwaggerClient', :path => 'Vendor/SwaggerClient' Import the following: ```objc -#import -#import +#import +#import // load models -#import -#import -#import -#import -#import +#import +#import +#import +#import +#import +#import +#import // load API classes for accessing endpoints -#import -#import -#import +#import +#import +#import ``` @@ -63,15 +65,15 @@ Please follow the [installation procedure](#installation--usage) and then run th ```objc -SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; +OAIDefaultConfiguration *apiConfig = [OAIDefaultConfiguration sharedConfig]; // Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; -SWGPet* *pet = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional) +OAIPet* *pet = [[OAIPet alloc] init]; // Pet object that needs to be added to the store (optional) -SWGPetApi *apiInstance = [[SWGPetApi alloc] init]; +OAIPetApi *apiInstance = [[OAIPetApi alloc] init]; // Add a new pet to the store [apiInstance addPetWithPet:pet @@ -89,35 +91,37 @@ All URIs are relative to *http://petstore.swagger.io/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*SWGPetApi* | [**addPet**](docs/SWGPetApi.md#addpet) | **POST** /pet | Add a new pet to the store -*SWGPetApi* | [**deletePet**](docs/SWGPetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet -*SWGPetApi* | [**findPetsByStatus**](docs/SWGPetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status -*SWGPetApi* | [**findPetsByTags**](docs/SWGPetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags -*SWGPetApi* | [**getPetById**](docs/SWGPetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID -*SWGPetApi* | [**updatePet**](docs/SWGPetApi.md#updatepet) | **PUT** /pet | Update an existing pet -*SWGPetApi* | [**updatePetWithForm**](docs/SWGPetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data -*SWGPetApi* | [**uploadFile**](docs/SWGPetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image -*SWGStoreApi* | [**deleteOrder**](docs/SWGStoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID -*SWGStoreApi* | [**getInventory**](docs/SWGStoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -*SWGStoreApi* | [**getOrderById**](docs/SWGStoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID -*SWGStoreApi* | [**placeOrder**](docs/SWGStoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet -*SWGUserApi* | [**createUser**](docs/SWGUserApi.md#createuser) | **POST** /user | Create user -*SWGUserApi* | [**createUsersWithArrayInput**](docs/SWGUserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array -*SWGUserApi* | [**createUsersWithListInput**](docs/SWGUserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array -*SWGUserApi* | [**deleteUser**](docs/SWGUserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user -*SWGUserApi* | [**getUserByName**](docs/SWGUserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name -*SWGUserApi* | [**loginUser**](docs/SWGUserApi.md#loginuser) | **GET** /user/login | Logs user into the system -*SWGUserApi* | [**logoutUser**](docs/SWGUserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session -*SWGUserApi* | [**updateUser**](docs/SWGUserApi.md#updateuser) | **PUT** /user/{username} | Updated user +*OAIPetApi* | [**addPet**](docs/OAIPetApi.md#addpet) | **POST** /pet | Add a new pet to the store +*OAIPetApi* | [**deletePet**](docs/OAIPetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +*OAIPetApi* | [**findPetsByStatus**](docs/OAIPetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +*OAIPetApi* | [**findPetsByTags**](docs/OAIPetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +*OAIPetApi* | [**getPetById**](docs/OAIPetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +*OAIPetApi* | [**updatePet**](docs/OAIPetApi.md#updatepet) | **PUT** /pet | Update an existing pet +*OAIPetApi* | [**updatePetWithForm**](docs/OAIPetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +*OAIPetApi* | [**uploadFile**](docs/OAIPetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +*OAIStoreApi* | [**deleteOrder**](docs/OAIStoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*OAIStoreApi* | [**getInventory**](docs/OAIStoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +*OAIStoreApi* | [**getOrderById**](docs/OAIStoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +*OAIStoreApi* | [**placeOrder**](docs/OAIStoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet +*OAIUserApi* | [**createUser**](docs/OAIUserApi.md#createuser) | **POST** /user | Create user +*OAIUserApi* | [**createUsersWithArrayInput**](docs/OAIUserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +*OAIUserApi* | [**createUsersWithListInput**](docs/OAIUserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +*OAIUserApi* | [**deleteUser**](docs/OAIUserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +*OAIUserApi* | [**getUserByName**](docs/OAIUserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +*OAIUserApi* | [**loginUser**](docs/OAIUserApi.md#loginuser) | **GET** /user/login | Logs user into the system +*OAIUserApi* | [**logoutUser**](docs/OAIUserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +*OAIUserApi* | [**updateUser**](docs/OAIUserApi.md#updateuser) | **PUT** /user/{username} | Updated user ## Documentation For Models - - [SWGCategory](docs/SWGCategory.md) - - [SWGOrder](docs/SWGOrder.md) - - [SWGPet](docs/SWGPet.md) - - [SWGTag](docs/SWGTag.md) - - [SWGUser](docs/SWGUser.md) + - [OAICategory](docs/OAICategory.md) + - [OAIInlineObject](docs/OAIInlineObject.md) + - [OAIInlineObject1](docs/OAIInlineObject1.md) + - [OAIOrder](docs/OAIOrder.md) + - [OAIPet](docs/OAIPet.md) + - [OAITag](docs/OAITag.md) + - [OAIUser](docs/OAIUser.md) ## Documentation For Authorization diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.h b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.h index 3783ee23362b..2753fa80578b 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.h @@ -6,7 +6,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -26,12 +26,12 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// Add a new pet to the store /// /// -/// @param pet Pet object that needs to be added to the store (optional) +/// @param body Pet object that needs to be added to the store (optional) /// /// code:405 message:"Invalid input" /// /// @return void --(NSURLSessionTask*) addPetWithPet: (SWGPet*) pet +-(NSURLSessionTask*) addPetWithBody: (SWGPet*) body completionHandler: (void (^)(NSError* error)) handler; @@ -92,14 +92,14 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// Update an existing pet /// /// -/// @param pet Pet object that needs to be added to the store (optional) +/// @param body Pet object that needs to be added to the store (optional) /// /// code:400 message:"Invalid ID supplied", /// code:404 message:"Pet not found", /// code:405 message:"Validation exception" /// /// @return void --(NSURLSessionTask*) updatePetWithPet: (SWGPet*) pet +-(NSURLSessionTask*) updatePetWithBody: (SWGPet*) body completionHandler: (void (^)(NSError* error)) handler; diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.m b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.m index e57006827b99..49f8d5bc3078 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.m +++ b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.m @@ -52,11 +52,11 @@ -(NSDictionary *)defaultHeaders { /// /// Add a new pet to the store /// -/// @param pet Pet object that needs to be added to the store (optional) +/// @param body Pet object that needs to be added to the store (optional) /// /// @returns void /// --(NSURLSessionTask*) addPetWithPet: (SWGPet*) pet +-(NSURLSessionTask*) addPetWithBody: (SWGPet*) body completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"]; @@ -83,7 +83,7 @@ -(NSURLSessionTask*) addPetWithPet: (SWGPet*) pet id bodyParam = nil; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - bodyParam = pet; + bodyParam = body; return [self.apiClient requestWithPath: resourcePath method: @"POST" @@ -193,7 +193,7 @@ -(NSURLSessionTask*) findPetsByStatusWithStatus: (NSArray*) status NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; if (status != nil) { - queryParams[@"status"] = [[SWGQueryParamCollection alloc] initWithValuesAndFormat: status format: @"csv"]; + queryParams[@"status"] = [[SWGQueryParamCollection alloc] initWithValuesAndFormat: status format: @"multi"]; } NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; [headerParams addEntriesFromDictionary:self.defaultHeaders]; @@ -250,7 +250,7 @@ -(NSURLSessionTask*) findPetsByTagsWithTags: (NSArray*) tags NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; if (tags != nil) { - queryParams[@"tags"] = [[SWGQueryParamCollection alloc] initWithValuesAndFormat: tags format: @"csv"]; + queryParams[@"tags"] = [[SWGQueryParamCollection alloc] initWithValuesAndFormat: tags format: @"multi"]; } NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; [headerParams addEntriesFromDictionary:self.defaultHeaders]; @@ -363,11 +363,11 @@ -(NSURLSessionTask*) getPetByIdWithPetId: (NSNumber*) petId /// /// Update an existing pet /// -/// @param pet Pet object that needs to be added to the store (optional) +/// @param body Pet object that needs to be added to the store (optional) /// /// @returns void /// --(NSURLSessionTask*) updatePetWithPet: (SWGPet*) pet +-(NSURLSessionTask*) updatePetWithBody: (SWGPet*) body completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"]; @@ -394,7 +394,7 @@ -(NSURLSessionTask*) updatePetWithPet: (SWGPet*) pet id bodyParam = nil; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - bodyParam = pet; + bodyParam = body; return [self.apiClient requestWithPath: resourcePath method: @"PUT" diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.h b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.h index d578190189c1..52bc78432754 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.h @@ -6,7 +6,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -64,13 +64,13 @@ extern NSInteger kSWGStoreApiMissingParamErrorCode; /// Place an order for a pet /// /// -/// @param order order placed for purchasing the pet (optional) +/// @param body order placed for purchasing the pet (optional) /// /// code:200 message:"successful operation", /// code:400 message:"Invalid Order" /// /// @return SWGOrder* --(NSURLSessionTask*) placeOrderWithOrder: (SWGOrder*) order +-(NSURLSessionTask*) placeOrderWithBody: (SWGOrder*) body completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler; diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.m b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.m index 4231e138bdaf..7d102a5c0d56 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.m +++ b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.m @@ -240,11 +240,11 @@ -(NSURLSessionTask*) getOrderByIdWithOrderId: (NSString*) orderId /// /// Place an order for a pet /// -/// @param order order placed for purchasing the pet (optional) +/// @param body order placed for purchasing the pet (optional) /// /// @returns SWGOrder* /// --(NSURLSessionTask*) placeOrderWithOrder: (SWGOrder*) order +-(NSURLSessionTask*) placeOrderWithBody: (SWGOrder*) body completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/order"]; @@ -271,7 +271,7 @@ -(NSURLSessionTask*) placeOrderWithOrder: (SWGOrder*) order id bodyParam = nil; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - bodyParam = order; + bodyParam = body; return [self.apiClient requestWithPath: resourcePath method: @"POST" diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.h b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.h index 5e0b6bbc8d83..63d35eb8960b 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.h @@ -6,7 +6,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -26,36 +26,36 @@ extern NSInteger kSWGUserApiMissingParamErrorCode; /// Create user /// This can only be done by the logged in user. /// -/// @param user Created user object (optional) +/// @param body Created user object (optional) /// /// code:0 message:"successful operation" /// /// @return void --(NSURLSessionTask*) createUserWithUser: (SWGUser*) user +-(NSURLSessionTask*) createUserWithBody: (SWGUser*) body completionHandler: (void (^)(NSError* error)) handler; /// Creates list of users with given input array /// /// -/// @param user List of user object (optional) +/// @param body List of user object (optional) /// /// code:0 message:"successful operation" /// /// @return void --(NSURLSessionTask*) createUsersWithArrayInputWithUser: (NSArray*) user +-(NSURLSessionTask*) createUsersWithArrayInputWithBody: (NSArray*) body completionHandler: (void (^)(NSError* error)) handler; /// Creates list of users with given input array /// /// -/// @param user List of user object (optional) +/// @param body List of user object (optional) /// /// code:0 message:"successful operation" /// /// @return void --(NSURLSessionTask*) createUsersWithListInputWithUser: (NSArray*) user +-(NSURLSessionTask*) createUsersWithListInputWithBody: (NSArray*) body completionHandler: (void (^)(NSError* error)) handler; @@ -116,14 +116,14 @@ extern NSInteger kSWGUserApiMissingParamErrorCode; /// This can only be done by the logged in user. /// /// @param username name that need to be deleted -/// @param user Updated user object (optional) +/// @param body Updated user object (optional) /// /// code:400 message:"Invalid user supplied", /// code:404 message:"User not found" /// /// @return void -(NSURLSessionTask*) updateUserWithUsername: (NSString*) username - user: (SWGUser*) user + body: (SWGUser*) body completionHandler: (void (^)(NSError* error)) handler; diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.m b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.m index 6ba11b3a44a1..da0d9cb68314 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.m +++ b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.m @@ -52,11 +52,11 @@ -(NSDictionary *)defaultHeaders { /// /// Create user /// This can only be done by the logged in user. -/// @param user Created user object (optional) +/// @param body Created user object (optional) /// /// @returns void /// --(NSURLSessionTask*) createUserWithUser: (SWGUser*) user +-(NSURLSessionTask*) createUserWithBody: (SWGUser*) body completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user"]; @@ -83,7 +83,7 @@ -(NSURLSessionTask*) createUserWithUser: (SWGUser*) user id bodyParam = nil; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - bodyParam = user; + bodyParam = body; return [self.apiClient requestWithPath: resourcePath method: @"POST" @@ -107,11 +107,11 @@ -(NSURLSessionTask*) createUserWithUser: (SWGUser*) user /// /// Creates list of users with given input array /// -/// @param user List of user object (optional) +/// @param body List of user object (optional) /// /// @returns void /// --(NSURLSessionTask*) createUsersWithArrayInputWithUser: (NSArray*) user +-(NSURLSessionTask*) createUsersWithArrayInputWithBody: (NSArray*) body completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/createWithArray"]; @@ -138,7 +138,7 @@ -(NSURLSessionTask*) createUsersWithArrayInputWithUser: (NSArray*) user id bodyParam = nil; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - bodyParam = user; + bodyParam = body; return [self.apiClient requestWithPath: resourcePath method: @"POST" @@ -162,11 +162,11 @@ -(NSURLSessionTask*) createUsersWithArrayInputWithUser: (NSArray*) user /// /// Creates list of users with given input array /// -/// @param user List of user object (optional) +/// @param body List of user object (optional) /// /// @returns void /// --(NSURLSessionTask*) createUsersWithListInputWithUser: (NSArray*) user +-(NSURLSessionTask*) createUsersWithListInputWithBody: (NSArray*) body completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/createWithList"]; @@ -193,7 +193,7 @@ -(NSURLSessionTask*) createUsersWithListInputWithUser: (NSArray*) user id bodyParam = nil; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - bodyParam = user; + bodyParam = body; return [self.apiClient requestWithPath: resourcePath method: @"POST" @@ -470,12 +470,12 @@ -(NSURLSessionTask*) logoutUserWithCompletionHandler: /// This can only be done by the logged in user. /// @param username name that need to be deleted /// -/// @param user Updated user object (optional) +/// @param body Updated user object (optional) /// /// @returns void /// -(NSURLSessionTask*) updateUserWithUsername: (NSString*) username - user: (SWGUser*) user + body: (SWGUser*) body completionHandler: (void (^)(NSError* error)) handler { // verify the required parameter 'username' is set if (username == nil) { @@ -516,7 +516,7 @@ -(NSURLSessionTask*) updateUserWithUsername: (NSString*) username id bodyParam = nil; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - bodyParam = user; + bodyParam = body; return [self.apiClient requestWithPath: resourcePath method: @"PUT" diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/JSONValueTransformer+ISO8601.h b/samples/client/petstore/objc/default/SwaggerClient/Core/JSONValueTransformer+ISO8601.h index 3925ca3728f8..5179ca2e99b8 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/JSONValueTransformer+ISO8601.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/JSONValueTransformer+ISO8601.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApi.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApi.h index 2ac4a2cdc785..6c0396f0cac5 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApi.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApi.h @@ -6,7 +6,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.h index 844893553809..04558b3d0a05 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.h @@ -7,7 +7,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGConfiguration.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGConfiguration.h index 1c3c741442de..f6b12de5c5c3 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGConfiguration.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGConfiguration.h @@ -6,7 +6,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.h index 24d89beeb61e..e141e0d092d5 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -93,7 +93,7 @@ /** * Sets API key * - * To remove a apiKey for an identifier, just set the apiKey to nil. + * To remove an apiKey for an identifier, just set the apiKey to nil. * * @param apiKey API key or token. * @param identifier API key identifier (authentication schema). diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGJSONRequestSerializer.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGJSONRequestSerializer.h index 500664a38c51..943ab1323133 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGJSONRequestSerializer.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGJSONRequestSerializer.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGLogger.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGLogger.h index bb3cb672c3eb..23f57acd7b8a 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGLogger.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGLogger.h @@ -4,7 +4,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGObject.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGObject.h index 047f52c2bb5f..7d7112c5976a 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGObject.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGObject.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGQueryParamCollection.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGQueryParamCollection.h index 2fd7c6dbec8b..4bd35d86f352 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGQueryParamCollection.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGQueryParamCollection.h @@ -4,7 +4,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGResponseDeserializer.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGResponseDeserializer.h index e51705deb256..68f83704f495 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGResponseDeserializer.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGResponseDeserializer.h @@ -4,7 +4,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -49,7 +49,7 @@ extern NSInteger const SWGUnknownResponseObjectErrorCode; @interface SWGResponseDeserializer : NSObject /** - * If an null value occurs in dictionary or array if set to YES whole response will be invalid else will be ignored + * If a null value occurs in dictionary or array if set to YES whole response will be invalid else will be ignored * @default NO */ @property (nonatomic, assign) BOOL treatNullAsError; diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGSanitizer.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGSanitizer.h index 4a2bea99fd05..83853bec8cf0 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGSanitizer.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGSanitizer.h @@ -4,7 +4,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGCategory.h b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGCategory.h index efe582a11a46..31eb9e6b31ca 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGCategory.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGCategory.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGOrder.h b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGOrder.h index 11f27bdba3f8..5ea7a94cfcbe 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGOrder.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGOrder.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGPet.h b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGPet.h index b3586e9ea821..4b3729193265 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGPet.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGPet.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGTag.h b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGTag.h index 991526f5d5aa..cdcedfd916bb 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGTag.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGTag.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGUser.h b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGUser.h index de28b05c42e2..7786883ed29c 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGUser.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGUser.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/default/docs/OAICategory.md b/samples/client/petstore/objc/default/docs/OAICategory.md new file mode 100644 index 000000000000..0cded0181f4a --- /dev/null +++ b/samples/client/petstore/objc/default/docs/OAICategory.md @@ -0,0 +1,11 @@ +# OAICategory + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **NSNumber*** | | [optional] +**name** | **NSString*** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/objc/default/docs/OAIInlineObject.md b/samples/client/petstore/objc/default/docs/OAIInlineObject.md new file mode 100644 index 000000000000..a9418ef70254 --- /dev/null +++ b/samples/client/petstore/objc/default/docs/OAIInlineObject.md @@ -0,0 +1,11 @@ +# OAIInlineObject + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **NSString*** | Updated name of the pet | [optional] +**status** | **NSString*** | Updated status of the pet | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/objc/default/docs/OAIInlineObject1.md b/samples/client/petstore/objc/default/docs/OAIInlineObject1.md new file mode 100644 index 000000000000..139b50ac372b --- /dev/null +++ b/samples/client/petstore/objc/default/docs/OAIInlineObject1.md @@ -0,0 +1,11 @@ +# OAIInlineObject1 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**additionalMetadata** | **NSString*** | Additional data to pass to server | [optional] +**file** | **NSURL*** | file to upload | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/objc/default/docs/OAIOrder.md b/samples/client/petstore/objc/default/docs/OAIOrder.md new file mode 100644 index 000000000000..2783b6073aa0 --- /dev/null +++ b/samples/client/petstore/objc/default/docs/OAIOrder.md @@ -0,0 +1,15 @@ +# OAIOrder + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **NSNumber*** | | [optional] +**petId** | **NSNumber*** | | [optional] +**quantity** | **NSNumber*** | | [optional] +**shipDate** | **NSDate*** | | [optional] +**status** | **NSString*** | Order Status | [optional] +**complete** | **NSNumber*** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/objc/default/docs/OAIPet.md b/samples/client/petstore/objc/default/docs/OAIPet.md new file mode 100644 index 000000000000..6fa891cfb1fb --- /dev/null +++ b/samples/client/petstore/objc/default/docs/OAIPet.md @@ -0,0 +1,15 @@ +# OAIPet + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **NSNumber*** | | [optional] +**category** | [**OAICategory***](OAICategory.md) | | [optional] +**name** | **NSString*** | | +**photoUrls** | **NSArray<NSString*>*** | | +**tags** | [**NSArray<OAITag>***](OAITag.md) | | [optional] +**status** | **NSString*** | pet status in the store | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/objc/default/docs/OAIPetApi.md b/samples/client/petstore/objc/default/docs/OAIPetApi.md new file mode 100644 index 000000000000..5272f6809587 --- /dev/null +++ b/samples/client/petstore/objc/default/docs/OAIPetApi.md @@ -0,0 +1,456 @@ +# OAIPetApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addPet**](OAIPetApi.md#addpet) | **POST** /pet | Add a new pet to the store +[**deletePet**](OAIPetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +[**findPetsByStatus**](OAIPetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +[**findPetsByTags**](OAIPetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +[**getPetById**](OAIPetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +[**updatePet**](OAIPetApi.md#updatepet) | **PUT** /pet | Update an existing pet +[**updatePetWithForm**](OAIPetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +[**uploadFile**](OAIPetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image + + +# **addPet** +```objc +-(NSURLSessionTask*) addPetWithPet: (OAIPet*) pet + completionHandler: (void (^)(NSError* error)) handler; +``` + +Add a new pet to the store + +### Example +```objc +OAIDefaultConfiguration *apiConfig = [OAIDefaultConfiguration sharedConfig]; + +// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) +[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; + + +OAIPet* pet = [[OAIPet alloc] init]; // Pet object that needs to be added to the store (optional) + +OAIPetApi*apiInstance = [[OAIPetApi alloc] init]; + +// Add a new pet to the store +[apiInstance addPetWithPet:pet + completionHandler: ^(NSError* error) { + if (error) { + NSLog(@"Error calling OAIPetApi->addPet: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**OAIPet***](OAIPet.md)| Pet object that needs to be added to the store | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **deletePet** +```objc +-(NSURLSessionTask*) deletePetWithPetId: (NSNumber*) petId + apiKey: (NSString*) apiKey + completionHandler: (void (^)(NSError* error)) handler; +``` + +Deletes a pet + +### Example +```objc +OAIDefaultConfiguration *apiConfig = [OAIDefaultConfiguration sharedConfig]; + +// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) +[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; + + +NSNumber* petId = @56; // Pet id to delete +NSString* apiKey = @"apiKey_example"; // (optional) + +OAIPetApi*apiInstance = [[OAIPetApi alloc] init]; + +// Deletes a pet +[apiInstance deletePetWithPetId:petId + apiKey:apiKey + completionHandler: ^(NSError* error) { + if (error) { + NSLog(@"Error calling OAIPetApi->deletePet: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **NSNumber***| Pet id to delete | + **apiKey** | **NSString***| | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **findPetsByStatus** +```objc +-(NSURLSessionTask*) findPetsByStatusWithStatus: (NSArray*) status + completionHandler: (void (^)(NSArray* output, NSError* error)) handler; +``` + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example +```objc +OAIDefaultConfiguration *apiConfig = [OAIDefaultConfiguration sharedConfig]; + +// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) +[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; + + +NSArray* status = @[@"status_example"]; // Status values that need to be considered for filter (optional) + +OAIPetApi*apiInstance = [[OAIPetApi alloc] init]; + +// Finds Pets by status +[apiInstance findPetsByStatusWithStatus:status + completionHandler: ^(NSArray* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling OAIPetApi->findPetsByStatus: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | [**NSArray<NSString*>***](NSString*.md)| Status values that need to be considered for filter | [optional] + +### Return type + +[**NSArray***](OAIPet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/xml + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **findPetsByTags** +```objc +-(NSURLSessionTask*) findPetsByTagsWithTags: (NSArray*) tags + completionHandler: (void (^)(NSArray* output, NSError* error)) handler; +``` + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example +```objc +OAIDefaultConfiguration *apiConfig = [OAIDefaultConfiguration sharedConfig]; + +// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) +[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; + + +NSArray* tags = @[@"tags_example"]; // Tags to filter by (optional) + +OAIPetApi*apiInstance = [[OAIPetApi alloc] init]; + +// Finds Pets by tags +[apiInstance findPetsByTagsWithTags:tags + completionHandler: ^(NSArray* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling OAIPetApi->findPetsByTags: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**NSArray<NSString*>***](NSString*.md)| Tags to filter by | [optional] + +### Return type + +[**NSArray***](OAIPet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/xml + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getPetById** +```objc +-(NSURLSessionTask*) getPetByIdWithPetId: (NSNumber*) petId + completionHandler: (void (^)(OAIPet* output, NSError* error)) handler; +``` + +Find pet by ID + +Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions + +### Example +```objc +OAIDefaultConfiguration *apiConfig = [OAIDefaultConfiguration sharedConfig]; + +// Configure API key authorization: (authentication scheme: api_key) +[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"api_key"]; +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"api_key"]; + +// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) +[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; + + +NSNumber* petId = @56; // ID of pet that needs to be fetched + +OAIPetApi*apiInstance = [[OAIPetApi alloc] init]; + +// Find pet by ID +[apiInstance getPetByIdWithPetId:petId + completionHandler: ^(OAIPet* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling OAIPetApi->getPetById: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **NSNumber***| ID of pet that needs to be fetched | + +### Return type + +[**OAIPet***](OAIPet.md) + +### Authorization + +[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/xml + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updatePet** +```objc +-(NSURLSessionTask*) updatePetWithPet: (OAIPet*) pet + completionHandler: (void (^)(NSError* error)) handler; +``` + +Update an existing pet + +### Example +```objc +OAIDefaultConfiguration *apiConfig = [OAIDefaultConfiguration sharedConfig]; + +// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) +[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; + + +OAIPet* pet = [[OAIPet alloc] init]; // Pet object that needs to be added to the store (optional) + +OAIPetApi*apiInstance = [[OAIPetApi alloc] init]; + +// Update an existing pet +[apiInstance updatePetWithPet:pet + completionHandler: ^(NSError* error) { + if (error) { + NSLog(@"Error calling OAIPetApi->updatePet: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**OAIPet***](OAIPet.md)| Pet object that needs to be added to the store | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updatePetWithForm** +```objc +-(NSURLSessionTask*) updatePetWithFormWithPetId: (NSString*) petId + name: (NSString*) name + status: (NSString*) status + completionHandler: (void (^)(NSError* error)) handler; +``` + +Updates a pet in the store with form data + +### Example +```objc +OAIDefaultConfiguration *apiConfig = [OAIDefaultConfiguration sharedConfig]; + +// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) +[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; + + +NSString* petId = @"petId_example"; // ID of pet that needs to be updated +NSString* name = @"name_example"; // Updated name of the pet (optional) +NSString* status = @"status_example"; // Updated status of the pet (optional) + +OAIPetApi*apiInstance = [[OAIPetApi alloc] init]; + +// Updates a pet in the store with form data +[apiInstance updatePetWithFormWithPetId:petId + name:name + status:status + completionHandler: ^(NSError* error) { + if (error) { + NSLog(@"Error calling OAIPetApi->updatePetWithForm: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **NSString***| ID of pet that needs to be updated | + **name** | **NSString***| Updated name of the pet | [optional] + **status** | **NSString***| Updated status of the pet | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **uploadFile** +```objc +-(NSURLSessionTask*) uploadFileWithPetId: (NSNumber*) petId + additionalMetadata: (NSString*) additionalMetadata + file: (NSURL*) file + completionHandler: (void (^)(NSError* error)) handler; +``` + +uploads an image + +### Example +```objc +OAIDefaultConfiguration *apiConfig = [OAIDefaultConfiguration sharedConfig]; + +// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) +[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; + + +NSNumber* petId = @56; // ID of pet to update +NSString* additionalMetadata = @"additionalMetadata_example"; // Additional data to pass to server (optional) +NSURL* file = [NSURL fileURLWithPath:@"/path/to/file"]; // file to upload (optional) + +OAIPetApi*apiInstance = [[OAIPetApi alloc] init]; + +// uploads an image +[apiInstance uploadFileWithPetId:petId + additionalMetadata:additionalMetadata + file:file + completionHandler: ^(NSError* error) { + if (error) { + NSLog(@"Error calling OAIPetApi->uploadFile: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **NSNumber***| ID of pet to update | + **additionalMetadata** | **NSString***| Additional data to pass to server | [optional] + **file** | **NSURL*****NSURL***| file to upload | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/objc/default/docs/OAIStoreApi.md b/samples/client/petstore/objc/default/docs/OAIStoreApi.md new file mode 100644 index 000000000000..2a1e597bc1e0 --- /dev/null +++ b/samples/client/petstore/objc/default/docs/OAIStoreApi.md @@ -0,0 +1,210 @@ +# OAIStoreApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deleteOrder**](OAIStoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +[**getInventory**](OAIStoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +[**getOrderById**](OAIStoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +[**placeOrder**](OAIStoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet + + +# **deleteOrder** +```objc +-(NSURLSessionTask*) deleteOrderWithOrderId: (NSString*) orderId + completionHandler: (void (^)(NSError* error)) handler; +``` + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example +```objc + +NSString* orderId = @"orderId_example"; // ID of the order that needs to be deleted + +OAIStoreApi*apiInstance = [[OAIStoreApi alloc] init]; + +// Delete purchase order by ID +[apiInstance deleteOrderWithOrderId:orderId + completionHandler: ^(NSError* error) { + if (error) { + NSLog(@"Error calling OAIStoreApi->deleteOrder: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **NSString***| ID of the order that needs to be deleted | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getInventory** +```objc +-(NSURLSessionTask*) getInventoryWithCompletionHandler: + (void (^)(NSDictionary* output, NSError* error)) handler; +``` + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```objc +OAIDefaultConfiguration *apiConfig = [OAIDefaultConfiguration sharedConfig]; + +// Configure API key authorization: (authentication scheme: api_key) +[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"api_key"]; +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"api_key"]; + + + +OAIStoreApi*apiInstance = [[OAIStoreApi alloc] init]; + +// Returns pet inventories by status +[apiInstance getInventoryWithCompletionHandler: + ^(NSDictionary* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling OAIStoreApi->getInventory: %@", error); + } + }]; +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**NSDictionary*** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/xml + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getOrderById** +```objc +-(NSURLSessionTask*) getOrderByIdWithOrderId: (NSString*) orderId + completionHandler: (void (^)(OAIOrder* output, NSError* error)) handler; +``` + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example +```objc + +NSString* orderId = @"orderId_example"; // ID of pet that needs to be fetched + +OAIStoreApi*apiInstance = [[OAIStoreApi alloc] init]; + +// Find purchase order by ID +[apiInstance getOrderByIdWithOrderId:orderId + completionHandler: ^(OAIOrder* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling OAIStoreApi->getOrderById: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **NSString***| ID of pet that needs to be fetched | + +### Return type + +[**OAIOrder***](OAIOrder.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/xml + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **placeOrder** +```objc +-(NSURLSessionTask*) placeOrderWithOrder: (OAIOrder*) order + completionHandler: (void (^)(OAIOrder* output, NSError* error)) handler; +``` + +Place an order for a pet + +### Example +```objc + +OAIOrder* order = [[OAIOrder alloc] init]; // order placed for purchasing the pet (optional) + +OAIStoreApi*apiInstance = [[OAIStoreApi alloc] init]; + +// Place an order for a pet +[apiInstance placeOrderWithOrder:order + completionHandler: ^(OAIOrder* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling OAIStoreApi->placeOrder: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order** | [**OAIOrder***](OAIOrder.md)| order placed for purchasing the pet | [optional] + +### Return type + +[**OAIOrder***](OAIOrder.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json, application/xml + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/objc/default/docs/OAITag.md b/samples/client/petstore/objc/default/docs/OAITag.md new file mode 100644 index 000000000000..149d42061ae1 --- /dev/null +++ b/samples/client/petstore/objc/default/docs/OAITag.md @@ -0,0 +1,11 @@ +# OAITag + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **NSNumber*** | | [optional] +**name** | **NSString*** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/objc/default/docs/OAIUser.md b/samples/client/petstore/objc/default/docs/OAIUser.md new file mode 100644 index 000000000000..5e26aaee7e7d --- /dev/null +++ b/samples/client/petstore/objc/default/docs/OAIUser.md @@ -0,0 +1,17 @@ +# OAIUser + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **NSNumber*** | | [optional] +**username** | **NSString*** | | [optional] +**firstName** | **NSString*** | | [optional] +**lastName** | **NSString*** | | [optional] +**email** | **NSString*** | | [optional] +**password** | **NSString*** | | [optional] +**phone** | **NSString*** | | [optional] +**userStatus** | **NSNumber*** | User Status | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/objc/default/docs/OAIUserApi.md b/samples/client/petstore/objc/default/docs/OAIUserApi.md new file mode 100644 index 000000000000..f3828ead2905 --- /dev/null +++ b/samples/client/petstore/objc/default/docs/OAIUserApi.md @@ -0,0 +1,392 @@ +# OAIUserApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createUser**](OAIUserApi.md#createuser) | **POST** /user | Create user +[**createUsersWithArrayInput**](OAIUserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +[**createUsersWithListInput**](OAIUserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +[**deleteUser**](OAIUserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +[**getUserByName**](OAIUserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +[**loginUser**](OAIUserApi.md#loginuser) | **GET** /user/login | Logs user into the system +[**logoutUser**](OAIUserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +[**updateUser**](OAIUserApi.md#updateuser) | **PUT** /user/{username} | Updated user + + +# **createUser** +```objc +-(NSURLSessionTask*) createUserWithUser: (OAIUser*) user + completionHandler: (void (^)(NSError* error)) handler; +``` + +Create user + +This can only be done by the logged in user. + +### Example +```objc + +OAIUser* user = [[OAIUser alloc] init]; // Created user object (optional) + +OAIUserApi*apiInstance = [[OAIUserApi alloc] init]; + +// Create user +[apiInstance createUserWithUser:user + completionHandler: ^(NSError* error) { + if (error) { + NSLog(@"Error calling OAIUserApi->createUser: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**OAIUser***](OAIUser.md)| Created user object | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **createUsersWithArrayInput** +```objc +-(NSURLSessionTask*) createUsersWithArrayInputWithUser: (NSArray*) user + completionHandler: (void (^)(NSError* error)) handler; +``` + +Creates list of users with given input array + +### Example +```objc + +NSArray* user = @[[[OAIUser alloc] init]]; // List of user object (optional) + +OAIUserApi*apiInstance = [[OAIUserApi alloc] init]; + +// Creates list of users with given input array +[apiInstance createUsersWithArrayInputWithUser:user + completionHandler: ^(NSError* error) { + if (error) { + NSLog(@"Error calling OAIUserApi->createUsersWithArrayInput: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**NSArray<OAIUser>***](OAIUser.md)| List of user object | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **createUsersWithListInput** +```objc +-(NSURLSessionTask*) createUsersWithListInputWithUser: (NSArray*) user + completionHandler: (void (^)(NSError* error)) handler; +``` + +Creates list of users with given input array + +### Example +```objc + +NSArray* user = @[[[OAIUser alloc] init]]; // List of user object (optional) + +OAIUserApi*apiInstance = [[OAIUserApi alloc] init]; + +// Creates list of users with given input array +[apiInstance createUsersWithListInputWithUser:user + completionHandler: ^(NSError* error) { + if (error) { + NSLog(@"Error calling OAIUserApi->createUsersWithListInput: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**NSArray<OAIUser>***](OAIUser.md)| List of user object | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **deleteUser** +```objc +-(NSURLSessionTask*) deleteUserWithUsername: (NSString*) username + completionHandler: (void (^)(NSError* error)) handler; +``` + +Delete user + +This can only be done by the logged in user. + +### Example +```objc + +NSString* username = @"username_example"; // The name that needs to be deleted + +OAIUserApi*apiInstance = [[OAIUserApi alloc] init]; + +// Delete user +[apiInstance deleteUserWithUsername:username + completionHandler: ^(NSError* error) { + if (error) { + NSLog(@"Error calling OAIUserApi->deleteUser: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **NSString***| The name that needs to be deleted | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getUserByName** +```objc +-(NSURLSessionTask*) getUserByNameWithUsername: (NSString*) username + completionHandler: (void (^)(OAIUser* output, NSError* error)) handler; +``` + +Get user by user name + +### Example +```objc + +NSString* username = @"username_example"; // The name that needs to be fetched. Use user1 for testing. + +OAIUserApi*apiInstance = [[OAIUserApi alloc] init]; + +// Get user by user name +[apiInstance getUserByNameWithUsername:username + completionHandler: ^(OAIUser* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling OAIUserApi->getUserByName: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **NSString***| The name that needs to be fetched. Use user1 for testing. | + +### Return type + +[**OAIUser***](OAIUser.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/xml + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **loginUser** +```objc +-(NSURLSessionTask*) loginUserWithUsername: (NSString*) username + password: (NSString*) password + completionHandler: (void (^)(NSString* output, NSError* error)) handler; +``` + +Logs user into the system + +### Example +```objc + +NSString* username = @"username_example"; // The user name for login (optional) +NSString* password = @"password_example"; // The password for login in clear text (optional) + +OAIUserApi*apiInstance = [[OAIUserApi alloc] init]; + +// Logs user into the system +[apiInstance loginUserWithUsername:username + password:password + completionHandler: ^(NSString* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling OAIUserApi->loginUser: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **NSString***| The user name for login | [optional] + **password** | **NSString***| The password for login in clear text | [optional] + +### Return type + +**NSString*** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/xml + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **logoutUser** +```objc +-(NSURLSessionTask*) logoutUserWithCompletionHandler: + (void (^)(NSError* error)) handler; +``` + +Logs out current logged in user session + +### Example +```objc + + +OAIUserApi*apiInstance = [[OAIUserApi alloc] init]; + +// Logs out current logged in user session +[apiInstance logoutUserWithCompletionHandler: + ^(NSError* error) { + if (error) { + NSLog(@"Error calling OAIUserApi->logoutUser: %@", error); + } + }]; +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updateUser** +```objc +-(NSURLSessionTask*) updateUserWithUsername: (NSString*) username + user: (OAIUser*) user + completionHandler: (void (^)(NSError* error)) handler; +``` + +Updated user + +This can only be done by the logged in user. + +### Example +```objc + +NSString* username = @"username_example"; // name that need to be deleted +OAIUser* user = [[OAIUser alloc] init]; // Updated user object (optional) + +OAIUserApi*apiInstance = [[OAIUserApi alloc] init]; + +// Updated user +[apiInstance updateUserWithUsername:username + user:user + completionHandler: ^(NSError* error) { + if (error) { + NSLog(@"Error calling OAIUserApi->updateUser: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **NSString***| name that need to be deleted | + **user** | [**OAIUser***](OAIUser.md)| Updated user object | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/objc/default/docs/SWGPetApi.md b/samples/client/petstore/objc/default/docs/SWGPetApi.md index e2dde91d7987..9f426a7e5ac9 100644 --- a/samples/client/petstore/objc/default/docs/SWGPetApi.md +++ b/samples/client/petstore/objc/default/docs/SWGPetApi.md @@ -16,7 +16,7 @@ Method | HTTP request | Description # **addPet** ```objc --(NSURLSessionTask*) addPetWithPet: (SWGPet*) pet +-(NSURLSessionTask*) addPetWithBody: (SWGPet*) body completionHandler: (void (^)(NSError* error)) handler; ``` @@ -30,12 +30,12 @@ SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; -SWGPet* pet = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional) +SWGPet* body = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional) SWGPetApi*apiInstance = [[SWGPetApi alloc] init]; // Add a new pet to the store -[apiInstance addPetWithPet:pet +[apiInstance addPetWithBody:body completionHandler: ^(NSError* error) { if (error) { NSLog(@"Error calling SWGPetApi->addPet: %@", error); @@ -47,7 +47,7 @@ SWGPetApi*apiInstance = [[SWGPetApi alloc] init]; Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet** | [**SWGPet***](SWGPet.md)| Pet object that needs to be added to the store | [optional] + **body** | [**SWGPet***](SWGPet.md)| Pet object that needs to be added to the store | [optional] ### Return type @@ -290,7 +290,7 @@ Name | Type | Description | Notes # **updatePet** ```objc --(NSURLSessionTask*) updatePetWithPet: (SWGPet*) pet +-(NSURLSessionTask*) updatePetWithBody: (SWGPet*) body completionHandler: (void (^)(NSError* error)) handler; ``` @@ -304,12 +304,12 @@ SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; -SWGPet* pet = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional) +SWGPet* body = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional) SWGPetApi*apiInstance = [[SWGPetApi alloc] init]; // Update an existing pet -[apiInstance updatePetWithPet:pet +[apiInstance updatePetWithBody:body completionHandler: ^(NSError* error) { if (error) { NSLog(@"Error calling SWGPetApi->updatePet: %@", error); @@ -321,7 +321,7 @@ SWGPetApi*apiInstance = [[SWGPetApi alloc] init]; Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet** | [**SWGPet***](SWGPet.md)| Pet object that needs to be added to the store | [optional] + **body** | [**SWGPet***](SWGPet.md)| Pet object that needs to be added to the store | [optional] ### Return type diff --git a/samples/client/petstore/objc/default/docs/SWGStoreApi.md b/samples/client/petstore/objc/default/docs/SWGStoreApi.md index 572b556ac041..cebab19d2bfa 100644 --- a/samples/client/petstore/objc/default/docs/SWGStoreApi.md +++ b/samples/client/petstore/objc/default/docs/SWGStoreApi.md @@ -162,7 +162,7 @@ No authorization required # **placeOrder** ```objc --(NSURLSessionTask*) placeOrderWithOrder: (SWGOrder*) order +-(NSURLSessionTask*) placeOrderWithBody: (SWGOrder*) body completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler; ``` @@ -171,12 +171,12 @@ Place an order for a pet ### Example ```objc -SWGOrder* order = [[SWGOrder alloc] init]; // order placed for purchasing the pet (optional) +SWGOrder* body = [[SWGOrder alloc] init]; // order placed for purchasing the pet (optional) SWGStoreApi*apiInstance = [[SWGStoreApi alloc] init]; // Place an order for a pet -[apiInstance placeOrderWithOrder:order +[apiInstance placeOrderWithBody:body completionHandler: ^(SWGOrder* output, NSError* error) { if (output) { NSLog(@"%@", output); @@ -191,7 +191,7 @@ SWGStoreApi*apiInstance = [[SWGStoreApi alloc] init]; Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **order** | [**SWGOrder***](SWGOrder.md)| order placed for purchasing the pet | [optional] + **body** | [**SWGOrder***](SWGOrder.md)| order placed for purchasing the pet | [optional] ### Return type diff --git a/samples/client/petstore/objc/default/docs/SWGUserApi.md b/samples/client/petstore/objc/default/docs/SWGUserApi.md index 8d28e604d0b3..f512a4fdeb6f 100644 --- a/samples/client/petstore/objc/default/docs/SWGUserApi.md +++ b/samples/client/petstore/objc/default/docs/SWGUserApi.md @@ -16,7 +16,7 @@ Method | HTTP request | Description # **createUser** ```objc --(NSURLSessionTask*) createUserWithUser: (SWGUser*) user +-(NSURLSessionTask*) createUserWithBody: (SWGUser*) body completionHandler: (void (^)(NSError* error)) handler; ``` @@ -27,12 +27,12 @@ This can only be done by the logged in user. ### Example ```objc -SWGUser* user = [[SWGUser alloc] init]; // Created user object (optional) +SWGUser* body = [[SWGUser alloc] init]; // Created user object (optional) SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; // Create user -[apiInstance createUserWithUser:user +[apiInstance createUserWithBody:body completionHandler: ^(NSError* error) { if (error) { NSLog(@"Error calling SWGUserApi->createUser: %@", error); @@ -44,7 +44,7 @@ SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**SWGUser***](SWGUser.md)| Created user object | [optional] + **body** | [**SWGUser***](SWGUser.md)| Created user object | [optional] ### Return type @@ -63,7 +63,7 @@ No authorization required # **createUsersWithArrayInput** ```objc --(NSURLSessionTask*) createUsersWithArrayInputWithUser: (NSArray*) user +-(NSURLSessionTask*) createUsersWithArrayInputWithBody: (NSArray*) body completionHandler: (void (^)(NSError* error)) handler; ``` @@ -72,12 +72,12 @@ Creates list of users with given input array ### Example ```objc -NSArray* user = @[[[NSArray alloc] init]]; // List of user object (optional) +NSArray* body = @[[[SWGUser alloc] init]]; // List of user object (optional) SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; // Creates list of users with given input array -[apiInstance createUsersWithArrayInputWithUser:user +[apiInstance createUsersWithArrayInputWithBody:body completionHandler: ^(NSError* error) { if (error) { NSLog(@"Error calling SWGUserApi->createUsersWithArrayInput: %@", error); @@ -89,7 +89,7 @@ SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**NSArray<SWGUser>***](NSArray.md)| List of user object | [optional] + **body** | [**NSArray<SWGUser>***](SWGUser.md)| List of user object | [optional] ### Return type @@ -108,7 +108,7 @@ No authorization required # **createUsersWithListInput** ```objc --(NSURLSessionTask*) createUsersWithListInputWithUser: (NSArray*) user +-(NSURLSessionTask*) createUsersWithListInputWithBody: (NSArray*) body completionHandler: (void (^)(NSError* error)) handler; ``` @@ -117,12 +117,12 @@ Creates list of users with given input array ### Example ```objc -NSArray* user = @[[[NSArray alloc] init]]; // List of user object (optional) +NSArray* body = @[[[SWGUser alloc] init]]; // List of user object (optional) SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; // Creates list of users with given input array -[apiInstance createUsersWithListInputWithUser:user +[apiInstance createUsersWithListInputWithBody:body completionHandler: ^(NSError* error) { if (error) { NSLog(@"Error calling SWGUserApi->createUsersWithListInput: %@", error); @@ -134,7 +134,7 @@ SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**NSArray<SWGUser>***](NSArray.md)| List of user object | [optional] + **body** | [**NSArray<SWGUser>***](SWGUser.md)| List of user object | [optional] ### Return type @@ -342,7 +342,7 @@ No authorization required # **updateUser** ```objc -(NSURLSessionTask*) updateUserWithUsername: (NSString*) username - user: (SWGUser*) user + body: (SWGUser*) body completionHandler: (void (^)(NSError* error)) handler; ``` @@ -354,13 +354,13 @@ This can only be done by the logged in user. ```objc NSString* username = @"username_example"; // name that need to be deleted -SWGUser* user = [[SWGUser alloc] init]; // Updated user object (optional) +SWGUser* body = [[SWGUser alloc] init]; // Updated user object (optional) SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; // Updated user [apiInstance updateUserWithUsername:username - user:user + body:body completionHandler: ^(NSError* error) { if (error) { NSLog(@"Error calling SWGUserApi->updateUser: %@", error); @@ -373,7 +373,7 @@ SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **NSString***| name that need to be deleted | - **user** | [**SWGUser***](SWGUser.md)| Updated user object | [optional] + **body** | [**SWGUser***](SWGUser.md)| Updated user object | [optional] ### Return type diff --git a/samples/client/petstore/perl/README.md b/samples/client/petstore/perl/README.md index ee3b37778233..e6d44314a57f 100644 --- a/samples/client/petstore/perl/README.md +++ b/samples/client/petstore/perl/README.md @@ -222,6 +222,7 @@ Each of these calls returns a hashref with various useful pieces of information. To load the API packages: ```perl use WWW::OpenAPIClient::AnotherFakeApi; +use WWW::OpenAPIClient::DefaultApi; use WWW::OpenAPIClient::FakeApi; use WWW::OpenAPIClient::FakeClassnameTags123Api; use WWW::OpenAPIClient::PetApi; @@ -232,14 +233,7 @@ use WWW::OpenAPIClient::UserApi; To load the models: ```perl -use WWW::OpenAPIClient::Object::AdditionalPropertiesAnyType; -use WWW::OpenAPIClient::Object::AdditionalPropertiesArray; -use WWW::OpenAPIClient::Object::AdditionalPropertiesBoolean; use WWW::OpenAPIClient::Object::AdditionalPropertiesClass; -use WWW::OpenAPIClient::Object::AdditionalPropertiesInteger; -use WWW::OpenAPIClient::Object::AdditionalPropertiesNumber; -use WWW::OpenAPIClient::Object::AdditionalPropertiesObject; -use WWW::OpenAPIClient::Object::AdditionalPropertiesString; use WWW::OpenAPIClient::Object::Animal; use WWW::OpenAPIClient::Object::ApiResponse; use WWW::OpenAPIClient::Object::ArrayOfArrayOfNumberOnly; @@ -258,26 +252,36 @@ use WWW::OpenAPIClient::Object::EnumClass; use WWW::OpenAPIClient::Object::EnumTest; use WWW::OpenAPIClient::Object::File; use WWW::OpenAPIClient::Object::FileSchemaTestClass; +use WWW::OpenAPIClient::Object::Foo; use WWW::OpenAPIClient::Object::FormatTest; use WWW::OpenAPIClient::Object::HasOnlyReadOnly; +use WWW::OpenAPIClient::Object::HealthCheckResult; +use WWW::OpenAPIClient::Object::InlineObject; +use WWW::OpenAPIClient::Object::InlineObject1; +use WWW::OpenAPIClient::Object::InlineObject2; +use WWW::OpenAPIClient::Object::InlineObject3; +use WWW::OpenAPIClient::Object::InlineObject4; +use WWW::OpenAPIClient::Object::InlineObject5; +use WWW::OpenAPIClient::Object::InlineResponseDefault; use WWW::OpenAPIClient::Object::List; use WWW::OpenAPIClient::Object::MapTest; use WWW::OpenAPIClient::Object::MixedPropertiesAndAdditionalPropertiesClass; use WWW::OpenAPIClient::Object::Model200Response; use WWW::OpenAPIClient::Object::ModelReturn; use WWW::OpenAPIClient::Object::Name; +use WWW::OpenAPIClient::Object::NullableClass; use WWW::OpenAPIClient::Object::NumberOnly; use WWW::OpenAPIClient::Object::Order; use WWW::OpenAPIClient::Object::OuterComposite; use WWW::OpenAPIClient::Object::OuterEnum; +use WWW::OpenAPIClient::Object::OuterEnumDefaultValue; +use WWW::OpenAPIClient::Object::OuterEnumInteger; +use WWW::OpenAPIClient::Object::OuterEnumIntegerDefaultValue; use WWW::OpenAPIClient::Object::Pet; use WWW::OpenAPIClient::Object::ReadOnlyFirst; use WWW::OpenAPIClient::Object::SpecialModelName; use WWW::OpenAPIClient::Object::Tag; -use WWW::OpenAPIClient::Object::TypeHolderDefault; -use WWW::OpenAPIClient::Object::TypeHolderExample; use WWW::OpenAPIClient::Object::User; -use WWW::OpenAPIClient::Object::XmlItem; ```` @@ -290,6 +294,7 @@ use strict; use warnings; # load the API package use WWW::OpenAPIClient::AnotherFakeApi; +use WWW::OpenAPIClient::DefaultApi; use WWW::OpenAPIClient::FakeApi; use WWW::OpenAPIClient::FakeClassnameTags123Api; use WWW::OpenAPIClient::PetApi; @@ -297,14 +302,7 @@ use WWW::OpenAPIClient::StoreApi; use WWW::OpenAPIClient::UserApi; # load the models -use WWW::OpenAPIClient::Object::AdditionalPropertiesAnyType; -use WWW::OpenAPIClient::Object::AdditionalPropertiesArray; -use WWW::OpenAPIClient::Object::AdditionalPropertiesBoolean; use WWW::OpenAPIClient::Object::AdditionalPropertiesClass; -use WWW::OpenAPIClient::Object::AdditionalPropertiesInteger; -use WWW::OpenAPIClient::Object::AdditionalPropertiesNumber; -use WWW::OpenAPIClient::Object::AdditionalPropertiesObject; -use WWW::OpenAPIClient::Object::AdditionalPropertiesString; use WWW::OpenAPIClient::Object::Animal; use WWW::OpenAPIClient::Object::ApiResponse; use WWW::OpenAPIClient::Object::ArrayOfArrayOfNumberOnly; @@ -323,26 +321,36 @@ use WWW::OpenAPIClient::Object::EnumClass; use WWW::OpenAPIClient::Object::EnumTest; use WWW::OpenAPIClient::Object::File; use WWW::OpenAPIClient::Object::FileSchemaTestClass; +use WWW::OpenAPIClient::Object::Foo; use WWW::OpenAPIClient::Object::FormatTest; use WWW::OpenAPIClient::Object::HasOnlyReadOnly; +use WWW::OpenAPIClient::Object::HealthCheckResult; +use WWW::OpenAPIClient::Object::InlineObject; +use WWW::OpenAPIClient::Object::InlineObject1; +use WWW::OpenAPIClient::Object::InlineObject2; +use WWW::OpenAPIClient::Object::InlineObject3; +use WWW::OpenAPIClient::Object::InlineObject4; +use WWW::OpenAPIClient::Object::InlineObject5; +use WWW::OpenAPIClient::Object::InlineResponseDefault; use WWW::OpenAPIClient::Object::List; use WWW::OpenAPIClient::Object::MapTest; use WWW::OpenAPIClient::Object::MixedPropertiesAndAdditionalPropertiesClass; use WWW::OpenAPIClient::Object::Model200Response; use WWW::OpenAPIClient::Object::ModelReturn; use WWW::OpenAPIClient::Object::Name; +use WWW::OpenAPIClient::Object::NullableClass; use WWW::OpenAPIClient::Object::NumberOnly; use WWW::OpenAPIClient::Object::Order; use WWW::OpenAPIClient::Object::OuterComposite; use WWW::OpenAPIClient::Object::OuterEnum; +use WWW::OpenAPIClient::Object::OuterEnumDefaultValue; +use WWW::OpenAPIClient::Object::OuterEnumInteger; +use WWW::OpenAPIClient::Object::OuterEnumIntegerDefaultValue; use WWW::OpenAPIClient::Object::Pet; use WWW::OpenAPIClient::Object::ReadOnlyFirst; use WWW::OpenAPIClient::Object::SpecialModelName; use WWW::OpenAPIClient::Object::Tag; -use WWW::OpenAPIClient::Object::TypeHolderDefault; -use WWW::OpenAPIClient::Object::TypeHolderExample; use WWW::OpenAPIClient::Object::User; -use WWW::OpenAPIClient::Object::XmlItem; # for displaying the API response data use Data::Dumper; @@ -351,10 +359,10 @@ use WWW::OpenAPIClient::; my $api_instance = WWW::OpenAPIClient::->new( ); -my $body = WWW::OpenAPIClient::Object::Client->new(); # Client | client model +my $client = WWW::OpenAPIClient::Object::Client->new(); # Client | client model eval { - my $result = $api_instance->call_123_test_special_tags(body => $body); + my $result = $api_instance->call_123_test_special_tags(client => $client); print Dumper($result); }; if ($@) { @@ -370,7 +378,8 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *AnotherFakeApi* | [**call_123_test_special_tags**](docs/AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags -*FakeApi* | [**create_xml_item**](docs/FakeApi.md#create_xml_item) | **POST** /fake/create_xml_item | creates an XmlItem +*DefaultApi* | [**foo_get**](docs/DefaultApi.md#foo_get) | **GET** /foo | +*FakeApi* | [**fake_health_get**](docs/FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint *FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | *FakeApi* | [**fake_outer_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | *FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | @@ -408,14 +417,7 @@ Class | Method | HTTP request | Description # DOCUMENTATION FOR MODELS - - [WWW::OpenAPIClient::Object::AdditionalPropertiesAnyType](docs/AdditionalPropertiesAnyType.md) - - [WWW::OpenAPIClient::Object::AdditionalPropertiesArray](docs/AdditionalPropertiesArray.md) - - [WWW::OpenAPIClient::Object::AdditionalPropertiesBoolean](docs/AdditionalPropertiesBoolean.md) - [WWW::OpenAPIClient::Object::AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) - - [WWW::OpenAPIClient::Object::AdditionalPropertiesInteger](docs/AdditionalPropertiesInteger.md) - - [WWW::OpenAPIClient::Object::AdditionalPropertiesNumber](docs/AdditionalPropertiesNumber.md) - - [WWW::OpenAPIClient::Object::AdditionalPropertiesObject](docs/AdditionalPropertiesObject.md) - - [WWW::OpenAPIClient::Object::AdditionalPropertiesString](docs/AdditionalPropertiesString.md) - [WWW::OpenAPIClient::Object::Animal](docs/Animal.md) - [WWW::OpenAPIClient::Object::ApiResponse](docs/ApiResponse.md) - [WWW::OpenAPIClient::Object::ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) @@ -434,26 +436,36 @@ Class | Method | HTTP request | Description - [WWW::OpenAPIClient::Object::EnumTest](docs/EnumTest.md) - [WWW::OpenAPIClient::Object::File](docs/File.md) - [WWW::OpenAPIClient::Object::FileSchemaTestClass](docs/FileSchemaTestClass.md) + - [WWW::OpenAPIClient::Object::Foo](docs/Foo.md) - [WWW::OpenAPIClient::Object::FormatTest](docs/FormatTest.md) - [WWW::OpenAPIClient::Object::HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [WWW::OpenAPIClient::Object::HealthCheckResult](docs/HealthCheckResult.md) + - [WWW::OpenAPIClient::Object::InlineObject](docs/InlineObject.md) + - [WWW::OpenAPIClient::Object::InlineObject1](docs/InlineObject1.md) + - [WWW::OpenAPIClient::Object::InlineObject2](docs/InlineObject2.md) + - [WWW::OpenAPIClient::Object::InlineObject3](docs/InlineObject3.md) + - [WWW::OpenAPIClient::Object::InlineObject4](docs/InlineObject4.md) + - [WWW::OpenAPIClient::Object::InlineObject5](docs/InlineObject5.md) + - [WWW::OpenAPIClient::Object::InlineResponseDefault](docs/InlineResponseDefault.md) - [WWW::OpenAPIClient::Object::List](docs/List.md) - [WWW::OpenAPIClient::Object::MapTest](docs/MapTest.md) - [WWW::OpenAPIClient::Object::MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - [WWW::OpenAPIClient::Object::Model200Response](docs/Model200Response.md) - [WWW::OpenAPIClient::Object::ModelReturn](docs/ModelReturn.md) - [WWW::OpenAPIClient::Object::Name](docs/Name.md) + - [WWW::OpenAPIClient::Object::NullableClass](docs/NullableClass.md) - [WWW::OpenAPIClient::Object::NumberOnly](docs/NumberOnly.md) - [WWW::OpenAPIClient::Object::Order](docs/Order.md) - [WWW::OpenAPIClient::Object::OuterComposite](docs/OuterComposite.md) - [WWW::OpenAPIClient::Object::OuterEnum](docs/OuterEnum.md) + - [WWW::OpenAPIClient::Object::OuterEnumDefaultValue](docs/OuterEnumDefaultValue.md) + - [WWW::OpenAPIClient::Object::OuterEnumInteger](docs/OuterEnumInteger.md) + - [WWW::OpenAPIClient::Object::OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md) - [WWW::OpenAPIClient::Object::Pet](docs/Pet.md) - [WWW::OpenAPIClient::Object::ReadOnlyFirst](docs/ReadOnlyFirst.md) - [WWW::OpenAPIClient::Object::SpecialModelName](docs/SpecialModelName.md) - [WWW::OpenAPIClient::Object::Tag](docs/Tag.md) - - [WWW::OpenAPIClient::Object::TypeHolderDefault](docs/TypeHolderDefault.md) - - [WWW::OpenAPIClient::Object::TypeHolderExample](docs/TypeHolderExample.md) - [WWW::OpenAPIClient::Object::User](docs/User.md) - - [WWW::OpenAPIClient::Object::XmlItem](docs/XmlItem.md) # DOCUMENTATION FOR AUTHORIZATION @@ -470,6 +482,10 @@ Class | Method | HTTP request | Description - **API key parameter name**: api_key_query - **Location**: URL query string +## bearer_test + +- **Type**: HTTP basic authentication + ## http_basic_test - **Type**: HTTP basic authentication diff --git a/samples/client/petstore/perl/docs/AdditionalPropertiesClass.md b/samples/client/petstore/perl/docs/AdditionalPropertiesClass.md index 47f95da8f0c5..ce21d69c2354 100644 --- a/samples/client/petstore/perl/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/perl/docs/AdditionalPropertiesClass.md @@ -8,17 +8,8 @@ use WWW::OpenAPIClient::Object::AdditionalPropertiesClass; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**map_string** | **HASH[string,string]** | | [optional] -**map_number** | **HASH[string,double]** | | [optional] -**map_integer** | **HASH[string,int]** | | [optional] -**map_boolean** | **HASH[string,boolean]** | | [optional] -**map_array_integer** | **HASH[string,ARRAY[int]]** | | [optional] -**map_array_anytype** | **HASH[string,ARRAY[object]]** | | [optional] -**map_map_string** | **HASH[string,HASH[string,string]]** | | [optional] -**map_map_anytype** | **HASH[string,HASH[string,object]]** | | [optional] -**anytype_1** | [**object**](.md) | | [optional] -**anytype_2** | [**object**](.md) | | [optional] -**anytype_3** | [**object**](.md) | | [optional] +**map_property** | **HASH[string,string]** | | [optional] +**map_of_map_property** | **HASH[string,HASH[string,string]]** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/perl/docs/AnotherFakeApi.md b/samples/client/petstore/perl/docs/AnotherFakeApi.md index 87c9e4015b79..a0b0fd6f8ea7 100644 --- a/samples/client/petstore/perl/docs/AnotherFakeApi.md +++ b/samples/client/petstore/perl/docs/AnotherFakeApi.md @@ -13,7 +13,7 @@ Method | HTTP request | Description # **call_123_test_special_tags** -> Client call_123_test_special_tags(body => $body) +> Client call_123_test_special_tags(client => $client) To test special tags @@ -26,10 +26,10 @@ use WWW::OpenAPIClient::AnotherFakeApi; my $api_instance = WWW::OpenAPIClient::AnotherFakeApi->new( ); -my $body = WWW::OpenAPIClient::Object::Client->new(); # Client | client model +my $client = WWW::OpenAPIClient::Object::Client->new(); # Client | client model eval { - my $result = $api_instance->call_123_test_special_tags(body => $body); + my $result = $api_instance->call_123_test_special_tags(client => $client); print Dumper($result); }; if ($@) { @@ -41,7 +41,7 @@ if ($@) { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type diff --git a/samples/client/petstore/perl/docs/EnumTest.md b/samples/client/petstore/perl/docs/EnumTest.md index aa889b2be864..60ed7418d2a5 100644 --- a/samples/client/petstore/perl/docs/EnumTest.md +++ b/samples/client/petstore/perl/docs/EnumTest.md @@ -13,6 +13,9 @@ Name | Type | Description | Notes **enum_integer** | **int** | | [optional] **enum_number** | **double** | | [optional] **outer_enum** | [**OuterEnum**](OuterEnum.md) | | [optional] +**outer_enum_integer** | [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional] +**outer_enum_default_value** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] +**outer_enum_integer_default_value** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/perl/docs/FakeApi.md b/samples/client/petstore/perl/docs/FakeApi.md index 71f47ac441d7..e4c380346f58 100644 --- a/samples/client/petstore/perl/docs/FakeApi.md +++ b/samples/client/petstore/perl/docs/FakeApi.md @@ -9,7 +9,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**create_xml_item**](FakeApi.md#create_xml_item) | **POST** /fake/create_xml_item | creates an XmlItem +[**fake_health_get**](FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint [**fake_outer_boolean_serialize**](FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | [**fake_outer_composite_serialize**](FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | [**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | @@ -24,12 +24,10 @@ Method | HTTP request | Description [**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data -# **create_xml_item** -> create_xml_item(xml_item => $xml_item) +# **fake_health_get** +> HealthCheckResult fake_health_get() -creates an XmlItem - -this route creates an XmlItem +Health check endpoint ### Example ```perl @@ -38,25 +36,22 @@ use WWW::OpenAPIClient::FakeApi; my $api_instance = WWW::OpenAPIClient::FakeApi->new( ); -my $xml_item = WWW::OpenAPIClient::Object::XmlItem->new(); # XmlItem | XmlItem Body eval { - $api_instance->create_xml_item(xml_item => $xml_item); + my $result = $api_instance->fake_health_get(); + print Dumper($result); }; if ($@) { - warn "Exception when calling FakeApi->create_xml_item: $@\n"; + warn "Exception when calling FakeApi->fake_health_get: $@\n"; } ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xml_item** | [**XmlItem**](XmlItem.md)| XmlItem Body | +This endpoint does not need any parameter. ### Return type -void (empty response body) +[**HealthCheckResult**](HealthCheckResult.md) ### Authorization @@ -64,8 +59,8 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/xml, application/xml; charset=utf-8, application/xml; charset=utf-16, text/xml, text/xml; charset=utf-8, text/xml; charset=utf-16 - - **Accept**: Not defined + - **Content-Type**: Not defined + - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -110,13 +105,13 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: */* [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **fake_outer_composite_serialize** -> OuterComposite fake_outer_composite_serialize(body => $body) +> OuterComposite fake_outer_composite_serialize(outer_composite => $outer_composite) @@ -129,10 +124,10 @@ use WWW::OpenAPIClient::FakeApi; my $api_instance = WWW::OpenAPIClient::FakeApi->new( ); -my $body = WWW::OpenAPIClient::Object::OuterComposite->new(); # OuterComposite | Input composite as post body +my $outer_composite = WWW::OpenAPIClient::Object::OuterComposite->new(); # OuterComposite | Input composite as post body eval { - my $result = $api_instance->fake_outer_composite_serialize(body => $body); + my $result = $api_instance->fake_outer_composite_serialize(outer_composite => $outer_composite); print Dumper($result); }; if ($@) { @@ -144,7 +139,7 @@ if ($@) { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + **outer_composite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] ### Return type @@ -156,7 +151,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: */* [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -202,7 +197,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: */* [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -248,13 +243,13 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: */* [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **test_body_with_file_schema** -> test_body_with_file_schema(body => $body) +> test_body_with_file_schema(file_schema_test_class => $file_schema_test_class) @@ -267,10 +262,10 @@ use WWW::OpenAPIClient::FakeApi; my $api_instance = WWW::OpenAPIClient::FakeApi->new( ); -my $body = WWW::OpenAPIClient::Object::FileSchemaTestClass->new(); # FileSchemaTestClass | +my $file_schema_test_class = WWW::OpenAPIClient::Object::FileSchemaTestClass->new(); # FileSchemaTestClass | eval { - $api_instance->test_body_with_file_schema(body => $body); + $api_instance->test_body_with_file_schema(file_schema_test_class => $file_schema_test_class); }; if ($@) { warn "Exception when calling FakeApi->test_body_with_file_schema: $@\n"; @@ -281,7 +276,7 @@ if ($@) { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | + **file_schema_test_class** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | ### Return type @@ -299,7 +294,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **test_body_with_query_params** -> test_body_with_query_params(query => $query, body => $body) +> test_body_with_query_params(query => $query, user => $user) @@ -311,10 +306,10 @@ my $api_instance = WWW::OpenAPIClient::FakeApi->new( ); my $query = "query_example"; # string | -my $body = WWW::OpenAPIClient::Object::User->new(); # User | +my $user = WWW::OpenAPIClient::Object::User->new(); # User | eval { - $api_instance->test_body_with_query_params(query => $query, body => $body); + $api_instance->test_body_with_query_params(query => $query, user => $user); }; if ($@) { warn "Exception when calling FakeApi->test_body_with_query_params: $@\n"; @@ -326,7 +321,7 @@ if ($@) { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **query** | **string**| | - **body** | [**User**](User.md)| | + **user** | [**User**](User.md)| | ### Return type @@ -344,7 +339,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **test_client_model** -> Client test_client_model(body => $body) +> Client test_client_model(client => $client) To test \"client\" model @@ -357,10 +352,10 @@ use WWW::OpenAPIClient::FakeApi; my $api_instance = WWW::OpenAPIClient::FakeApi->new( ); -my $body = WWW::OpenAPIClient::Object::Client->new(); # Client | client model +my $client = WWW::OpenAPIClient::Object::Client->new(); # Client | client model eval { - my $result = $api_instance->test_client_model(body => $body); + my $result = $api_instance->test_client_model(client => $client); print Dumper($result); }; if ($@) { @@ -372,7 +367,7 @@ if ($@) { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type @@ -536,6 +531,11 @@ Fake endpoint to test group parameters (optional) use Data::Dumper; use WWW::OpenAPIClient::FakeApi; my $api_instance = WWW::OpenAPIClient::FakeApi->new( + + # Configure HTTP basic authorization: bearer_test + # Configure bearer access token for authorization: bearer_test + access_token => 'YOUR_BEARER_TOKEN', + ); my $required_string_group = 56; # int | Required String in group parameters @@ -570,7 +570,7 @@ void (empty response body) ### Authorization -No authorization required +[bearer_test](../README.md#bearer_test) ### HTTP request headers @@ -580,7 +580,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **test_inline_additional_properties** -> test_inline_additional_properties(param => $param) +> test_inline_additional_properties(request_body => $request_body) test inline additionalProperties @@ -591,10 +591,10 @@ use WWW::OpenAPIClient::FakeApi; my $api_instance = WWW::OpenAPIClient::FakeApi->new( ); -my $param = WWW::OpenAPIClient::Object::HASH[string,string]->new(); # HASH[string,string] | request body +my $request_body = WWW::OpenAPIClient::Object::HASH[string,string]->new(); # HASH[string,string] | request body eval { - $api_instance->test_inline_additional_properties(param => $param); + $api_instance->test_inline_additional_properties(request_body => $request_body); }; if ($@) { warn "Exception when calling FakeApi->test_inline_additional_properties: $@\n"; @@ -605,7 +605,7 @@ if ($@) { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **param** | [**HASH[string,string]**](string.md)| request body | + **request_body** | [**HASH[string,string]**](string.md)| request body | ### Return type diff --git a/samples/client/petstore/perl/docs/FakeClassnameTags123Api.md b/samples/client/petstore/perl/docs/FakeClassnameTags123Api.md index 70e303f7bf0b..67c2122cb6ff 100644 --- a/samples/client/petstore/perl/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/perl/docs/FakeClassnameTags123Api.md @@ -13,7 +13,7 @@ Method | HTTP request | Description # **test_classname** -> Client test_classname(body => $body) +> Client test_classname(client => $client) To test class name in snake case @@ -31,10 +31,10 @@ my $api_instance = WWW::OpenAPIClient::FakeClassnameTags123Api->new( #api_key_prefix => {'api_key_query' => 'Bearer'}, ); -my $body = WWW::OpenAPIClient::Object::Client->new(); # Client | client model +my $client = WWW::OpenAPIClient::Object::Client->new(); # Client | client model eval { - my $result = $api_instance->test_classname(body => $body); + my $result = $api_instance->test_classname(client => $client); print Dumper($result); }; if ($@) { @@ -46,7 +46,7 @@ if ($@) { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type diff --git a/samples/client/petstore/perl/docs/FormatTest.md b/samples/client/petstore/perl/docs/FormatTest.md index 3a1bf2c21f3c..7cfabebb2813 100644 --- a/samples/client/petstore/perl/docs/FormatTest.md +++ b/samples/client/petstore/perl/docs/FormatTest.md @@ -21,6 +21,8 @@ Name | Type | Description | Notes **date_time** | **DateTime** | | [optional] **uuid** | **string** | | [optional] **password** | **string** | | +**pattern_with_digits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [optional] +**pattern_with_digits_and_delimiter** | **string** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/perl/docs/PetApi.md b/samples/client/petstore/perl/docs/PetApi.md index 899e2f63e074..5218d9282f19 100644 --- a/samples/client/petstore/perl/docs/PetApi.md +++ b/samples/client/petstore/perl/docs/PetApi.md @@ -21,7 +21,7 @@ Method | HTTP request | Description # **add_pet** -> add_pet(body => $body) +> add_pet(pet => $pet) Add a new pet to the store @@ -35,10 +35,10 @@ my $api_instance = WWW::OpenAPIClient::PetApi->new( access_token => 'YOUR_ACCESS_TOKEN', ); -my $body = WWW::OpenAPIClient::Object::Pet->new(); # Pet | Pet object that needs to be added to the store +my $pet = WWW::OpenAPIClient::Object::Pet->new(); # Pet | Pet object that needs to be added to the store eval { - $api_instance->add_pet(body => $body); + $api_instance->add_pet(pet => $pet); }; if ($@) { warn "Exception when calling PetApi->add_pet: $@\n"; @@ -49,7 +49,7 @@ if ($@) { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -264,7 +264,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **update_pet** -> update_pet(body => $body) +> update_pet(pet => $pet) Update an existing pet @@ -278,10 +278,10 @@ my $api_instance = WWW::OpenAPIClient::PetApi->new( access_token => 'YOUR_ACCESS_TOKEN', ); -my $body = WWW::OpenAPIClient::Object::Pet->new(); # Pet | Pet object that needs to be added to the store +my $pet = WWW::OpenAPIClient::Object::Pet->new(); # Pet | Pet object that needs to be added to the store eval { - $api_instance->update_pet(body => $body); + $api_instance->update_pet(pet => $pet); }; if ($@) { warn "Exception when calling PetApi->update_pet: $@\n"; @@ -292,7 +292,7 @@ if ($@) { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type diff --git a/samples/client/petstore/perl/docs/StoreApi.md b/samples/client/petstore/perl/docs/StoreApi.md index fe591e701a82..e467823c53a9 100644 --- a/samples/client/petstore/perl/docs/StoreApi.md +++ b/samples/client/petstore/perl/docs/StoreApi.md @@ -154,7 +154,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **place_order** -> Order place_order(body => $body) +> Order place_order(order => $order) Place an order for a pet @@ -165,10 +165,10 @@ use WWW::OpenAPIClient::StoreApi; my $api_instance = WWW::OpenAPIClient::StoreApi->new( ); -my $body = WWW::OpenAPIClient::Object::Order->new(); # Order | order placed for purchasing the pet +my $order = WWW::OpenAPIClient::Object::Order->new(); # Order | order placed for purchasing the pet eval { - my $result = $api_instance->place_order(body => $body); + my $result = $api_instance->place_order(order => $order); print Dumper($result); }; if ($@) { @@ -180,7 +180,7 @@ if ($@) { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | + **order** | [**Order**](Order.md)| order placed for purchasing the pet | ### Return type @@ -192,7 +192,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/xml, application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/samples/client/petstore/perl/docs/UserApi.md b/samples/client/petstore/perl/docs/UserApi.md index 543f18109c75..3ab7ae9e4064 100644 --- a/samples/client/petstore/perl/docs/UserApi.md +++ b/samples/client/petstore/perl/docs/UserApi.md @@ -20,7 +20,7 @@ Method | HTTP request | Description # **create_user** -> create_user(body => $body) +> create_user(user => $user) Create user @@ -33,10 +33,10 @@ use WWW::OpenAPIClient::UserApi; my $api_instance = WWW::OpenAPIClient::UserApi->new( ); -my $body = WWW::OpenAPIClient::Object::User->new(); # User | Created user object +my $user = WWW::OpenAPIClient::Object::User->new(); # User | Created user object eval { - $api_instance->create_user(body => $body); + $api_instance->create_user(user => $user); }; if ($@) { warn "Exception when calling UserApi->create_user: $@\n"; @@ -47,7 +47,7 @@ if ($@) { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | + **user** | [**User**](User.md)| Created user object | ### Return type @@ -59,13 +59,13 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **create_users_with_array_input** -> create_users_with_array_input(body => $body) +> create_users_with_array_input(user => $user) Creates list of users with given input array @@ -76,10 +76,10 @@ use WWW::OpenAPIClient::UserApi; my $api_instance = WWW::OpenAPIClient::UserApi->new( ); -my $body = [WWW::OpenAPIClient::Object::ARRAY[User]->new()]; # ARRAY[User] | List of user object +my $user = [WWW::OpenAPIClient::Object::ARRAY[User]->new()]; # ARRAY[User] | List of user object eval { - $api_instance->create_users_with_array_input(body => $body); + $api_instance->create_users_with_array_input(user => $user); }; if ($@) { warn "Exception when calling UserApi->create_users_with_array_input: $@\n"; @@ -90,7 +90,7 @@ if ($@) { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**ARRAY[User]**](User.md)| List of user object | + **user** | [**ARRAY[User]**](User.md)| List of user object | ### Return type @@ -102,13 +102,13 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **create_users_with_list_input** -> create_users_with_list_input(body => $body) +> create_users_with_list_input(user => $user) Creates list of users with given input array @@ -119,10 +119,10 @@ use WWW::OpenAPIClient::UserApi; my $api_instance = WWW::OpenAPIClient::UserApi->new( ); -my $body = [WWW::OpenAPIClient::Object::ARRAY[User]->new()]; # ARRAY[User] | List of user object +my $user = [WWW::OpenAPIClient::Object::ARRAY[User]->new()]; # ARRAY[User] | List of user object eval { - $api_instance->create_users_with_list_input(body => $body); + $api_instance->create_users_with_list_input(user => $user); }; if ($@) { warn "Exception when calling UserApi->create_users_with_list_input: $@\n"; @@ -133,7 +133,7 @@ if ($@) { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**ARRAY[User]**](User.md)| List of user object | + **user** | [**ARRAY[User]**](User.md)| List of user object | ### Return type @@ -145,7 +145,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -325,7 +325,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **update_user** -> update_user(username => $username, body => $body) +> update_user(username => $username, user => $user) Updated user @@ -339,10 +339,10 @@ my $api_instance = WWW::OpenAPIClient::UserApi->new( ); my $username = "username_example"; # string | name that need to be deleted -my $body = WWW::OpenAPIClient::Object::User->new(); # User | Updated user object +my $user = WWW::OpenAPIClient::Object::User->new(); # User | Updated user object eval { - $api_instance->update_user(username => $username, body => $body); + $api_instance->update_user(username => $username, user => $user); }; if ($@) { warn "Exception when calling UserApi->update_user: $@\n"; @@ -354,7 +354,7 @@ if ($@) { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **string**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | + **user** | [**User**](User.md)| Updated user object | ### Return type @@ -366,7 +366,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/AnotherFakeApi.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/AnotherFakeApi.pm index e389921bd420..cd1df44004df 100644 --- a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/AnotherFakeApi.pm +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/AnotherFakeApi.pm @@ -53,10 +53,10 @@ sub new { # # To test special tags # -# @param Client $body client model (required) +# @param Client $client client model (required) { my $params = { - 'body' => { + 'client' => { data_type => 'Client', description => 'client model', required => '1', @@ -73,9 +73,9 @@ sub new { sub call_123_test_special_tags { my ($self, %args) = @_; - # verify the required parameter 'body' is set - unless (exists $args{'body'}) { - croak("Missing the required parameter 'body' when calling call_123_test_special_tags"); + # verify the required parameter 'client' is set + unless (exists $args{'client'}) { + croak("Missing the required parameter 'client' when calling call_123_test_special_tags"); } # parse inputs @@ -95,8 +95,8 @@ sub call_123_test_special_tags { my $_body_data; # body params - if ( exists $args{'body'}) { - $_body_data = $args{'body'}; + if ( exists $args{'client'}) { + $_body_data = $args{'client'}; } # authentication setting, if any diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/ApiClient.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/ApiClient.pm index f99f06bd87df..e7fc63fd1023 100644 --- a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/ApiClient.pm +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/ApiClient.pm @@ -348,6 +348,12 @@ sub update_params_for_auth { $query_params->{'api_key_query'} = $api_key; } } + elsif ($auth eq 'bearer_test') { + // this endpoint requires Bearer (JWT) authentication (access token) + if ($self->{config}{access_token}) { + $headers['Authorization'] = 'Bearer ' . $self->{config}{access_token}; + } + } elsif ($auth eq 'http_basic_test') { if ($self->{config}{username} || $self->{config}{password}) { $header_params->{'Authorization'} = 'Basic ' . encode_base64($self->{config}{username} . ":" . $self->{config}{password}); diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/FakeApi.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/FakeApi.pm index 5309ef4b29ca..29dcd10fe837 100644 --- a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/FakeApi.pm +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/FakeApi.pm @@ -49,64 +49,52 @@ sub new { # -# create_xml_item +# fake_health_get # -# creates an XmlItem +# Health check endpoint # -# @param XmlItem $xml_item XmlItem Body (required) { my $params = { - 'xml_item' => { - data_type => 'XmlItem', - description => 'XmlItem Body', - required => '1', - }, }; - __PACKAGE__->method_documentation->{ 'create_xml_item' } = { - summary => 'creates an XmlItem', + __PACKAGE__->method_documentation->{ 'fake_health_get' } = { + summary => 'Health check endpoint', params => $params, - returns => undef, + returns => 'HealthCheckResult', }; } -# @return void +# @return HealthCheckResult # -sub create_xml_item { +sub fake_health_get { my ($self, %args) = @_; - # verify the required parameter 'xml_item' is set - unless (exists $args{'xml_item'}) { - croak("Missing the required parameter 'xml_item' when calling create_xml_item"); - } - # parse inputs - my $_resource_path = '/fake/create_xml_item'; + my $_resource_path = '/fake/health'; - my $_method = 'POST'; + my $_method = 'GET'; my $query_params = {}; my $header_params = {}; my $form_params = {}; # 'Accept' and 'Content-Type' header - my $_header_accept = $self->{api_client}->select_header_accept(); + my $_header_accept = $self->{api_client}->select_header_accept('application/json'); if ($_header_accept) { $header_params->{'Accept'} = $_header_accept; } - $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/xml', 'application/xml; charset=utf-8', 'application/xml; charset=utf-16', 'text/xml', 'text/xml; charset=utf-8', 'text/xml; charset=utf-16'); + $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); my $_body_data; - # body params - if ( exists $args{'xml_item'}) { - $_body_data = $args{'xml_item'}; - } - # authentication setting, if any my $auth_settings = [qw()]; # make the API Call - $self->{api_client}->call_api($_resource_path, $_method, + my $response = $self->{api_client}->call_api($_resource_path, $_method, $query_params, $form_params, $header_params, $_body_data, $auth_settings); - return; + if (!$response) { + return; + } + my $_response_object = $self->{api_client}->deserialize('HealthCheckResult', $response); + return $_response_object; } # @@ -147,7 +135,7 @@ sub fake_outer_boolean_serialize { if ($_header_accept) { $header_params->{'Accept'} = $_header_accept; } - $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); + $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); my $_body_data; # body params @@ -174,10 +162,10 @@ sub fake_outer_boolean_serialize { # # # -# @param OuterComposite $body Input composite as post body (optional) +# @param OuterComposite $outer_composite Input composite as post body (optional) { my $params = { - 'body' => { + 'outer_composite' => { data_type => 'OuterComposite', description => 'Input composite as post body', required => '0', @@ -207,12 +195,12 @@ sub fake_outer_composite_serialize { if ($_header_accept) { $header_params->{'Accept'} = $_header_accept; } - $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); + $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); my $_body_data; # body params - if ( exists $args{'body'}) { - $_body_data = $args{'body'}; + if ( exists $args{'outer_composite'}) { + $_body_data = $args{'outer_composite'}; } # authentication setting, if any @@ -267,7 +255,7 @@ sub fake_outer_number_serialize { if ($_header_accept) { $header_params->{'Accept'} = $_header_accept; } - $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); + $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); my $_body_data; # body params @@ -327,7 +315,7 @@ sub fake_outer_string_serialize { if ($_header_accept) { $header_params->{'Accept'} = $_header_accept; } - $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); + $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); my $_body_data; # body params @@ -354,10 +342,10 @@ sub fake_outer_string_serialize { # # # -# @param FileSchemaTestClass $body (required) +# @param FileSchemaTestClass $file_schema_test_class (required) { my $params = { - 'body' => { + 'file_schema_test_class' => { data_type => 'FileSchemaTestClass', description => '', required => '1', @@ -374,9 +362,9 @@ sub fake_outer_string_serialize { sub test_body_with_file_schema { my ($self, %args) = @_; - # verify the required parameter 'body' is set - unless (exists $args{'body'}) { - croak("Missing the required parameter 'body' when calling test_body_with_file_schema"); + # verify the required parameter 'file_schema_test_class' is set + unless (exists $args{'file_schema_test_class'}) { + croak("Missing the required parameter 'file_schema_test_class' when calling test_body_with_file_schema"); } # parse inputs @@ -396,8 +384,8 @@ sub test_body_with_file_schema { my $_body_data; # body params - if ( exists $args{'body'}) { - $_body_data = $args{'body'}; + if ( exists $args{'file_schema_test_class'}) { + $_body_data = $args{'file_schema_test_class'}; } # authentication setting, if any @@ -416,7 +404,7 @@ sub test_body_with_file_schema { # # # @param string $query (required) -# @param User $body (required) +# @param User $user (required) { my $params = { 'query' => { @@ -424,7 +412,7 @@ sub test_body_with_file_schema { description => '', required => '1', }, - 'body' => { + 'user' => { data_type => 'User', description => '', required => '1', @@ -446,9 +434,9 @@ sub test_body_with_query_params { croak("Missing the required parameter 'query' when calling test_body_with_query_params"); } - # verify the required parameter 'body' is set - unless (exists $args{'body'}) { - croak("Missing the required parameter 'body' when calling test_body_with_query_params"); + # verify the required parameter 'user' is set + unless (exists $args{'user'}) { + croak("Missing the required parameter 'user' when calling test_body_with_query_params"); } # parse inputs @@ -473,8 +461,8 @@ sub test_body_with_query_params { my $_body_data; # body params - if ( exists $args{'body'}) { - $_body_data = $args{'body'}; + if ( exists $args{'user'}) { + $_body_data = $args{'user'}; } # authentication setting, if any @@ -492,10 +480,10 @@ sub test_body_with_query_params { # # To test \"client\" model # -# @param Client $body client model (required) +# @param Client $client client model (required) { my $params = { - 'body' => { + 'client' => { data_type => 'Client', description => 'client model', required => '1', @@ -512,9 +500,9 @@ sub test_body_with_query_params { sub test_client_model { my ($self, %args) = @_; - # verify the required parameter 'body' is set - unless (exists $args{'body'}) { - croak("Missing the required parameter 'body' when calling test_client_model"); + # verify the required parameter 'client' is set + unless (exists $args{'client'}) { + croak("Missing the required parameter 'client' when calling test_client_model"); } # parse inputs @@ -534,8 +522,8 @@ sub test_client_model { my $_body_data; # body params - if ( exists $args{'body'}) { - $_body_data = $args{'body'}; + if ( exists $args{'client'}) { + $_body_data = $args{'client'}; } # authentication setting, if any @@ -1022,7 +1010,7 @@ sub test_group_parameters { my $_body_data; # authentication setting, if any - my $auth_settings = [qw()]; + my $auth_settings = [qw(bearer_test )]; # make the API Call $self->{api_client}->call_api($_resource_path, $_method, @@ -1036,10 +1024,10 @@ sub test_group_parameters { # # test inline additionalProperties # -# @param HASH[string,string] $param request body (required) +# @param HASH[string,string] $request_body request body (required) { my $params = { - 'param' => { + 'request_body' => { data_type => 'HASH[string,string]', description => 'request body', required => '1', @@ -1056,9 +1044,9 @@ sub test_group_parameters { sub test_inline_additional_properties { my ($self, %args) = @_; - # verify the required parameter 'param' is set - unless (exists $args{'param'}) { - croak("Missing the required parameter 'param' when calling test_inline_additional_properties"); + # verify the required parameter 'request_body' is set + unless (exists $args{'request_body'}) { + croak("Missing the required parameter 'request_body' when calling test_inline_additional_properties"); } # parse inputs @@ -1078,8 +1066,8 @@ sub test_inline_additional_properties { my $_body_data; # body params - if ( exists $args{'param'}) { - $_body_data = $args{'param'}; + if ( exists $args{'request_body'}) { + $_body_data = $args{'request_body'}; } # authentication setting, if any diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/FakeClassnameTags123Api.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/FakeClassnameTags123Api.pm index f57d72428c9d..c521d2c5758f 100644 --- a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/FakeClassnameTags123Api.pm +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/FakeClassnameTags123Api.pm @@ -53,10 +53,10 @@ sub new { # # To test class name in snake case # -# @param Client $body client model (required) +# @param Client $client client model (required) { my $params = { - 'body' => { + 'client' => { data_type => 'Client', description => 'client model', required => '1', @@ -73,9 +73,9 @@ sub new { sub test_classname { my ($self, %args) = @_; - # verify the required parameter 'body' is set - unless (exists $args{'body'}) { - croak("Missing the required parameter 'body' when calling test_classname"); + # verify the required parameter 'client' is set + unless (exists $args{'client'}) { + croak("Missing the required parameter 'client' when calling test_classname"); } # parse inputs @@ -95,8 +95,8 @@ sub test_classname { my $_body_data; # body params - if ( exists $args{'body'}) { - $_body_data = $args{'body'}; + if ( exists $args{'client'}) { + $_body_data = $args{'client'}; } # authentication setting, if any diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/AdditionalPropertiesClass.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/AdditionalPropertiesClass.pm index f388c3a4d1d9..3bbbceeb84bc 100644 --- a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/AdditionalPropertiesClass.pm +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/AdditionalPropertiesClass.pm @@ -161,79 +161,16 @@ __PACKAGE__->class_documentation({description => '', } ); __PACKAGE__->method_documentation({ - 'map_string' => { + 'map_property' => { datatype => 'HASH[string,string]', - base_name => 'map_string', + base_name => 'map_property', description => '', format => '', read_only => '', }, - 'map_number' => { - datatype => 'HASH[string,double]', - base_name => 'map_number', - description => '', - format => '', - read_only => '', - }, - 'map_integer' => { - datatype => 'HASH[string,int]', - base_name => 'map_integer', - description => '', - format => '', - read_only => '', - }, - 'map_boolean' => { - datatype => 'HASH[string,boolean]', - base_name => 'map_boolean', - description => '', - format => '', - read_only => '', - }, - 'map_array_integer' => { - datatype => 'HASH[string,ARRAY[int]]', - base_name => 'map_array_integer', - description => '', - format => '', - read_only => '', - }, - 'map_array_anytype' => { - datatype => 'HASH[string,ARRAY[object]]', - base_name => 'map_array_anytype', - description => '', - format => '', - read_only => '', - }, - 'map_map_string' => { + 'map_of_map_property' => { datatype => 'HASH[string,HASH[string,string]]', - base_name => 'map_map_string', - description => '', - format => '', - read_only => '', - }, - 'map_map_anytype' => { - datatype => 'HASH[string,HASH[string,object]]', - base_name => 'map_map_anytype', - description => '', - format => '', - read_only => '', - }, - 'anytype_1' => { - datatype => 'object', - base_name => 'anytype_1', - description => '', - format => '', - read_only => '', - }, - 'anytype_2' => { - datatype => 'object', - base_name => 'anytype_2', - description => '', - format => '', - read_only => '', - }, - 'anytype_3' => { - datatype => 'object', - base_name => 'anytype_3', + base_name => 'map_of_map_property', description => '', format => '', read_only => '', @@ -241,31 +178,13 @@ __PACKAGE__->method_documentation({ }); __PACKAGE__->openapi_types( { - 'map_string' => 'HASH[string,string]', - 'map_number' => 'HASH[string,double]', - 'map_integer' => 'HASH[string,int]', - 'map_boolean' => 'HASH[string,boolean]', - 'map_array_integer' => 'HASH[string,ARRAY[int]]', - 'map_array_anytype' => 'HASH[string,ARRAY[object]]', - 'map_map_string' => 'HASH[string,HASH[string,string]]', - 'map_map_anytype' => 'HASH[string,HASH[string,object]]', - 'anytype_1' => 'object', - 'anytype_2' => 'object', - 'anytype_3' => 'object' + 'map_property' => 'HASH[string,string]', + 'map_of_map_property' => 'HASH[string,HASH[string,string]]' } ); __PACKAGE__->attribute_map( { - 'map_string' => 'map_string', - 'map_number' => 'map_number', - 'map_integer' => 'map_integer', - 'map_boolean' => 'map_boolean', - 'map_array_integer' => 'map_array_integer', - 'map_array_anytype' => 'map_array_anytype', - 'map_map_string' => 'map_map_string', - 'map_map_anytype' => 'map_map_anytype', - 'anytype_1' => 'anytype_1', - 'anytype_2' => 'anytype_2', - 'anytype_3' => 'anytype_3' + 'map_property' => 'map_property', + 'map_of_map_property' => 'map_of_map_property' } ); __PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map}); diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/EnumTest.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/EnumTest.pm index 34585dee3848..a563f72d70ec 100644 --- a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/EnumTest.pm +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/EnumTest.pm @@ -31,6 +31,9 @@ use Date::Parse; use DateTime; use WWW::OpenAPIClient::Object::OuterEnum; +use WWW::OpenAPIClient::Object::OuterEnumDefaultValue; +use WWW::OpenAPIClient::Object::OuterEnumInteger; +use WWW::OpenAPIClient::Object::OuterEnumIntegerDefaultValue; use base ("Class::Accessor", "Class::Data::Inheritable"); @@ -197,6 +200,27 @@ __PACKAGE__->method_documentation({ format => '', read_only => '', }, + 'outer_enum_integer' => { + datatype => 'OuterEnumInteger', + base_name => 'outerEnumInteger', + description => '', + format => '', + read_only => '', + }, + 'outer_enum_default_value' => { + datatype => 'OuterEnumDefaultValue', + base_name => 'outerEnumDefaultValue', + description => '', + format => '', + read_only => '', + }, + 'outer_enum_integer_default_value' => { + datatype => 'OuterEnumIntegerDefaultValue', + base_name => 'outerEnumIntegerDefaultValue', + description => '', + format => '', + read_only => '', + }, }); __PACKAGE__->openapi_types( { @@ -204,7 +228,10 @@ __PACKAGE__->openapi_types( { 'enum_string_required' => 'string', 'enum_integer' => 'int', 'enum_number' => 'double', - 'outer_enum' => 'OuterEnum' + 'outer_enum' => 'OuterEnum', + 'outer_enum_integer' => 'OuterEnumInteger', + 'outer_enum_default_value' => 'OuterEnumDefaultValue', + 'outer_enum_integer_default_value' => 'OuterEnumIntegerDefaultValue' } ); __PACKAGE__->attribute_map( { @@ -212,7 +239,10 @@ __PACKAGE__->attribute_map( { 'enum_string_required' => 'enum_string_required', 'enum_integer' => 'enum_integer', 'enum_number' => 'enum_number', - 'outer_enum' => 'outerEnum' + 'outer_enum' => 'outerEnum', + 'outer_enum_integer' => 'outerEnumInteger', + 'outer_enum_default_value' => 'outerEnumDefaultValue', + 'outer_enum_integer_default_value' => 'outerEnumIntegerDefaultValue' } ); __PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map}); diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/FormatTest.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/FormatTest.pm index 3a077d8fc9be..b3c1defbd7ed 100644 --- a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/FormatTest.pm +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/FormatTest.pm @@ -252,6 +252,20 @@ __PACKAGE__->method_documentation({ format => '', read_only => '', }, + 'pattern_with_digits' => { + datatype => 'string', + base_name => 'pattern_with_digits', + description => 'A string that is a 10 digit number. Can have leading zeros.', + format => '', + read_only => '', + }, + 'pattern_with_digits_and_delimiter' => { + datatype => 'string', + base_name => 'pattern_with_digits_and_delimiter', + description => 'A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.', + format => '', + read_only => '', + }, }); __PACKAGE__->openapi_types( { @@ -267,7 +281,9 @@ __PACKAGE__->openapi_types( { 'date' => 'DateTime', 'date_time' => 'DateTime', 'uuid' => 'string', - 'password' => 'string' + 'password' => 'string', + 'pattern_with_digits' => 'string', + 'pattern_with_digits_and_delimiter' => 'string' } ); __PACKAGE__->attribute_map( { @@ -283,7 +299,9 @@ __PACKAGE__->attribute_map( { 'date' => 'date', 'date_time' => 'dateTime', 'uuid' => 'uuid', - 'password' => 'password' + 'password' => 'password', + 'pattern_with_digits' => 'pattern_with_digits', + 'pattern_with_digits_and_delimiter' => 'pattern_with_digits_and_delimiter' } ); __PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map}); diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/PetApi.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/PetApi.pm index 70d569890125..f55d7b63834a 100644 --- a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/PetApi.pm +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/PetApi.pm @@ -53,10 +53,10 @@ sub new { # # Add a new pet to the store # -# @param Pet $body Pet object that needs to be added to the store (required) +# @param Pet $pet Pet object that needs to be added to the store (required) { my $params = { - 'body' => { + 'pet' => { data_type => 'Pet', description => 'Pet object that needs to be added to the store', required => '1', @@ -73,9 +73,9 @@ sub new { sub add_pet { my ($self, %args) = @_; - # verify the required parameter 'body' is set - unless (exists $args{'body'}) { - croak("Missing the required parameter 'body' when calling add_pet"); + # verify the required parameter 'pet' is set + unless (exists $args{'pet'}) { + croak("Missing the required parameter 'pet' when calling add_pet"); } # parse inputs @@ -95,8 +95,8 @@ sub add_pet { my $_body_data; # body params - if ( exists $args{'body'}) { - $_body_data = $args{'body'}; + if ( exists $args{'pet'}) { + $_body_data = $args{'pet'}; } # authentication setting, if any @@ -385,10 +385,10 @@ sub get_pet_by_id { # # Update an existing pet # -# @param Pet $body Pet object that needs to be added to the store (required) +# @param Pet $pet Pet object that needs to be added to the store (required) { my $params = { - 'body' => { + 'pet' => { data_type => 'Pet', description => 'Pet object that needs to be added to the store', required => '1', @@ -405,9 +405,9 @@ sub get_pet_by_id { sub update_pet { my ($self, %args) = @_; - # verify the required parameter 'body' is set - unless (exists $args{'body'}) { - croak("Missing the required parameter 'body' when calling update_pet"); + # verify the required parameter 'pet' is set + unless (exists $args{'pet'}) { + croak("Missing the required parameter 'pet' when calling update_pet"); } # parse inputs @@ -427,8 +427,8 @@ sub update_pet { my $_body_data; # body params - if ( exists $args{'body'}) { - $_body_data = $args{'body'}; + if ( exists $args{'pet'}) { + $_body_data = $args{'pet'}; } # authentication setting, if any diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/StoreApi.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/StoreApi.pm index cfd4a0a29fca..3b87d3d8f731 100644 --- a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/StoreApi.pm +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/StoreApi.pm @@ -232,10 +232,10 @@ sub get_order_by_id { # # Place an order for a pet # -# @param Order $body order placed for purchasing the pet (required) +# @param Order $order order placed for purchasing the pet (required) { my $params = { - 'body' => { + 'order' => { data_type => 'Order', description => 'order placed for purchasing the pet', required => '1', @@ -252,9 +252,9 @@ sub get_order_by_id { sub place_order { my ($self, %args) = @_; - # verify the required parameter 'body' is set - unless (exists $args{'body'}) { - croak("Missing the required parameter 'body' when calling place_order"); + # verify the required parameter 'order' is set + unless (exists $args{'order'}) { + croak("Missing the required parameter 'order' when calling place_order"); } # parse inputs @@ -270,12 +270,12 @@ sub place_order { if ($_header_accept) { $header_params->{'Accept'} = $_header_accept; } - $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); + $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); my $_body_data; # body params - if ( exists $args{'body'}) { - $_body_data = $args{'body'}; + if ( exists $args{'order'}) { + $_body_data = $args{'order'}; } # authentication setting, if any diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/UserApi.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/UserApi.pm index 3d3dfab9c7db..15bb4b97a3c1 100644 --- a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/UserApi.pm +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/UserApi.pm @@ -53,10 +53,10 @@ sub new { # # Create user # -# @param User $body Created user object (required) +# @param User $user Created user object (required) { my $params = { - 'body' => { + 'user' => { data_type => 'User', description => 'Created user object', required => '1', @@ -73,9 +73,9 @@ sub new { sub create_user { my ($self, %args) = @_; - # verify the required parameter 'body' is set - unless (exists $args{'body'}) { - croak("Missing the required parameter 'body' when calling create_user"); + # verify the required parameter 'user' is set + unless (exists $args{'user'}) { + croak("Missing the required parameter 'user' when calling create_user"); } # parse inputs @@ -91,12 +91,12 @@ sub create_user { if ($_header_accept) { $header_params->{'Accept'} = $_header_accept; } - $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); + $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); my $_body_data; # body params - if ( exists $args{'body'}) { - $_body_data = $args{'body'}; + if ( exists $args{'user'}) { + $_body_data = $args{'user'}; } # authentication setting, if any @@ -114,10 +114,10 @@ sub create_user { # # Creates list of users with given input array # -# @param ARRAY[User] $body List of user object (required) +# @param ARRAY[User] $user List of user object (required) { my $params = { - 'body' => { + 'user' => { data_type => 'ARRAY[User]', description => 'List of user object', required => '1', @@ -134,9 +134,9 @@ sub create_user { sub create_users_with_array_input { my ($self, %args) = @_; - # verify the required parameter 'body' is set - unless (exists $args{'body'}) { - croak("Missing the required parameter 'body' when calling create_users_with_array_input"); + # verify the required parameter 'user' is set + unless (exists $args{'user'}) { + croak("Missing the required parameter 'user' when calling create_users_with_array_input"); } # parse inputs @@ -152,12 +152,12 @@ sub create_users_with_array_input { if ($_header_accept) { $header_params->{'Accept'} = $_header_accept; } - $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); + $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); my $_body_data; # body params - if ( exists $args{'body'}) { - $_body_data = $args{'body'}; + if ( exists $args{'user'}) { + $_body_data = $args{'user'}; } # authentication setting, if any @@ -175,10 +175,10 @@ sub create_users_with_array_input { # # Creates list of users with given input array # -# @param ARRAY[User] $body List of user object (required) +# @param ARRAY[User] $user List of user object (required) { my $params = { - 'body' => { + 'user' => { data_type => 'ARRAY[User]', description => 'List of user object', required => '1', @@ -195,9 +195,9 @@ sub create_users_with_array_input { sub create_users_with_list_input { my ($self, %args) = @_; - # verify the required parameter 'body' is set - unless (exists $args{'body'}) { - croak("Missing the required parameter 'body' when calling create_users_with_list_input"); + # verify the required parameter 'user' is set + unless (exists $args{'user'}) { + croak("Missing the required parameter 'user' when calling create_users_with_list_input"); } # parse inputs @@ -213,12 +213,12 @@ sub create_users_with_list_input { if ($_header_accept) { $header_params->{'Accept'} = $_header_accept; } - $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); + $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); my $_body_data; # body params - if ( exists $args{'body'}) { - $_body_data = $args{'body'}; + if ( exists $args{'user'}) { + $_body_data = $args{'user'}; } # authentication setting, if any @@ -493,7 +493,7 @@ sub logout_user { # Updated user # # @param string $username name that need to be deleted (required) -# @param User $body Updated user object (required) +# @param User $user Updated user object (required) { my $params = { 'username' => { @@ -501,7 +501,7 @@ sub logout_user { description => 'name that need to be deleted', required => '1', }, - 'body' => { + 'user' => { data_type => 'User', description => 'Updated user object', required => '1', @@ -523,9 +523,9 @@ sub update_user { croak("Missing the required parameter 'username' when calling update_user"); } - # verify the required parameter 'body' is set - unless (exists $args{'body'}) { - croak("Missing the required parameter 'body' when calling update_user"); + # verify the required parameter 'user' is set + unless (exists $args{'user'}) { + croak("Missing the required parameter 'user' when calling update_user"); } # parse inputs @@ -541,7 +541,7 @@ sub update_user { if ($_header_accept) { $header_params->{'Accept'} = $_header_accept; } - $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); + $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); # path params if ( exists $args{'username'}) { @@ -552,8 +552,8 @@ sub update_user { my $_body_data; # body params - if ( exists $args{'body'}) { - $_body_data = $args{'body'}; + if ( exists $args{'user'}) { + $_body_data = $args{'user'}; } # authentication setting, if any diff --git a/samples/client/petstore/powershell/.openapi-generator/VERSION b/samples/client/petstore/powershell/.openapi-generator/VERSION index afa636560641..83a328a9227e 100644 --- a/samples/client/petstore/powershell/.openapi-generator/VERSION +++ b/samples/client/petstore/powershell/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/powershell/src/Org.OpenAPITools/API/PetApi.ps1 b/samples/client/petstore/powershell/src/Org.OpenAPITools/API/PetApi.ps1 index 9eb13d258475..45aee1f6f2d3 100644 --- a/samples/client/petstore/powershell/src/Org.OpenAPITools/API/PetApi.ps1 +++ b/samples/client/petstore/powershell/src/Org.OpenAPITools/API/PetApi.ps1 @@ -3,7 +3,7 @@ function Invoke-PetApiAddPet { Param ( [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $true)] [Org.OpenAPITools.Model.Pet] - ${body} + ${pet} ) Process { @@ -11,7 +11,7 @@ function Invoke-PetApiAddPet { $PSBoundParameters | Out-DebugParameter | Write-Debug $Script:PetApi.AddPet( - ${body} + ${pet} ) } } @@ -61,7 +61,10 @@ function Invoke-PetApiFindPetsByTags { Param ( [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $true)] [String[]] - ${tags} + ${tags}, + [Parameter(Position = 1, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] + [Int32] + ${maxCount} ) Process { @@ -69,7 +72,8 @@ function Invoke-PetApiFindPetsByTags { $PSBoundParameters | Out-DebugParameter | Write-Debug $Script:PetApi.FindPetsByTags( - ${tags} + ${tags}, + ${maxCount} ) } } @@ -97,7 +101,7 @@ function Invoke-PetApiUpdatePet { Param ( [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $true)] [Org.OpenAPITools.Model.Pet] - ${body} + ${pet} ) Process { @@ -105,7 +109,7 @@ function Invoke-PetApiUpdatePet { $PSBoundParameters | Out-DebugParameter | Write-Debug $Script:PetApi.UpdatePet( - ${body} + ${pet} ) } } diff --git a/samples/client/petstore/powershell/src/Org.OpenAPITools/API/StoreApi.ps1 b/samples/client/petstore/powershell/src/Org.OpenAPITools/API/StoreApi.ps1 index 679176f56a24..cfd4cdc3b454 100644 --- a/samples/client/petstore/powershell/src/Org.OpenAPITools/API/StoreApi.ps1 +++ b/samples/client/petstore/powershell/src/Org.OpenAPITools/API/StoreApi.ps1 @@ -53,7 +53,7 @@ function Invoke-StoreApiPlaceOrder { Param ( [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $true)] [Org.OpenAPITools.Model.Order] - ${body} + ${order} ) Process { @@ -61,7 +61,7 @@ function Invoke-StoreApiPlaceOrder { $PSBoundParameters | Out-DebugParameter | Write-Debug $Script:StoreApi.PlaceOrder( - ${body} + ${order} ) } } diff --git a/samples/client/petstore/powershell/src/Org.OpenAPITools/API/UserApi.ps1 b/samples/client/petstore/powershell/src/Org.OpenAPITools/API/UserApi.ps1 index d8eea661dcc2..d716a6203af2 100644 --- a/samples/client/petstore/powershell/src/Org.OpenAPITools/API/UserApi.ps1 +++ b/samples/client/petstore/powershell/src/Org.OpenAPITools/API/UserApi.ps1 @@ -3,7 +3,7 @@ function Invoke-UserApiCreateUser { Param ( [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $true)] [Org.OpenAPITools.Model.User] - ${body} + ${user} ) Process { @@ -11,7 +11,7 @@ function Invoke-UserApiCreateUser { $PSBoundParameters | Out-DebugParameter | Write-Debug $Script:UserApi.CreateUser( - ${body} + ${user} ) } } @@ -21,7 +21,7 @@ function Invoke-UserApiCreateUsersWithArrayInput { Param ( [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $true)] [Org.OpenAPITools.Model.User[]] - ${body} + ${user} ) Process { @@ -29,7 +29,7 @@ function Invoke-UserApiCreateUsersWithArrayInput { $PSBoundParameters | Out-DebugParameter | Write-Debug $Script:UserApi.CreateUsersWithArrayInput( - ${body} + ${user} ) } } @@ -39,7 +39,7 @@ function Invoke-UserApiCreateUsersWithListInput { Param ( [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $true)] [Org.OpenAPITools.Model.User[]] - ${body} + ${user} ) Process { @@ -47,7 +47,7 @@ function Invoke-UserApiCreateUsersWithListInput { $PSBoundParameters | Out-DebugParameter | Write-Debug $Script:UserApi.CreateUsersWithListInput( - ${body} + ${user} ) } } @@ -132,7 +132,7 @@ function Invoke-UserApiUpdateUser { ${username}, [Parameter(Position = 1, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $true)] [Org.OpenAPITools.Model.User] - ${body} + ${user} ) Process { @@ -141,7 +141,7 @@ function Invoke-UserApiUpdateUser { $Script:UserApi.UpdateUser( ${username}, - ${body} + ${user} ) } } diff --git a/samples/client/petstore/powershell/src/Org.OpenAPITools/Model/New-InlineObject.ps1 b/samples/client/petstore/powershell/src/Org.OpenAPITools/Model/New-InlineObject.ps1 new file mode 100644 index 000000000000..cdab2d989a3c --- /dev/null +++ b/samples/client/petstore/powershell/src/Org.OpenAPITools/Model/New-InlineObject.ps1 @@ -0,0 +1,21 @@ +function New-InlineObject { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [String] + ${name}, + [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)] + [String] + ${status} + ) + + Process { + 'Creating object: Org.OpenAPITools.Model.InlineObject' | Write-Verbose + $PSBoundParameters | Out-DebugParameter | Write-Debug + + New-Object -TypeName Org.OpenAPITools.Model.InlineObject -ArgumentList @( + ${name}, + ${status} + ) + } +} diff --git a/samples/client/petstore/powershell/src/Org.OpenAPITools/Model/New-InlineObject1.ps1 b/samples/client/petstore/powershell/src/Org.OpenAPITools/Model/New-InlineObject1.ps1 new file mode 100644 index 000000000000..0293b3068a4b --- /dev/null +++ b/samples/client/petstore/powershell/src/Org.OpenAPITools/Model/New-InlineObject1.ps1 @@ -0,0 +1,21 @@ +function New-InlineObject1 { + [CmdletBinding()] + Param ( + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [String] + ${additionalMetadata}, + [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)] + [System.Nullable[String]] + ${file} + ) + + Process { + 'Creating object: Org.OpenAPITools.Model.InlineObject1' | Write-Verbose + $PSBoundParameters | Out-DebugParameter | Write-Debug + + New-Object -TypeName Org.OpenAPITools.Model.InlineObject1 -ArgumentList @( + ${additionalMetadata}, + ${file} + ) + } +} diff --git a/samples/client/petstore/powershell/test/InlineObject1Test.ps1 b/samples/client/petstore/powershell/test/InlineObject1Test.ps1 new file mode 100644 index 000000000000..1fc8f6add422 --- /dev/null +++ b/samples/client/petstore/powershell/test/InlineObject1Test.ps1 @@ -0,0 +1,2 @@ +## TODO we need to update the template to test the model files + diff --git a/samples/client/petstore/powershell/test/InlineObjectTest.ps1 b/samples/client/petstore/powershell/test/InlineObjectTest.ps1 new file mode 100644 index 000000000000..1fc8f6add422 --- /dev/null +++ b/samples/client/petstore/powershell/test/InlineObjectTest.ps1 @@ -0,0 +1,2 @@ +## TODO we need to update the template to test the model files + diff --git a/samples/client/petstore/python-experimental/.openapi-generator/VERSION b/samples/client/petstore/python-experimental/.openapi-generator/VERSION index 479c313e87b9..83a328a9227e 100644 --- a/samples/client/petstore/python-experimental/.openapi-generator/VERSION +++ b/samples/client/petstore/python-experimental/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.3-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/python-experimental/README.md b/samples/client/petstore/python-experimental/README.md index 3e91b2678bea..54185e442335 100644 --- a/samples/client/petstore/python-experimental/README.md +++ b/samples/client/petstore/python-experimental/README.md @@ -1,4 +1,4 @@ -# petstore-api +# openapi-client This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: @@ -23,7 +23,7 @@ pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git Then import the package: ```python -import petstore_api +import openapi_client ``` ### Setuptools @@ -37,7 +37,7 @@ python setup.py install --user Then import the package: ```python -import petstore_api +import openapi_client ``` ## Getting Started @@ -47,14 +47,16 @@ Please follow the [installation procedure](#installation--usage) and then run th ```python from __future__ import print_function import time -import petstore_api -from petstore_api.rest import ApiException +import openapi_client +from openapi_client.rest import ApiException from pprint import pprint -# create an instance of the API class -api_instance = petstore_api.AnotherFakeApi(petstore_api.ApiClient(configuration)) -body = petstore_api.Client() # Client | client model +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = openapi_client.AnotherFakeApi(openapi_client.ApiClient(configuration)) +body = openapi_client.Client() # Client | client model try: # To test special tags diff --git a/samples/client/petstore/python-experimental/docs/AnotherFakeApi.md b/samples/client/petstore/python-experimental/docs/AnotherFakeApi.md index c3f84772cfd6..b0e079b4675b 100644 --- a/samples/client/petstore/python-experimental/docs/AnotherFakeApi.md +++ b/samples/client/petstore/python-experimental/docs/AnotherFakeApi.md @@ -1,4 +1,4 @@ -# petstore_api.AnotherFakeApi +# openapi_client.AnotherFakeApi All URIs are relative to *http://petstore.swagger.io:80/v2* @@ -19,13 +19,13 @@ To test special tags and operation ID starting with number ```python from __future__ import print_function import time -import petstore_api -from petstore_api.rest import ApiException +import openapi_client +from openapi_client.rest import ApiException from pprint import pprint -# create an instance of the API class -api_instance = petstore_api.AnotherFakeApi() -body = petstore_api.Client() # Client | client model +# Create an instance of the API class +api_instance = openapi_client.AnotherFakeApi() +body = openapi_client.Client() # Client | client model try: # To test special tags diff --git a/samples/client/petstore/python-experimental/docs/FakeApi.md b/samples/client/petstore/python-experimental/docs/FakeApi.md index 946a8ce3e77d..d0857ed0b869 100644 --- a/samples/client/petstore/python-experimental/docs/FakeApi.md +++ b/samples/client/petstore/python-experimental/docs/FakeApi.md @@ -1,4 +1,4 @@ -# petstore_api.FakeApi +# openapi_client.FakeApi All URIs are relative to *http://petstore.swagger.io:80/v2* @@ -31,13 +31,13 @@ this route creates an XmlItem ```python from __future__ import print_function import time -import petstore_api -from petstore_api.rest import ApiException +import openapi_client +from openapi_client.rest import ApiException from pprint import pprint -# create an instance of the API class -api_instance = petstore_api.FakeApi() -xml_item = petstore_api.XmlItem() # XmlItem | XmlItem Body +# Create an instance of the API class +api_instance = openapi_client.FakeApi() +xml_item = openapi_client.XmlItem() # XmlItem | XmlItem Body try: # creates an XmlItem @@ -84,12 +84,12 @@ Test serialization of outer boolean types ```python from __future__ import print_function import time -import petstore_api -from petstore_api.rest import ApiException +import openapi_client +from openapi_client.rest import ApiException from pprint import pprint -# create an instance of the API class -api_instance = petstore_api.FakeApi() +# Create an instance of the API class +api_instance = openapi_client.FakeApi() body = True # bool | Input boolean as post body (optional) try: @@ -137,13 +137,13 @@ Test serialization of object with outer number type ```python from __future__ import print_function import time -import petstore_api -from petstore_api.rest import ApiException +import openapi_client +from openapi_client.rest import ApiException from pprint import pprint -# create an instance of the API class -api_instance = petstore_api.FakeApi() -body = petstore_api.OuterComposite() # OuterComposite | Input composite as post body (optional) +# Create an instance of the API class +api_instance = openapi_client.FakeApi() +body = openapi_client.OuterComposite() # OuterComposite | Input composite as post body (optional) try: api_response = api_instance.fake_outer_composite_serialize(body=body) @@ -190,12 +190,12 @@ Test serialization of outer number types ```python from __future__ import print_function import time -import petstore_api -from petstore_api.rest import ApiException +import openapi_client +from openapi_client.rest import ApiException from pprint import pprint -# create an instance of the API class -api_instance = petstore_api.FakeApi() +# Create an instance of the API class +api_instance = openapi_client.FakeApi() body = 3.4 # float | Input number as post body (optional) try: @@ -243,12 +243,12 @@ Test serialization of outer string types ```python from __future__ import print_function import time -import petstore_api -from petstore_api.rest import ApiException +import openapi_client +from openapi_client.rest import ApiException from pprint import pprint -# create an instance of the API class -api_instance = petstore_api.FakeApi() +# Create an instance of the API class +api_instance = openapi_client.FakeApi() body = 'body_example' # str | Input string as post body (optional) try: @@ -296,13 +296,13 @@ For this test, the body for this request much reference a schema named `File`. ```python from __future__ import print_function import time -import petstore_api -from petstore_api.rest import ApiException +import openapi_client +from openapi_client.rest import ApiException from pprint import pprint -# create an instance of the API class -api_instance = petstore_api.FakeApi() -body = petstore_api.FileSchemaTestClass() # FileSchemaTestClass | +# Create an instance of the API class +api_instance = openapi_client.FakeApi() +body = openapi_client.FileSchemaTestClass() # FileSchemaTestClass | try: api_instance.test_body_with_file_schema(body) @@ -346,14 +346,14 @@ No authorization required ```python from __future__ import print_function import time -import petstore_api -from petstore_api.rest import ApiException +import openapi_client +from openapi_client.rest import ApiException from pprint import pprint -# create an instance of the API class -api_instance = petstore_api.FakeApi() +# Create an instance of the API class +api_instance = openapi_client.FakeApi() query = 'query_example' # str | -body = petstore_api.User() # User | +body = openapi_client.User() # User | try: api_instance.test_body_with_query_params(query, body) @@ -400,13 +400,13 @@ To test \"client\" model ```python from __future__ import print_function import time -import petstore_api -from petstore_api.rest import ApiException +import openapi_client +from openapi_client.rest import ApiException from pprint import pprint -# create an instance of the API class -api_instance = petstore_api.FakeApi() -body = petstore_api.Client() # Client | client model +# Create an instance of the API class +api_instance = openapi_client.FakeApi() +body = openapi_client.Client() # Client | client model try: # To test \"client\" model @@ -455,16 +455,18 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン ```python from __future__ import print_function import time -import petstore_api -from petstore_api.rest import ApiException +import openapi_client +from openapi_client.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +configuration = openapi_client.Configuration() # Configure HTTP basic authorization: http_basic_test configuration.username = 'YOUR_USERNAME' configuration.password = 'YOUR_PASSWORD' -# create an instance of the API class -api_instance = petstore_api.FakeApi(petstore_api.ApiClient(configuration)) +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = openapi_client.FakeApi(openapi_client.ApiClient(configuration)) number = 3.4 # float | None double = 3.4 # float | None pattern_without_delimiter = 'pattern_without_delimiter_example' # str | None @@ -539,12 +541,12 @@ To test enum parameters ```python from __future__ import print_function import time -import petstore_api -from petstore_api.rest import ApiException +import openapi_client +from openapi_client.rest import ApiException from pprint import pprint -# create an instance of the API class -api_instance = petstore_api.FakeApi() +# Create an instance of the API class +api_instance = openapi_client.FakeApi() enum_header_string_array = ['enum_header_string_array_example'] # list[str] | Header parameter enum test (string array) (optional) enum_header_string = '-efg' # str | Header parameter enum test (string) (optional) (default to '-efg') enum_query_string_array = ['enum_query_string_array_example'] # list[str] | Query parameter enum test (string array) (optional) @@ -607,12 +609,12 @@ Fake endpoint to test group parameters (optional) ```python from __future__ import print_function import time -import petstore_api -from petstore_api.rest import ApiException +import openapi_client +from openapi_client.rest import ApiException from pprint import pprint -# create an instance of the API class -api_instance = petstore_api.FakeApi() +# Create an instance of the API class +api_instance = openapi_client.FakeApi() required_string_group = 56 # int | Required String in group parameters required_boolean_group = True # bool | Required Boolean in group parameters required_int64_group = 56 # int | Required Integer in group parameters @@ -668,12 +670,12 @@ test inline additionalProperties ```python from __future__ import print_function import time -import petstore_api -from petstore_api.rest import ApiException +import openapi_client +from openapi_client.rest import ApiException from pprint import pprint -# create an instance of the API class -api_instance = petstore_api.FakeApi() +# Create an instance of the API class +api_instance = openapi_client.FakeApi() param = {'key': 'param_example'} # dict(str, str) | request body try: @@ -719,12 +721,12 @@ test json serialization of form data ```python from __future__ import print_function import time -import petstore_api -from petstore_api.rest import ApiException +import openapi_client +from openapi_client.rest import ApiException from pprint import pprint -# create an instance of the API class -api_instance = petstore_api.FakeApi() +# Create an instance of the API class +api_instance = openapi_client.FakeApi() param = 'param_example' # str | field1 param2 = 'param2_example' # str | field2 diff --git a/samples/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md b/samples/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md index 7ffcf2112243..47bf608219e2 100644 --- a/samples/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md @@ -1,4 +1,4 @@ -# petstore_api.FakeClassnameTags123Api +# openapi_client.FakeClassnameTags123Api All URIs are relative to *http://petstore.swagger.io:80/v2* @@ -20,18 +20,20 @@ To test class name in snake case ```python from __future__ import print_function import time -import petstore_api -from petstore_api.rest import ApiException +import openapi_client +from openapi_client.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +configuration = openapi_client.Configuration() # Configure API key authorization: api_key_query configuration.api_key['api_key_query'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['api_key_query'] = 'Bearer' -# create an instance of the API class -api_instance = petstore_api.FakeClassnameTags123Api(petstore_api.ApiClient(configuration)) -body = petstore_api.Client() # Client | client model +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = openapi_client.FakeClassnameTags123Api(openapi_client.ApiClient(configuration)) +body = openapi_client.Client() # Client | client model try: # To test class name in snake case diff --git a/samples/client/petstore/python-experimental/docs/PetApi.md b/samples/client/petstore/python-experimental/docs/PetApi.md index 3ed2551bd64b..2896bb8ea8ab 100644 --- a/samples/client/petstore/python-experimental/docs/PetApi.md +++ b/samples/client/petstore/python-experimental/docs/PetApi.md @@ -1,4 +1,4 @@ -# petstore_api.PetApi +# openapi_client.PetApi All URIs are relative to *http://petstore.swagger.io:80/v2* @@ -26,16 +26,18 @@ Add a new pet to the store ```python from __future__ import print_function import time -import petstore_api -from petstore_api.rest import ApiException +import openapi_client +from openapi_client.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +configuration = openapi_client.Configuration() # Configure OAuth2 access token for authorization: petstore_auth configuration.access_token = 'YOUR_ACCESS_TOKEN' -# create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -body = petstore_api.Pet() # Pet | Pet object that needs to be added to the store +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = openapi_client.PetApi(openapi_client.ApiClient(configuration)) +body = openapi_client.Pet() # Pet | Pet object that needs to be added to the store try: # Add a new pet to the store @@ -82,15 +84,17 @@ Deletes a pet ```python from __future__ import print_function import time -import petstore_api -from petstore_api.rest import ApiException +import openapi_client +from openapi_client.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +configuration = openapi_client.Configuration() # Configure OAuth2 access token for authorization: petstore_auth configuration.access_token = 'YOUR_ACCESS_TOKEN' -# create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = openapi_client.PetApi(openapi_client.ApiClient(configuration)) pet_id = 56 # int | Pet id to delete api_key = 'api_key_example' # str | (optional) @@ -142,15 +146,17 @@ Multiple status values can be provided with comma separated strings ```python from __future__ import print_function import time -import petstore_api -from petstore_api.rest import ApiException +import openapi_client +from openapi_client.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +configuration = openapi_client.Configuration() # Configure OAuth2 access token for authorization: petstore_auth configuration.access_token = 'YOUR_ACCESS_TOKEN' -# create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = openapi_client.PetApi(openapi_client.ApiClient(configuration)) status = ['status_example'] # list[str] | Status values that need to be considered for filter try: @@ -201,15 +207,17 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 ```python from __future__ import print_function import time -import petstore_api -from petstore_api.rest import ApiException +import openapi_client +from openapi_client.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +configuration = openapi_client.Configuration() # Configure OAuth2 access token for authorization: petstore_auth configuration.access_token = 'YOUR_ACCESS_TOKEN' -# create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = openapi_client.PetApi(openapi_client.ApiClient(configuration)) tags = ['tags_example'] # list[str] | Tags to filter by try: @@ -260,17 +268,19 @@ Returns a single pet ```python from __future__ import print_function import time -import petstore_api -from petstore_api.rest import ApiException +import openapi_client +from openapi_client.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +configuration = openapi_client.Configuration() # Configure API key authorization: api_key configuration.api_key['api_key'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['api_key'] = 'Bearer' -# create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = openapi_client.PetApi(openapi_client.ApiClient(configuration)) pet_id = 56 # int | ID of pet to return try: @@ -320,16 +330,18 @@ Update an existing pet ```python from __future__ import print_function import time -import petstore_api -from petstore_api.rest import ApiException +import openapi_client +from openapi_client.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +configuration = openapi_client.Configuration() # Configure OAuth2 access token for authorization: petstore_auth configuration.access_token = 'YOUR_ACCESS_TOKEN' -# create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -body = petstore_api.Pet() # Pet | Pet object that needs to be added to the store +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = openapi_client.PetApi(openapi_client.ApiClient(configuration)) +body = openapi_client.Pet() # Pet | Pet object that needs to be added to the store try: # Update an existing pet @@ -378,15 +390,17 @@ Updates a pet in the store with form data ```python from __future__ import print_function import time -import petstore_api -from petstore_api.rest import ApiException +import openapi_client +from openapi_client.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +configuration = openapi_client.Configuration() # Configure OAuth2 access token for authorization: petstore_auth configuration.access_token = 'YOUR_ACCESS_TOKEN' -# create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = openapi_client.PetApi(openapi_client.ApiClient(configuration)) pet_id = 56 # int | ID of pet that needs to be updated name = 'name_example' # str | Updated name of the pet (optional) status = 'status_example' # str | Updated status of the pet (optional) @@ -437,15 +451,17 @@ uploads an image ```python from __future__ import print_function import time -import petstore_api -from petstore_api.rest import ApiException +import openapi_client +from openapi_client.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +configuration = openapi_client.Configuration() # Configure OAuth2 access token for authorization: petstore_auth configuration.access_token = 'YOUR_ACCESS_TOKEN' -# create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = openapi_client.PetApi(openapi_client.ApiClient(configuration)) pet_id = 56 # int | ID of pet to update additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional) file = '/path/to/file' # file | file to upload (optional) @@ -497,15 +513,17 @@ uploads an image (required) ```python from __future__ import print_function import time -import petstore_api -from petstore_api.rest import ApiException +import openapi_client +from openapi_client.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +configuration = openapi_client.Configuration() # Configure OAuth2 access token for authorization: petstore_auth configuration.access_token = 'YOUR_ACCESS_TOKEN' -# create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = openapi_client.PetApi(openapi_client.ApiClient(configuration)) pet_id = 56 # int | ID of pet to update required_file = '/path/to/file' # file | file to upload additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional) diff --git a/samples/client/petstore/python-experimental/docs/StoreApi.md b/samples/client/petstore/python-experimental/docs/StoreApi.md index 76b94f73dcf7..46c0007fc64e 100644 --- a/samples/client/petstore/python-experimental/docs/StoreApi.md +++ b/samples/client/petstore/python-experimental/docs/StoreApi.md @@ -1,4 +1,4 @@ -# petstore_api.StoreApi +# openapi_client.StoreApi All URIs are relative to *http://petstore.swagger.io:80/v2* @@ -22,12 +22,12 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non ```python from __future__ import print_function import time -import petstore_api -from petstore_api.rest import ApiException +import openapi_client +from openapi_client.rest import ApiException from pprint import pprint -# create an instance of the API class -api_instance = petstore_api.StoreApi() +# Create an instance of the API class +api_instance = openapi_client.StoreApi() order_id = 'order_id_example' # str | ID of the order that needs to be deleted try: @@ -77,17 +77,19 @@ Returns a map of status codes to quantities ```python from __future__ import print_function import time -import petstore_api -from petstore_api.rest import ApiException +import openapi_client +from openapi_client.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +configuration = openapi_client.Configuration() # Configure API key authorization: api_key configuration.api_key['api_key'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['api_key'] = 'Bearer' -# create an instance of the API class -api_instance = petstore_api.StoreApi(petstore_api.ApiClient(configuration)) +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = openapi_client.StoreApi(openapi_client.ApiClient(configuration)) try: # Returns pet inventories by status @@ -132,12 +134,12 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge ```python from __future__ import print_function import time -import petstore_api -from petstore_api.rest import ApiException +import openapi_client +from openapi_client.rest import ApiException from pprint import pprint -# create an instance of the API class -api_instance = petstore_api.StoreApi() +# Create an instance of the API class +api_instance = openapi_client.StoreApi() order_id = 56 # int | ID of pet that needs to be fetched try: @@ -186,13 +188,13 @@ Place an order for a pet ```python from __future__ import print_function import time -import petstore_api -from petstore_api.rest import ApiException +import openapi_client +from openapi_client.rest import ApiException from pprint import pprint -# create an instance of the API class -api_instance = petstore_api.StoreApi() -body = petstore_api.Order() # Order | order placed for purchasing the pet +# Create an instance of the API class +api_instance = openapi_client.StoreApi() +body = openapi_client.Order() # Order | order placed for purchasing the pet try: # Place an order for a pet diff --git a/samples/client/petstore/python-experimental/docs/UserApi.md b/samples/client/petstore/python-experimental/docs/UserApi.md index 783bb991ce1c..e8b9c754b62b 100644 --- a/samples/client/petstore/python-experimental/docs/UserApi.md +++ b/samples/client/petstore/python-experimental/docs/UserApi.md @@ -1,4 +1,4 @@ -# petstore_api.UserApi +# openapi_client.UserApi All URIs are relative to *http://petstore.swagger.io:80/v2* @@ -26,13 +26,13 @@ This can only be done by the logged in user. ```python from __future__ import print_function import time -import petstore_api -from petstore_api.rest import ApiException +import openapi_client +from openapi_client.rest import ApiException from pprint import pprint -# create an instance of the API class -api_instance = petstore_api.UserApi() -body = petstore_api.User() # User | Created user object +# Create an instance of the API class +api_instance = openapi_client.UserApi() +body = openapi_client.User() # User | Created user object try: # Create user @@ -77,13 +77,13 @@ Creates list of users with given input array ```python from __future__ import print_function import time -import petstore_api -from petstore_api.rest import ApiException +import openapi_client +from openapi_client.rest import ApiException from pprint import pprint -# create an instance of the API class -api_instance = petstore_api.UserApi() -body = [petstore_api.User()] # list[User] | List of user object +# Create an instance of the API class +api_instance = openapi_client.UserApi() +body = [openapi_client.User()] # list[User] | List of user object try: # Creates list of users with given input array @@ -128,13 +128,13 @@ Creates list of users with given input array ```python from __future__ import print_function import time -import petstore_api -from petstore_api.rest import ApiException +import openapi_client +from openapi_client.rest import ApiException from pprint import pprint -# create an instance of the API class -api_instance = petstore_api.UserApi() -body = [petstore_api.User()] # list[User] | List of user object +# Create an instance of the API class +api_instance = openapi_client.UserApi() +body = [openapi_client.User()] # list[User] | List of user object try: # Creates list of users with given input array @@ -181,12 +181,12 @@ This can only be done by the logged in user. ```python from __future__ import print_function import time -import petstore_api -from petstore_api.rest import ApiException +import openapi_client +from openapi_client.rest import ApiException from pprint import pprint -# create an instance of the API class -api_instance = petstore_api.UserApi() +# Create an instance of the API class +api_instance = openapi_client.UserApi() username = 'username_example' # str | The name that needs to be deleted try: @@ -233,12 +233,12 @@ Get user by user name ```python from __future__ import print_function import time -import petstore_api -from petstore_api.rest import ApiException +import openapi_client +from openapi_client.rest import ApiException from pprint import pprint -# create an instance of the API class -api_instance = petstore_api.UserApi() +# Create an instance of the API class +api_instance = openapi_client.UserApi() username = 'username_example' # str | The name that needs to be fetched. Use user1 for testing. try: @@ -287,12 +287,12 @@ Logs user into the system ```python from __future__ import print_function import time -import petstore_api -from petstore_api.rest import ApiException +import openapi_client +from openapi_client.rest import ApiException from pprint import pprint -# create an instance of the API class -api_instance = petstore_api.UserApi() +# Create an instance of the API class +api_instance = openapi_client.UserApi() username = 'username_example' # str | The user name for login password = 'password_example' # str | The password for login in clear text @@ -342,12 +342,12 @@ Logs out current logged in user session ```python from __future__ import print_function import time -import petstore_api -from petstore_api.rest import ApiException +import openapi_client +from openapi_client.rest import ApiException from pprint import pprint -# create an instance of the API class -api_instance = petstore_api.UserApi() +# Create an instance of the API class +api_instance = openapi_client.UserApi() try: # Logs out current logged in user session @@ -391,14 +391,14 @@ This can only be done by the logged in user. ```python from __future__ import print_function import time -import petstore_api -from petstore_api.rest import ApiException +import openapi_client +from openapi_client.rest import ApiException from pprint import pprint -# create an instance of the API class -api_instance = petstore_api.UserApi() +# Create an instance of the API class +api_instance = openapi_client.UserApi() username = 'username_example' # str | name that need to be deleted -body = petstore_api.User() # User | Updated user object +body = openapi_client.User() # User | Updated user object try: # Updated user diff --git a/samples/client/petstore/python-experimental/openapi_client/__init__.py b/samples/client/petstore/python-experimental/openapi_client/__init__.py new file mode 100644 index 000000000000..c8ca35de6ad8 --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/__init__.py @@ -0,0 +1,82 @@ +# coding: utf-8 + +# flake8: noqa + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +__version__ = "1.0.0" + +# import apis into sdk package +from openapi_client.api.another_fake_api import AnotherFakeApi +from openapi_client.api.fake_api import FakeApi +from openapi_client.api.fake_classname_tags_123_api import FakeClassnameTags123Api +from openapi_client.api.pet_api import PetApi +from openapi_client.api.store_api import StoreApi +from openapi_client.api.user_api import UserApi + +# import ApiClient +from openapi_client.api_client import ApiClient +from openapi_client.configuration import Configuration +from openapi_client.exceptions import OpenApiException +from openapi_client.exceptions import ApiTypeError +from openapi_client.exceptions import ApiValueError +from openapi_client.exceptions import ApiKeyError +from openapi_client.exceptions import ApiException +# import models into sdk package +from openapi_client.models.additional_properties_any_type import AdditionalPropertiesAnyType +from openapi_client.models.additional_properties_array import AdditionalPropertiesArray +from openapi_client.models.additional_properties_boolean import AdditionalPropertiesBoolean +from openapi_client.models.additional_properties_class import AdditionalPropertiesClass +from openapi_client.models.additional_properties_integer import AdditionalPropertiesInteger +from openapi_client.models.additional_properties_number import AdditionalPropertiesNumber +from openapi_client.models.additional_properties_object import AdditionalPropertiesObject +from openapi_client.models.additional_properties_string import AdditionalPropertiesString +from openapi_client.models.animal import Animal +from openapi_client.models.api_response import ApiResponse +from openapi_client.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly +from openapi_client.models.array_of_number_only import ArrayOfNumberOnly +from openapi_client.models.array_test import ArrayTest +from openapi_client.models.capitalization import Capitalization +from openapi_client.models.cat import Cat +from openapi_client.models.cat_all_of import CatAllOf +from openapi_client.models.category import Category +from openapi_client.models.class_model import ClassModel +from openapi_client.models.client import Client +from openapi_client.models.dog import Dog +from openapi_client.models.dog_all_of import DogAllOf +from openapi_client.models.enum_arrays import EnumArrays +from openapi_client.models.enum_class import EnumClass +from openapi_client.models.enum_test import EnumTest +from openapi_client.models.file import File +from openapi_client.models.file_schema_test_class import FileSchemaTestClass +from openapi_client.models.format_test import FormatTest +from openapi_client.models.has_only_read_only import HasOnlyReadOnly +from openapi_client.models.list import List +from openapi_client.models.map_test import MapTest +from openapi_client.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass +from openapi_client.models.model200_response import Model200Response +from openapi_client.models.model_return import ModelReturn +from openapi_client.models.name import Name +from openapi_client.models.number_only import NumberOnly +from openapi_client.models.order import Order +from openapi_client.models.outer_composite import OuterComposite +from openapi_client.models.outer_enum import OuterEnum +from openapi_client.models.pet import Pet +from openapi_client.models.read_only_first import ReadOnlyFirst +from openapi_client.models.special_model_name import SpecialModelName +from openapi_client.models.tag import Tag +from openapi_client.models.type_holder_default import TypeHolderDefault +from openapi_client.models.type_holder_example import TypeHolderExample +from openapi_client.models.user import User +from openapi_client.models.xml_item import XmlItem + diff --git a/samples/client/petstore/python-experimental/openapi_client/api/__init__.py b/samples/client/petstore/python-experimental/openapi_client/api/__init__.py new file mode 100644 index 000000000000..f023a721f7f5 --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/api/__init__.py @@ -0,0 +1,11 @@ +from __future__ import absolute_import + +# flake8: noqa + +# import apis into api package +from openapi_client.api.another_fake_api import AnotherFakeApi +from openapi_client.api.fake_api import FakeApi +from openapi_client.api.fake_classname_tags_123_api import FakeClassnameTags123Api +from openapi_client.api.pet_api import PetApi +from openapi_client.api.store_api import StoreApi +from openapi_client.api.user_api import UserApi diff --git a/samples/client/petstore/python-experimental/openapi_client/api/another_fake_api.py b/samples/client/petstore/python-experimental/openapi_client/api/another_fake_api.py new file mode 100644 index 000000000000..041aaf66074a --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/api/another_fake_api.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from openapi_client.api_client import ApiClient +from openapi_client.exceptions import ( + ApiTypeError, + ApiValueError +) + + +class AnotherFakeApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def call_123_test_special_tags(self, body, **kwargs): # noqa: E501 + """To test special tags # noqa: E501 + + To test special tags and operation ID starting with number # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.call_123_test_special_tags(body, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param Client body: client model (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Client + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.call_123_test_special_tags_with_http_info(body, **kwargs) # noqa: E501 + + def call_123_test_special_tags_with_http_info(self, body, **kwargs): # noqa: E501 + """To test special tags # noqa: E501 + + To test special tags and operation ID starting with number # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.call_123_test_special_tags_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param Client body: client model (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: tuple(Client, status_code(int), headers(HTTPHeaderDict)) + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method call_123_test_special_tags" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in local_var_params or + local_var_params['body'] is None): + raise ApiValueError("Missing the required parameter `body` when calling `call_123_test_special_tags`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in local_var_params: + body_params = local_var_params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/another-fake/dummy', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Client', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/samples/client/petstore/python-experimental/openapi_client/api/fake_api.py b/samples/client/petstore/python-experimental/openapi_client/api/fake_api.py new file mode 100644 index 000000000000..e6571fbe0b1c --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/api/fake_api.py @@ -0,0 +1,1582 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from openapi_client.api_client import ApiClient +from openapi_client.exceptions import ( + ApiTypeError, + ApiValueError +) + + +class FakeApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def create_xml_item(self, xml_item, **kwargs): # noqa: E501 + """creates an XmlItem # noqa: E501 + + this route creates an XmlItem # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_xml_item(xml_item, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param XmlItem xml_item: XmlItem Body (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.create_xml_item_with_http_info(xml_item, **kwargs) # noqa: E501 + + def create_xml_item_with_http_info(self, xml_item, **kwargs): # noqa: E501 + """creates an XmlItem # noqa: E501 + + this route creates an XmlItem # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_xml_item_with_http_info(xml_item, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param XmlItem xml_item: XmlItem Body (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['xml_item'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_xml_item" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'xml_item' is set + if ('xml_item' not in local_var_params or + local_var_params['xml_item'] is None): + raise ApiValueError("Missing the required parameter `xml_item` when calling `create_xml_item`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'xml_item' in local_var_params: + body_params = local_var_params['xml_item'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/xml', 'application/xml; charset=utf-8', 'application/xml; charset=utf-16', 'text/xml', 'text/xml; charset=utf-8', 'text/xml; charset=utf-16']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/fake/create_xml_item', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def fake_outer_boolean_serialize(self, **kwargs): # noqa: E501 + """fake_outer_boolean_serialize # noqa: E501 + + Test serialization of outer boolean types # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.fake_outer_boolean_serialize(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param bool body: Input boolean as post body + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: bool + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.fake_outer_boolean_serialize_with_http_info(**kwargs) # noqa: E501 + + def fake_outer_boolean_serialize_with_http_info(self, **kwargs): # noqa: E501 + """fake_outer_boolean_serialize # noqa: E501 + + Test serialization of outer boolean types # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.fake_outer_boolean_serialize_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param bool body: Input boolean as post body + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: tuple(bool, status_code(int), headers(HTTPHeaderDict)) + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method fake_outer_boolean_serialize" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in local_var_params: + body_params = local_var_params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/fake/outer/boolean', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='bool', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def fake_outer_composite_serialize(self, **kwargs): # noqa: E501 + """fake_outer_composite_serialize # noqa: E501 + + Test serialization of object with outer number type # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.fake_outer_composite_serialize(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param OuterComposite body: Input composite as post body + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: OuterComposite + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.fake_outer_composite_serialize_with_http_info(**kwargs) # noqa: E501 + + def fake_outer_composite_serialize_with_http_info(self, **kwargs): # noqa: E501 + """fake_outer_composite_serialize # noqa: E501 + + Test serialization of object with outer number type # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.fake_outer_composite_serialize_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param OuterComposite body: Input composite as post body + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: tuple(OuterComposite, status_code(int), headers(HTTPHeaderDict)) + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method fake_outer_composite_serialize" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in local_var_params: + body_params = local_var_params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/fake/outer/composite', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OuterComposite', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def fake_outer_number_serialize(self, **kwargs): # noqa: E501 + """fake_outer_number_serialize # noqa: E501 + + Test serialization of outer number types # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.fake_outer_number_serialize(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param float body: Input number as post body + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: float + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.fake_outer_number_serialize_with_http_info(**kwargs) # noqa: E501 + + def fake_outer_number_serialize_with_http_info(self, **kwargs): # noqa: E501 + """fake_outer_number_serialize # noqa: E501 + + Test serialization of outer number types # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.fake_outer_number_serialize_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param float body: Input number as post body + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: tuple(float, status_code(int), headers(HTTPHeaderDict)) + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method fake_outer_number_serialize" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in local_var_params: + body_params = local_var_params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/fake/outer/number', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='float', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def fake_outer_string_serialize(self, **kwargs): # noqa: E501 + """fake_outer_string_serialize # noqa: E501 + + Test serialization of outer string types # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.fake_outer_string_serialize(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str body: Input string as post body + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: str + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.fake_outer_string_serialize_with_http_info(**kwargs) # noqa: E501 + + def fake_outer_string_serialize_with_http_info(self, **kwargs): # noqa: E501 + """fake_outer_string_serialize # noqa: E501 + + Test serialization of outer string types # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.fake_outer_string_serialize_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str body: Input string as post body + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: tuple(str, status_code(int), headers(HTTPHeaderDict)) + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method fake_outer_string_serialize" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in local_var_params: + body_params = local_var_params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/fake/outer/string', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='str', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def test_body_with_file_schema(self, body, **kwargs): # noqa: E501 + """test_body_with_file_schema # noqa: E501 + + For this test, the body for this request much reference a schema named `File`. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_body_with_file_schema(body, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param FileSchemaTestClass body: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.test_body_with_file_schema_with_http_info(body, **kwargs) # noqa: E501 + + def test_body_with_file_schema_with_http_info(self, body, **kwargs): # noqa: E501 + """test_body_with_file_schema # noqa: E501 + + For this test, the body for this request much reference a schema named `File`. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_body_with_file_schema_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param FileSchemaTestClass body: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method test_body_with_file_schema" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in local_var_params or + local_var_params['body'] is None): + raise ApiValueError("Missing the required parameter `body` when calling `test_body_with_file_schema`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in local_var_params: + body_params = local_var_params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/fake/body-with-file-schema', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def test_body_with_query_params(self, query, body, **kwargs): # noqa: E501 + """test_body_with_query_params # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_body_with_query_params(query, body, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str query: (required) + :param User body: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.test_body_with_query_params_with_http_info(query, body, **kwargs) # noqa: E501 + + def test_body_with_query_params_with_http_info(self, query, body, **kwargs): # noqa: E501 + """test_body_with_query_params # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_body_with_query_params_with_http_info(query, body, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str query: (required) + :param User body: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['query', 'body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method test_body_with_query_params" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'query' is set + if ('query' not in local_var_params or + local_var_params['query'] is None): + raise ApiValueError("Missing the required parameter `query` when calling `test_body_with_query_params`") # noqa: E501 + # verify the required parameter 'body' is set + if ('body' not in local_var_params or + local_var_params['body'] is None): + raise ApiValueError("Missing the required parameter `body` when calling `test_body_with_query_params`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'query' in local_var_params: + query_params.append(('query', local_var_params['query'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in local_var_params: + body_params = local_var_params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/fake/body-with-query-params', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def test_client_model(self, body, **kwargs): # noqa: E501 + """To test \"client\" model # noqa: E501 + + To test \"client\" model # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_client_model(body, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param Client body: client model (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Client + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.test_client_model_with_http_info(body, **kwargs) # noqa: E501 + + def test_client_model_with_http_info(self, body, **kwargs): # noqa: E501 + """To test \"client\" model # noqa: E501 + + To test \"client\" model # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_client_model_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param Client body: client model (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: tuple(Client, status_code(int), headers(HTTPHeaderDict)) + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method test_client_model" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in local_var_params or + local_var_params['body'] is None): + raise ApiValueError("Missing the required parameter `body` when calling `test_client_model`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in local_var_params: + body_params = local_var_params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/fake', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Client', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def test_endpoint_parameters(self, number, double, pattern_without_delimiter, byte, **kwargs): # noqa: E501 + """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 + + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param float number: None (required) + :param float double: None (required) + :param str pattern_without_delimiter: None (required) + :param str byte: None (required) + :param int integer: None + :param int int32: None + :param int int64: None + :param float float: None + :param str string: None + :param file binary: None + :param date date: None + :param datetime date_time: None + :param str password: None + :param str param_callback: None + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, **kwargs) # noqa: E501 + + def test_endpoint_parameters_with_http_info(self, number, double, pattern_without_delimiter, byte, **kwargs): # noqa: E501 + """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 + + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param float number: None (required) + :param float double: None (required) + :param str pattern_without_delimiter: None (required) + :param str byte: None (required) + :param int integer: None + :param int int32: None + :param int int64: None + :param float float: None + :param str string: None + :param file binary: None + :param date date: None + :param datetime date_time: None + :param str password: None + :param str param_callback: None + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['number', 'double', 'pattern_without_delimiter', 'byte', 'integer', 'int32', 'int64', 'float', 'string', 'binary', 'date', 'date_time', 'password', 'param_callback'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method test_endpoint_parameters" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'number' is set + if ('number' not in local_var_params or + local_var_params['number'] is None): + raise ApiValueError("Missing the required parameter `number` when calling `test_endpoint_parameters`") # noqa: E501 + # verify the required parameter 'double' is set + if ('double' not in local_var_params or + local_var_params['double'] is None): + raise ApiValueError("Missing the required parameter `double` when calling `test_endpoint_parameters`") # noqa: E501 + # verify the required parameter 'pattern_without_delimiter' is set + if ('pattern_without_delimiter' not in local_var_params or + local_var_params['pattern_without_delimiter'] is None): + raise ApiValueError("Missing the required parameter `pattern_without_delimiter` when calling `test_endpoint_parameters`") # noqa: E501 + # verify the required parameter 'byte' is set + if ('byte' not in local_var_params or + local_var_params['byte'] is None): + raise ApiValueError("Missing the required parameter `byte` when calling `test_endpoint_parameters`") # noqa: E501 + + if 'number' in local_var_params and local_var_params['number'] > 543.2: # noqa: E501 + raise ApiValueError("Invalid value for parameter `number` when calling `test_endpoint_parameters`, must be a value less than or equal to `543.2`") # noqa: E501 + if 'number' in local_var_params and local_var_params['number'] < 32.1: # noqa: E501 + raise ApiValueError("Invalid value for parameter `number` when calling `test_endpoint_parameters`, must be a value greater than or equal to `32.1`") # noqa: E501 + if 'double' in local_var_params and local_var_params['double'] > 123.4: # noqa: E501 + raise ApiValueError("Invalid value for parameter `double` when calling `test_endpoint_parameters`, must be a value less than or equal to `123.4`") # noqa: E501 + if 'double' in local_var_params and local_var_params['double'] < 67.8: # noqa: E501 + raise ApiValueError("Invalid value for parameter `double` when calling `test_endpoint_parameters`, must be a value greater than or equal to `67.8`") # noqa: E501 + if 'pattern_without_delimiter' in local_var_params and not re.search(r'^[A-Z].*', local_var_params['pattern_without_delimiter']): # noqa: E501 + raise ApiValueError("Invalid value for parameter `pattern_without_delimiter` when calling `test_endpoint_parameters`, must conform to the pattern `/^[A-Z].*/`") # noqa: E501 + if 'integer' in local_var_params and local_var_params['integer'] > 100: # noqa: E501 + raise ApiValueError("Invalid value for parameter `integer` when calling `test_endpoint_parameters`, must be a value less than or equal to `100`") # noqa: E501 + if 'integer' in local_var_params and local_var_params['integer'] < 10: # noqa: E501 + raise ApiValueError("Invalid value for parameter `integer` when calling `test_endpoint_parameters`, must be a value greater than or equal to `10`") # noqa: E501 + if 'int32' in local_var_params and local_var_params['int32'] > 200: # noqa: E501 + raise ApiValueError("Invalid value for parameter `int32` when calling `test_endpoint_parameters`, must be a value less than or equal to `200`") # noqa: E501 + if 'int32' in local_var_params and local_var_params['int32'] < 20: # noqa: E501 + raise ApiValueError("Invalid value for parameter `int32` when calling `test_endpoint_parameters`, must be a value greater than or equal to `20`") # noqa: E501 + if 'float' in local_var_params and local_var_params['float'] > 987.6: # noqa: E501 + raise ApiValueError("Invalid value for parameter `float` when calling `test_endpoint_parameters`, must be a value less than or equal to `987.6`") # noqa: E501 + if 'string' in local_var_params and not re.search(r'[a-z]', local_var_params['string'], flags=re.IGNORECASE): # noqa: E501 + raise ApiValueError("Invalid value for parameter `string` when calling `test_endpoint_parameters`, must conform to the pattern `/[a-z]/i`") # noqa: E501 + if ('password' in local_var_params and + len(local_var_params['password']) > 64): + raise ApiValueError("Invalid value for parameter `password` when calling `test_endpoint_parameters`, length must be less than or equal to `64`") # noqa: E501 + if ('password' in local_var_params and + len(local_var_params['password']) < 10): + raise ApiValueError("Invalid value for parameter `password` when calling `test_endpoint_parameters`, length must be greater than or equal to `10`") # noqa: E501 + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + if 'integer' in local_var_params: + form_params.append(('integer', local_var_params['integer'])) # noqa: E501 + if 'int32' in local_var_params: + form_params.append(('int32', local_var_params['int32'])) # noqa: E501 + if 'int64' in local_var_params: + form_params.append(('int64', local_var_params['int64'])) # noqa: E501 + if 'number' in local_var_params: + form_params.append(('number', local_var_params['number'])) # noqa: E501 + if 'float' in local_var_params: + form_params.append(('float', local_var_params['float'])) # noqa: E501 + if 'double' in local_var_params: + form_params.append(('double', local_var_params['double'])) # noqa: E501 + if 'string' in local_var_params: + form_params.append(('string', local_var_params['string'])) # noqa: E501 + if 'pattern_without_delimiter' in local_var_params: + form_params.append(('pattern_without_delimiter', local_var_params['pattern_without_delimiter'])) # noqa: E501 + if 'byte' in local_var_params: + form_params.append(('byte', local_var_params['byte'])) # noqa: E501 + if 'binary' in local_var_params: + local_var_files['binary'] = local_var_params['binary'] # noqa: E501 + if 'date' in local_var_params: + form_params.append(('date', local_var_params['date'])) # noqa: E501 + if 'date_time' in local_var_params: + form_params.append(('dateTime', local_var_params['date_time'])) # noqa: E501 + if 'password' in local_var_params: + form_params.append(('password', local_var_params['password'])) # noqa: E501 + if 'param_callback' in local_var_params: + form_params.append(('callback', local_var_params['param_callback'])) # noqa: E501 + + body_params = None + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/x-www-form-urlencoded']) # noqa: E501 + + # Authentication setting + auth_settings = ['http_basic_test'] # noqa: E501 + + return self.api_client.call_api( + '/fake', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def test_enum_parameters(self, **kwargs): # noqa: E501 + """To test enum parameters # noqa: E501 + + To test enum parameters # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_enum_parameters(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param list[str] enum_header_string_array: Header parameter enum test (string array) + :param str enum_header_string: Header parameter enum test (string) + :param list[str] enum_query_string_array: Query parameter enum test (string array) + :param str enum_query_string: Query parameter enum test (string) + :param int enum_query_integer: Query parameter enum test (double) + :param float enum_query_double: Query parameter enum test (double) + :param list[str] enum_form_string_array: Form parameter enum test (string array) + :param str enum_form_string: Form parameter enum test (string) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.test_enum_parameters_with_http_info(**kwargs) # noqa: E501 + + def test_enum_parameters_with_http_info(self, **kwargs): # noqa: E501 + """To test enum parameters # noqa: E501 + + To test enum parameters # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_enum_parameters_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param list[str] enum_header_string_array: Header parameter enum test (string array) + :param str enum_header_string: Header parameter enum test (string) + :param list[str] enum_query_string_array: Query parameter enum test (string array) + :param str enum_query_string: Query parameter enum test (string) + :param int enum_query_integer: Query parameter enum test (double) + :param float enum_query_double: Query parameter enum test (double) + :param list[str] enum_form_string_array: Form parameter enum test (string array) + :param str enum_form_string: Form parameter enum test (string) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['enum_header_string_array', 'enum_header_string', 'enum_query_string_array', 'enum_query_string', 'enum_query_integer', 'enum_query_double', 'enum_form_string_array', 'enum_form_string'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method test_enum_parameters" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'enum_query_string_array' in local_var_params: + query_params.append(('enum_query_string_array', local_var_params['enum_query_string_array'])) # noqa: E501 + collection_formats['enum_query_string_array'] = 'csv' # noqa: E501 + if 'enum_query_string' in local_var_params: + query_params.append(('enum_query_string', local_var_params['enum_query_string'])) # noqa: E501 + if 'enum_query_integer' in local_var_params: + query_params.append(('enum_query_integer', local_var_params['enum_query_integer'])) # noqa: E501 + if 'enum_query_double' in local_var_params: + query_params.append(('enum_query_double', local_var_params['enum_query_double'])) # noqa: E501 + + header_params = {} + if 'enum_header_string_array' in local_var_params: + header_params['enum_header_string_array'] = local_var_params['enum_header_string_array'] # noqa: E501 + collection_formats['enum_header_string_array'] = 'csv' # noqa: E501 + if 'enum_header_string' in local_var_params: + header_params['enum_header_string'] = local_var_params['enum_header_string'] # noqa: E501 + + form_params = [] + local_var_files = {} + if 'enum_form_string_array' in local_var_params: + form_params.append(('enum_form_string_array', local_var_params['enum_form_string_array'])) # noqa: E501 + collection_formats['enum_form_string_array'] = 'csv' # noqa: E501 + if 'enum_form_string' in local_var_params: + form_params.append(('enum_form_string', local_var_params['enum_form_string'])) # noqa: E501 + + body_params = None + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/x-www-form-urlencoded']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/fake', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def test_group_parameters(self, required_string_group, required_boolean_group, required_int64_group, **kwargs): # noqa: E501 + """Fake endpoint to test group parameters (optional) # noqa: E501 + + Fake endpoint to test group parameters (optional) # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param int required_string_group: Required String in group parameters (required) + :param bool required_boolean_group: Required Boolean in group parameters (required) + :param int required_int64_group: Required Integer in group parameters (required) + :param int string_group: String in group parameters + :param bool boolean_group: Boolean in group parameters + :param int int64_group: Integer in group parameters + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.test_group_parameters_with_http_info(required_string_group, required_boolean_group, required_int64_group, **kwargs) # noqa: E501 + + def test_group_parameters_with_http_info(self, required_string_group, required_boolean_group, required_int64_group, **kwargs): # noqa: E501 + """Fake endpoint to test group parameters (optional) # noqa: E501 + + Fake endpoint to test group parameters (optional) # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_group_parameters_with_http_info(required_string_group, required_boolean_group, required_int64_group, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param int required_string_group: Required String in group parameters (required) + :param bool required_boolean_group: Required Boolean in group parameters (required) + :param int required_int64_group: Required Integer in group parameters (required) + :param int string_group: String in group parameters + :param bool boolean_group: Boolean in group parameters + :param int int64_group: Integer in group parameters + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['required_string_group', 'required_boolean_group', 'required_int64_group', 'string_group', 'boolean_group', 'int64_group'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method test_group_parameters" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'required_string_group' is set + if ('required_string_group' not in local_var_params or + local_var_params['required_string_group'] is None): + raise ApiValueError("Missing the required parameter `required_string_group` when calling `test_group_parameters`") # noqa: E501 + # verify the required parameter 'required_boolean_group' is set + if ('required_boolean_group' not in local_var_params or + local_var_params['required_boolean_group'] is None): + raise ApiValueError("Missing the required parameter `required_boolean_group` when calling `test_group_parameters`") # noqa: E501 + # verify the required parameter 'required_int64_group' is set + if ('required_int64_group' not in local_var_params or + local_var_params['required_int64_group'] is None): + raise ApiValueError("Missing the required parameter `required_int64_group` when calling `test_group_parameters`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'required_string_group' in local_var_params: + query_params.append(('required_string_group', local_var_params['required_string_group'])) # noqa: E501 + if 'required_int64_group' in local_var_params: + query_params.append(('required_int64_group', local_var_params['required_int64_group'])) # noqa: E501 + if 'string_group' in local_var_params: + query_params.append(('string_group', local_var_params['string_group'])) # noqa: E501 + if 'int64_group' in local_var_params: + query_params.append(('int64_group', local_var_params['int64_group'])) # noqa: E501 + + header_params = {} + if 'required_boolean_group' in local_var_params: + header_params['required_boolean_group'] = local_var_params['required_boolean_group'] # noqa: E501 + if 'boolean_group' in local_var_params: + header_params['boolean_group'] = local_var_params['boolean_group'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/fake', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def test_inline_additional_properties(self, param, **kwargs): # noqa: E501 + """test inline additionalProperties # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_inline_additional_properties(param, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param dict(str, str) param: request body (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.test_inline_additional_properties_with_http_info(param, **kwargs) # noqa: E501 + + def test_inline_additional_properties_with_http_info(self, param, **kwargs): # noqa: E501 + """test inline additionalProperties # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_inline_additional_properties_with_http_info(param, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param dict(str, str) param: request body (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['param'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method test_inline_additional_properties" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'param' is set + if ('param' not in local_var_params or + local_var_params['param'] is None): + raise ApiValueError("Missing the required parameter `param` when calling `test_inline_additional_properties`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'param' in local_var_params: + body_params = local_var_params['param'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/fake/inline-additionalProperties', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def test_json_form_data(self, param, param2, **kwargs): # noqa: E501 + """test json serialization of form data # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_json_form_data(param, param2, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str param: field1 (required) + :param str param2: field2 (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.test_json_form_data_with_http_info(param, param2, **kwargs) # noqa: E501 + + def test_json_form_data_with_http_info(self, param, param2, **kwargs): # noqa: E501 + """test json serialization of form data # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_json_form_data_with_http_info(param, param2, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str param: field1 (required) + :param str param2: field2 (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['param', 'param2'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method test_json_form_data" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'param' is set + if ('param' not in local_var_params or + local_var_params['param'] is None): + raise ApiValueError("Missing the required parameter `param` when calling `test_json_form_data`") # noqa: E501 + # verify the required parameter 'param2' is set + if ('param2' not in local_var_params or + local_var_params['param2'] is None): + raise ApiValueError("Missing the required parameter `param2` when calling `test_json_form_data`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + if 'param' in local_var_params: + form_params.append(('param', local_var_params['param'])) # noqa: E501 + if 'param2' in local_var_params: + form_params.append(('param2', local_var_params['param2'])) # noqa: E501 + + body_params = None + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/x-www-form-urlencoded']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/fake/jsonFormData', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/samples/client/petstore/python-experimental/openapi_client/api/fake_classname_tags_123_api.py b/samples/client/petstore/python-experimental/openapi_client/api/fake_classname_tags_123_api.py new file mode 100644 index 000000000000..59b7cb01a9ab --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/api/fake_classname_tags_123_api.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from openapi_client.api_client import ApiClient +from openapi_client.exceptions import ( + ApiTypeError, + ApiValueError +) + + +class FakeClassnameTags123Api(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def test_classname(self, body, **kwargs): # noqa: E501 + """To test class name in snake case # noqa: E501 + + To test class name in snake case # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_classname(body, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param Client body: client model (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Client + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.test_classname_with_http_info(body, **kwargs) # noqa: E501 + + def test_classname_with_http_info(self, body, **kwargs): # noqa: E501 + """To test class name in snake case # noqa: E501 + + To test class name in snake case # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_classname_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param Client body: client model (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: tuple(Client, status_code(int), headers(HTTPHeaderDict)) + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method test_classname" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in local_var_params or + local_var_params['body'] is None): + raise ApiValueError("Missing the required parameter `body` when calling `test_classname`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in local_var_params: + body_params = local_var_params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key_query'] # noqa: E501 + + return self.api_client.call_api( + '/fake_classname_test', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Client', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/samples/client/petstore/python-experimental/openapi_client/api/pet_api.py b/samples/client/petstore/python-experimental/openapi_client/api/pet_api.py new file mode 100644 index 000000000000..c35b743af2e9 --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/api/pet_api.py @@ -0,0 +1,1035 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from openapi_client.api_client import ApiClient +from openapi_client.exceptions import ( + ApiTypeError, + ApiValueError +) + + +class PetApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def add_pet(self, body, **kwargs): # noqa: E501 + """Add a new pet to the store # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_pet(body, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param Pet body: Pet object that needs to be added to the store (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.add_pet_with_http_info(body, **kwargs) # noqa: E501 + + def add_pet_with_http_info(self, body, **kwargs): # noqa: E501 + """Add a new pet to the store # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_pet_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param Pet body: Pet object that needs to be added to the store (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method add_pet" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in local_var_params or + local_var_params['body'] is None): + raise ApiValueError("Missing the required parameter `body` when calling `add_pet`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in local_var_params: + body_params = local_var_params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json', 'application/xml']) # noqa: E501 + + # Authentication setting + auth_settings = ['petstore_auth'] # noqa: E501 + + return self.api_client.call_api( + '/pet', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def delete_pet(self, pet_id, **kwargs): # noqa: E501 + """Deletes a pet # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_pet(pet_id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param int pet_id: Pet id to delete (required) + :param str api_key: + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.delete_pet_with_http_info(pet_id, **kwargs) # noqa: E501 + + def delete_pet_with_http_info(self, pet_id, **kwargs): # noqa: E501 + """Deletes a pet # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_pet_with_http_info(pet_id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param int pet_id: Pet id to delete (required) + :param str api_key: + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['pet_id', 'api_key'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_pet" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'pet_id' is set + if ('pet_id' not in local_var_params or + local_var_params['pet_id'] is None): + raise ApiValueError("Missing the required parameter `pet_id` when calling `delete_pet`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'pet_id' in local_var_params: + path_params['petId'] = local_var_params['pet_id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'api_key' in local_var_params: + header_params['api_key'] = local_var_params['api_key'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = ['petstore_auth'] # noqa: E501 + + return self.api_client.call_api( + '/pet/{petId}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def find_pets_by_status(self, status, **kwargs): # noqa: E501 + """Finds Pets by status # noqa: E501 + + Multiple status values can be provided with comma separated strings # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.find_pets_by_status(status, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param list[str] status: Status values that need to be considered for filter (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: list[Pet] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.find_pets_by_status_with_http_info(status, **kwargs) # noqa: E501 + + def find_pets_by_status_with_http_info(self, status, **kwargs): # noqa: E501 + """Finds Pets by status # noqa: E501 + + Multiple status values can be provided with comma separated strings # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.find_pets_by_status_with_http_info(status, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param list[str] status: Status values that need to be considered for filter (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: tuple(list[Pet], status_code(int), headers(HTTPHeaderDict)) + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['status'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method find_pets_by_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'status' is set + if ('status' not in local_var_params or + local_var_params['status'] is None): + raise ApiValueError("Missing the required parameter `status` when calling `find_pets_by_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'status' in local_var_params: + query_params.append(('status', local_var_params['status'])) # noqa: E501 + collection_formats['status'] = 'csv' # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['petstore_auth'] # noqa: E501 + + return self.api_client.call_api( + '/pet/findByStatus', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[Pet]', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def find_pets_by_tags(self, tags, **kwargs): # noqa: E501 + """Finds Pets by tags # noqa: E501 + + Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.find_pets_by_tags(tags, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param list[str] tags: Tags to filter by (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: list[Pet] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.find_pets_by_tags_with_http_info(tags, **kwargs) # noqa: E501 + + def find_pets_by_tags_with_http_info(self, tags, **kwargs): # noqa: E501 + """Finds Pets by tags # noqa: E501 + + Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.find_pets_by_tags_with_http_info(tags, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param list[str] tags: Tags to filter by (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: tuple(list[Pet], status_code(int), headers(HTTPHeaderDict)) + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['tags'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method find_pets_by_tags" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'tags' is set + if ('tags' not in local_var_params or + local_var_params['tags'] is None): + raise ApiValueError("Missing the required parameter `tags` when calling `find_pets_by_tags`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'tags' in local_var_params: + query_params.append(('tags', local_var_params['tags'])) # noqa: E501 + collection_formats['tags'] = 'csv' # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['petstore_auth'] # noqa: E501 + + return self.api_client.call_api( + '/pet/findByTags', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[Pet]', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_pet_by_id(self, pet_id, **kwargs): # noqa: E501 + """Find pet by ID # noqa: E501 + + Returns a single pet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_pet_by_id(pet_id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param int pet_id: ID of pet to return (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Pet + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_pet_by_id_with_http_info(pet_id, **kwargs) # noqa: E501 + + def get_pet_by_id_with_http_info(self, pet_id, **kwargs): # noqa: E501 + """Find pet by ID # noqa: E501 + + Returns a single pet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_pet_by_id_with_http_info(pet_id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param int pet_id: ID of pet to return (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: tuple(Pet, status_code(int), headers(HTTPHeaderDict)) + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['pet_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_pet_by_id" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'pet_id' is set + if ('pet_id' not in local_var_params or + local_var_params['pet_id'] is None): + raise ApiValueError("Missing the required parameter `pet_id` when calling `get_pet_by_id`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'pet_id' in local_var_params: + path_params['petId'] = local_var_params['pet_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/pet/{petId}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Pet', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def update_pet(self, body, **kwargs): # noqa: E501 + """Update an existing pet # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_pet(body, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param Pet body: Pet object that needs to be added to the store (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.update_pet_with_http_info(body, **kwargs) # noqa: E501 + + def update_pet_with_http_info(self, body, **kwargs): # noqa: E501 + """Update an existing pet # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_pet_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param Pet body: Pet object that needs to be added to the store (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method update_pet" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in local_var_params or + local_var_params['body'] is None): + raise ApiValueError("Missing the required parameter `body` when calling `update_pet`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in local_var_params: + body_params = local_var_params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json', 'application/xml']) # noqa: E501 + + # Authentication setting + auth_settings = ['petstore_auth'] # noqa: E501 + + return self.api_client.call_api( + '/pet', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def update_pet_with_form(self, pet_id, **kwargs): # noqa: E501 + """Updates a pet in the store with form data # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_pet_with_form(pet_id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param int pet_id: ID of pet that needs to be updated (required) + :param str name: Updated name of the pet + :param str status: Updated status of the pet + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.update_pet_with_form_with_http_info(pet_id, **kwargs) # noqa: E501 + + def update_pet_with_form_with_http_info(self, pet_id, **kwargs): # noqa: E501 + """Updates a pet in the store with form data # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_pet_with_form_with_http_info(pet_id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param int pet_id: ID of pet that needs to be updated (required) + :param str name: Updated name of the pet + :param str status: Updated status of the pet + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['pet_id', 'name', 'status'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method update_pet_with_form" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'pet_id' is set + if ('pet_id' not in local_var_params or + local_var_params['pet_id'] is None): + raise ApiValueError("Missing the required parameter `pet_id` when calling `update_pet_with_form`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'pet_id' in local_var_params: + path_params['petId'] = local_var_params['pet_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + if 'name' in local_var_params: + form_params.append(('name', local_var_params['name'])) # noqa: E501 + if 'status' in local_var_params: + form_params.append(('status', local_var_params['status'])) # noqa: E501 + + body_params = None + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/x-www-form-urlencoded']) # noqa: E501 + + # Authentication setting + auth_settings = ['petstore_auth'] # noqa: E501 + + return self.api_client.call_api( + '/pet/{petId}', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def upload_file(self, pet_id, **kwargs): # noqa: E501 + """uploads an image # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.upload_file(pet_id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param int pet_id: ID of pet to update (required) + :param str additional_metadata: Additional data to pass to server + :param file file: file to upload + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: ApiResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.upload_file_with_http_info(pet_id, **kwargs) # noqa: E501 + + def upload_file_with_http_info(self, pet_id, **kwargs): # noqa: E501 + """uploads an image # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.upload_file_with_http_info(pet_id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param int pet_id: ID of pet to update (required) + :param str additional_metadata: Additional data to pass to server + :param file file: file to upload + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: tuple(ApiResponse, status_code(int), headers(HTTPHeaderDict)) + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['pet_id', 'additional_metadata', 'file'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method upload_file" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'pet_id' is set + if ('pet_id' not in local_var_params or + local_var_params['pet_id'] is None): + raise ApiValueError("Missing the required parameter `pet_id` when calling `upload_file`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'pet_id' in local_var_params: + path_params['petId'] = local_var_params['pet_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + if 'additional_metadata' in local_var_params: + form_params.append(('additionalMetadata', local_var_params['additional_metadata'])) # noqa: E501 + if 'file' in local_var_params: + local_var_files['file'] = local_var_params['file'] # noqa: E501 + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['multipart/form-data']) # noqa: E501 + + # Authentication setting + auth_settings = ['petstore_auth'] # noqa: E501 + + return self.api_client.call_api( + '/pet/{petId}/uploadImage', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ApiResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def upload_file_with_required_file(self, pet_id, required_file, **kwargs): # noqa: E501 + """uploads an image (required) # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.upload_file_with_required_file(pet_id, required_file, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param int pet_id: ID of pet to update (required) + :param file required_file: file to upload (required) + :param str additional_metadata: Additional data to pass to server + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: ApiResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.upload_file_with_required_file_with_http_info(pet_id, required_file, **kwargs) # noqa: E501 + + def upload_file_with_required_file_with_http_info(self, pet_id, required_file, **kwargs): # noqa: E501 + """uploads an image (required) # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.upload_file_with_required_file_with_http_info(pet_id, required_file, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param int pet_id: ID of pet to update (required) + :param file required_file: file to upload (required) + :param str additional_metadata: Additional data to pass to server + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: tuple(ApiResponse, status_code(int), headers(HTTPHeaderDict)) + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['pet_id', 'required_file', 'additional_metadata'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method upload_file_with_required_file" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'pet_id' is set + if ('pet_id' not in local_var_params or + local_var_params['pet_id'] is None): + raise ApiValueError("Missing the required parameter `pet_id` when calling `upload_file_with_required_file`") # noqa: E501 + # verify the required parameter 'required_file' is set + if ('required_file' not in local_var_params or + local_var_params['required_file'] is None): + raise ApiValueError("Missing the required parameter `required_file` when calling `upload_file_with_required_file`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'pet_id' in local_var_params: + path_params['petId'] = local_var_params['pet_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + if 'additional_metadata' in local_var_params: + form_params.append(('additionalMetadata', local_var_params['additional_metadata'])) # noqa: E501 + if 'required_file' in local_var_params: + local_var_files['requiredFile'] = local_var_params['required_file'] # noqa: E501 + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['multipart/form-data']) # noqa: E501 + + # Authentication setting + auth_settings = ['petstore_auth'] # noqa: E501 + + return self.api_client.call_api( + '/fake/{petId}/uploadImageWithRequiredFile', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ApiResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/samples/client/petstore/python-experimental/openapi_client/api/store_api.py b/samples/client/petstore/python-experimental/openapi_client/api/store_api.py new file mode 100644 index 000000000000..164fe4f4b3f7 --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/api/store_api.py @@ -0,0 +1,459 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from openapi_client.api_client import ApiClient +from openapi_client.exceptions import ( + ApiTypeError, + ApiValueError +) + + +class StoreApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def delete_order(self, order_id, **kwargs): # noqa: E501 + """Delete purchase order by ID # noqa: E501 + + For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_order(order_id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str order_id: ID of the order that needs to be deleted (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.delete_order_with_http_info(order_id, **kwargs) # noqa: E501 + + def delete_order_with_http_info(self, order_id, **kwargs): # noqa: E501 + """Delete purchase order by ID # noqa: E501 + + For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_order_with_http_info(order_id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str order_id: ID of the order that needs to be deleted (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['order_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_order" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'order_id' is set + if ('order_id' not in local_var_params or + local_var_params['order_id'] is None): + raise ApiValueError("Missing the required parameter `order_id` when calling `delete_order`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'order_id' in local_var_params: + path_params['order_id'] = local_var_params['order_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/store/order/{order_id}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_inventory(self, **kwargs): # noqa: E501 + """Returns pet inventories by status # noqa: E501 + + Returns a map of status codes to quantities # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_inventory(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: dict(str, int) + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_inventory_with_http_info(**kwargs) # noqa: E501 + + def get_inventory_with_http_info(self, **kwargs): # noqa: E501 + """Returns pet inventories by status # noqa: E501 + + Returns a map of status codes to quantities # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_inventory_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: tuple(dict(str, int), status_code(int), headers(HTTPHeaderDict)) + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_inventory" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/store/inventory', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='dict(str, int)', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_order_by_id(self, order_id, **kwargs): # noqa: E501 + """Find purchase order by ID # noqa: E501 + + For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_order_by_id(order_id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param int order_id: ID of pet that needs to be fetched (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Order + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_order_by_id_with_http_info(order_id, **kwargs) # noqa: E501 + + def get_order_by_id_with_http_info(self, order_id, **kwargs): # noqa: E501 + """Find purchase order by ID # noqa: E501 + + For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_order_by_id_with_http_info(order_id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param int order_id: ID of pet that needs to be fetched (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: tuple(Order, status_code(int), headers(HTTPHeaderDict)) + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['order_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_order_by_id" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'order_id' is set + if ('order_id' not in local_var_params or + local_var_params['order_id'] is None): + raise ApiValueError("Missing the required parameter `order_id` when calling `get_order_by_id`") # noqa: E501 + + if 'order_id' in local_var_params and local_var_params['order_id'] > 5: # noqa: E501 + raise ApiValueError("Invalid value for parameter `order_id` when calling `get_order_by_id`, must be a value less than or equal to `5`") # noqa: E501 + if 'order_id' in local_var_params and local_var_params['order_id'] < 1: # noqa: E501 + raise ApiValueError("Invalid value for parameter `order_id` when calling `get_order_by_id`, must be a value greater than or equal to `1`") # noqa: E501 + collection_formats = {} + + path_params = {} + if 'order_id' in local_var_params: + path_params['order_id'] = local_var_params['order_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/store/order/{order_id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Order', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def place_order(self, body, **kwargs): # noqa: E501 + """Place an order for a pet # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.place_order(body, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param Order body: order placed for purchasing the pet (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Order + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.place_order_with_http_info(body, **kwargs) # noqa: E501 + + def place_order_with_http_info(self, body, **kwargs): # noqa: E501 + """Place an order for a pet # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.place_order_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param Order body: order placed for purchasing the pet (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: tuple(Order, status_code(int), headers(HTTPHeaderDict)) + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method place_order" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in local_var_params or + local_var_params['body'] is None): + raise ApiValueError("Missing the required parameter `body` when calling `place_order`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in local_var_params: + body_params = local_var_params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/store/order', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Order', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/samples/client/petstore/python-experimental/openapi_client/api/user_api.py b/samples/client/petstore/python-experimental/openapi_client/api/user_api.py new file mode 100644 index 000000000000..8257f268a1f0 --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/api/user_api.py @@ -0,0 +1,875 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from openapi_client.api_client import ApiClient +from openapi_client.exceptions import ( + ApiTypeError, + ApiValueError +) + + +class UserApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def create_user(self, body, **kwargs): # noqa: E501 + """Create user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_user(body, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param User body: Created user object (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.create_user_with_http_info(body, **kwargs) # noqa: E501 + + def create_user_with_http_info(self, body, **kwargs): # noqa: E501 + """Create user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_user_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param User body: Created user object (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_user" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in local_var_params or + local_var_params['body'] is None): + raise ApiValueError("Missing the required parameter `body` when calling `create_user`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in local_var_params: + body_params = local_var_params['body'] + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/user', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def create_users_with_array_input(self, body, **kwargs): # noqa: E501 + """Creates list of users with given input array # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_users_with_array_input(body, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param list[User] body: List of user object (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.create_users_with_array_input_with_http_info(body, **kwargs) # noqa: E501 + + def create_users_with_array_input_with_http_info(self, body, **kwargs): # noqa: E501 + """Creates list of users with given input array # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_users_with_array_input_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param list[User] body: List of user object (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_users_with_array_input" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in local_var_params or + local_var_params['body'] is None): + raise ApiValueError("Missing the required parameter `body` when calling `create_users_with_array_input`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in local_var_params: + body_params = local_var_params['body'] + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/user/createWithArray', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def create_users_with_list_input(self, body, **kwargs): # noqa: E501 + """Creates list of users with given input array # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_users_with_list_input(body, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param list[User] body: List of user object (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.create_users_with_list_input_with_http_info(body, **kwargs) # noqa: E501 + + def create_users_with_list_input_with_http_info(self, body, **kwargs): # noqa: E501 + """Creates list of users with given input array # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_users_with_list_input_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param list[User] body: List of user object (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_users_with_list_input" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in local_var_params or + local_var_params['body'] is None): + raise ApiValueError("Missing the required parameter `body` when calling `create_users_with_list_input`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in local_var_params: + body_params = local_var_params['body'] + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/user/createWithList', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def delete_user(self, username, **kwargs): # noqa: E501 + """Delete user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_user(username, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str username: The name that needs to be deleted (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.delete_user_with_http_info(username, **kwargs) # noqa: E501 + + def delete_user_with_http_info(self, username, **kwargs): # noqa: E501 + """Delete user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_user_with_http_info(username, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str username: The name that needs to be deleted (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['username'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_user" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'username' is set + if ('username' not in local_var_params or + local_var_params['username'] is None): + raise ApiValueError("Missing the required parameter `username` when calling `delete_user`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'username' in local_var_params: + path_params['username'] = local_var_params['username'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/user/{username}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_user_by_name(self, username, **kwargs): # noqa: E501 + """Get user by user name # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_user_by_name(username, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str username: The name that needs to be fetched. Use user1 for testing. (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: User + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_user_by_name_with_http_info(username, **kwargs) # noqa: E501 + + def get_user_by_name_with_http_info(self, username, **kwargs): # noqa: E501 + """Get user by user name # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_user_by_name_with_http_info(username, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str username: The name that needs to be fetched. Use user1 for testing. (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: tuple(User, status_code(int), headers(HTTPHeaderDict)) + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['username'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_user_by_name" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'username' is set + if ('username' not in local_var_params or + local_var_params['username'] is None): + raise ApiValueError("Missing the required parameter `username` when calling `get_user_by_name`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'username' in local_var_params: + path_params['username'] = local_var_params['username'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/user/{username}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='User', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def login_user(self, username, password, **kwargs): # noqa: E501 + """Logs user into the system # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.login_user(username, password, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str username: The user name for login (required) + :param str password: The password for login in clear text (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: str + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.login_user_with_http_info(username, password, **kwargs) # noqa: E501 + + def login_user_with_http_info(self, username, password, **kwargs): # noqa: E501 + """Logs user into the system # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.login_user_with_http_info(username, password, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str username: The user name for login (required) + :param str password: The password for login in clear text (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: tuple(str, status_code(int), headers(HTTPHeaderDict)) + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['username', 'password'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method login_user" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'username' is set + if ('username' not in local_var_params or + local_var_params['username'] is None): + raise ApiValueError("Missing the required parameter `username` when calling `login_user`") # noqa: E501 + # verify the required parameter 'password' is set + if ('password' not in local_var_params or + local_var_params['password'] is None): + raise ApiValueError("Missing the required parameter `password` when calling `login_user`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'username' in local_var_params: + query_params.append(('username', local_var_params['username'])) # noqa: E501 + if 'password' in local_var_params: + query_params.append(('password', local_var_params['password'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/user/login', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='str', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def logout_user(self, **kwargs): # noqa: E501 + """Logs out current logged in user session # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.logout_user(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.logout_user_with_http_info(**kwargs) # noqa: E501 + + def logout_user_with_http_info(self, **kwargs): # noqa: E501 + """Logs out current logged in user session # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.logout_user_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method logout_user" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/user/logout', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def update_user(self, username, body, **kwargs): # noqa: E501 + """Updated user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_user(username, body, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str username: name that need to be deleted (required) + :param User body: Updated user object (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.update_user_with_http_info(username, body, **kwargs) # noqa: E501 + + def update_user_with_http_info(self, username, body, **kwargs): # noqa: E501 + """Updated user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_user_with_http_info(username, body, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str username: name that need to be deleted (required) + :param User body: Updated user object (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['username', 'body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method update_user" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'username' is set + if ('username' not in local_var_params or + local_var_params['username'] is None): + raise ApiValueError("Missing the required parameter `username` when calling `update_user`") # noqa: E501 + # verify the required parameter 'body' is set + if ('body' not in local_var_params or + local_var_params['body'] is None): + raise ApiValueError("Missing the required parameter `body` when calling `update_user`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'username' in local_var_params: + path_params['username'] = local_var_params['username'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in local_var_params: + body_params = local_var_params['body'] + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/user/{username}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/samples/client/petstore/python-experimental/openapi_client/api_client.py b/samples/client/petstore/python-experimental/openapi_client/api_client.py new file mode 100644 index 000000000000..d274a4e64108 --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/api_client.py @@ -0,0 +1,640 @@ +# coding: utf-8 +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +from __future__ import absolute_import + +import datetime +import json +import mimetypes +from multiprocessing.pool import ThreadPool +import os +import re +import tempfile + +# python 2 and python 3 compatibility library +import six +from six.moves.urllib.parse import quote + +from openapi_client.configuration import Configuration +import openapi_client.models +from openapi_client import rest +from openapi_client.exceptions import ApiValueError + + +class ApiClient(object): + """Generic API client for OpenAPI client library builds. + + OpenAPI generic API client. This client handles the client- + server communication, and is invariant across implementations. Specifics of + the methods and models for each application are generated from the OpenAPI + templates. + + NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + + :param configuration: .Configuration object for this client + :param header_name: a header to pass when making calls to the API. + :param header_value: a header value to pass when making calls to + the API. + :param cookie: a cookie to include in the header when making calls + to the API + :param pool_threads: The number of threads to use for async requests + to the API. More threads means more concurrent API requests. + """ + + PRIMITIVE_TYPES = (float, bool, bytes, six.text_type) + six.integer_types + NATIVE_TYPES_MAPPING = { + 'int': int, + 'long': int if six.PY3 else long, # noqa: F821 + 'float': float, + 'str': str, + 'bool': bool, + 'date': datetime.date, + 'datetime': datetime.datetime, + 'object': object, + } + _pool = None + + def __init__(self, configuration=None, header_name=None, header_value=None, + cookie=None, pool_threads=1): + if configuration is None: + configuration = Configuration() + self.configuration = configuration + self.pool_threads = pool_threads + + self.rest_client = rest.RESTClientObject(configuration) + self.default_headers = {} + if header_name is not None: + self.default_headers[header_name] = header_value + self.cookie = cookie + # Set default User-Agent. + self.user_agent = 'OpenAPI-Generator/1.0.0/python' + + def __del__(self): + if self._pool: + self._pool.close() + self._pool.join() + self._pool = None + + @property + def pool(self): + """Create thread pool on first request + avoids instantiating unused threadpool for blocking clients. + """ + if self._pool is None: + self._pool = ThreadPool(self.pool_threads) + return self._pool + + @property + def user_agent(self): + """User agent for this API client""" + return self.default_headers['User-Agent'] + + @user_agent.setter + def user_agent(self, value): + self.default_headers['User-Agent'] = value + + def set_default_header(self, header_name, header_value): + self.default_headers[header_name] = header_value + + def __call_api( + self, resource_path, method, path_params=None, + query_params=None, header_params=None, body=None, post_params=None, + files=None, response_type=None, auth_settings=None, + _return_http_data_only=None, collection_formats=None, + _preload_content=True, _request_timeout=None, _host=None): + + config = self.configuration + + # header parameters + header_params = header_params or {} + header_params.update(self.default_headers) + if self.cookie: + header_params['Cookie'] = self.cookie + if header_params: + header_params = self.sanitize_for_serialization(header_params) + header_params = dict(self.parameters_to_tuples(header_params, + collection_formats)) + + # path parameters + if path_params: + path_params = self.sanitize_for_serialization(path_params) + path_params = self.parameters_to_tuples(path_params, + collection_formats) + for k, v in path_params: + # specified safe chars, encode everything + resource_path = resource_path.replace( + '{%s}' % k, + quote(str(v), safe=config.safe_chars_for_path_param) + ) + + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + query_params = self.parameters_to_tuples(query_params, + collection_formats) + + # post parameters + if post_params or files: + post_params = post_params if post_params else [] + post_params = self.sanitize_for_serialization(post_params) + post_params = self.parameters_to_tuples(post_params, + collection_formats) + post_params.extend(self.files_parameters(files)) + + # auth setting + self.update_params_for_auth(header_params, query_params, auth_settings) + + # body + if body: + body = self.sanitize_for_serialization(body) + + # request url + if _host is None: + url = self.configuration.host + resource_path + else: + # use server/host defined in path or operation instead + url = _host + resource_path + + # perform request and return response + response_data = self.request( + method, url, query_params=query_params, headers=header_params, + post_params=post_params, body=body, + _preload_content=_preload_content, + _request_timeout=_request_timeout) + + self.last_response = response_data + + return_data = response_data + if _preload_content: + # deserialize response data + if response_type: + return_data = self.deserialize(response_data, response_type) + else: + return_data = None + + if _return_http_data_only: + return (return_data) + else: + return (return_data, response_data.status, + response_data.getheaders()) + + def sanitize_for_serialization(self, obj): + """Builds a JSON POST object. + + If obj is None, return None. + If obj is str, int, long, float, bool, return directly. + If obj is datetime.datetime, datetime.date + convert to string in iso8601 format. + If obj is list, sanitize each element in the list. + If obj is dict, return the dict. + If obj is OpenAPI model, return the properties dict. + + :param obj: The data to serialize. + :return: The serialized form of data. + """ + if obj is None: + return None + elif isinstance(obj, self.PRIMITIVE_TYPES): + return obj + elif isinstance(obj, list): + return [self.sanitize_for_serialization(sub_obj) + for sub_obj in obj] + elif isinstance(obj, tuple): + return tuple(self.sanitize_for_serialization(sub_obj) + for sub_obj in obj) + elif isinstance(obj, (datetime.datetime, datetime.date)): + return obj.isoformat() + + if isinstance(obj, dict): + obj_dict = obj + else: + # Convert model obj to dict except + # attributes `openapi_types`, `attribute_map` + # and attributes which value is not None. + # Convert attribute name to json key in + # model definition for request. + obj_dict = {obj.attribute_map[attr]: getattr(obj, attr) + for attr, _ in six.iteritems(obj.openapi_types) + if getattr(obj, attr) is not None} + + return {key: self.sanitize_for_serialization(val) + for key, val in six.iteritems(obj_dict)} + + def deserialize(self, response, response_type): + """Deserializes response into an object. + + :param response: RESTResponse object to be deserialized. + :param response_type: class literal for + deserialized object, or string of class name. + + :return: deserialized object. + """ + # handle file downloading + # save response body into a tmp file and return the instance + if response_type == "file": + return self.__deserialize_file(response) + + # fetch data from response object + try: + data = json.loads(response.data) + except ValueError: + data = response.data + + return self.__deserialize(data, response_type) + + def __deserialize(self, data, klass): + """Deserializes dict, list, str into an object. + + :param data: dict, list or str. + :param klass: class literal, or string of class name. + + :return: object. + """ + if data is None: + return None + + if type(klass) == str: + if klass.startswith('list['): + sub_kls = re.match(r'list\[(.*)\]', klass).group(1) + return [self.__deserialize(sub_data, sub_kls) + for sub_data in data] + + if klass.startswith('dict('): + sub_kls = re.match(r'dict\(([^,]*), (.*)\)', klass).group(2) + return {k: self.__deserialize(v, sub_kls) + for k, v in six.iteritems(data)} + + # convert str to class + if klass in self.NATIVE_TYPES_MAPPING: + klass = self.NATIVE_TYPES_MAPPING[klass] + else: + klass = getattr(openapi_client.models, klass) + + if klass in self.PRIMITIVE_TYPES: + return self.__deserialize_primitive(data, klass) + elif klass == object: + return self.__deserialize_object(data) + elif klass == datetime.date: + return self.__deserialize_date(data) + elif klass == datetime.datetime: + return self.__deserialize_datatime(data) + else: + return self.__deserialize_model(data, klass) + + def call_api(self, resource_path, method, + path_params=None, query_params=None, header_params=None, + body=None, post_params=None, files=None, + response_type=None, auth_settings=None, async_req=None, + _return_http_data_only=None, collection_formats=None, + _preload_content=True, _request_timeout=None, _host=None): + """Makes the HTTP request (synchronous) and returns deserialized data. + + To make an async_req request, set the async_req parameter. + + :param resource_path: Path to method endpoint. + :param method: Method to call. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param response: Response data type. + :param files dict: key -> filename, value -> filepath, + for `multipart/form-data`. + :param async_req bool: execute request asynchronously + :param _return_http_data_only: response data without head status code + and headers + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: + If async_req parameter is True, + the request will be called asynchronously. + The method will return the request thread. + If parameter async_req is False or missing, + then the method will return the response directly. + """ + if not async_req: + return self.__call_api(resource_path, method, + path_params, query_params, header_params, + body, post_params, files, + response_type, auth_settings, + _return_http_data_only, collection_formats, + _preload_content, _request_timeout, _host) + else: + thread = self.pool.apply_async(self.__call_api, (resource_path, + method, path_params, query_params, + header_params, body, + post_params, files, + response_type, auth_settings, + _return_http_data_only, + collection_formats, + _preload_content, + _request_timeout, + _host)) + return thread + + def request(self, method, url, query_params=None, headers=None, + post_params=None, body=None, _preload_content=True, + _request_timeout=None): + """Makes the HTTP request using RESTClient.""" + if method == "GET": + return self.rest_client.GET(url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers) + elif method == "HEAD": + return self.rest_client.HEAD(url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers) + elif method == "OPTIONS": + return self.rest_client.OPTIONS(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "POST": + return self.rest_client.POST(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "PUT": + return self.rest_client.PUT(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "PATCH": + return self.rest_client.PATCH(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "DELETE": + return self.rest_client.DELETE(url, + query_params=query_params, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + else: + raise ApiValueError( + "http method must be `GET`, `HEAD`, `OPTIONS`," + " `POST`, `PATCH`, `PUT` or `DELETE`." + ) + + def parameters_to_tuples(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: Parameters as list of tuples, collections formatted + """ + new_params = [] + if collection_formats is None: + collection_formats = {} + for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501 + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, value) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(str(value) for value in v))) + else: + new_params.append((k, v)) + return new_params + + def files_parameters(self, files=None): + """Builds form parameters. + + :param files: File parameters. + :return: Form parameters with files. + """ + params = [] + + if files: + for k, v in six.iteritems(files): + if not v: + continue + file_names = v if type(v) is list else [v] + for n in file_names: + with open(n, 'rb') as f: + filename = os.path.basename(f.name) + filedata = f.read() + mimetype = (mimetypes.guess_type(filename)[0] or + 'application/octet-stream') + params.append( + tuple([k, tuple([filename, filedata, mimetype])])) + + return params + + def select_header_accept(self, accepts): + """Returns `Accept` based on an array of accepts provided. + + :param accepts: List of headers. + :return: Accept (e.g. application/json). + """ + if not accepts: + return + + accepts = [x.lower() for x in accepts] + + if 'application/json' in accepts: + return 'application/json' + else: + return ', '.join(accepts) + + def select_header_content_type(self, content_types): + """Returns `Content-Type` based on an array of content_types provided. + + :param content_types: List of content-types. + :return: Content-Type (e.g. application/json). + """ + if not content_types: + return 'application/json' + + content_types = [x.lower() for x in content_types] + + if 'application/json' in content_types or '*/*' in content_types: + return 'application/json' + else: + return content_types[0] + + def update_params_for_auth(self, headers, querys, auth_settings): + """Updates header and query params based on authentication setting. + + :param headers: Header parameters dict to be updated. + :param querys: Query parameters tuple list to be updated. + :param auth_settings: Authentication setting identifiers list. + """ + if not auth_settings: + return + + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + if not auth_setting['value']: + continue + elif auth_setting['in'] == 'cookie': + headers['Cookie'] = auth_setting['value'] + elif auth_setting['in'] == 'header': + headers[auth_setting['key']] = auth_setting['value'] + elif auth_setting['in'] == 'query': + querys.append((auth_setting['key'], auth_setting['value'])) + else: + raise ApiValueError( + 'Authentication token must be in `query` or `header`' + ) + + def __deserialize_file(self, response): + """Deserializes body to file + + Saves response body into a file in a temporary folder, + using the filename from the `Content-Disposition` header if provided. + + :param response: RESTResponse. + :return: file path. + """ + fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) + os.close(fd) + os.remove(path) + + content_disposition = response.getheader("Content-Disposition") + if content_disposition: + filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition).group(1) + path = os.path.join(os.path.dirname(path), filename) + + with open(path, "wb") as f: + f.write(response.data) + + return path + + def __deserialize_primitive(self, data, klass): + """Deserializes string to primitive type. + + :param data: str. + :param klass: class literal. + + :return: int, long, float, str, bool. + """ + try: + return klass(data) + except UnicodeEncodeError: + return six.text_type(data) + except TypeError: + return data + + def __deserialize_object(self, value): + """Return an original value. + + :return: object. + """ + return value + + def __deserialize_date(self, string): + """Deserializes string to date. + + :param string: str. + :return: date. + """ + try: + from dateutil.parser import parse + return parse(string).date() + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason="Failed to parse `{0}` as date object".format(string) + ) + + def __deserialize_datatime(self, string): + """Deserializes string to datetime. + + The string should be in iso8601 datetime format. + + :param string: str. + :return: datetime. + """ + try: + from dateutil.parser import parse + return parse(string) + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as datetime object" + .format(string) + ) + ) + + def __deserialize_model(self, data, klass): + """Deserializes list or dict to model. + + :param data: dict, list. + :param klass: class literal. + :return: model object. + """ + + if not klass.openapi_types and not hasattr(klass, + 'get_real_child_model'): + return data + + kwargs = {} + if klass.openapi_types is not None: + for attr, attr_type in six.iteritems(klass.openapi_types): + if (data is not None and + klass.attribute_map[attr] in data and + isinstance(data, (list, dict))): + value = data[klass.attribute_map[attr]] + kwargs[attr] = self.__deserialize(value, attr_type) + + instance = klass(**kwargs) + + if hasattr(instance, 'get_real_child_model'): + klass_name = instance.get_real_child_model(data) + if klass_name: + instance = self.__deserialize(data, klass_name) + return instance diff --git a/samples/client/petstore/python-experimental/openapi_client/configuration.py b/samples/client/petstore/python-experimental/openapi_client/configuration.py new file mode 100644 index 000000000000..f14aa23da6a4 --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/configuration.py @@ -0,0 +1,342 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import copy +import logging +import multiprocessing +import sys +import urllib3 + +import six +from six.moves import http_client as httplib + + +class TypeWithDefault(type): + def __init__(cls, name, bases, dct): + super(TypeWithDefault, cls).__init__(name, bases, dct) + cls._default = None + + def __call__(cls, **kwargs): + if cls._default is None: + cls._default = type.__call__(cls, **kwargs) + return copy.copy(cls._default) + + def set_default(cls, default): + cls._default = copy.copy(default) + + +class Configuration(six.with_metaclass(TypeWithDefault, object)): + """NOTE: This class is auto generated by OpenAPI Generator + + Ref: https://openapi-generator.tech + Do not edit the class manually. + + :param host: Base url + :param api_key: Dict to store API key(s) + :param api_key_prefix: Dict to store API prefix (e.g. Bearer) + :param username: Username for HTTP basic authentication + :param password: Password for HTTP basic authentication + """ + + def __init__(self, host="http://petstore.swagger.io:80/v2", + api_key={}, api_key_prefix={}, + username="", password=""): + """Constructor + """ + self.host = host + """Default Base url + """ + self.temp_folder_path = None + """Temp file folder for downloading files + """ + # Authentication Settings + self.api_key = api_key + """dict to store API key(s) + """ + self.api_key_prefix = api_key_prefix + """dict to store API prefix (e.g. Bearer) + """ + self.username = username + """Username for HTTP basic authentication + """ + self.password = password + """Password for HTTP basic authentication + """ + self.access_token = "" + """access token for OAuth/Bearer + """ + self.logger = {} + """Logging Settings + """ + self.logger["package_logger"] = logging.getLogger("openapi_client") + self.logger["urllib3_logger"] = logging.getLogger("urllib3") + self.logger_format = '%(asctime)s %(levelname)s %(message)s' + """Log format + """ + self.logger_stream_handler = None + """Log stream handler + """ + self.logger_file_handler = None + """Log file handler + """ + self.logger_file = None + """Debug file location + """ + self.debug = False + """Debug switch + """ + + self.verify_ssl = True + """SSL/TLS verification + Set this to false to skip verifying SSL certificate when calling API + from https server. + """ + self.ssl_ca_cert = None + """Set this to customize the certificate file to verify the peer. + """ + self.cert_file = None + """client certificate file + """ + self.key_file = None + """client key file + """ + self.assert_hostname = None + """Set this to True/False to enable/disable SSL hostname verification. + """ + + self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + """urllib3 connection pool's maximum number of connections saved + per pool. urllib3 uses 1 connection as default value, but this is + not the best value when you are making a lot of possibly parallel + requests to the same host, which is often the case here. + cpu_count * 5 is used as default value to increase performance. + """ + + self.proxy = None + """Proxy URL + """ + self.proxy_headers = None + """Proxy headers + """ + self.safe_chars_for_path_param = '' + """Safe chars for path_param + """ + self.retries = None + """Adding retries to override urllib3 default value 3 + """ + + @property + def logger_file(self): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + return self.__logger_file + + @logger_file.setter + def logger_file(self, value): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + self.__logger_file = value + if self.__logger_file: + # If set logging file, + # then add file handler and remove stream handler. + self.logger_file_handler = logging.FileHandler(self.__logger_file) + self.logger_file_handler.setFormatter(self.logger_formatter) + for _, logger in six.iteritems(self.logger): + logger.addHandler(self.logger_file_handler) + + @property + def debug(self): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + return self.__debug + + @debug.setter + def debug(self, value): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + self.__debug = value + if self.__debug: + # if debug status is True, turn on debug logging + for _, logger in six.iteritems(self.logger): + logger.setLevel(logging.DEBUG) + # turn on httplib debug + httplib.HTTPConnection.debuglevel = 1 + else: + # if debug status is False, turn off debug logging, + # setting log level to default `logging.WARNING` + for _, logger in six.iteritems(self.logger): + logger.setLevel(logging.WARNING) + # turn off httplib debug + httplib.HTTPConnection.debuglevel = 0 + + @property + def logger_format(self): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + return self.__logger_format + + @logger_format.setter + def logger_format(self, value): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + self.__logger_format = value + self.logger_formatter = logging.Formatter(self.__logger_format) + + def get_api_key_with_prefix(self, identifier): + """Gets API key (with prefix if set). + + :param identifier: The identifier of apiKey. + :return: The token for api key authentication. + """ + if (self.api_key.get(identifier) and + self.api_key_prefix.get(identifier)): + return self.api_key_prefix[identifier] + ' ' + self.api_key[identifier] # noqa: E501 + elif self.api_key.get(identifier): + return self.api_key[identifier] + + def get_basic_auth_token(self): + """Gets HTTP basic authentication header (string). + + :return: The token for basic HTTP authentication. + """ + return urllib3.util.make_headers( + basic_auth=self.username + ':' + self.password + ).get('authorization') + + def auth_settings(self): + """Gets Auth Settings dict for api client. + + :return: The Auth Settings information dict. + """ + return { + 'api_key': + { + 'type': 'api_key', + 'in': 'header', + 'key': 'api_key', + 'value': self.get_api_key_with_prefix('api_key') + }, + 'api_key_query': + { + 'type': 'api_key', + 'in': 'query', + 'key': 'api_key_query', + 'value': self.get_api_key_with_prefix('api_key_query') + }, + 'http_basic_test': + { + 'type': 'basic', + 'in': 'header', + 'key': 'Authorization', + 'value': self.get_basic_auth_token() + }, + 'petstore_auth': + { + 'type': 'oauth2', + 'in': 'header', + 'key': 'Authorization', + 'value': 'Bearer ' + self.access_token + }, + } + + def to_debug_report(self): + """Gets the essential information for debugging. + + :return: The report for debugging. + """ + return "Python SDK Debug Report:\n"\ + "OS: {env}\n"\ + "Python Version: {pyversion}\n"\ + "Version of the API: 1.0.0\n"\ + "SDK Package Version: 1.0.0".\ + format(env=sys.platform, pyversion=sys.version) + + def get_host_settings(self): + """Gets an array of host settings + + :return: An array of host settings + """ + return [ + { + 'url': "http://petstore.swagger.io:80/v2", + 'description': "No description provided", + } + ] + + def get_host_from_settings(self, index, variables={}): + """Gets host URL based on the index and variables + :param index: array index of the host settings + :param variables: hash of variable and the corresponding value + :return: URL based on host settings + """ + + servers = self.get_host_settings() + + # check array index out of bound + if index < 0 or index >= len(servers): + raise ValueError( + "Invalid index {} when selecting the host settings. Must be less than {}" # noqa: E501 + .format(index, len(servers))) + + server = servers[index] + url = server['url'] + + # go through variable and assign a value + for variable_name in server['variables']: + if variable_name in variables: + if variables[variable_name] in server['variables'][ + variable_name]['enum_values']: + url = url.replace("{" + variable_name + "}", + variables[variable_name]) + else: + raise ValueError( + "The variable `{}` in the host URL has invalid value {}. Must be {}." # noqa: E501 + .format( + variable_name, variables[variable_name], + server['variables'][variable_name]['enum_values'])) + else: + # use default value + url = url.replace( + "{" + variable_name + "}", + server['variables'][variable_name]['default_value']) + + return url diff --git a/samples/client/petstore/python-experimental/openapi_client/exceptions.py b/samples/client/petstore/python-experimental/openapi_client/exceptions.py new file mode 100644 index 000000000000..100be3e0540f --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/exceptions.py @@ -0,0 +1,120 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import six + + +class OpenApiException(Exception): + """The base exception class for all OpenAPIExceptions""" + + +class ApiTypeError(OpenApiException, TypeError): + def __init__(self, msg, path_to_item=None, valid_classes=None, + key_type=None): + """ Raises an exception for TypeErrors + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list): a list of keys an indices to get to the + current_item + None if unset + valid_classes (tuple): the primitive classes that current item + should be an instance of + None if unset + key_type (bool): False if our value is a value in a dict + True if it is a key in a dict + False if our item is an item in a list + None if unset + """ + self.path_to_item = path_to_item + self.valid_classes = valid_classes + self.key_type = key_type + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiTypeError, self).__init__(full_msg) + + +class ApiValueError(OpenApiException, ValueError): + def __init__(self, msg, path_to_item=None): + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list) the path to the exception in the + received_data dict. None if unset + """ + + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiValueError, self).__init__(full_msg) + + +class ApiKeyError(OpenApiException, KeyError): + def __init__(self, msg, path_to_item=None): + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiKeyError, self).__init__(full_msg) + + +class ApiException(OpenApiException): + + def __init__(self, status=None, reason=None, http_resp=None): + if http_resp: + self.status = http_resp.status + self.reason = http_resp.reason + self.body = http_resp.data + self.headers = http_resp.getheaders() + else: + self.status = status + self.reason = reason + self.body = None + self.headers = None + + def __str__(self): + """Custom error messages for exception""" + error_message = "({0})\n"\ + "Reason: {1}\n".format(self.status, self.reason) + if self.headers: + error_message += "HTTP response headers: {0}\n".format( + self.headers) + + if self.body: + error_message += "HTTP response body: {0}\n".format(self.body) + + return error_message + + +def render_path(path_to_item): + """Returns a string representation of a path""" + result = "" + for pth in path_to_item: + if isinstance(pth, six.integer_types): + result += "[{0}]".format(pth) + else: + result += "['{0}']".format(pth) + return result diff --git a/samples/client/petstore/python-experimental/openapi_client/models/__init__.py b/samples/client/petstore/python-experimental/openapi_client/models/__init__.py new file mode 100644 index 000000000000..3e6b50cfbfd5 --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/models/__init__.py @@ -0,0 +1,62 @@ +# coding: utf-8 + +# flake8: noqa +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +# import models into model package +from openapi_client.models.additional_properties_any_type import AdditionalPropertiesAnyType +from openapi_client.models.additional_properties_array import AdditionalPropertiesArray +from openapi_client.models.additional_properties_boolean import AdditionalPropertiesBoolean +from openapi_client.models.additional_properties_class import AdditionalPropertiesClass +from openapi_client.models.additional_properties_integer import AdditionalPropertiesInteger +from openapi_client.models.additional_properties_number import AdditionalPropertiesNumber +from openapi_client.models.additional_properties_object import AdditionalPropertiesObject +from openapi_client.models.additional_properties_string import AdditionalPropertiesString +from openapi_client.models.animal import Animal +from openapi_client.models.api_response import ApiResponse +from openapi_client.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly +from openapi_client.models.array_of_number_only import ArrayOfNumberOnly +from openapi_client.models.array_test import ArrayTest +from openapi_client.models.capitalization import Capitalization +from openapi_client.models.cat import Cat +from openapi_client.models.cat_all_of import CatAllOf +from openapi_client.models.category import Category +from openapi_client.models.class_model import ClassModel +from openapi_client.models.client import Client +from openapi_client.models.dog import Dog +from openapi_client.models.dog_all_of import DogAllOf +from openapi_client.models.enum_arrays import EnumArrays +from openapi_client.models.enum_class import EnumClass +from openapi_client.models.enum_test import EnumTest +from openapi_client.models.file import File +from openapi_client.models.file_schema_test_class import FileSchemaTestClass +from openapi_client.models.format_test import FormatTest +from openapi_client.models.has_only_read_only import HasOnlyReadOnly +from openapi_client.models.list import List +from openapi_client.models.map_test import MapTest +from openapi_client.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass +from openapi_client.models.model200_response import Model200Response +from openapi_client.models.model_return import ModelReturn +from openapi_client.models.name import Name +from openapi_client.models.number_only import NumberOnly +from openapi_client.models.order import Order +from openapi_client.models.outer_composite import OuterComposite +from openapi_client.models.outer_enum import OuterEnum +from openapi_client.models.pet import Pet +from openapi_client.models.read_only_first import ReadOnlyFirst +from openapi_client.models.special_model_name import SpecialModelName +from openapi_client.models.tag import Tag +from openapi_client.models.type_holder_default import TypeHolderDefault +from openapi_client.models.type_holder_example import TypeHolderExample +from openapi_client.models.user import User +from openapi_client.models.xml_item import XmlItem diff --git a/samples/client/petstore/python-experimental/openapi_client/models/additional_properties_any_type.py b/samples/client/petstore/python-experimental/openapi_client/models/additional_properties_any_type.py new file mode 100644 index 000000000000..ed4f40068bf8 --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/models/additional_properties_any_type.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class AdditionalPropertiesAnyType(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'name': 'str' + } + + attribute_map = { + 'name': 'name' + } + + def __init__(self, name=None): # noqa: E501 + """AdditionalPropertiesAnyType - a model defined in OpenAPI""" # noqa: E501 + + self._name = None + self.discriminator = None + + if name is not None: + self.name = name + + @property + def name(self): + """Gets the name of this AdditionalPropertiesAnyType. # noqa: E501 + + + :return: The name of this AdditionalPropertiesAnyType. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this AdditionalPropertiesAnyType. + + + :param name: The name of this AdditionalPropertiesAnyType. # noqa: E501 + :type: str + """ + + self._name = name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AdditionalPropertiesAnyType): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python-experimental/openapi_client/models/additional_properties_array.py b/samples/client/petstore/python-experimental/openapi_client/models/additional_properties_array.py new file mode 100644 index 000000000000..22b4133f3675 --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/models/additional_properties_array.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class AdditionalPropertiesArray(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'name': 'str' + } + + attribute_map = { + 'name': 'name' + } + + def __init__(self, name=None): # noqa: E501 + """AdditionalPropertiesArray - a model defined in OpenAPI""" # noqa: E501 + + self._name = None + self.discriminator = None + + if name is not None: + self.name = name + + @property + def name(self): + """Gets the name of this AdditionalPropertiesArray. # noqa: E501 + + + :return: The name of this AdditionalPropertiesArray. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this AdditionalPropertiesArray. + + + :param name: The name of this AdditionalPropertiesArray. # noqa: E501 + :type: str + """ + + self._name = name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AdditionalPropertiesArray): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python-experimental/openapi_client/models/additional_properties_boolean.py b/samples/client/petstore/python-experimental/openapi_client/models/additional_properties_boolean.py new file mode 100644 index 000000000000..24e2fc178abc --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/models/additional_properties_boolean.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class AdditionalPropertiesBoolean(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'name': 'str' + } + + attribute_map = { + 'name': 'name' + } + + def __init__(self, name=None): # noqa: E501 + """AdditionalPropertiesBoolean - a model defined in OpenAPI""" # noqa: E501 + + self._name = None + self.discriminator = None + + if name is not None: + self.name = name + + @property + def name(self): + """Gets the name of this AdditionalPropertiesBoolean. # noqa: E501 + + + :return: The name of this AdditionalPropertiesBoolean. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this AdditionalPropertiesBoolean. + + + :param name: The name of this AdditionalPropertiesBoolean. # noqa: E501 + :type: str + """ + + self._name = name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AdditionalPropertiesBoolean): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python-experimental/openapi_client/models/additional_properties_class.py b/samples/client/petstore/python-experimental/openapi_client/models/additional_properties_class.py new file mode 100644 index 000000000000..e9e9307d1b72 --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/models/additional_properties_class.py @@ -0,0 +1,372 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class AdditionalPropertiesClass(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'map_string': 'dict(str, str)', + 'map_number': 'dict(str, float)', + 'map_integer': 'dict(str, int)', + 'map_boolean': 'dict(str, bool)', + 'map_array_integer': 'dict(str, list[int])', + 'map_array_anytype': 'dict(str, list[object])', + 'map_map_string': 'dict(str, dict(str, str))', + 'map_map_anytype': 'dict(str, dict(str, object))', + 'anytype_1': 'object', + 'anytype_2': 'object', + 'anytype_3': 'object' + } + + attribute_map = { + 'map_string': 'map_string', + 'map_number': 'map_number', + 'map_integer': 'map_integer', + 'map_boolean': 'map_boolean', + 'map_array_integer': 'map_array_integer', + 'map_array_anytype': 'map_array_anytype', + 'map_map_string': 'map_map_string', + 'map_map_anytype': 'map_map_anytype', + 'anytype_1': 'anytype_1', + 'anytype_2': 'anytype_2', + 'anytype_3': 'anytype_3' + } + + def __init__(self, map_string=None, map_number=None, map_integer=None, map_boolean=None, map_array_integer=None, map_array_anytype=None, map_map_string=None, map_map_anytype=None, anytype_1=None, anytype_2=None, anytype_3=None): # noqa: E501 + """AdditionalPropertiesClass - a model defined in OpenAPI""" # noqa: E501 + + self._map_string = None + self._map_number = None + self._map_integer = None + self._map_boolean = None + self._map_array_integer = None + self._map_array_anytype = None + self._map_map_string = None + self._map_map_anytype = None + self._anytype_1 = None + self._anytype_2 = None + self._anytype_3 = None + self.discriminator = None + + if map_string is not None: + self.map_string = map_string + if map_number is not None: + self.map_number = map_number + if map_integer is not None: + self.map_integer = map_integer + if map_boolean is not None: + self.map_boolean = map_boolean + if map_array_integer is not None: + self.map_array_integer = map_array_integer + if map_array_anytype is not None: + self.map_array_anytype = map_array_anytype + if map_map_string is not None: + self.map_map_string = map_map_string + if map_map_anytype is not None: + self.map_map_anytype = map_map_anytype + if anytype_1 is not None: + self.anytype_1 = anytype_1 + if anytype_2 is not None: + self.anytype_2 = anytype_2 + if anytype_3 is not None: + self.anytype_3 = anytype_3 + + @property + def map_string(self): + """Gets the map_string of this AdditionalPropertiesClass. # noqa: E501 + + + :return: The map_string of this AdditionalPropertiesClass. # noqa: E501 + :rtype: dict(str, str) + """ + return self._map_string + + @map_string.setter + def map_string(self, map_string): + """Sets the map_string of this AdditionalPropertiesClass. + + + :param map_string: The map_string of this AdditionalPropertiesClass. # noqa: E501 + :type: dict(str, str) + """ + + self._map_string = map_string + + @property + def map_number(self): + """Gets the map_number of this AdditionalPropertiesClass. # noqa: E501 + + + :return: The map_number of this AdditionalPropertiesClass. # noqa: E501 + :rtype: dict(str, float) + """ + return self._map_number + + @map_number.setter + def map_number(self, map_number): + """Sets the map_number of this AdditionalPropertiesClass. + + + :param map_number: The map_number of this AdditionalPropertiesClass. # noqa: E501 + :type: dict(str, float) + """ + + self._map_number = map_number + + @property + def map_integer(self): + """Gets the map_integer of this AdditionalPropertiesClass. # noqa: E501 + + + :return: The map_integer of this AdditionalPropertiesClass. # noqa: E501 + :rtype: dict(str, int) + """ + return self._map_integer + + @map_integer.setter + def map_integer(self, map_integer): + """Sets the map_integer of this AdditionalPropertiesClass. + + + :param map_integer: The map_integer of this AdditionalPropertiesClass. # noqa: E501 + :type: dict(str, int) + """ + + self._map_integer = map_integer + + @property + def map_boolean(self): + """Gets the map_boolean of this AdditionalPropertiesClass. # noqa: E501 + + + :return: The map_boolean of this AdditionalPropertiesClass. # noqa: E501 + :rtype: dict(str, bool) + """ + return self._map_boolean + + @map_boolean.setter + def map_boolean(self, map_boolean): + """Sets the map_boolean of this AdditionalPropertiesClass. + + + :param map_boolean: The map_boolean of this AdditionalPropertiesClass. # noqa: E501 + :type: dict(str, bool) + """ + + self._map_boolean = map_boolean + + @property + def map_array_integer(self): + """Gets the map_array_integer of this AdditionalPropertiesClass. # noqa: E501 + + + :return: The map_array_integer of this AdditionalPropertiesClass. # noqa: E501 + :rtype: dict(str, list[int]) + """ + return self._map_array_integer + + @map_array_integer.setter + def map_array_integer(self, map_array_integer): + """Sets the map_array_integer of this AdditionalPropertiesClass. + + + :param map_array_integer: The map_array_integer of this AdditionalPropertiesClass. # noqa: E501 + :type: dict(str, list[int]) + """ + + self._map_array_integer = map_array_integer + + @property + def map_array_anytype(self): + """Gets the map_array_anytype of this AdditionalPropertiesClass. # noqa: E501 + + + :return: The map_array_anytype of this AdditionalPropertiesClass. # noqa: E501 + :rtype: dict(str, list[object]) + """ + return self._map_array_anytype + + @map_array_anytype.setter + def map_array_anytype(self, map_array_anytype): + """Sets the map_array_anytype of this AdditionalPropertiesClass. + + + :param map_array_anytype: The map_array_anytype of this AdditionalPropertiesClass. # noqa: E501 + :type: dict(str, list[object]) + """ + + self._map_array_anytype = map_array_anytype + + @property + def map_map_string(self): + """Gets the map_map_string of this AdditionalPropertiesClass. # noqa: E501 + + + :return: The map_map_string of this AdditionalPropertiesClass. # noqa: E501 + :rtype: dict(str, dict(str, str)) + """ + return self._map_map_string + + @map_map_string.setter + def map_map_string(self, map_map_string): + """Sets the map_map_string of this AdditionalPropertiesClass. + + + :param map_map_string: The map_map_string of this AdditionalPropertiesClass. # noqa: E501 + :type: dict(str, dict(str, str)) + """ + + self._map_map_string = map_map_string + + @property + def map_map_anytype(self): + """Gets the map_map_anytype of this AdditionalPropertiesClass. # noqa: E501 + + + :return: The map_map_anytype of this AdditionalPropertiesClass. # noqa: E501 + :rtype: dict(str, dict(str, object)) + """ + return self._map_map_anytype + + @map_map_anytype.setter + def map_map_anytype(self, map_map_anytype): + """Sets the map_map_anytype of this AdditionalPropertiesClass. + + + :param map_map_anytype: The map_map_anytype of this AdditionalPropertiesClass. # noqa: E501 + :type: dict(str, dict(str, object)) + """ + + self._map_map_anytype = map_map_anytype + + @property + def anytype_1(self): + """Gets the anytype_1 of this AdditionalPropertiesClass. # noqa: E501 + + + :return: The anytype_1 of this AdditionalPropertiesClass. # noqa: E501 + :rtype: object + """ + return self._anytype_1 + + @anytype_1.setter + def anytype_1(self, anytype_1): + """Sets the anytype_1 of this AdditionalPropertiesClass. + + + :param anytype_1: The anytype_1 of this AdditionalPropertiesClass. # noqa: E501 + :type: object + """ + + self._anytype_1 = anytype_1 + + @property + def anytype_2(self): + """Gets the anytype_2 of this AdditionalPropertiesClass. # noqa: E501 + + + :return: The anytype_2 of this AdditionalPropertiesClass. # noqa: E501 + :rtype: object + """ + return self._anytype_2 + + @anytype_2.setter + def anytype_2(self, anytype_2): + """Sets the anytype_2 of this AdditionalPropertiesClass. + + + :param anytype_2: The anytype_2 of this AdditionalPropertiesClass. # noqa: E501 + :type: object + """ + + self._anytype_2 = anytype_2 + + @property + def anytype_3(self): + """Gets the anytype_3 of this AdditionalPropertiesClass. # noqa: E501 + + + :return: The anytype_3 of this AdditionalPropertiesClass. # noqa: E501 + :rtype: object + """ + return self._anytype_3 + + @anytype_3.setter + def anytype_3(self, anytype_3): + """Sets the anytype_3 of this AdditionalPropertiesClass. + + + :param anytype_3: The anytype_3 of this AdditionalPropertiesClass. # noqa: E501 + :type: object + """ + + self._anytype_3 = anytype_3 + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AdditionalPropertiesClass): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python-experimental/openapi_client/models/additional_properties_integer.py b/samples/client/petstore/python-experimental/openapi_client/models/additional_properties_integer.py new file mode 100644 index 000000000000..43bcf425a7b3 --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/models/additional_properties_integer.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class AdditionalPropertiesInteger(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'name': 'str' + } + + attribute_map = { + 'name': 'name' + } + + def __init__(self, name=None): # noqa: E501 + """AdditionalPropertiesInteger - a model defined in OpenAPI""" # noqa: E501 + + self._name = None + self.discriminator = None + + if name is not None: + self.name = name + + @property + def name(self): + """Gets the name of this AdditionalPropertiesInteger. # noqa: E501 + + + :return: The name of this AdditionalPropertiesInteger. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this AdditionalPropertiesInteger. + + + :param name: The name of this AdditionalPropertiesInteger. # noqa: E501 + :type: str + """ + + self._name = name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AdditionalPropertiesInteger): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python-experimental/openapi_client/models/additional_properties_number.py b/samples/client/petstore/python-experimental/openapi_client/models/additional_properties_number.py new file mode 100644 index 000000000000..b3e034035a8e --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/models/additional_properties_number.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class AdditionalPropertiesNumber(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'name': 'str' + } + + attribute_map = { + 'name': 'name' + } + + def __init__(self, name=None): # noqa: E501 + """AdditionalPropertiesNumber - a model defined in OpenAPI""" # noqa: E501 + + self._name = None + self.discriminator = None + + if name is not None: + self.name = name + + @property + def name(self): + """Gets the name of this AdditionalPropertiesNumber. # noqa: E501 + + + :return: The name of this AdditionalPropertiesNumber. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this AdditionalPropertiesNumber. + + + :param name: The name of this AdditionalPropertiesNumber. # noqa: E501 + :type: str + """ + + self._name = name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AdditionalPropertiesNumber): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python-experimental/openapi_client/models/additional_properties_object.py b/samples/client/petstore/python-experimental/openapi_client/models/additional_properties_object.py new file mode 100644 index 000000000000..9ab56a4e5537 --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/models/additional_properties_object.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class AdditionalPropertiesObject(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'name': 'str' + } + + attribute_map = { + 'name': 'name' + } + + def __init__(self, name=None): # noqa: E501 + """AdditionalPropertiesObject - a model defined in OpenAPI""" # noqa: E501 + + self._name = None + self.discriminator = None + + if name is not None: + self.name = name + + @property + def name(self): + """Gets the name of this AdditionalPropertiesObject. # noqa: E501 + + + :return: The name of this AdditionalPropertiesObject. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this AdditionalPropertiesObject. + + + :param name: The name of this AdditionalPropertiesObject. # noqa: E501 + :type: str + """ + + self._name = name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AdditionalPropertiesObject): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python-experimental/openapi_client/models/additional_properties_string.py b/samples/client/petstore/python-experimental/openapi_client/models/additional_properties_string.py new file mode 100644 index 000000000000..4667186bdc4f --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/models/additional_properties_string.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class AdditionalPropertiesString(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'name': 'str' + } + + attribute_map = { + 'name': 'name' + } + + def __init__(self, name=None): # noqa: E501 + """AdditionalPropertiesString - a model defined in OpenAPI""" # noqa: E501 + + self._name = None + self.discriminator = None + + if name is not None: + self.name = name + + @property + def name(self): + """Gets the name of this AdditionalPropertiesString. # noqa: E501 + + + :return: The name of this AdditionalPropertiesString. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this AdditionalPropertiesString. + + + :param name: The name of this AdditionalPropertiesString. # noqa: E501 + :type: str + """ + + self._name = name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AdditionalPropertiesString): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python-experimental/openapi_client/models/animal.py b/samples/client/petstore/python-experimental/openapi_client/models/animal.py new file mode 100644 index 000000000000..552ef0e8326b --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/models/animal.py @@ -0,0 +1,150 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class Animal(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'class_name': 'str', + 'color': 'str' + } + + attribute_map = { + 'class_name': 'className', + 'color': 'color' + } + + discriminator_value_class_map = { + 'Dog': 'Dog', + 'Cat': 'Cat' + } + + def __init__(self, class_name=None, color='red'): # noqa: E501 + """Animal - a model defined in OpenAPI""" # noqa: E501 + + self._class_name = None + self._color = None + self.discriminator = 'class_name' + + self.class_name = class_name + if color is not None: + self.color = color + + @property + def class_name(self): + """Gets the class_name of this Animal. # noqa: E501 + + + :return: The class_name of this Animal. # noqa: E501 + :rtype: str + """ + return self._class_name + + @class_name.setter + def class_name(self, class_name): + """Sets the class_name of this Animal. + + + :param class_name: The class_name of this Animal. # noqa: E501 + :type: str + """ + if class_name is None: + raise ValueError("Invalid value for `class_name`, must not be `None`") # noqa: E501 + + self._class_name = class_name + + @property + def color(self): + """Gets the color of this Animal. # noqa: E501 + + + :return: The color of this Animal. # noqa: E501 + :rtype: str + """ + return self._color + + @color.setter + def color(self, color): + """Sets the color of this Animal. + + + :param color: The color of this Animal. # noqa: E501 + :type: str + """ + + self._color = color + + def get_real_child_model(self, data): + """Returns the real base class specified by the discriminator""" + discriminator_key = self.attribute_map[self.discriminator] + discriminator_value = data[discriminator_key] + return self.discriminator_value_class_map.get(discriminator_value) + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Animal): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python-experimental/openapi_client/models/api_response.py b/samples/client/petstore/python-experimental/openapi_client/models/api_response.py new file mode 100644 index 000000000000..190c3df34526 --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/models/api_response.py @@ -0,0 +1,164 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class ApiResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'int', + 'type': 'str', + 'message': 'str' + } + + attribute_map = { + 'code': 'code', + 'type': 'type', + 'message': 'message' + } + + def __init__(self, code=None, type=None, message=None): # noqa: E501 + """ApiResponse - a model defined in OpenAPI""" # noqa: E501 + + self._code = None + self._type = None + self._message = None + self.discriminator = None + + if code is not None: + self.code = code + if type is not None: + self.type = type + if message is not None: + self.message = message + + @property + def code(self): + """Gets the code of this ApiResponse. # noqa: E501 + + + :return: The code of this ApiResponse. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this ApiResponse. + + + :param code: The code of this ApiResponse. # noqa: E501 + :type: int + """ + + self._code = code + + @property + def type(self): + """Gets the type of this ApiResponse. # noqa: E501 + + + :return: The type of this ApiResponse. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this ApiResponse. + + + :param type: The type of this ApiResponse. # noqa: E501 + :type: str + """ + + self._type = type + + @property + def message(self): + """Gets the message of this ApiResponse. # noqa: E501 + + + :return: The message of this ApiResponse. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this ApiResponse. + + + :param message: The message of this ApiResponse. # noqa: E501 + :type: str + """ + + self._message = message + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ApiResponse): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python-experimental/openapi_client/models/array_of_array_of_number_only.py b/samples/client/petstore/python-experimental/openapi_client/models/array_of_array_of_number_only.py new file mode 100644 index 000000000000..ebf964298018 --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/models/array_of_array_of_number_only.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class ArrayOfArrayOfNumberOnly(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'array_array_number': 'list[list[float]]' + } + + attribute_map = { + 'array_array_number': 'ArrayArrayNumber' + } + + def __init__(self, array_array_number=None): # noqa: E501 + """ArrayOfArrayOfNumberOnly - a model defined in OpenAPI""" # noqa: E501 + + self._array_array_number = None + self.discriminator = None + + if array_array_number is not None: + self.array_array_number = array_array_number + + @property + def array_array_number(self): + """Gets the array_array_number of this ArrayOfArrayOfNumberOnly. # noqa: E501 + + + :return: The array_array_number of this ArrayOfArrayOfNumberOnly. # noqa: E501 + :rtype: list[list[float]] + """ + return self._array_array_number + + @array_array_number.setter + def array_array_number(self, array_array_number): + """Sets the array_array_number of this ArrayOfArrayOfNumberOnly. + + + :param array_array_number: The array_array_number of this ArrayOfArrayOfNumberOnly. # noqa: E501 + :type: list[list[float]] + """ + + self._array_array_number = array_array_number + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ArrayOfArrayOfNumberOnly): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python-experimental/openapi_client/models/array_of_number_only.py b/samples/client/petstore/python-experimental/openapi_client/models/array_of_number_only.py new file mode 100644 index 000000000000..8e1837c46bda --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/models/array_of_number_only.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class ArrayOfNumberOnly(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'array_number': 'list[float]' + } + + attribute_map = { + 'array_number': 'ArrayNumber' + } + + def __init__(self, array_number=None): # noqa: E501 + """ArrayOfNumberOnly - a model defined in OpenAPI""" # noqa: E501 + + self._array_number = None + self.discriminator = None + + if array_number is not None: + self.array_number = array_number + + @property + def array_number(self): + """Gets the array_number of this ArrayOfNumberOnly. # noqa: E501 + + + :return: The array_number of this ArrayOfNumberOnly. # noqa: E501 + :rtype: list[float] + """ + return self._array_number + + @array_number.setter + def array_number(self, array_number): + """Sets the array_number of this ArrayOfNumberOnly. + + + :param array_number: The array_number of this ArrayOfNumberOnly. # noqa: E501 + :type: list[float] + """ + + self._array_number = array_number + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ArrayOfNumberOnly): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python-experimental/openapi_client/models/array_test.py b/samples/client/petstore/python-experimental/openapi_client/models/array_test.py new file mode 100644 index 000000000000..f548fef3ee8c --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/models/array_test.py @@ -0,0 +1,164 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class ArrayTest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'array_of_string': 'list[str]', + 'array_array_of_integer': 'list[list[int]]', + 'array_array_of_model': 'list[list[ReadOnlyFirst]]' + } + + attribute_map = { + 'array_of_string': 'array_of_string', + 'array_array_of_integer': 'array_array_of_integer', + 'array_array_of_model': 'array_array_of_model' + } + + def __init__(self, array_of_string=None, array_array_of_integer=None, array_array_of_model=None): # noqa: E501 + """ArrayTest - a model defined in OpenAPI""" # noqa: E501 + + self._array_of_string = None + self._array_array_of_integer = None + self._array_array_of_model = None + self.discriminator = None + + if array_of_string is not None: + self.array_of_string = array_of_string + if array_array_of_integer is not None: + self.array_array_of_integer = array_array_of_integer + if array_array_of_model is not None: + self.array_array_of_model = array_array_of_model + + @property + def array_of_string(self): + """Gets the array_of_string of this ArrayTest. # noqa: E501 + + + :return: The array_of_string of this ArrayTest. # noqa: E501 + :rtype: list[str] + """ + return self._array_of_string + + @array_of_string.setter + def array_of_string(self, array_of_string): + """Sets the array_of_string of this ArrayTest. + + + :param array_of_string: The array_of_string of this ArrayTest. # noqa: E501 + :type: list[str] + """ + + self._array_of_string = array_of_string + + @property + def array_array_of_integer(self): + """Gets the array_array_of_integer of this ArrayTest. # noqa: E501 + + + :return: The array_array_of_integer of this ArrayTest. # noqa: E501 + :rtype: list[list[int]] + """ + return self._array_array_of_integer + + @array_array_of_integer.setter + def array_array_of_integer(self, array_array_of_integer): + """Sets the array_array_of_integer of this ArrayTest. + + + :param array_array_of_integer: The array_array_of_integer of this ArrayTest. # noqa: E501 + :type: list[list[int]] + """ + + self._array_array_of_integer = array_array_of_integer + + @property + def array_array_of_model(self): + """Gets the array_array_of_model of this ArrayTest. # noqa: E501 + + + :return: The array_array_of_model of this ArrayTest. # noqa: E501 + :rtype: list[list[ReadOnlyFirst]] + """ + return self._array_array_of_model + + @array_array_of_model.setter + def array_array_of_model(self, array_array_of_model): + """Sets the array_array_of_model of this ArrayTest. + + + :param array_array_of_model: The array_array_of_model of this ArrayTest. # noqa: E501 + :type: list[list[ReadOnlyFirst]] + """ + + self._array_array_of_model = array_array_of_model + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ArrayTest): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python-experimental/openapi_client/models/capitalization.py b/samples/client/petstore/python-experimental/openapi_client/models/capitalization.py new file mode 100644 index 000000000000..0da6b77e84dc --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/models/capitalization.py @@ -0,0 +1,244 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class Capitalization(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'small_camel': 'str', + 'capital_camel': 'str', + 'small_snake': 'str', + 'capital_snake': 'str', + 'sca_eth_flow_points': 'str', + 'att_name': 'str' + } + + attribute_map = { + 'small_camel': 'smallCamel', + 'capital_camel': 'CapitalCamel', + 'small_snake': 'small_Snake', + 'capital_snake': 'Capital_Snake', + 'sca_eth_flow_points': 'SCA_ETH_Flow_Points', + 'att_name': 'ATT_NAME' + } + + def __init__(self, small_camel=None, capital_camel=None, small_snake=None, capital_snake=None, sca_eth_flow_points=None, att_name=None): # noqa: E501 + """Capitalization - a model defined in OpenAPI""" # noqa: E501 + + self._small_camel = None + self._capital_camel = None + self._small_snake = None + self._capital_snake = None + self._sca_eth_flow_points = None + self._att_name = None + self.discriminator = None + + if small_camel is not None: + self.small_camel = small_camel + if capital_camel is not None: + self.capital_camel = capital_camel + if small_snake is not None: + self.small_snake = small_snake + if capital_snake is not None: + self.capital_snake = capital_snake + if sca_eth_flow_points is not None: + self.sca_eth_flow_points = sca_eth_flow_points + if att_name is not None: + self.att_name = att_name + + @property + def small_camel(self): + """Gets the small_camel of this Capitalization. # noqa: E501 + + + :return: The small_camel of this Capitalization. # noqa: E501 + :rtype: str + """ + return self._small_camel + + @small_camel.setter + def small_camel(self, small_camel): + """Sets the small_camel of this Capitalization. + + + :param small_camel: The small_camel of this Capitalization. # noqa: E501 + :type: str + """ + + self._small_camel = small_camel + + @property + def capital_camel(self): + """Gets the capital_camel of this Capitalization. # noqa: E501 + + + :return: The capital_camel of this Capitalization. # noqa: E501 + :rtype: str + """ + return self._capital_camel + + @capital_camel.setter + def capital_camel(self, capital_camel): + """Sets the capital_camel of this Capitalization. + + + :param capital_camel: The capital_camel of this Capitalization. # noqa: E501 + :type: str + """ + + self._capital_camel = capital_camel + + @property + def small_snake(self): + """Gets the small_snake of this Capitalization. # noqa: E501 + + + :return: The small_snake of this Capitalization. # noqa: E501 + :rtype: str + """ + return self._small_snake + + @small_snake.setter + def small_snake(self, small_snake): + """Sets the small_snake of this Capitalization. + + + :param small_snake: The small_snake of this Capitalization. # noqa: E501 + :type: str + """ + + self._small_snake = small_snake + + @property + def capital_snake(self): + """Gets the capital_snake of this Capitalization. # noqa: E501 + + + :return: The capital_snake of this Capitalization. # noqa: E501 + :rtype: str + """ + return self._capital_snake + + @capital_snake.setter + def capital_snake(self, capital_snake): + """Sets the capital_snake of this Capitalization. + + + :param capital_snake: The capital_snake of this Capitalization. # noqa: E501 + :type: str + """ + + self._capital_snake = capital_snake + + @property + def sca_eth_flow_points(self): + """Gets the sca_eth_flow_points of this Capitalization. # noqa: E501 + + + :return: The sca_eth_flow_points of this Capitalization. # noqa: E501 + :rtype: str + """ + return self._sca_eth_flow_points + + @sca_eth_flow_points.setter + def sca_eth_flow_points(self, sca_eth_flow_points): + """Sets the sca_eth_flow_points of this Capitalization. + + + :param sca_eth_flow_points: The sca_eth_flow_points of this Capitalization. # noqa: E501 + :type: str + """ + + self._sca_eth_flow_points = sca_eth_flow_points + + @property + def att_name(self): + """Gets the att_name of this Capitalization. # noqa: E501 + + Name of the pet # noqa: E501 + + :return: The att_name of this Capitalization. # noqa: E501 + :rtype: str + """ + return self._att_name + + @att_name.setter + def att_name(self, att_name): + """Sets the att_name of this Capitalization. + + Name of the pet # noqa: E501 + + :param att_name: The att_name of this Capitalization. # noqa: E501 + :type: str + """ + + self._att_name = att_name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Capitalization): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python-experimental/openapi_client/models/cat.py b/samples/client/petstore/python-experimental/openapi_client/models/cat.py new file mode 100644 index 000000000000..216e5123538c --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/models/cat.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class Cat(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'declawed': 'bool' + } + + attribute_map = { + 'declawed': 'declawed' + } + + def __init__(self, declawed=None): # noqa: E501 + """Cat - a model defined in OpenAPI""" # noqa: E501 + + self._declawed = None + self.discriminator = None + + if declawed is not None: + self.declawed = declawed + + @property + def declawed(self): + """Gets the declawed of this Cat. # noqa: E501 + + + :return: The declawed of this Cat. # noqa: E501 + :rtype: bool + """ + return self._declawed + + @declawed.setter + def declawed(self, declawed): + """Sets the declawed of this Cat. + + + :param declawed: The declawed of this Cat. # noqa: E501 + :type: bool + """ + + self._declawed = declawed + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Cat): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python-experimental/openapi_client/models/cat_all_of.py b/samples/client/petstore/python-experimental/openapi_client/models/cat_all_of.py new file mode 100644 index 000000000000..3c90df84ec3a --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/models/cat_all_of.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class CatAllOf(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'declawed': 'bool' + } + + attribute_map = { + 'declawed': 'declawed' + } + + def __init__(self, declawed=None): # noqa: E501 + """CatAllOf - a model defined in OpenAPI""" # noqa: E501 + + self._declawed = None + self.discriminator = None + + if declawed is not None: + self.declawed = declawed + + @property + def declawed(self): + """Gets the declawed of this CatAllOf. # noqa: E501 + + + :return: The declawed of this CatAllOf. # noqa: E501 + :rtype: bool + """ + return self._declawed + + @declawed.setter + def declawed(self, declawed): + """Sets the declawed of this CatAllOf. + + + :param declawed: The declawed of this CatAllOf. # noqa: E501 + :type: bool + """ + + self._declawed = declawed + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CatAllOf): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python-experimental/openapi_client/models/category.py b/samples/client/petstore/python-experimental/openapi_client/models/category.py new file mode 100644 index 000000000000..0e23c409e50a --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/models/category.py @@ -0,0 +1,139 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class Category(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'id': 'int', + 'name': 'str' + } + + attribute_map = { + 'id': 'id', + 'name': 'name' + } + + def __init__(self, id=None, name='default-name'): # noqa: E501 + """Category - a model defined in OpenAPI""" # noqa: E501 + + self._id = None + self._name = None + self.discriminator = None + + if id is not None: + self.id = id + self.name = name + + @property + def id(self): + """Gets the id of this Category. # noqa: E501 + + + :return: The id of this Category. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this Category. + + + :param id: The id of this Category. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def name(self): + """Gets the name of this Category. # noqa: E501 + + + :return: The name of this Category. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this Category. + + + :param name: The name of this Category. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Category): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python-experimental/openapi_client/models/class_model.py b/samples/client/petstore/python-experimental/openapi_client/models/class_model.py new file mode 100644 index 000000000000..88562beff8b1 --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/models/class_model.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class ClassModel(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + '_class': 'str' + } + + attribute_map = { + '_class': '_class' + } + + def __init__(self, _class=None): # noqa: E501 + """ClassModel - a model defined in OpenAPI""" # noqa: E501 + + self.__class = None + self.discriminator = None + + if _class is not None: + self._class = _class + + @property + def _class(self): + """Gets the _class of this ClassModel. # noqa: E501 + + + :return: The _class of this ClassModel. # noqa: E501 + :rtype: str + """ + return self.__class + + @_class.setter + def _class(self, _class): + """Sets the _class of this ClassModel. + + + :param _class: The _class of this ClassModel. # noqa: E501 + :type: str + """ + + self.__class = _class + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ClassModel): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python-experimental/openapi_client/models/client.py b/samples/client/petstore/python-experimental/openapi_client/models/client.py new file mode 100644 index 000000000000..b7083fd9bd75 --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/models/client.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class Client(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'client': 'str' + } + + attribute_map = { + 'client': 'client' + } + + def __init__(self, client=None): # noqa: E501 + """Client - a model defined in OpenAPI""" # noqa: E501 + + self._client = None + self.discriminator = None + + if client is not None: + self.client = client + + @property + def client(self): + """Gets the client of this Client. # noqa: E501 + + + :return: The client of this Client. # noqa: E501 + :rtype: str + """ + return self._client + + @client.setter + def client(self, client): + """Sets the client of this Client. + + + :param client: The client of this Client. # noqa: E501 + :type: str + """ + + self._client = client + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Client): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python-experimental/openapi_client/models/dog.py b/samples/client/petstore/python-experimental/openapi_client/models/dog.py new file mode 100644 index 000000000000..c325cb252c32 --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/models/dog.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class Dog(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'breed': 'str' + } + + attribute_map = { + 'breed': 'breed' + } + + def __init__(self, breed=None): # noqa: E501 + """Dog - a model defined in OpenAPI""" # noqa: E501 + + self._breed = None + self.discriminator = None + + if breed is not None: + self.breed = breed + + @property + def breed(self): + """Gets the breed of this Dog. # noqa: E501 + + + :return: The breed of this Dog. # noqa: E501 + :rtype: str + """ + return self._breed + + @breed.setter + def breed(self, breed): + """Sets the breed of this Dog. + + + :param breed: The breed of this Dog. # noqa: E501 + :type: str + """ + + self._breed = breed + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Dog): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python-experimental/openapi_client/models/dog_all_of.py b/samples/client/petstore/python-experimental/openapi_client/models/dog_all_of.py new file mode 100644 index 000000000000..b6328b05589e --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/models/dog_all_of.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class DogAllOf(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'breed': 'str' + } + + attribute_map = { + 'breed': 'breed' + } + + def __init__(self, breed=None): # noqa: E501 + """DogAllOf - a model defined in OpenAPI""" # noqa: E501 + + self._breed = None + self.discriminator = None + + if breed is not None: + self.breed = breed + + @property + def breed(self): + """Gets the breed of this DogAllOf. # noqa: E501 + + + :return: The breed of this DogAllOf. # noqa: E501 + :rtype: str + """ + return self._breed + + @breed.setter + def breed(self, breed): + """Sets the breed of this DogAllOf. + + + :param breed: The breed of this DogAllOf. # noqa: E501 + :type: str + """ + + self._breed = breed + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DogAllOf): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python-experimental/openapi_client/models/enum_arrays.py b/samples/client/petstore/python-experimental/openapi_client/models/enum_arrays.py new file mode 100644 index 000000000000..00aa21d04da8 --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/models/enum_arrays.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class EnumArrays(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'just_symbol': 'str', + 'array_enum': 'list[str]' + } + + attribute_map = { + 'just_symbol': 'just_symbol', + 'array_enum': 'array_enum' + } + + def __init__(self, just_symbol=None, array_enum=None): # noqa: E501 + """EnumArrays - a model defined in OpenAPI""" # noqa: E501 + + self._just_symbol = None + self._array_enum = None + self.discriminator = None + + if just_symbol is not None: + self.just_symbol = just_symbol + if array_enum is not None: + self.array_enum = array_enum + + @property + def just_symbol(self): + """Gets the just_symbol of this EnumArrays. # noqa: E501 + + + :return: The just_symbol of this EnumArrays. # noqa: E501 + :rtype: str + """ + return self._just_symbol + + @just_symbol.setter + def just_symbol(self, just_symbol): + """Sets the just_symbol of this EnumArrays. + + + :param just_symbol: The just_symbol of this EnumArrays. # noqa: E501 + :type: str + """ + allowed_values = [">=", "$"] # noqa: E501 + if just_symbol not in allowed_values: + raise ValueError( + "Invalid value for `just_symbol` ({0}), must be one of {1}" # noqa: E501 + .format(just_symbol, allowed_values) + ) + + self._just_symbol = just_symbol + + @property + def array_enum(self): + """Gets the array_enum of this EnumArrays. # noqa: E501 + + + :return: The array_enum of this EnumArrays. # noqa: E501 + :rtype: list[str] + """ + return self._array_enum + + @array_enum.setter + def array_enum(self, array_enum): + """Sets the array_enum of this EnumArrays. + + + :param array_enum: The array_enum of this EnumArrays. # noqa: E501 + :type: list[str] + """ + allowed_values = ["fish", "crab"] # noqa: E501 + if not set(array_enum).issubset(set(allowed_values)): + raise ValueError( + "Invalid values for `array_enum` [{0}], must be a subset of [{1}]" # noqa: E501 + .format(", ".join(map(str, set(array_enum) - set(allowed_values))), # noqa: E501 + ", ".join(map(str, allowed_values))) + ) + + self._array_enum = array_enum + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, EnumArrays): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python-experimental/openapi_client/models/enum_class.py b/samples/client/petstore/python-experimental/openapi_client/models/enum_class.py new file mode 100644 index 000000000000..3c1aa279755b --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/models/enum_class.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class EnumClass(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + _ABC = "_abc" + _EFG = "-efg" + _XYZ_ = "(xyz)" + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """EnumClass - a model defined in OpenAPI""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, EnumClass): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python-experimental/openapi_client/models/enum_test.py b/samples/client/petstore/python-experimental/openapi_client/models/enum_test.py new file mode 100644 index 000000000000..11e5020363ec --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/models/enum_test.py @@ -0,0 +1,241 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class EnumTest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'enum_string': 'str', + 'enum_string_required': 'str', + 'enum_integer': 'int', + 'enum_number': 'float', + 'outer_enum': 'OuterEnum' + } + + attribute_map = { + 'enum_string': 'enum_string', + 'enum_string_required': 'enum_string_required', + 'enum_integer': 'enum_integer', + 'enum_number': 'enum_number', + 'outer_enum': 'outerEnum' + } + + def __init__(self, enum_string=None, enum_string_required=None, enum_integer=None, enum_number=None, outer_enum=None): # noqa: E501 + """EnumTest - a model defined in OpenAPI""" # noqa: E501 + + self._enum_string = None + self._enum_string_required = None + self._enum_integer = None + self._enum_number = None + self._outer_enum = None + self.discriminator = None + + if enum_string is not None: + self.enum_string = enum_string + self.enum_string_required = enum_string_required + if enum_integer is not None: + self.enum_integer = enum_integer + if enum_number is not None: + self.enum_number = enum_number + if outer_enum is not None: + self.outer_enum = outer_enum + + @property + def enum_string(self): + """Gets the enum_string of this EnumTest. # noqa: E501 + + + :return: The enum_string of this EnumTest. # noqa: E501 + :rtype: str + """ + return self._enum_string + + @enum_string.setter + def enum_string(self, enum_string): + """Sets the enum_string of this EnumTest. + + + :param enum_string: The enum_string of this EnumTest. # noqa: E501 + :type: str + """ + allowed_values = ["UPPER", "lower", ""] # noqa: E501 + if enum_string not in allowed_values: + raise ValueError( + "Invalid value for `enum_string` ({0}), must be one of {1}" # noqa: E501 + .format(enum_string, allowed_values) + ) + + self._enum_string = enum_string + + @property + def enum_string_required(self): + """Gets the enum_string_required of this EnumTest. # noqa: E501 + + + :return: The enum_string_required of this EnumTest. # noqa: E501 + :rtype: str + """ + return self._enum_string_required + + @enum_string_required.setter + def enum_string_required(self, enum_string_required): + """Sets the enum_string_required of this EnumTest. + + + :param enum_string_required: The enum_string_required of this EnumTest. # noqa: E501 + :type: str + """ + if enum_string_required is None: + raise ValueError("Invalid value for `enum_string_required`, must not be `None`") # noqa: E501 + allowed_values = ["UPPER", "lower", ""] # noqa: E501 + if enum_string_required not in allowed_values: + raise ValueError( + "Invalid value for `enum_string_required` ({0}), must be one of {1}" # noqa: E501 + .format(enum_string_required, allowed_values) + ) + + self._enum_string_required = enum_string_required + + @property + def enum_integer(self): + """Gets the enum_integer of this EnumTest. # noqa: E501 + + + :return: The enum_integer of this EnumTest. # noqa: E501 + :rtype: int + """ + return self._enum_integer + + @enum_integer.setter + def enum_integer(self, enum_integer): + """Sets the enum_integer of this EnumTest. + + + :param enum_integer: The enum_integer of this EnumTest. # noqa: E501 + :type: int + """ + allowed_values = [1, -1] # noqa: E501 + if enum_integer not in allowed_values: + raise ValueError( + "Invalid value for `enum_integer` ({0}), must be one of {1}" # noqa: E501 + .format(enum_integer, allowed_values) + ) + + self._enum_integer = enum_integer + + @property + def enum_number(self): + """Gets the enum_number of this EnumTest. # noqa: E501 + + + :return: The enum_number of this EnumTest. # noqa: E501 + :rtype: float + """ + return self._enum_number + + @enum_number.setter + def enum_number(self, enum_number): + """Sets the enum_number of this EnumTest. + + + :param enum_number: The enum_number of this EnumTest. # noqa: E501 + :type: float + """ + allowed_values = [1.1, -1.2] # noqa: E501 + if enum_number not in allowed_values: + raise ValueError( + "Invalid value for `enum_number` ({0}), must be one of {1}" # noqa: E501 + .format(enum_number, allowed_values) + ) + + self._enum_number = enum_number + + @property + def outer_enum(self): + """Gets the outer_enum of this EnumTest. # noqa: E501 + + + :return: The outer_enum of this EnumTest. # noqa: E501 + :rtype: OuterEnum + """ + return self._outer_enum + + @outer_enum.setter + def outer_enum(self, outer_enum): + """Sets the outer_enum of this EnumTest. + + + :param outer_enum: The outer_enum of this EnumTest. # noqa: E501 + :type: OuterEnum + """ + + self._outer_enum = outer_enum + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, EnumTest): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python-experimental/openapi_client/models/file.py b/samples/client/petstore/python-experimental/openapi_client/models/file.py new file mode 100644 index 000000000000..475f86b799f7 --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/models/file.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class File(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'source_uri': 'str' + } + + attribute_map = { + 'source_uri': 'sourceURI' + } + + def __init__(self, source_uri=None): # noqa: E501 + """File - a model defined in OpenAPI""" # noqa: E501 + + self._source_uri = None + self.discriminator = None + + if source_uri is not None: + self.source_uri = source_uri + + @property + def source_uri(self): + """Gets the source_uri of this File. # noqa: E501 + + Test capitalization # noqa: E501 + + :return: The source_uri of this File. # noqa: E501 + :rtype: str + """ + return self._source_uri + + @source_uri.setter + def source_uri(self, source_uri): + """Sets the source_uri of this File. + + Test capitalization # noqa: E501 + + :param source_uri: The source_uri of this File. # noqa: E501 + :type: str + """ + + self._source_uri = source_uri + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, File): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python-experimental/openapi_client/models/file_schema_test_class.py b/samples/client/petstore/python-experimental/openapi_client/models/file_schema_test_class.py new file mode 100644 index 000000000000..9f3b5bdc1793 --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/models/file_schema_test_class.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class FileSchemaTestClass(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'file': 'File', + 'files': 'list[File]' + } + + attribute_map = { + 'file': 'file', + 'files': 'files' + } + + def __init__(self, file=None, files=None): # noqa: E501 + """FileSchemaTestClass - a model defined in OpenAPI""" # noqa: E501 + + self._file = None + self._files = None + self.discriminator = None + + if file is not None: + self.file = file + if files is not None: + self.files = files + + @property + def file(self): + """Gets the file of this FileSchemaTestClass. # noqa: E501 + + + :return: The file of this FileSchemaTestClass. # noqa: E501 + :rtype: File + """ + return self._file + + @file.setter + def file(self, file): + """Sets the file of this FileSchemaTestClass. + + + :param file: The file of this FileSchemaTestClass. # noqa: E501 + :type: File + """ + + self._file = file + + @property + def files(self): + """Gets the files of this FileSchemaTestClass. # noqa: E501 + + + :return: The files of this FileSchemaTestClass. # noqa: E501 + :rtype: list[File] + """ + return self._files + + @files.setter + def files(self, files): + """Sets the files of this FileSchemaTestClass. + + + :param files: The files of this FileSchemaTestClass. # noqa: E501 + :type: list[File] + """ + + self._files = files + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FileSchemaTestClass): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python-experimental/openapi_client/models/format_test.py b/samples/client/petstore/python-experimental/openapi_client/models/format_test.py new file mode 100644 index 000000000000..c27d6394dbe5 --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/models/format_test.py @@ -0,0 +1,456 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class FormatTest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'integer': 'int', + 'int32': 'int', + 'int64': 'int', + 'number': 'float', + 'float': 'float', + 'double': 'float', + 'string': 'str', + 'byte': 'str', + 'binary': 'file', + 'date': 'date', + 'date_time': 'datetime', + 'uuid': 'str', + 'password': 'str' + } + + attribute_map = { + 'integer': 'integer', + 'int32': 'int32', + 'int64': 'int64', + 'number': 'number', + 'float': 'float', + 'double': 'double', + 'string': 'string', + 'byte': 'byte', + 'binary': 'binary', + 'date': 'date', + 'date_time': 'dateTime', + 'uuid': 'uuid', + 'password': 'password' + } + + def __init__(self, integer=None, int32=None, int64=None, number=None, float=None, double=None, string=None, byte=None, binary=None, date=None, date_time=None, uuid=None, password=None): # noqa: E501 + """FormatTest - a model defined in OpenAPI""" # noqa: E501 + + self._integer = None + self._int32 = None + self._int64 = None + self._number = None + self._float = None + self._double = None + self._string = None + self._byte = None + self._binary = None + self._date = None + self._date_time = None + self._uuid = None + self._password = None + self.discriminator = None + + if integer is not None: + self.integer = integer + if int32 is not None: + self.int32 = int32 + if int64 is not None: + self.int64 = int64 + self.number = number + if float is not None: + self.float = float + if double is not None: + self.double = double + if string is not None: + self.string = string + self.byte = byte + if binary is not None: + self.binary = binary + self.date = date + if date_time is not None: + self.date_time = date_time + if uuid is not None: + self.uuid = uuid + self.password = password + + @property + def integer(self): + """Gets the integer of this FormatTest. # noqa: E501 + + + :return: The integer of this FormatTest. # noqa: E501 + :rtype: int + """ + return self._integer + + @integer.setter + def integer(self, integer): + """Sets the integer of this FormatTest. + + + :param integer: The integer of this FormatTest. # noqa: E501 + :type: int + """ + if integer is not None and integer > 100: # noqa: E501 + raise ValueError("Invalid value for `integer`, must be a value less than or equal to `100`") # noqa: E501 + if integer is not None and integer < 10: # noqa: E501 + raise ValueError("Invalid value for `integer`, must be a value greater than or equal to `10`") # noqa: E501 + + self._integer = integer + + @property + def int32(self): + """Gets the int32 of this FormatTest. # noqa: E501 + + + :return: The int32 of this FormatTest. # noqa: E501 + :rtype: int + """ + return self._int32 + + @int32.setter + def int32(self, int32): + """Sets the int32 of this FormatTest. + + + :param int32: The int32 of this FormatTest. # noqa: E501 + :type: int + """ + if int32 is not None and int32 > 200: # noqa: E501 + raise ValueError("Invalid value for `int32`, must be a value less than or equal to `200`") # noqa: E501 + if int32 is not None and int32 < 20: # noqa: E501 + raise ValueError("Invalid value for `int32`, must be a value greater than or equal to `20`") # noqa: E501 + + self._int32 = int32 + + @property + def int64(self): + """Gets the int64 of this FormatTest. # noqa: E501 + + + :return: The int64 of this FormatTest. # noqa: E501 + :rtype: int + """ + return self._int64 + + @int64.setter + def int64(self, int64): + """Sets the int64 of this FormatTest. + + + :param int64: The int64 of this FormatTest. # noqa: E501 + :type: int + """ + + self._int64 = int64 + + @property + def number(self): + """Gets the number of this FormatTest. # noqa: E501 + + + :return: The number of this FormatTest. # noqa: E501 + :rtype: float + """ + return self._number + + @number.setter + def number(self, number): + """Sets the number of this FormatTest. + + + :param number: The number of this FormatTest. # noqa: E501 + :type: float + """ + if number is None: + raise ValueError("Invalid value for `number`, must not be `None`") # noqa: E501 + if number is not None and number > 543.2: # noqa: E501 + raise ValueError("Invalid value for `number`, must be a value less than or equal to `543.2`") # noqa: E501 + if number is not None and number < 32.1: # noqa: E501 + raise ValueError("Invalid value for `number`, must be a value greater than or equal to `32.1`") # noqa: E501 + + self._number = number + + @property + def float(self): + """Gets the float of this FormatTest. # noqa: E501 + + + :return: The float of this FormatTest. # noqa: E501 + :rtype: float + """ + return self._float + + @float.setter + def float(self, float): + """Sets the float of this FormatTest. + + + :param float: The float of this FormatTest. # noqa: E501 + :type: float + """ + if float is not None and float > 987.6: # noqa: E501 + raise ValueError("Invalid value for `float`, must be a value less than or equal to `987.6`") # noqa: E501 + if float is not None and float < 54.3: # noqa: E501 + raise ValueError("Invalid value for `float`, must be a value greater than or equal to `54.3`") # noqa: E501 + + self._float = float + + @property + def double(self): + """Gets the double of this FormatTest. # noqa: E501 + + + :return: The double of this FormatTest. # noqa: E501 + :rtype: float + """ + return self._double + + @double.setter + def double(self, double): + """Sets the double of this FormatTest. + + + :param double: The double of this FormatTest. # noqa: E501 + :type: float + """ + if double is not None and double > 123.4: # noqa: E501 + raise ValueError("Invalid value for `double`, must be a value less than or equal to `123.4`") # noqa: E501 + if double is not None and double < 67.8: # noqa: E501 + raise ValueError("Invalid value for `double`, must be a value greater than or equal to `67.8`") # noqa: E501 + + self._double = double + + @property + def string(self): + """Gets the string of this FormatTest. # noqa: E501 + + + :return: The string of this FormatTest. # noqa: E501 + :rtype: str + """ + return self._string + + @string.setter + def string(self, string): + """Sets the string of this FormatTest. + + + :param string: The string of this FormatTest. # noqa: E501 + :type: str + """ + if string is not None and not re.search(r'[a-z]', string, flags=re.IGNORECASE): # noqa: E501 + raise ValueError(r"Invalid value for `string`, must be a follow pattern or equal to `/[a-z]/i`") # noqa: E501 + + self._string = string + + @property + def byte(self): + """Gets the byte of this FormatTest. # noqa: E501 + + + :return: The byte of this FormatTest. # noqa: E501 + :rtype: str + """ + return self._byte + + @byte.setter + def byte(self, byte): + """Sets the byte of this FormatTest. + + + :param byte: The byte of this FormatTest. # noqa: E501 + :type: str + """ + if byte is None: + raise ValueError("Invalid value for `byte`, must not be `None`") # noqa: E501 + if byte is not None and not re.search(r'^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$', byte): # noqa: E501 + raise ValueError(r"Invalid value for `byte`, must be a follow pattern or equal to `/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/`") # noqa: E501 + + self._byte = byte + + @property + def binary(self): + """Gets the binary of this FormatTest. # noqa: E501 + + + :return: The binary of this FormatTest. # noqa: E501 + :rtype: file + """ + return self._binary + + @binary.setter + def binary(self, binary): + """Sets the binary of this FormatTest. + + + :param binary: The binary of this FormatTest. # noqa: E501 + :type: file + """ + + self._binary = binary + + @property + def date(self): + """Gets the date of this FormatTest. # noqa: E501 + + + :return: The date of this FormatTest. # noqa: E501 + :rtype: date + """ + return self._date + + @date.setter + def date(self, date): + """Sets the date of this FormatTest. + + + :param date: The date of this FormatTest. # noqa: E501 + :type: date + """ + if date is None: + raise ValueError("Invalid value for `date`, must not be `None`") # noqa: E501 + + self._date = date + + @property + def date_time(self): + """Gets the date_time of this FormatTest. # noqa: E501 + + + :return: The date_time of this FormatTest. # noqa: E501 + :rtype: datetime + """ + return self._date_time + + @date_time.setter + def date_time(self, date_time): + """Sets the date_time of this FormatTest. + + + :param date_time: The date_time of this FormatTest. # noqa: E501 + :type: datetime + """ + + self._date_time = date_time + + @property + def uuid(self): + """Gets the uuid of this FormatTest. # noqa: E501 + + + :return: The uuid of this FormatTest. # noqa: E501 + :rtype: str + """ + return self._uuid + + @uuid.setter + def uuid(self, uuid): + """Sets the uuid of this FormatTest. + + + :param uuid: The uuid of this FormatTest. # noqa: E501 + :type: str + """ + + self._uuid = uuid + + @property + def password(self): + """Gets the password of this FormatTest. # noqa: E501 + + + :return: The password of this FormatTest. # noqa: E501 + :rtype: str + """ + return self._password + + @password.setter + def password(self, password): + """Sets the password of this FormatTest. + + + :param password: The password of this FormatTest. # noqa: E501 + :type: str + """ + if password is None: + raise ValueError("Invalid value for `password`, must not be `None`") # noqa: E501 + if password is not None and len(password) > 64: + raise ValueError("Invalid value for `password`, length must be less than or equal to `64`") # noqa: E501 + if password is not None and len(password) < 10: + raise ValueError("Invalid value for `password`, length must be greater than or equal to `10`") # noqa: E501 + + self._password = password + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FormatTest): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python-experimental/openapi_client/models/has_only_read_only.py b/samples/client/petstore/python-experimental/openapi_client/models/has_only_read_only.py new file mode 100644 index 000000000000..7c8d921a2d8d --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/models/has_only_read_only.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class HasOnlyReadOnly(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'bar': 'str', + 'foo': 'str' + } + + attribute_map = { + 'bar': 'bar', + 'foo': 'foo' + } + + def __init__(self, bar=None, foo=None): # noqa: E501 + """HasOnlyReadOnly - a model defined in OpenAPI""" # noqa: E501 + + self._bar = None + self._foo = None + self.discriminator = None + + if bar is not None: + self.bar = bar + if foo is not None: + self.foo = foo + + @property + def bar(self): + """Gets the bar of this HasOnlyReadOnly. # noqa: E501 + + + :return: The bar of this HasOnlyReadOnly. # noqa: E501 + :rtype: str + """ + return self._bar + + @bar.setter + def bar(self, bar): + """Sets the bar of this HasOnlyReadOnly. + + + :param bar: The bar of this HasOnlyReadOnly. # noqa: E501 + :type: str + """ + + self._bar = bar + + @property + def foo(self): + """Gets the foo of this HasOnlyReadOnly. # noqa: E501 + + + :return: The foo of this HasOnlyReadOnly. # noqa: E501 + :rtype: str + """ + return self._foo + + @foo.setter + def foo(self, foo): + """Sets the foo of this HasOnlyReadOnly. + + + :param foo: The foo of this HasOnlyReadOnly. # noqa: E501 + :type: str + """ + + self._foo = foo + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, HasOnlyReadOnly): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python-experimental/openapi_client/models/list.py b/samples/client/petstore/python-experimental/openapi_client/models/list.py new file mode 100644 index 000000000000..74fc3719aa03 --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/models/list.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class List(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + '_123_list': 'str' + } + + attribute_map = { + '_123_list': '123-list' + } + + def __init__(self, _123_list=None): # noqa: E501 + """List - a model defined in OpenAPI""" # noqa: E501 + + self.__123_list = None + self.discriminator = None + + if _123_list is not None: + self._123_list = _123_list + + @property + def _123_list(self): + """Gets the _123_list of this List. # noqa: E501 + + + :return: The _123_list of this List. # noqa: E501 + :rtype: str + """ + return self.__123_list + + @_123_list.setter + def _123_list(self, _123_list): + """Sets the _123_list of this List. + + + :param _123_list: The _123_list of this List. # noqa: E501 + :type: str + """ + + self.__123_list = _123_list + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, List): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python-experimental/openapi_client/models/map_test.py b/samples/client/petstore/python-experimental/openapi_client/models/map_test.py new file mode 100644 index 000000000000..cdfb9365297c --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/models/map_test.py @@ -0,0 +1,197 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class MapTest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'map_map_of_string': 'dict(str, dict(str, str))', + 'map_of_enum_string': 'dict(str, str)', + 'direct_map': 'dict(str, bool)', + 'indirect_map': 'dict(str, bool)' + } + + attribute_map = { + 'map_map_of_string': 'map_map_of_string', + 'map_of_enum_string': 'map_of_enum_string', + 'direct_map': 'direct_map', + 'indirect_map': 'indirect_map' + } + + def __init__(self, map_map_of_string=None, map_of_enum_string=None, direct_map=None, indirect_map=None): # noqa: E501 + """MapTest - a model defined in OpenAPI""" # noqa: E501 + + self._map_map_of_string = None + self._map_of_enum_string = None + self._direct_map = None + self._indirect_map = None + self.discriminator = None + + if map_map_of_string is not None: + self.map_map_of_string = map_map_of_string + if map_of_enum_string is not None: + self.map_of_enum_string = map_of_enum_string + if direct_map is not None: + self.direct_map = direct_map + if indirect_map is not None: + self.indirect_map = indirect_map + + @property + def map_map_of_string(self): + """Gets the map_map_of_string of this MapTest. # noqa: E501 + + + :return: The map_map_of_string of this MapTest. # noqa: E501 + :rtype: dict(str, dict(str, str)) + """ + return self._map_map_of_string + + @map_map_of_string.setter + def map_map_of_string(self, map_map_of_string): + """Sets the map_map_of_string of this MapTest. + + + :param map_map_of_string: The map_map_of_string of this MapTest. # noqa: E501 + :type: dict(str, dict(str, str)) + """ + + self._map_map_of_string = map_map_of_string + + @property + def map_of_enum_string(self): + """Gets the map_of_enum_string of this MapTest. # noqa: E501 + + + :return: The map_of_enum_string of this MapTest. # noqa: E501 + :rtype: dict(str, str) + """ + return self._map_of_enum_string + + @map_of_enum_string.setter + def map_of_enum_string(self, map_of_enum_string): + """Sets the map_of_enum_string of this MapTest. + + + :param map_of_enum_string: The map_of_enum_string of this MapTest. # noqa: E501 + :type: dict(str, str) + """ + allowed_values = ["UPPER", "lower"] # noqa: E501 + if not set(map_of_enum_string.keys()).issubset(set(allowed_values)): + raise ValueError( + "Invalid keys in `map_of_enum_string` [{0}], must be a subset of [{1}]" # noqa: E501 + .format(", ".join(map(str, set(map_of_enum_string.keys()) - set(allowed_values))), # noqa: E501 + ", ".join(map(str, allowed_values))) + ) + + self._map_of_enum_string = map_of_enum_string + + @property + def direct_map(self): + """Gets the direct_map of this MapTest. # noqa: E501 + + + :return: The direct_map of this MapTest. # noqa: E501 + :rtype: dict(str, bool) + """ + return self._direct_map + + @direct_map.setter + def direct_map(self, direct_map): + """Sets the direct_map of this MapTest. + + + :param direct_map: The direct_map of this MapTest. # noqa: E501 + :type: dict(str, bool) + """ + + self._direct_map = direct_map + + @property + def indirect_map(self): + """Gets the indirect_map of this MapTest. # noqa: E501 + + + :return: The indirect_map of this MapTest. # noqa: E501 + :rtype: dict(str, bool) + """ + return self._indirect_map + + @indirect_map.setter + def indirect_map(self, indirect_map): + """Sets the indirect_map of this MapTest. + + + :param indirect_map: The indirect_map of this MapTest. # noqa: E501 + :type: dict(str, bool) + """ + + self._indirect_map = indirect_map + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MapTest): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python-experimental/openapi_client/models/mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python-experimental/openapi_client/models/mixed_properties_and_additional_properties_class.py new file mode 100644 index 000000000000..41a916eac10f --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/models/mixed_properties_and_additional_properties_class.py @@ -0,0 +1,164 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class MixedPropertiesAndAdditionalPropertiesClass(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'uuid': 'str', + 'date_time': 'datetime', + 'map': 'dict(str, Animal)' + } + + attribute_map = { + 'uuid': 'uuid', + 'date_time': 'dateTime', + 'map': 'map' + } + + def __init__(self, uuid=None, date_time=None, map=None): # noqa: E501 + """MixedPropertiesAndAdditionalPropertiesClass - a model defined in OpenAPI""" # noqa: E501 + + self._uuid = None + self._date_time = None + self._map = None + self.discriminator = None + + if uuid is not None: + self.uuid = uuid + if date_time is not None: + self.date_time = date_time + if map is not None: + self.map = map + + @property + def uuid(self): + """Gets the uuid of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 + + + :return: The uuid of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 + :rtype: str + """ + return self._uuid + + @uuid.setter + def uuid(self, uuid): + """Sets the uuid of this MixedPropertiesAndAdditionalPropertiesClass. + + + :param uuid: The uuid of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 + :type: str + """ + + self._uuid = uuid + + @property + def date_time(self): + """Gets the date_time of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 + + + :return: The date_time of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 + :rtype: datetime + """ + return self._date_time + + @date_time.setter + def date_time(self, date_time): + """Sets the date_time of this MixedPropertiesAndAdditionalPropertiesClass. + + + :param date_time: The date_time of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 + :type: datetime + """ + + self._date_time = date_time + + @property + def map(self): + """Gets the map of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 + + + :return: The map of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 + :rtype: dict(str, Animal) + """ + return self._map + + @map.setter + def map(self, map): + """Sets the map of this MixedPropertiesAndAdditionalPropertiesClass. + + + :param map: The map of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 + :type: dict(str, Animal) + """ + + self._map = map + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MixedPropertiesAndAdditionalPropertiesClass): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python-experimental/openapi_client/models/model200_response.py b/samples/client/petstore/python-experimental/openapi_client/models/model200_response.py new file mode 100644 index 000000000000..563b82b59391 --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/models/model200_response.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class Model200Response(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'name': 'int', + '_class': 'str' + } + + attribute_map = { + 'name': 'name', + '_class': 'class' + } + + def __init__(self, name=None, _class=None): # noqa: E501 + """Model200Response - a model defined in OpenAPI""" # noqa: E501 + + self._name = None + self.__class = None + self.discriminator = None + + if name is not None: + self.name = name + if _class is not None: + self._class = _class + + @property + def name(self): + """Gets the name of this Model200Response. # noqa: E501 + + + :return: The name of this Model200Response. # noqa: E501 + :rtype: int + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this Model200Response. + + + :param name: The name of this Model200Response. # noqa: E501 + :type: int + """ + + self._name = name + + @property + def _class(self): + """Gets the _class of this Model200Response. # noqa: E501 + + + :return: The _class of this Model200Response. # noqa: E501 + :rtype: str + """ + return self.__class + + @_class.setter + def _class(self, _class): + """Sets the _class of this Model200Response. + + + :param _class: The _class of this Model200Response. # noqa: E501 + :type: str + """ + + self.__class = _class + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Model200Response): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python-experimental/openapi_client/models/model_return.py b/samples/client/petstore/python-experimental/openapi_client/models/model_return.py new file mode 100644 index 000000000000..098012015988 --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/models/model_return.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class ModelReturn(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + '_return': 'int' + } + + attribute_map = { + '_return': 'return' + } + + def __init__(self, _return=None): # noqa: E501 + """ModelReturn - a model defined in OpenAPI""" # noqa: E501 + + self.__return = None + self.discriminator = None + + if _return is not None: + self._return = _return + + @property + def _return(self): + """Gets the _return of this ModelReturn. # noqa: E501 + + + :return: The _return of this ModelReturn. # noqa: E501 + :rtype: int + """ + return self.__return + + @_return.setter + def _return(self, _return): + """Sets the _return of this ModelReturn. + + + :param _return: The _return of this ModelReturn. # noqa: E501 + :type: int + """ + + self.__return = _return + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ModelReturn): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python-experimental/openapi_client/models/name.py b/samples/client/petstore/python-experimental/openapi_client/models/name.py new file mode 100644 index 000000000000..43014d0fb643 --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/models/name.py @@ -0,0 +1,191 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class Name(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'name': 'int', + 'snake_case': 'int', + '_property': 'str', + '_123_number': 'int' + } + + attribute_map = { + 'name': 'name', + 'snake_case': 'snake_case', + '_property': 'property', + '_123_number': '123Number' + } + + def __init__(self, name=None, snake_case=None, _property=None, _123_number=None): # noqa: E501 + """Name - a model defined in OpenAPI""" # noqa: E501 + + self._name = None + self._snake_case = None + self.__property = None + self.__123_number = None + self.discriminator = None + + self.name = name + if snake_case is not None: + self.snake_case = snake_case + if _property is not None: + self._property = _property + if _123_number is not None: + self._123_number = _123_number + + @property + def name(self): + """Gets the name of this Name. # noqa: E501 + + + :return: The name of this Name. # noqa: E501 + :rtype: int + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this Name. + + + :param name: The name of this Name. # noqa: E501 + :type: int + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def snake_case(self): + """Gets the snake_case of this Name. # noqa: E501 + + + :return: The snake_case of this Name. # noqa: E501 + :rtype: int + """ + return self._snake_case + + @snake_case.setter + def snake_case(self, snake_case): + """Sets the snake_case of this Name. + + + :param snake_case: The snake_case of this Name. # noqa: E501 + :type: int + """ + + self._snake_case = snake_case + + @property + def _property(self): + """Gets the _property of this Name. # noqa: E501 + + + :return: The _property of this Name. # noqa: E501 + :rtype: str + """ + return self.__property + + @_property.setter + def _property(self, _property): + """Sets the _property of this Name. + + + :param _property: The _property of this Name. # noqa: E501 + :type: str + """ + + self.__property = _property + + @property + def _123_number(self): + """Gets the _123_number of this Name. # noqa: E501 + + + :return: The _123_number of this Name. # noqa: E501 + :rtype: int + """ + return self.__123_number + + @_123_number.setter + def _123_number(self, _123_number): + """Sets the _123_number of this Name. + + + :param _123_number: The _123_number of this Name. # noqa: E501 + :type: int + """ + + self.__123_number = _123_number + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Name): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python-experimental/openapi_client/models/number_only.py b/samples/client/petstore/python-experimental/openapi_client/models/number_only.py new file mode 100644 index 000000000000..b6f3d1c1b65c --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/models/number_only.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class NumberOnly(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'just_number': 'float' + } + + attribute_map = { + 'just_number': 'JustNumber' + } + + def __init__(self, just_number=None): # noqa: E501 + """NumberOnly - a model defined in OpenAPI""" # noqa: E501 + + self._just_number = None + self.discriminator = None + + if just_number is not None: + self.just_number = just_number + + @property + def just_number(self): + """Gets the just_number of this NumberOnly. # noqa: E501 + + + :return: The just_number of this NumberOnly. # noqa: E501 + :rtype: float + """ + return self._just_number + + @just_number.setter + def just_number(self, just_number): + """Sets the just_number of this NumberOnly. + + + :param just_number: The just_number of this NumberOnly. # noqa: E501 + :type: float + """ + + self._just_number = just_number + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, NumberOnly): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python-experimental/openapi_client/models/order.py b/samples/client/petstore/python-experimental/openapi_client/models/order.py new file mode 100644 index 000000000000..8b64e3a35832 --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/models/order.py @@ -0,0 +1,250 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class Order(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'id': 'int', + 'pet_id': 'int', + 'quantity': 'int', + 'ship_date': 'datetime', + 'status': 'str', + 'complete': 'bool' + } + + attribute_map = { + 'id': 'id', + 'pet_id': 'petId', + 'quantity': 'quantity', + 'ship_date': 'shipDate', + 'status': 'status', + 'complete': 'complete' + } + + def __init__(self, id=None, pet_id=None, quantity=None, ship_date=None, status=None, complete=False): # noqa: E501 + """Order - a model defined in OpenAPI""" # noqa: E501 + + self._id = None + self._pet_id = None + self._quantity = None + self._ship_date = None + self._status = None + self._complete = None + self.discriminator = None + + if id is not None: + self.id = id + if pet_id is not None: + self.pet_id = pet_id + if quantity is not None: + self.quantity = quantity + if ship_date is not None: + self.ship_date = ship_date + if status is not None: + self.status = status + if complete is not None: + self.complete = complete + + @property + def id(self): + """Gets the id of this Order. # noqa: E501 + + + :return: The id of this Order. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this Order. + + + :param id: The id of this Order. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def pet_id(self): + """Gets the pet_id of this Order. # noqa: E501 + + + :return: The pet_id of this Order. # noqa: E501 + :rtype: int + """ + return self._pet_id + + @pet_id.setter + def pet_id(self, pet_id): + """Sets the pet_id of this Order. + + + :param pet_id: The pet_id of this Order. # noqa: E501 + :type: int + """ + + self._pet_id = pet_id + + @property + def quantity(self): + """Gets the quantity of this Order. # noqa: E501 + + + :return: The quantity of this Order. # noqa: E501 + :rtype: int + """ + return self._quantity + + @quantity.setter + def quantity(self, quantity): + """Sets the quantity of this Order. + + + :param quantity: The quantity of this Order. # noqa: E501 + :type: int + """ + + self._quantity = quantity + + @property + def ship_date(self): + """Gets the ship_date of this Order. # noqa: E501 + + + :return: The ship_date of this Order. # noqa: E501 + :rtype: datetime + """ + return self._ship_date + + @ship_date.setter + def ship_date(self, ship_date): + """Sets the ship_date of this Order. + + + :param ship_date: The ship_date of this Order. # noqa: E501 + :type: datetime + """ + + self._ship_date = ship_date + + @property + def status(self): + """Gets the status of this Order. # noqa: E501 + + Order Status # noqa: E501 + + :return: The status of this Order. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this Order. + + Order Status # noqa: E501 + + :param status: The status of this Order. # noqa: E501 + :type: str + """ + allowed_values = ["placed", "approved", "delivered"] # noqa: E501 + if status not in allowed_values: + raise ValueError( + "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 + .format(status, allowed_values) + ) + + self._status = status + + @property + def complete(self): + """Gets the complete of this Order. # noqa: E501 + + + :return: The complete of this Order. # noqa: E501 + :rtype: bool + """ + return self._complete + + @complete.setter + def complete(self, complete): + """Sets the complete of this Order. + + + :param complete: The complete of this Order. # noqa: E501 + :type: bool + """ + + self._complete = complete + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Order): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python-experimental/openapi_client/models/outer_composite.py b/samples/client/petstore/python-experimental/openapi_client/models/outer_composite.py new file mode 100644 index 000000000000..dccd67055bed --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/models/outer_composite.py @@ -0,0 +1,164 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class OuterComposite(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'my_number': 'float', + 'my_string': 'str', + 'my_boolean': 'bool' + } + + attribute_map = { + 'my_number': 'my_number', + 'my_string': 'my_string', + 'my_boolean': 'my_boolean' + } + + def __init__(self, my_number=None, my_string=None, my_boolean=None): # noqa: E501 + """OuterComposite - a model defined in OpenAPI""" # noqa: E501 + + self._my_number = None + self._my_string = None + self._my_boolean = None + self.discriminator = None + + if my_number is not None: + self.my_number = my_number + if my_string is not None: + self.my_string = my_string + if my_boolean is not None: + self.my_boolean = my_boolean + + @property + def my_number(self): + """Gets the my_number of this OuterComposite. # noqa: E501 + + + :return: The my_number of this OuterComposite. # noqa: E501 + :rtype: float + """ + return self._my_number + + @my_number.setter + def my_number(self, my_number): + """Sets the my_number of this OuterComposite. + + + :param my_number: The my_number of this OuterComposite. # noqa: E501 + :type: float + """ + + self._my_number = my_number + + @property + def my_string(self): + """Gets the my_string of this OuterComposite. # noqa: E501 + + + :return: The my_string of this OuterComposite. # noqa: E501 + :rtype: str + """ + return self._my_string + + @my_string.setter + def my_string(self, my_string): + """Sets the my_string of this OuterComposite. + + + :param my_string: The my_string of this OuterComposite. # noqa: E501 + :type: str + """ + + self._my_string = my_string + + @property + def my_boolean(self): + """Gets the my_boolean of this OuterComposite. # noqa: E501 + + + :return: The my_boolean of this OuterComposite. # noqa: E501 + :rtype: bool + """ + return self._my_boolean + + @my_boolean.setter + def my_boolean(self, my_boolean): + """Sets the my_boolean of this OuterComposite. + + + :param my_boolean: The my_boolean of this OuterComposite. # noqa: E501 + :type: bool + """ + + self._my_boolean = my_boolean + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OuterComposite): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python-experimental/openapi_client/models/outer_enum.py b/samples/client/petstore/python-experimental/openapi_client/models/outer_enum.py new file mode 100644 index 000000000000..a6697a0b1522 --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/models/outer_enum.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class OuterEnum(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + PLACED = "placed" + APPROVED = "approved" + DELIVERED = "delivered" + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """OuterEnum - a model defined in OpenAPI""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OuterEnum): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python-experimental/openapi_client/models/pet.py b/samples/client/petstore/python-experimental/openapi_client/models/pet.py new file mode 100644 index 000000000000..870608e17ac3 --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/models/pet.py @@ -0,0 +1,252 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class Pet(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'id': 'int', + 'category': 'Category', + 'name': 'str', + 'photo_urls': 'list[str]', + 'tags': 'list[Tag]', + 'status': 'str' + } + + attribute_map = { + 'id': 'id', + 'category': 'category', + 'name': 'name', + 'photo_urls': 'photoUrls', + 'tags': 'tags', + 'status': 'status' + } + + def __init__(self, id=None, category=None, name=None, photo_urls=None, tags=None, status=None): # noqa: E501 + """Pet - a model defined in OpenAPI""" # noqa: E501 + + self._id = None + self._category = None + self._name = None + self._photo_urls = None + self._tags = None + self._status = None + self.discriminator = None + + if id is not None: + self.id = id + if category is not None: + self.category = category + self.name = name + self.photo_urls = photo_urls + if tags is not None: + self.tags = tags + if status is not None: + self.status = status + + @property + def id(self): + """Gets the id of this Pet. # noqa: E501 + + + :return: The id of this Pet. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this Pet. + + + :param id: The id of this Pet. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def category(self): + """Gets the category of this Pet. # noqa: E501 + + + :return: The category of this Pet. # noqa: E501 + :rtype: Category + """ + return self._category + + @category.setter + def category(self, category): + """Sets the category of this Pet. + + + :param category: The category of this Pet. # noqa: E501 + :type: Category + """ + + self._category = category + + @property + def name(self): + """Gets the name of this Pet. # noqa: E501 + + + :return: The name of this Pet. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this Pet. + + + :param name: The name of this Pet. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def photo_urls(self): + """Gets the photo_urls of this Pet. # noqa: E501 + + + :return: The photo_urls of this Pet. # noqa: E501 + :rtype: list[str] + """ + return self._photo_urls + + @photo_urls.setter + def photo_urls(self, photo_urls): + """Sets the photo_urls of this Pet. + + + :param photo_urls: The photo_urls of this Pet. # noqa: E501 + :type: list[str] + """ + if photo_urls is None: + raise ValueError("Invalid value for `photo_urls`, must not be `None`") # noqa: E501 + + self._photo_urls = photo_urls + + @property + def tags(self): + """Gets the tags of this Pet. # noqa: E501 + + + :return: The tags of this Pet. # noqa: E501 + :rtype: list[Tag] + """ + return self._tags + + @tags.setter + def tags(self, tags): + """Sets the tags of this Pet. + + + :param tags: The tags of this Pet. # noqa: E501 + :type: list[Tag] + """ + + self._tags = tags + + @property + def status(self): + """Gets the status of this Pet. # noqa: E501 + + pet status in the store # noqa: E501 + + :return: The status of this Pet. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this Pet. + + pet status in the store # noqa: E501 + + :param status: The status of this Pet. # noqa: E501 + :type: str + """ + allowed_values = ["available", "pending", "sold"] # noqa: E501 + if status not in allowed_values: + raise ValueError( + "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 + .format(status, allowed_values) + ) + + self._status = status + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Pet): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python-experimental/openapi_client/models/read_only_first.py b/samples/client/petstore/python-experimental/openapi_client/models/read_only_first.py new file mode 100644 index 000000000000..3dfb7c7f6267 --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/models/read_only_first.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class ReadOnlyFirst(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'bar': 'str', + 'baz': 'str' + } + + attribute_map = { + 'bar': 'bar', + 'baz': 'baz' + } + + def __init__(self, bar=None, baz=None): # noqa: E501 + """ReadOnlyFirst - a model defined in OpenAPI""" # noqa: E501 + + self._bar = None + self._baz = None + self.discriminator = None + + if bar is not None: + self.bar = bar + if baz is not None: + self.baz = baz + + @property + def bar(self): + """Gets the bar of this ReadOnlyFirst. # noqa: E501 + + + :return: The bar of this ReadOnlyFirst. # noqa: E501 + :rtype: str + """ + return self._bar + + @bar.setter + def bar(self, bar): + """Sets the bar of this ReadOnlyFirst. + + + :param bar: The bar of this ReadOnlyFirst. # noqa: E501 + :type: str + """ + + self._bar = bar + + @property + def baz(self): + """Gets the baz of this ReadOnlyFirst. # noqa: E501 + + + :return: The baz of this ReadOnlyFirst. # noqa: E501 + :rtype: str + """ + return self._baz + + @baz.setter + def baz(self, baz): + """Sets the baz of this ReadOnlyFirst. + + + :param baz: The baz of this ReadOnlyFirst. # noqa: E501 + :type: str + """ + + self._baz = baz + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ReadOnlyFirst): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python-experimental/openapi_client/models/special_model_name.py b/samples/client/petstore/python-experimental/openapi_client/models/special_model_name.py new file mode 100644 index 000000000000..2fd6378fcdc5 --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/models/special_model_name.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class SpecialModelName(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'special_property_name': 'int' + } + + attribute_map = { + 'special_property_name': '$special[property.name]' + } + + def __init__(self, special_property_name=None): # noqa: E501 + """SpecialModelName - a model defined in OpenAPI""" # noqa: E501 + + self._special_property_name = None + self.discriminator = None + + if special_property_name is not None: + self.special_property_name = special_property_name + + @property + def special_property_name(self): + """Gets the special_property_name of this SpecialModelName. # noqa: E501 + + + :return: The special_property_name of this SpecialModelName. # noqa: E501 + :rtype: int + """ + return self._special_property_name + + @special_property_name.setter + def special_property_name(self, special_property_name): + """Sets the special_property_name of this SpecialModelName. + + + :param special_property_name: The special_property_name of this SpecialModelName. # noqa: E501 + :type: int + """ + + self._special_property_name = special_property_name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SpecialModelName): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python-experimental/openapi_client/models/tag.py b/samples/client/petstore/python-experimental/openapi_client/models/tag.py new file mode 100644 index 000000000000..cb9c22d9f53a --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/models/tag.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class Tag(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'id': 'int', + 'name': 'str' + } + + attribute_map = { + 'id': 'id', + 'name': 'name' + } + + def __init__(self, id=None, name=None): # noqa: E501 + """Tag - a model defined in OpenAPI""" # noqa: E501 + + self._id = None + self._name = None + self.discriminator = None + + if id is not None: + self.id = id + if name is not None: + self.name = name + + @property + def id(self): + """Gets the id of this Tag. # noqa: E501 + + + :return: The id of this Tag. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this Tag. + + + :param id: The id of this Tag. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def name(self): + """Gets the name of this Tag. # noqa: E501 + + + :return: The name of this Tag. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this Tag. + + + :param name: The name of this Tag. # noqa: E501 + :type: str + """ + + self._name = name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Tag): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python-experimental/openapi_client/models/type_holder_default.py b/samples/client/petstore/python-experimental/openapi_client/models/type_holder_default.py new file mode 100644 index 000000000000..d7c207cb5f63 --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/models/type_holder_default.py @@ -0,0 +1,221 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class TypeHolderDefault(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'string_item': 'str', + 'number_item': 'float', + 'integer_item': 'int', + 'bool_item': 'bool', + 'array_item': 'list[int]' + } + + attribute_map = { + 'string_item': 'string_item', + 'number_item': 'number_item', + 'integer_item': 'integer_item', + 'bool_item': 'bool_item', + 'array_item': 'array_item' + } + + def __init__(self, string_item='what', number_item=None, integer_item=None, bool_item=True, array_item=None): # noqa: E501 + """TypeHolderDefault - a model defined in OpenAPI""" # noqa: E501 + + self._string_item = None + self._number_item = None + self._integer_item = None + self._bool_item = None + self._array_item = None + self.discriminator = None + + self.string_item = string_item + self.number_item = number_item + self.integer_item = integer_item + self.bool_item = bool_item + self.array_item = array_item + + @property + def string_item(self): + """Gets the string_item of this TypeHolderDefault. # noqa: E501 + + + :return: The string_item of this TypeHolderDefault. # noqa: E501 + :rtype: str + """ + return self._string_item + + @string_item.setter + def string_item(self, string_item): + """Sets the string_item of this TypeHolderDefault. + + + :param string_item: The string_item of this TypeHolderDefault. # noqa: E501 + :type: str + """ + if string_item is None: + raise ValueError("Invalid value for `string_item`, must not be `None`") # noqa: E501 + + self._string_item = string_item + + @property + def number_item(self): + """Gets the number_item of this TypeHolderDefault. # noqa: E501 + + + :return: The number_item of this TypeHolderDefault. # noqa: E501 + :rtype: float + """ + return self._number_item + + @number_item.setter + def number_item(self, number_item): + """Sets the number_item of this TypeHolderDefault. + + + :param number_item: The number_item of this TypeHolderDefault. # noqa: E501 + :type: float + """ + if number_item is None: + raise ValueError("Invalid value for `number_item`, must not be `None`") # noqa: E501 + + self._number_item = number_item + + @property + def integer_item(self): + """Gets the integer_item of this TypeHolderDefault. # noqa: E501 + + + :return: The integer_item of this TypeHolderDefault. # noqa: E501 + :rtype: int + """ + return self._integer_item + + @integer_item.setter + def integer_item(self, integer_item): + """Sets the integer_item of this TypeHolderDefault. + + + :param integer_item: The integer_item of this TypeHolderDefault. # noqa: E501 + :type: int + """ + if integer_item is None: + raise ValueError("Invalid value for `integer_item`, must not be `None`") # noqa: E501 + + self._integer_item = integer_item + + @property + def bool_item(self): + """Gets the bool_item of this TypeHolderDefault. # noqa: E501 + + + :return: The bool_item of this TypeHolderDefault. # noqa: E501 + :rtype: bool + """ + return self._bool_item + + @bool_item.setter + def bool_item(self, bool_item): + """Sets the bool_item of this TypeHolderDefault. + + + :param bool_item: The bool_item of this TypeHolderDefault. # noqa: E501 + :type: bool + """ + if bool_item is None: + raise ValueError("Invalid value for `bool_item`, must not be `None`") # noqa: E501 + + self._bool_item = bool_item + + @property + def array_item(self): + """Gets the array_item of this TypeHolderDefault. # noqa: E501 + + + :return: The array_item of this TypeHolderDefault. # noqa: E501 + :rtype: list[int] + """ + return self._array_item + + @array_item.setter + def array_item(self, array_item): + """Sets the array_item of this TypeHolderDefault. + + + :param array_item: The array_item of this TypeHolderDefault. # noqa: E501 + :type: list[int] + """ + if array_item is None: + raise ValueError("Invalid value for `array_item`, must not be `None`") # noqa: E501 + + self._array_item = array_item + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TypeHolderDefault): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python-experimental/openapi_client/models/type_holder_example.py b/samples/client/petstore/python-experimental/openapi_client/models/type_holder_example.py new file mode 100644 index 000000000000..8f2b5d6b7d3b --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/models/type_holder_example.py @@ -0,0 +1,221 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class TypeHolderExample(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'string_item': 'str', + 'number_item': 'float', + 'integer_item': 'int', + 'bool_item': 'bool', + 'array_item': 'list[int]' + } + + attribute_map = { + 'string_item': 'string_item', + 'number_item': 'number_item', + 'integer_item': 'integer_item', + 'bool_item': 'bool_item', + 'array_item': 'array_item' + } + + def __init__(self, string_item=None, number_item=None, integer_item=None, bool_item=None, array_item=None): # noqa: E501 + """TypeHolderExample - a model defined in OpenAPI""" # noqa: E501 + + self._string_item = None + self._number_item = None + self._integer_item = None + self._bool_item = None + self._array_item = None + self.discriminator = None + + self.string_item = string_item + self.number_item = number_item + self.integer_item = integer_item + self.bool_item = bool_item + self.array_item = array_item + + @property + def string_item(self): + """Gets the string_item of this TypeHolderExample. # noqa: E501 + + + :return: The string_item of this TypeHolderExample. # noqa: E501 + :rtype: str + """ + return self._string_item + + @string_item.setter + def string_item(self, string_item): + """Sets the string_item of this TypeHolderExample. + + + :param string_item: The string_item of this TypeHolderExample. # noqa: E501 + :type: str + """ + if string_item is None: + raise ValueError("Invalid value for `string_item`, must not be `None`") # noqa: E501 + + self._string_item = string_item + + @property + def number_item(self): + """Gets the number_item of this TypeHolderExample. # noqa: E501 + + + :return: The number_item of this TypeHolderExample. # noqa: E501 + :rtype: float + """ + return self._number_item + + @number_item.setter + def number_item(self, number_item): + """Sets the number_item of this TypeHolderExample. + + + :param number_item: The number_item of this TypeHolderExample. # noqa: E501 + :type: float + """ + if number_item is None: + raise ValueError("Invalid value for `number_item`, must not be `None`") # noqa: E501 + + self._number_item = number_item + + @property + def integer_item(self): + """Gets the integer_item of this TypeHolderExample. # noqa: E501 + + + :return: The integer_item of this TypeHolderExample. # noqa: E501 + :rtype: int + """ + return self._integer_item + + @integer_item.setter + def integer_item(self, integer_item): + """Sets the integer_item of this TypeHolderExample. + + + :param integer_item: The integer_item of this TypeHolderExample. # noqa: E501 + :type: int + """ + if integer_item is None: + raise ValueError("Invalid value for `integer_item`, must not be `None`") # noqa: E501 + + self._integer_item = integer_item + + @property + def bool_item(self): + """Gets the bool_item of this TypeHolderExample. # noqa: E501 + + + :return: The bool_item of this TypeHolderExample. # noqa: E501 + :rtype: bool + """ + return self._bool_item + + @bool_item.setter + def bool_item(self, bool_item): + """Sets the bool_item of this TypeHolderExample. + + + :param bool_item: The bool_item of this TypeHolderExample. # noqa: E501 + :type: bool + """ + if bool_item is None: + raise ValueError("Invalid value for `bool_item`, must not be `None`") # noqa: E501 + + self._bool_item = bool_item + + @property + def array_item(self): + """Gets the array_item of this TypeHolderExample. # noqa: E501 + + + :return: The array_item of this TypeHolderExample. # noqa: E501 + :rtype: list[int] + """ + return self._array_item + + @array_item.setter + def array_item(self, array_item): + """Sets the array_item of this TypeHolderExample. + + + :param array_item: The array_item of this TypeHolderExample. # noqa: E501 + :type: list[int] + """ + if array_item is None: + raise ValueError("Invalid value for `array_item`, must not be `None`") # noqa: E501 + + self._array_item = array_item + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TypeHolderExample): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python-experimental/openapi_client/models/user.py b/samples/client/petstore/python-experimental/openapi_client/models/user.py new file mode 100644 index 000000000000..f46f5165dfd6 --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/models/user.py @@ -0,0 +1,296 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class User(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'id': 'int', + 'username': 'str', + 'first_name': 'str', + 'last_name': 'str', + 'email': 'str', + 'password': 'str', + 'phone': 'str', + 'user_status': 'int' + } + + attribute_map = { + 'id': 'id', + 'username': 'username', + 'first_name': 'firstName', + 'last_name': 'lastName', + 'email': 'email', + 'password': 'password', + 'phone': 'phone', + 'user_status': 'userStatus' + } + + def __init__(self, id=None, username=None, first_name=None, last_name=None, email=None, password=None, phone=None, user_status=None): # noqa: E501 + """User - a model defined in OpenAPI""" # noqa: E501 + + self._id = None + self._username = None + self._first_name = None + self._last_name = None + self._email = None + self._password = None + self._phone = None + self._user_status = None + self.discriminator = None + + if id is not None: + self.id = id + if username is not None: + self.username = username + if first_name is not None: + self.first_name = first_name + if last_name is not None: + self.last_name = last_name + if email is not None: + self.email = email + if password is not None: + self.password = password + if phone is not None: + self.phone = phone + if user_status is not None: + self.user_status = user_status + + @property + def id(self): + """Gets the id of this User. # noqa: E501 + + + :return: The id of this User. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this User. + + + :param id: The id of this User. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def username(self): + """Gets the username of this User. # noqa: E501 + + + :return: The username of this User. # noqa: E501 + :rtype: str + """ + return self._username + + @username.setter + def username(self, username): + """Sets the username of this User. + + + :param username: The username of this User. # noqa: E501 + :type: str + """ + + self._username = username + + @property + def first_name(self): + """Gets the first_name of this User. # noqa: E501 + + + :return: The first_name of this User. # noqa: E501 + :rtype: str + """ + return self._first_name + + @first_name.setter + def first_name(self, first_name): + """Sets the first_name of this User. + + + :param first_name: The first_name of this User. # noqa: E501 + :type: str + """ + + self._first_name = first_name + + @property + def last_name(self): + """Gets the last_name of this User. # noqa: E501 + + + :return: The last_name of this User. # noqa: E501 + :rtype: str + """ + return self._last_name + + @last_name.setter + def last_name(self, last_name): + """Sets the last_name of this User. + + + :param last_name: The last_name of this User. # noqa: E501 + :type: str + """ + + self._last_name = last_name + + @property + def email(self): + """Gets the email of this User. # noqa: E501 + + + :return: The email of this User. # noqa: E501 + :rtype: str + """ + return self._email + + @email.setter + def email(self, email): + """Sets the email of this User. + + + :param email: The email of this User. # noqa: E501 + :type: str + """ + + self._email = email + + @property + def password(self): + """Gets the password of this User. # noqa: E501 + + + :return: The password of this User. # noqa: E501 + :rtype: str + """ + return self._password + + @password.setter + def password(self, password): + """Sets the password of this User. + + + :param password: The password of this User. # noqa: E501 + :type: str + """ + + self._password = password + + @property + def phone(self): + """Gets the phone of this User. # noqa: E501 + + + :return: The phone of this User. # noqa: E501 + :rtype: str + """ + return self._phone + + @phone.setter + def phone(self, phone): + """Sets the phone of this User. + + + :param phone: The phone of this User. # noqa: E501 + :type: str + """ + + self._phone = phone + + @property + def user_status(self): + """Gets the user_status of this User. # noqa: E501 + + User Status # noqa: E501 + + :return: The user_status of this User. # noqa: E501 + :rtype: int + """ + return self._user_status + + @user_status.setter + def user_status(self, user_status): + """Sets the user_status of this User. + + User Status # noqa: E501 + + :param user_status: The user_status of this User. # noqa: E501 + :type: int + """ + + self._user_status = user_status + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, User): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python-experimental/openapi_client/models/xml_item.py b/samples/client/petstore/python-experimental/openapi_client/models/xml_item.py new file mode 100644 index 000000000000..eaceeb5ef45d --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/models/xml_item.py @@ -0,0 +1,840 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + + +class XmlItem(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'attribute_string': 'str', + 'attribute_number': 'float', + 'attribute_integer': 'int', + 'attribute_boolean': 'bool', + 'wrapped_array': 'list[int]', + 'name_string': 'str', + 'name_number': 'float', + 'name_integer': 'int', + 'name_boolean': 'bool', + 'name_array': 'list[int]', + 'name_wrapped_array': 'list[int]', + 'prefix_string': 'str', + 'prefix_number': 'float', + 'prefix_integer': 'int', + 'prefix_boolean': 'bool', + 'prefix_array': 'list[int]', + 'prefix_wrapped_array': 'list[int]', + 'namespace_string': 'str', + 'namespace_number': 'float', + 'namespace_integer': 'int', + 'namespace_boolean': 'bool', + 'namespace_array': 'list[int]', + 'namespace_wrapped_array': 'list[int]', + 'prefix_ns_string': 'str', + 'prefix_ns_number': 'float', + 'prefix_ns_integer': 'int', + 'prefix_ns_boolean': 'bool', + 'prefix_ns_array': 'list[int]', + 'prefix_ns_wrapped_array': 'list[int]' + } + + attribute_map = { + 'attribute_string': 'attribute_string', + 'attribute_number': 'attribute_number', + 'attribute_integer': 'attribute_integer', + 'attribute_boolean': 'attribute_boolean', + 'wrapped_array': 'wrapped_array', + 'name_string': 'name_string', + 'name_number': 'name_number', + 'name_integer': 'name_integer', + 'name_boolean': 'name_boolean', + 'name_array': 'name_array', + 'name_wrapped_array': 'name_wrapped_array', + 'prefix_string': 'prefix_string', + 'prefix_number': 'prefix_number', + 'prefix_integer': 'prefix_integer', + 'prefix_boolean': 'prefix_boolean', + 'prefix_array': 'prefix_array', + 'prefix_wrapped_array': 'prefix_wrapped_array', + 'namespace_string': 'namespace_string', + 'namespace_number': 'namespace_number', + 'namespace_integer': 'namespace_integer', + 'namespace_boolean': 'namespace_boolean', + 'namespace_array': 'namespace_array', + 'namespace_wrapped_array': 'namespace_wrapped_array', + 'prefix_ns_string': 'prefix_ns_string', + 'prefix_ns_number': 'prefix_ns_number', + 'prefix_ns_integer': 'prefix_ns_integer', + 'prefix_ns_boolean': 'prefix_ns_boolean', + 'prefix_ns_array': 'prefix_ns_array', + 'prefix_ns_wrapped_array': 'prefix_ns_wrapped_array' + } + + def __init__(self, attribute_string=None, attribute_number=None, attribute_integer=None, attribute_boolean=None, wrapped_array=None, name_string=None, name_number=None, name_integer=None, name_boolean=None, name_array=None, name_wrapped_array=None, prefix_string=None, prefix_number=None, prefix_integer=None, prefix_boolean=None, prefix_array=None, prefix_wrapped_array=None, namespace_string=None, namespace_number=None, namespace_integer=None, namespace_boolean=None, namespace_array=None, namespace_wrapped_array=None, prefix_ns_string=None, prefix_ns_number=None, prefix_ns_integer=None, prefix_ns_boolean=None, prefix_ns_array=None, prefix_ns_wrapped_array=None): # noqa: E501 + """XmlItem - a model defined in OpenAPI""" # noqa: E501 + + self._attribute_string = None + self._attribute_number = None + self._attribute_integer = None + self._attribute_boolean = None + self._wrapped_array = None + self._name_string = None + self._name_number = None + self._name_integer = None + self._name_boolean = None + self._name_array = None + self._name_wrapped_array = None + self._prefix_string = None + self._prefix_number = None + self._prefix_integer = None + self._prefix_boolean = None + self._prefix_array = None + self._prefix_wrapped_array = None + self._namespace_string = None + self._namespace_number = None + self._namespace_integer = None + self._namespace_boolean = None + self._namespace_array = None + self._namespace_wrapped_array = None + self._prefix_ns_string = None + self._prefix_ns_number = None + self._prefix_ns_integer = None + self._prefix_ns_boolean = None + self._prefix_ns_array = None + self._prefix_ns_wrapped_array = None + self.discriminator = None + + if attribute_string is not None: + self.attribute_string = attribute_string + if attribute_number is not None: + self.attribute_number = attribute_number + if attribute_integer is not None: + self.attribute_integer = attribute_integer + if attribute_boolean is not None: + self.attribute_boolean = attribute_boolean + if wrapped_array is not None: + self.wrapped_array = wrapped_array + if name_string is not None: + self.name_string = name_string + if name_number is not None: + self.name_number = name_number + if name_integer is not None: + self.name_integer = name_integer + if name_boolean is not None: + self.name_boolean = name_boolean + if name_array is not None: + self.name_array = name_array + if name_wrapped_array is not None: + self.name_wrapped_array = name_wrapped_array + if prefix_string is not None: + self.prefix_string = prefix_string + if prefix_number is not None: + self.prefix_number = prefix_number + if prefix_integer is not None: + self.prefix_integer = prefix_integer + if prefix_boolean is not None: + self.prefix_boolean = prefix_boolean + if prefix_array is not None: + self.prefix_array = prefix_array + if prefix_wrapped_array is not None: + self.prefix_wrapped_array = prefix_wrapped_array + if namespace_string is not None: + self.namespace_string = namespace_string + if namespace_number is not None: + self.namespace_number = namespace_number + if namespace_integer is not None: + self.namespace_integer = namespace_integer + if namespace_boolean is not None: + self.namespace_boolean = namespace_boolean + if namespace_array is not None: + self.namespace_array = namespace_array + if namespace_wrapped_array is not None: + self.namespace_wrapped_array = namespace_wrapped_array + if prefix_ns_string is not None: + self.prefix_ns_string = prefix_ns_string + if prefix_ns_number is not None: + self.prefix_ns_number = prefix_ns_number + if prefix_ns_integer is not None: + self.prefix_ns_integer = prefix_ns_integer + if prefix_ns_boolean is not None: + self.prefix_ns_boolean = prefix_ns_boolean + if prefix_ns_array is not None: + self.prefix_ns_array = prefix_ns_array + if prefix_ns_wrapped_array is not None: + self.prefix_ns_wrapped_array = prefix_ns_wrapped_array + + @property + def attribute_string(self): + """Gets the attribute_string of this XmlItem. # noqa: E501 + + + :return: The attribute_string of this XmlItem. # noqa: E501 + :rtype: str + """ + return self._attribute_string + + @attribute_string.setter + def attribute_string(self, attribute_string): + """Sets the attribute_string of this XmlItem. + + + :param attribute_string: The attribute_string of this XmlItem. # noqa: E501 + :type: str + """ + + self._attribute_string = attribute_string + + @property + def attribute_number(self): + """Gets the attribute_number of this XmlItem. # noqa: E501 + + + :return: The attribute_number of this XmlItem. # noqa: E501 + :rtype: float + """ + return self._attribute_number + + @attribute_number.setter + def attribute_number(self, attribute_number): + """Sets the attribute_number of this XmlItem. + + + :param attribute_number: The attribute_number of this XmlItem. # noqa: E501 + :type: float + """ + + self._attribute_number = attribute_number + + @property + def attribute_integer(self): + """Gets the attribute_integer of this XmlItem. # noqa: E501 + + + :return: The attribute_integer of this XmlItem. # noqa: E501 + :rtype: int + """ + return self._attribute_integer + + @attribute_integer.setter + def attribute_integer(self, attribute_integer): + """Sets the attribute_integer of this XmlItem. + + + :param attribute_integer: The attribute_integer of this XmlItem. # noqa: E501 + :type: int + """ + + self._attribute_integer = attribute_integer + + @property + def attribute_boolean(self): + """Gets the attribute_boolean of this XmlItem. # noqa: E501 + + + :return: The attribute_boolean of this XmlItem. # noqa: E501 + :rtype: bool + """ + return self._attribute_boolean + + @attribute_boolean.setter + def attribute_boolean(self, attribute_boolean): + """Sets the attribute_boolean of this XmlItem. + + + :param attribute_boolean: The attribute_boolean of this XmlItem. # noqa: E501 + :type: bool + """ + + self._attribute_boolean = attribute_boolean + + @property + def wrapped_array(self): + """Gets the wrapped_array of this XmlItem. # noqa: E501 + + + :return: The wrapped_array of this XmlItem. # noqa: E501 + :rtype: list[int] + """ + return self._wrapped_array + + @wrapped_array.setter + def wrapped_array(self, wrapped_array): + """Sets the wrapped_array of this XmlItem. + + + :param wrapped_array: The wrapped_array of this XmlItem. # noqa: E501 + :type: list[int] + """ + + self._wrapped_array = wrapped_array + + @property + def name_string(self): + """Gets the name_string of this XmlItem. # noqa: E501 + + + :return: The name_string of this XmlItem. # noqa: E501 + :rtype: str + """ + return self._name_string + + @name_string.setter + def name_string(self, name_string): + """Sets the name_string of this XmlItem. + + + :param name_string: The name_string of this XmlItem. # noqa: E501 + :type: str + """ + + self._name_string = name_string + + @property + def name_number(self): + """Gets the name_number of this XmlItem. # noqa: E501 + + + :return: The name_number of this XmlItem. # noqa: E501 + :rtype: float + """ + return self._name_number + + @name_number.setter + def name_number(self, name_number): + """Sets the name_number of this XmlItem. + + + :param name_number: The name_number of this XmlItem. # noqa: E501 + :type: float + """ + + self._name_number = name_number + + @property + def name_integer(self): + """Gets the name_integer of this XmlItem. # noqa: E501 + + + :return: The name_integer of this XmlItem. # noqa: E501 + :rtype: int + """ + return self._name_integer + + @name_integer.setter + def name_integer(self, name_integer): + """Sets the name_integer of this XmlItem. + + + :param name_integer: The name_integer of this XmlItem. # noqa: E501 + :type: int + """ + + self._name_integer = name_integer + + @property + def name_boolean(self): + """Gets the name_boolean of this XmlItem. # noqa: E501 + + + :return: The name_boolean of this XmlItem. # noqa: E501 + :rtype: bool + """ + return self._name_boolean + + @name_boolean.setter + def name_boolean(self, name_boolean): + """Sets the name_boolean of this XmlItem. + + + :param name_boolean: The name_boolean of this XmlItem. # noqa: E501 + :type: bool + """ + + self._name_boolean = name_boolean + + @property + def name_array(self): + """Gets the name_array of this XmlItem. # noqa: E501 + + + :return: The name_array of this XmlItem. # noqa: E501 + :rtype: list[int] + """ + return self._name_array + + @name_array.setter + def name_array(self, name_array): + """Sets the name_array of this XmlItem. + + + :param name_array: The name_array of this XmlItem. # noqa: E501 + :type: list[int] + """ + + self._name_array = name_array + + @property + def name_wrapped_array(self): + """Gets the name_wrapped_array of this XmlItem. # noqa: E501 + + + :return: The name_wrapped_array of this XmlItem. # noqa: E501 + :rtype: list[int] + """ + return self._name_wrapped_array + + @name_wrapped_array.setter + def name_wrapped_array(self, name_wrapped_array): + """Sets the name_wrapped_array of this XmlItem. + + + :param name_wrapped_array: The name_wrapped_array of this XmlItem. # noqa: E501 + :type: list[int] + """ + + self._name_wrapped_array = name_wrapped_array + + @property + def prefix_string(self): + """Gets the prefix_string of this XmlItem. # noqa: E501 + + + :return: The prefix_string of this XmlItem. # noqa: E501 + :rtype: str + """ + return self._prefix_string + + @prefix_string.setter + def prefix_string(self, prefix_string): + """Sets the prefix_string of this XmlItem. + + + :param prefix_string: The prefix_string of this XmlItem. # noqa: E501 + :type: str + """ + + self._prefix_string = prefix_string + + @property + def prefix_number(self): + """Gets the prefix_number of this XmlItem. # noqa: E501 + + + :return: The prefix_number of this XmlItem. # noqa: E501 + :rtype: float + """ + return self._prefix_number + + @prefix_number.setter + def prefix_number(self, prefix_number): + """Sets the prefix_number of this XmlItem. + + + :param prefix_number: The prefix_number of this XmlItem. # noqa: E501 + :type: float + """ + + self._prefix_number = prefix_number + + @property + def prefix_integer(self): + """Gets the prefix_integer of this XmlItem. # noqa: E501 + + + :return: The prefix_integer of this XmlItem. # noqa: E501 + :rtype: int + """ + return self._prefix_integer + + @prefix_integer.setter + def prefix_integer(self, prefix_integer): + """Sets the prefix_integer of this XmlItem. + + + :param prefix_integer: The prefix_integer of this XmlItem. # noqa: E501 + :type: int + """ + + self._prefix_integer = prefix_integer + + @property + def prefix_boolean(self): + """Gets the prefix_boolean of this XmlItem. # noqa: E501 + + + :return: The prefix_boolean of this XmlItem. # noqa: E501 + :rtype: bool + """ + return self._prefix_boolean + + @prefix_boolean.setter + def prefix_boolean(self, prefix_boolean): + """Sets the prefix_boolean of this XmlItem. + + + :param prefix_boolean: The prefix_boolean of this XmlItem. # noqa: E501 + :type: bool + """ + + self._prefix_boolean = prefix_boolean + + @property + def prefix_array(self): + """Gets the prefix_array of this XmlItem. # noqa: E501 + + + :return: The prefix_array of this XmlItem. # noqa: E501 + :rtype: list[int] + """ + return self._prefix_array + + @prefix_array.setter + def prefix_array(self, prefix_array): + """Sets the prefix_array of this XmlItem. + + + :param prefix_array: The prefix_array of this XmlItem. # noqa: E501 + :type: list[int] + """ + + self._prefix_array = prefix_array + + @property + def prefix_wrapped_array(self): + """Gets the prefix_wrapped_array of this XmlItem. # noqa: E501 + + + :return: The prefix_wrapped_array of this XmlItem. # noqa: E501 + :rtype: list[int] + """ + return self._prefix_wrapped_array + + @prefix_wrapped_array.setter + def prefix_wrapped_array(self, prefix_wrapped_array): + """Sets the prefix_wrapped_array of this XmlItem. + + + :param prefix_wrapped_array: The prefix_wrapped_array of this XmlItem. # noqa: E501 + :type: list[int] + """ + + self._prefix_wrapped_array = prefix_wrapped_array + + @property + def namespace_string(self): + """Gets the namespace_string of this XmlItem. # noqa: E501 + + + :return: The namespace_string of this XmlItem. # noqa: E501 + :rtype: str + """ + return self._namespace_string + + @namespace_string.setter + def namespace_string(self, namespace_string): + """Sets the namespace_string of this XmlItem. + + + :param namespace_string: The namespace_string of this XmlItem. # noqa: E501 + :type: str + """ + + self._namespace_string = namespace_string + + @property + def namespace_number(self): + """Gets the namespace_number of this XmlItem. # noqa: E501 + + + :return: The namespace_number of this XmlItem. # noqa: E501 + :rtype: float + """ + return self._namespace_number + + @namespace_number.setter + def namespace_number(self, namespace_number): + """Sets the namespace_number of this XmlItem. + + + :param namespace_number: The namespace_number of this XmlItem. # noqa: E501 + :type: float + """ + + self._namespace_number = namespace_number + + @property + def namespace_integer(self): + """Gets the namespace_integer of this XmlItem. # noqa: E501 + + + :return: The namespace_integer of this XmlItem. # noqa: E501 + :rtype: int + """ + return self._namespace_integer + + @namespace_integer.setter + def namespace_integer(self, namespace_integer): + """Sets the namespace_integer of this XmlItem. + + + :param namespace_integer: The namespace_integer of this XmlItem. # noqa: E501 + :type: int + """ + + self._namespace_integer = namespace_integer + + @property + def namespace_boolean(self): + """Gets the namespace_boolean of this XmlItem. # noqa: E501 + + + :return: The namespace_boolean of this XmlItem. # noqa: E501 + :rtype: bool + """ + return self._namespace_boolean + + @namespace_boolean.setter + def namespace_boolean(self, namespace_boolean): + """Sets the namespace_boolean of this XmlItem. + + + :param namespace_boolean: The namespace_boolean of this XmlItem. # noqa: E501 + :type: bool + """ + + self._namespace_boolean = namespace_boolean + + @property + def namespace_array(self): + """Gets the namespace_array of this XmlItem. # noqa: E501 + + + :return: The namespace_array of this XmlItem. # noqa: E501 + :rtype: list[int] + """ + return self._namespace_array + + @namespace_array.setter + def namespace_array(self, namespace_array): + """Sets the namespace_array of this XmlItem. + + + :param namespace_array: The namespace_array of this XmlItem. # noqa: E501 + :type: list[int] + """ + + self._namespace_array = namespace_array + + @property + def namespace_wrapped_array(self): + """Gets the namespace_wrapped_array of this XmlItem. # noqa: E501 + + + :return: The namespace_wrapped_array of this XmlItem. # noqa: E501 + :rtype: list[int] + """ + return self._namespace_wrapped_array + + @namespace_wrapped_array.setter + def namespace_wrapped_array(self, namespace_wrapped_array): + """Sets the namespace_wrapped_array of this XmlItem. + + + :param namespace_wrapped_array: The namespace_wrapped_array of this XmlItem. # noqa: E501 + :type: list[int] + """ + + self._namespace_wrapped_array = namespace_wrapped_array + + @property + def prefix_ns_string(self): + """Gets the prefix_ns_string of this XmlItem. # noqa: E501 + + + :return: The prefix_ns_string of this XmlItem. # noqa: E501 + :rtype: str + """ + return self._prefix_ns_string + + @prefix_ns_string.setter + def prefix_ns_string(self, prefix_ns_string): + """Sets the prefix_ns_string of this XmlItem. + + + :param prefix_ns_string: The prefix_ns_string of this XmlItem. # noqa: E501 + :type: str + """ + + self._prefix_ns_string = prefix_ns_string + + @property + def prefix_ns_number(self): + """Gets the prefix_ns_number of this XmlItem. # noqa: E501 + + + :return: The prefix_ns_number of this XmlItem. # noqa: E501 + :rtype: float + """ + return self._prefix_ns_number + + @prefix_ns_number.setter + def prefix_ns_number(self, prefix_ns_number): + """Sets the prefix_ns_number of this XmlItem. + + + :param prefix_ns_number: The prefix_ns_number of this XmlItem. # noqa: E501 + :type: float + """ + + self._prefix_ns_number = prefix_ns_number + + @property + def prefix_ns_integer(self): + """Gets the prefix_ns_integer of this XmlItem. # noqa: E501 + + + :return: The prefix_ns_integer of this XmlItem. # noqa: E501 + :rtype: int + """ + return self._prefix_ns_integer + + @prefix_ns_integer.setter + def prefix_ns_integer(self, prefix_ns_integer): + """Sets the prefix_ns_integer of this XmlItem. + + + :param prefix_ns_integer: The prefix_ns_integer of this XmlItem. # noqa: E501 + :type: int + """ + + self._prefix_ns_integer = prefix_ns_integer + + @property + def prefix_ns_boolean(self): + """Gets the prefix_ns_boolean of this XmlItem. # noqa: E501 + + + :return: The prefix_ns_boolean of this XmlItem. # noqa: E501 + :rtype: bool + """ + return self._prefix_ns_boolean + + @prefix_ns_boolean.setter + def prefix_ns_boolean(self, prefix_ns_boolean): + """Sets the prefix_ns_boolean of this XmlItem. + + + :param prefix_ns_boolean: The prefix_ns_boolean of this XmlItem. # noqa: E501 + :type: bool + """ + + self._prefix_ns_boolean = prefix_ns_boolean + + @property + def prefix_ns_array(self): + """Gets the prefix_ns_array of this XmlItem. # noqa: E501 + + + :return: The prefix_ns_array of this XmlItem. # noqa: E501 + :rtype: list[int] + """ + return self._prefix_ns_array + + @prefix_ns_array.setter + def prefix_ns_array(self, prefix_ns_array): + """Sets the prefix_ns_array of this XmlItem. + + + :param prefix_ns_array: The prefix_ns_array of this XmlItem. # noqa: E501 + :type: list[int] + """ + + self._prefix_ns_array = prefix_ns_array + + @property + def prefix_ns_wrapped_array(self): + """Gets the prefix_ns_wrapped_array of this XmlItem. # noqa: E501 + + + :return: The prefix_ns_wrapped_array of this XmlItem. # noqa: E501 + :rtype: list[int] + """ + return self._prefix_ns_wrapped_array + + @prefix_ns_wrapped_array.setter + def prefix_ns_wrapped_array(self, prefix_ns_wrapped_array): + """Sets the prefix_ns_wrapped_array of this XmlItem. + + + :param prefix_ns_wrapped_array: The prefix_ns_wrapped_array of this XmlItem. # noqa: E501 + :type: list[int] + """ + + self._prefix_ns_wrapped_array = prefix_ns_wrapped_array + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, XmlItem): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python-experimental/openapi_client/rest.py b/samples/client/petstore/python-experimental/openapi_client/rest.py new file mode 100644 index 000000000000..827a6fc24261 --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/rest.py @@ -0,0 +1,296 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import io +import json +import logging +import re +import ssl + +import certifi +# python 2 and python 3 compatibility library +import six +from six.moves.urllib.parse import urlencode +import urllib3 + +from openapi_client.exceptions import ApiException, ApiValueError + + +logger = logging.getLogger(__name__) + + +class RESTResponse(io.IOBase): + + def __init__(self, resp): + self.urllib3_response = resp + self.status = resp.status + self.reason = resp.reason + self.data = resp.data + + def getheaders(self): + """Returns a dictionary of the response headers.""" + return self.urllib3_response.getheaders() + + def getheader(self, name, default=None): + """Returns a given response header.""" + return self.urllib3_response.getheader(name, default) + + +class RESTClientObject(object): + + def __init__(self, configuration, pools_size=4, maxsize=None): + # urllib3.PoolManager will pass all kw parameters to connectionpool + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 + # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 + # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 + + # cert_reqs + if configuration.verify_ssl: + cert_reqs = ssl.CERT_REQUIRED + else: + cert_reqs = ssl.CERT_NONE + + # ca_certs + if configuration.ssl_ca_cert: + ca_certs = configuration.ssl_ca_cert + else: + # if not set certificate file, use Mozilla's root certificates. + ca_certs = certifi.where() + + addition_pool_args = {} + if configuration.assert_hostname is not None: + addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 + + if configuration.retries is not None: + addition_pool_args['retries'] = configuration.retries + + if maxsize is None: + if configuration.connection_pool_maxsize is not None: + maxsize = configuration.connection_pool_maxsize + else: + maxsize = 4 + + # https pool manager + if configuration.proxy: + self.pool_manager = urllib3.ProxyManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + proxy_url=configuration.proxy, + proxy_headers=configuration.proxy_headers, + **addition_pool_args + ) + else: + self.pool_manager = urllib3.PoolManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + **addition_pool_args + ) + + def request(self, method, url, query_params=None, headers=None, + body=None, post_params=None, _preload_content=True, + _request_timeout=None): + """Perform requests. + + :param method: http request method + :param url: http request url + :param query_params: query parameters in the url + :param headers: http request headers + :param body: request json body, for `application/json` + :param post_params: request post parameters, + `application/x-www-form-urlencoded` + and `multipart/form-data` + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + """ + method = method.upper() + assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', + 'PATCH', 'OPTIONS'] + + if post_params and body: + raise ApiValueError( + "body parameter cannot be used with post_params parameter." + ) + + post_params = post_params or {} + headers = headers or {} + + timeout = None + if _request_timeout: + if isinstance(_request_timeout, (int, ) if six.PY3 else (int, long)): # noqa: E501,F821 + timeout = urllib3.Timeout(total=_request_timeout) + elif (isinstance(_request_timeout, tuple) and + len(_request_timeout) == 2): + timeout = urllib3.Timeout( + connect=_request_timeout[0], read=_request_timeout[1]) + + if 'Content-Type' not in headers: + headers['Content-Type'] = 'application/json' + + try: + # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` + if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: + if query_params: + url += '?' + urlencode(query_params) + if re.search('json', headers['Content-Type'], re.IGNORECASE): + request_body = None + if body is not None: + request_body = json.dumps(body) + r = self.pool_manager.request( + method, url, + body=request_body, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 + r = self.pool_manager.request( + method, url, + fields=post_params, + encode_multipart=False, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + elif headers['Content-Type'] == 'multipart/form-data': + # must del headers['Content-Type'], or the correct + # Content-Type which generated by urllib3 will be + # overwritten. + del headers['Content-Type'] + r = self.pool_manager.request( + method, url, + fields=post_params, + encode_multipart=True, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + # Pass a `string` parameter directly in the body to support + # other content types than Json when `body` argument is + # provided in serialized form + elif isinstance(body, str) or isinstance(body, bytes): + request_body = body + r = self.pool_manager.request( + method, url, + body=request_body, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + else: + # Cannot generate the request from given parameters + msg = """Cannot prepare a request message for provided + arguments. Please check that your arguments match + declared content type.""" + raise ApiException(status=0, reason=msg) + # For `GET`, `HEAD` + else: + r = self.pool_manager.request(method, url, + fields=query_params, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + except urllib3.exceptions.SSLError as e: + msg = "{0}\n{1}".format(type(e).__name__, str(e)) + raise ApiException(status=0, reason=msg) + + if _preload_content: + r = RESTResponse(r) + + # In the python 3, the response.data is bytes. + # we need to decode it to string. + if six.PY3: + r.data = r.data.decode('utf8') + + # log response body + logger.debug("response body: %s", r.data) + + if not 200 <= r.status <= 299: + raise ApiException(http_resp=r) + + return r + + def GET(self, url, headers=None, query_params=None, _preload_content=True, + _request_timeout=None): + return self.request("GET", url, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params) + + def HEAD(self, url, headers=None, query_params=None, _preload_content=True, + _request_timeout=None): + return self.request("HEAD", url, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params) + + def OPTIONS(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("OPTIONS", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def DELETE(self, url, headers=None, query_params=None, body=None, + _preload_content=True, _request_timeout=None): + return self.request("DELETE", url, + headers=headers, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def POST(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("POST", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def PUT(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("PUT", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def PATCH(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("PATCH", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) diff --git a/samples/client/petstore/python-experimental/setup.py b/samples/client/petstore/python-experimental/setup.py index 86988b6d42e0..9bcee494adfa 100644 --- a/samples/client/petstore/python-experimental/setup.py +++ b/samples/client/petstore/python-experimental/setup.py @@ -12,7 +12,7 @@ from setuptools import setup, find_packages # noqa: H301 -NAME = "petstore-api" +NAME = "openapi-client" VERSION = "1.0.0" # To install the library, run the following # diff --git a/samples/client/petstore/rust/README.md b/samples/client/petstore/rust/README.md index a1149b09036b..f3b8f80c2493 100644 --- a/samples/client/petstore/rust/README.md +++ b/samples/client/petstore/rust/README.md @@ -50,6 +50,8 @@ Class | Method | HTTP request | Description - [ApiResponse](docs/ApiResponse.md) - [Category](docs/Category.md) + - [InlineObject](docs/InlineObject.md) + - [InlineObject1](docs/InlineObject1.md) - [Order](docs/Order.md) - [Pet](docs/Pet.md) - [Tag](docs/Tag.md) diff --git a/samples/client/petstore/rust/docs/InlineObject.md b/samples/client/petstore/rust/docs/InlineObject.md new file mode 100644 index 000000000000..bfe33a4efb36 --- /dev/null +++ b/samples/client/petstore/rust/docs/InlineObject.md @@ -0,0 +1,12 @@ +# InlineObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Updated name of the pet | [optional] +**status** | **String** | Updated status of the pet | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/rust/docs/InlineObject1.md b/samples/client/petstore/rust/docs/InlineObject1.md new file mode 100644 index 000000000000..930d10cdcbf3 --- /dev/null +++ b/samples/client/petstore/rust/docs/InlineObject1.md @@ -0,0 +1,12 @@ +# InlineObject1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**additional_metadata** | **String** | Additional data to pass to server | [optional] +**file** | [***std::path::PathBuf**](std::path::PathBuf.md) | file to upload | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/rust/docs/PetApi.md b/samples/client/petstore/rust/docs/PetApi.md index f6f1929b427a..43e20f398cb2 100644 --- a/samples/client/petstore/rust/docs/PetApi.md +++ b/samples/client/petstore/rust/docs/PetApi.md @@ -17,7 +17,7 @@ Method | HTTP request | Description ## add_pet -> add_pet(body) +> add_pet(pet) Add a new pet to the store ### Parameters @@ -25,7 +25,7 @@ Add a new pet to the store Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**body** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | Required | +**pet** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | Required | ### Return type @@ -104,7 +104,7 @@ Name | Type | Description | Required | Notes ## find_pets_by_tags -> Vec find_pets_by_tags(tags) +> Vec find_pets_by_tags(tags, max_count) Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. @@ -115,6 +115,7 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **tags** | [**Vec**](String.md) | Tags to filter by | Required | +**max_count** | **i32** | Maximum number of items to return | | ### Return type @@ -164,7 +165,7 @@ Name | Type | Description | Required | Notes ## update_pet -> update_pet(body) +> update_pet(pet) Update an existing pet ### Parameters @@ -172,7 +173,7 @@ Update an existing pet Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**body** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | Required | +**pet** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | Required | ### Return type diff --git a/samples/client/petstore/rust/docs/StoreApi.md b/samples/client/petstore/rust/docs/StoreApi.md index 44aa5e83a37c..427f8d34331a 100644 --- a/samples/client/petstore/rust/docs/StoreApi.md +++ b/samples/client/petstore/rust/docs/StoreApi.md @@ -100,7 +100,7 @@ No authorization required ## place_order -> crate::models::Order place_order(body) +> crate::models::Order place_order(order) Place an order for a pet ### Parameters @@ -108,7 +108,7 @@ Place an order for a pet Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**body** | [**Order**](Order.md) | order placed for purchasing the pet | Required | +**order** | [**Order**](Order.md) | order placed for purchasing the pet | Required | ### Return type @@ -120,7 +120,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: application/xml, application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/samples/client/petstore/rust/docs/UserApi.md b/samples/client/petstore/rust/docs/UserApi.md index 051a6a15ff42..7275d23ccc09 100644 --- a/samples/client/petstore/rust/docs/UserApi.md +++ b/samples/client/petstore/rust/docs/UserApi.md @@ -17,7 +17,7 @@ Method | HTTP request | Description ## create_user -> create_user(body) +> create_user(user) Create user This can only be done by the logged in user. @@ -27,7 +27,7 @@ This can only be done by the logged in user. Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**body** | [**User**](User.md) | Created user object | Required | +**user** | [**User**](User.md) | Created user object | Required | ### Return type @@ -35,11 +35,11 @@ Name | Type | Description | Required | Notes ### Authorization -No authorization required +[auth_cookie](../README.md#auth_cookie) ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -47,7 +47,7 @@ No authorization required ## create_users_with_array_input -> create_users_with_array_input(body) +> create_users_with_array_input(user) Creates list of users with given input array ### Parameters @@ -55,7 +55,7 @@ Creates list of users with given input array Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**body** | [**Vec**](User.md) | List of user object | Required | +**user** | [**Vec**](User.md) | List of user object | Required | ### Return type @@ -63,11 +63,11 @@ Name | Type | Description | Required | Notes ### Authorization -No authorization required +[auth_cookie](../README.md#auth_cookie) ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -75,7 +75,7 @@ No authorization required ## create_users_with_list_input -> create_users_with_list_input(body) +> create_users_with_list_input(user) Creates list of users with given input array ### Parameters @@ -83,7 +83,7 @@ Creates list of users with given input array Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**body** | [**Vec**](User.md) | List of user object | Required | +**user** | [**Vec**](User.md) | List of user object | Required | ### Return type @@ -91,11 +91,11 @@ Name | Type | Description | Required | Notes ### Authorization -No authorization required +[auth_cookie](../README.md#auth_cookie) ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -121,7 +121,7 @@ Name | Type | Description | Required | Notes ### Authorization -No authorization required +[auth_cookie](../README.md#auth_cookie) ### HTTP request headers @@ -203,7 +203,7 @@ This endpoint does not need any parameter. ### Authorization -No authorization required +[auth_cookie](../README.md#auth_cookie) ### HTTP request headers @@ -215,7 +215,7 @@ No authorization required ## update_user -> update_user(username, body) +> update_user(username, user) Updated user This can only be done by the logged in user. @@ -226,7 +226,7 @@ This can only be done by the logged in user. Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **username** | **String** | name that need to be deleted | Required | -**body** | [**User**](User.md) | Updated user object | Required | +**user** | [**User**](User.md) | Updated user object | Required | ### Return type @@ -234,11 +234,11 @@ Name | Type | Description | Required | Notes ### Authorization -No authorization required +[auth_cookie](../README.md#auth_cookie) ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/samples/client/petstore/rust/src/apis/pet_api.rs b/samples/client/petstore/rust/src/apis/pet_api.rs index e3fe372fc9b2..24ccb8c4c0ae 100644 --- a/samples/client/petstore/rust/src/apis/pet_api.rs +++ b/samples/client/petstore/rust/src/apis/pet_api.rs @@ -31,22 +31,22 @@ impl PetApiClient { } pub trait PetApi { - fn add_pet(&self, body: crate::models::Pet) -> Box>>; + fn add_pet(&self, pet: crate::models::Pet) -> Box>>; fn delete_pet(&self, pet_id: i64, api_key: &str) -> Box>>; fn find_pets_by_status(&self, status: Vec) -> Box, Error = Error>>; - fn find_pets_by_tags(&self, tags: Vec) -> Box, Error = Error>>; + fn find_pets_by_tags(&self, tags: Vec, max_count: i32) -> Box, Error = Error>>; fn get_pet_by_id(&self, pet_id: i64) -> Box>>; - fn update_pet(&self, body: crate::models::Pet) -> Box>>; + fn update_pet(&self, pet: crate::models::Pet) -> Box>>; fn update_pet_with_form(&self, pet_id: i64, name: &str, status: &str) -> Box>>; fn upload_file(&self, pet_id: i64, additional_metadata: &str, file: std::path::PathBuf) -> Box>>; } implPetApi for PetApiClient { - fn add_pet(&self, body: crate::models::Pet) -> Box>> { + fn add_pet(&self, pet: crate::models::Pet) -> Box>> { __internal_request::Request::new(hyper::Method::Post, "/pet".to_string()) .with_auth(__internal_request::Auth::Oauth) - .with_body_param(body) + .with_body_param(pet) .returns_nothing() .execute(self.configuration.borrow()) } @@ -67,10 +67,11 @@ implPetApi for PetApiClient { .execute(self.configuration.borrow()) } - fn find_pets_by_tags(&self, tags: Vec) -> Box, Error = Error>> { + fn find_pets_by_tags(&self, tags: Vec, max_count: i32) -> Box, Error = Error>> { __internal_request::Request::new(hyper::Method::Get, "/pet/findByTags".to_string()) .with_auth(__internal_request::Auth::Oauth) .with_query_param("tags".to_string(), tags.join(",").to_string()) + .with_query_param("maxCount".to_string(), max_count.to_string()) .execute(self.configuration.borrow()) } @@ -85,10 +86,10 @@ implPetApi for PetApiClient { .execute(self.configuration.borrow()) } - fn update_pet(&self, body: crate::models::Pet) -> Box>> { + fn update_pet(&self, pet: crate::models::Pet) -> Box>> { __internal_request::Request::new(hyper::Method::Put, "/pet".to_string()) .with_auth(__internal_request::Auth::Oauth) - .with_body_param(body) + .with_body_param(pet) .returns_nothing() .execute(self.configuration.borrow()) } diff --git a/samples/client/petstore/rust/src/apis/store_api.rs b/samples/client/petstore/rust/src/apis/store_api.rs index 2c827cce0452..22d2bd3bb613 100644 --- a/samples/client/petstore/rust/src/apis/store_api.rs +++ b/samples/client/petstore/rust/src/apis/store_api.rs @@ -34,7 +34,7 @@ pub trait StoreApi { fn delete_order(&self, order_id: &str) -> Box>>; fn get_inventory(&self, ) -> Box, Error = Error>>; fn get_order_by_id(&self, order_id: i64) -> Box>>; - fn place_order(&self, body: crate::models::Order) -> Box>>; + fn place_order(&self, order: crate::models::Order) -> Box>>; } @@ -62,9 +62,9 @@ implStoreApi for StoreApiClient { .execute(self.configuration.borrow()) } - fn place_order(&self, body: crate::models::Order) -> Box>> { + fn place_order(&self, order: crate::models::Order) -> Box>> { __internal_request::Request::new(hyper::Method::Post, "/store/order".to_string()) - .with_body_param(body) + .with_body_param(order) .execute(self.configuration.borrow()) } diff --git a/samples/client/petstore/rust/src/apis/user_api.rs b/samples/client/petstore/rust/src/apis/user_api.rs index 1ea00f7536d7..b1cb8407b3e6 100644 --- a/samples/client/petstore/rust/src/apis/user_api.rs +++ b/samples/client/petstore/rust/src/apis/user_api.rs @@ -31,41 +31,61 @@ impl UserApiClient { } pub trait UserApi { - fn create_user(&self, body: crate::models::User) -> Box>>; - fn create_users_with_array_input(&self, body: Vec) -> Box>>; - fn create_users_with_list_input(&self, body: Vec) -> Box>>; + fn create_user(&self, user: crate::models::User) -> Box>>; + fn create_users_with_array_input(&self, user: Vec) -> Box>>; + fn create_users_with_list_input(&self, user: Vec) -> Box>>; fn delete_user(&self, username: &str) -> Box>>; fn get_user_by_name(&self, username: &str) -> Box>>; fn login_user(&self, username: &str, password: &str) -> Box>>; fn logout_user(&self, ) -> Box>>; - fn update_user(&self, username: &str, body: crate::models::User) -> Box>>; + fn update_user(&self, username: &str, user: crate::models::User) -> Box>>; } implUserApi for UserApiClient { - fn create_user(&self, body: crate::models::User) -> Box>> { + fn create_user(&self, user: crate::models::User) -> Box>> { __internal_request::Request::new(hyper::Method::Post, "/user".to_string()) - .with_body_param(body) + .with_auth(__internal_request::Auth::ApiKey(__internal_request::ApiKey{ + in_header: false, + in_query: false, + param_name: "AUTH_KEY".to_owned(), + })) + .with_body_param(user) .returns_nothing() .execute(self.configuration.borrow()) } - fn create_users_with_array_input(&self, body: Vec) -> Box>> { + fn create_users_with_array_input(&self, user: Vec) -> Box>> { __internal_request::Request::new(hyper::Method::Post, "/user/createWithArray".to_string()) - .with_body_param(body) + .with_auth(__internal_request::Auth::ApiKey(__internal_request::ApiKey{ + in_header: false, + in_query: false, + param_name: "AUTH_KEY".to_owned(), + })) + .with_body_param(user) .returns_nothing() .execute(self.configuration.borrow()) } - fn create_users_with_list_input(&self, body: Vec) -> Box>> { + fn create_users_with_list_input(&self, user: Vec) -> Box>> { __internal_request::Request::new(hyper::Method::Post, "/user/createWithList".to_string()) - .with_body_param(body) + .with_auth(__internal_request::Auth::ApiKey(__internal_request::ApiKey{ + in_header: false, + in_query: false, + param_name: "AUTH_KEY".to_owned(), + })) + .with_body_param(user) .returns_nothing() .execute(self.configuration.borrow()) } fn delete_user(&self, username: &str) -> Box>> { __internal_request::Request::new(hyper::Method::Delete, "/user/{username}".to_string()) + .with_auth(__internal_request::Auth::ApiKey(__internal_request::ApiKey{ + in_header: false, + in_query: false, + param_name: "AUTH_KEY".to_owned(), + })) .with_path_param("username".to_string(), username.to_string()) .returns_nothing() .execute(self.configuration.borrow()) @@ -86,14 +106,24 @@ implUserApi for UserApiClient { fn logout_user(&self, ) -> Box>> { __internal_request::Request::new(hyper::Method::Get, "/user/logout".to_string()) + .with_auth(__internal_request::Auth::ApiKey(__internal_request::ApiKey{ + in_header: false, + in_query: false, + param_name: "AUTH_KEY".to_owned(), + })) .returns_nothing() .execute(self.configuration.borrow()) } - fn update_user(&self, username: &str, body: crate::models::User) -> Box>> { + fn update_user(&self, username: &str, user: crate::models::User) -> Box>> { __internal_request::Request::new(hyper::Method::Put, "/user/{username}".to_string()) + .with_auth(__internal_request::Auth::ApiKey(__internal_request::ApiKey{ + in_header: false, + in_query: false, + param_name: "AUTH_KEY".to_owned(), + })) .with_path_param("username".to_string(), username.to_string()) - .with_body_param(body) + .with_body_param(user) .returns_nothing() .execute(self.configuration.borrow()) } diff --git a/samples/client/petstore/rust/src/models/inline_object.rs b/samples/client/petstore/rust/src/models/inline_object.rs new file mode 100644 index 000000000000..b1444810dcff --- /dev/null +++ b/samples/client/petstore/rust/src/models/inline_object.rs @@ -0,0 +1,32 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +pub struct InlineObject { + /// Updated name of the pet + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Updated status of the pet + #[serde(rename = "status", skip_serializing_if = "Option::is_none")] + pub status: Option, +} + +impl InlineObject { + pub fn new() -> InlineObject { + InlineObject { + name: None, + status: None, + } + } +} + + diff --git a/samples/client/petstore/rust/src/models/inline_object_1.rs b/samples/client/petstore/rust/src/models/inline_object_1.rs new file mode 100644 index 000000000000..ee4c1b78ae57 --- /dev/null +++ b/samples/client/petstore/rust/src/models/inline_object_1.rs @@ -0,0 +1,32 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +pub struct InlineObject1 { + /// Additional data to pass to server + #[serde(rename = "additionalMetadata", skip_serializing_if = "Option::is_none")] + pub additional_metadata: Option, + /// file to upload + #[serde(rename = "file", skip_serializing_if = "Option::is_none")] + pub file: Option, +} + +impl InlineObject1 { + pub fn new() -> InlineObject1 { + InlineObject1 { + additional_metadata: None, + file: None, + } + } +} + + diff --git a/samples/client/petstore/rust/src/models/mod.rs b/samples/client/petstore/rust/src/models/mod.rs index b4495b6a5fc5..95c436facbab 100644 --- a/samples/client/petstore/rust/src/models/mod.rs +++ b/samples/client/petstore/rust/src/models/mod.rs @@ -2,6 +2,10 @@ mod api_response; pub use self::api_response::ApiResponse; mod category; pub use self::category::Category; +mod inline_object; +pub use self::inline_object::InlineObject; +mod inline_object_1; +pub use self::inline_object_1::InlineObject1; mod order; pub use self::order::Order; mod pet; diff --git a/samples/client/petstore/scala-akka/.openapi-generator/VERSION b/samples/client/petstore/scala-akka/.openapi-generator/VERSION index afa636560641..83a328a9227e 100644 --- a/samples/client/petstore/scala-akka/.openapi-generator/VERSION +++ b/samples/client/petstore/scala-akka/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/scala-akka/README.md b/samples/client/petstore/scala-akka/README.md index a1ab296dc4d8..040074e90ff1 100644 --- a/samples/client/petstore/scala-akka/README.md +++ b/samples/client/petstore/scala-akka/README.md @@ -91,6 +91,8 @@ Class | Method | HTTP request | Description - [ApiResponse](ApiResponse.md) - [Category](Category.md) + - [InlineObject](InlineObject.md) + - [InlineObject1](InlineObject1.md) - [Order](Order.md) - [Pet](Pet.md) - [Tag](Tag.md) @@ -106,6 +108,12 @@ Authentication schemes defined for the API: - **API key parameter name**: api_key - **Location**: HTTP header +### auth_cookie + +- **Type**: API key +- **API key parameter name**: AUTH_KEY +- **Location**: + ## Author diff --git a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/EnumsSerializers.scala b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/EnumsSerializers.scala index 85cc57e381ba..71ad618e31fb 100644 --- a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/EnumsSerializers.scala +++ b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/EnumsSerializers.scala @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/PetApi.scala b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/PetApi.scala index 9aeea7d8d61a..3a25f9cd29bf 100644 --- a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/PetApi.scala +++ b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/PetApi.scala @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -29,11 +29,11 @@ class PetApi(baseUrl: String) { * Expected answers: * code 405 : (Invalid input) * - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store */ - def addPet(body: Pet): ApiRequest[Unit] = + def addPet(pet: Pet): ApiRequest[Unit] = ApiRequest[Unit](ApiMethods.POST, "http://petstore.swagger.io/v2", "/pet", "application/json") - .withBody(body) + .withBody(pet) .withErrorResponse[Unit](405) @@ -75,10 +75,12 @@ class PetApi(baseUrl: String) { * code 400 : (Invalid tag value) * * @param tags Tags to filter by + * @param maxCount Maximum number of items to return */ - def findPetsByTags(tags: Seq[String]): ApiRequest[Seq[Pet]] = + def findPetsByTags(tags: Seq[String], maxCount: Option[Int] = None): ApiRequest[Seq[Pet]] = ApiRequest[Seq[Pet]](ApiMethods.GET, "http://petstore.swagger.io/v2", "/pet/findByTags", "application/json") .withQueryParam("tags", ArrayValues(tags, CSV)) + .withQueryParam("maxCount", maxCount) .withSuccessResponse[Seq[Pet]](200) .withErrorResponse[Unit](400) @@ -111,11 +113,11 @@ class PetApi(baseUrl: String) { * code 404 : (Pet not found) * code 405 : (Validation exception) * - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store */ - def updatePet(body: Pet): ApiRequest[Unit] = + def updatePet(pet: Pet): ApiRequest[Unit] = ApiRequest[Unit](ApiMethods.PUT, "http://petstore.swagger.io/v2", "/pet", "application/json") - .withBody(body) + .withBody(pet) .withErrorResponse[Unit](400) .withErrorResponse[Unit](404) .withErrorResponse[Unit](405) diff --git a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/StoreApi.scala b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/StoreApi.scala index 716625d5d6d4..c60389654a61 100644 --- a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/StoreApi.scala +++ b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/StoreApi.scala @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -77,11 +77,11 @@ class StoreApi(baseUrl: String) { * code 200 : Order (successful operation) * code 400 : (Invalid Order) * - * @param body order placed for purchasing the pet + * @param order order placed for purchasing the pet */ - def placeOrder(body: Order): ApiRequest[Order] = + def placeOrder(order: Order): ApiRequest[Order] = ApiRequest[Order](ApiMethods.POST, "http://petstore.swagger.io/v2", "/store/order", "application/json") - .withBody(body) + .withBody(order) .withSuccessResponse[Order](200) .withErrorResponse[Unit](400) diff --git a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/UserApi.scala b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/UserApi.scala index e695e1b41908..783bd380a8b5 100644 --- a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/UserApi.scala +++ b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/UserApi.scala @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -29,11 +29,15 @@ class UserApi(baseUrl: String) { * Expected answers: * code 0 : (successful operation) * - * @param body Created user object + * Available security schemes: + * auth_cookie (apiKey) + * + * @param user Created user object */ - def createUser(body: User): ApiRequest[Unit] = + def createUser(user: User)(implicit apiKey: ApiKeyValue): ApiRequest[Unit] = ApiRequest[Unit](ApiMethods.POST, "http://petstore.swagger.io/v2", "/user", "application/json") - .withBody(body) + .withApiKey(apiKey, "AUTH_KEY", ) + .withBody(user) .withDefaultSuccessResponse[Unit] @@ -41,11 +45,15 @@ class UserApi(baseUrl: String) { * Expected answers: * code 0 : (successful operation) * - * @param body List of user object + * Available security schemes: + * auth_cookie (apiKey) + * + * @param user List of user object */ - def createUsersWithArrayInput(body: Seq[User]): ApiRequest[Unit] = + def createUsersWithArrayInput(user: Seq[User])(implicit apiKey: ApiKeyValue): ApiRequest[Unit] = ApiRequest[Unit](ApiMethods.POST, "http://petstore.swagger.io/v2", "/user/createWithArray", "application/json") - .withBody(body) + .withApiKey(apiKey, "AUTH_KEY", ) + .withBody(user) .withDefaultSuccessResponse[Unit] @@ -53,11 +61,15 @@ class UserApi(baseUrl: String) { * Expected answers: * code 0 : (successful operation) * - * @param body List of user object + * Available security schemes: + * auth_cookie (apiKey) + * + * @param user List of user object */ - def createUsersWithListInput(body: Seq[User]): ApiRequest[Unit] = + def createUsersWithListInput(user: Seq[User])(implicit apiKey: ApiKeyValue): ApiRequest[Unit] = ApiRequest[Unit](ApiMethods.POST, "http://petstore.swagger.io/v2", "/user/createWithList", "application/json") - .withBody(body) + .withApiKey(apiKey, "AUTH_KEY", ) + .withBody(user) .withDefaultSuccessResponse[Unit] @@ -68,10 +80,14 @@ class UserApi(baseUrl: String) { * code 400 : (Invalid username supplied) * code 404 : (User not found) * + * Available security schemes: + * auth_cookie (apiKey) + * * @param username The name that needs to be deleted */ - def deleteUser(username: String): ApiRequest[Unit] = + def deleteUser(username: String)(implicit apiKey: ApiKeyValue): ApiRequest[Unit] = ApiRequest[Unit](ApiMethods.DELETE, "http://petstore.swagger.io/v2", "/user/{username}", "application/json") + .withApiKey(apiKey, "AUTH_KEY", ) .withPathParam("username", username) .withErrorResponse[Unit](400) .withErrorResponse[Unit](404) @@ -97,6 +113,7 @@ class UserApi(baseUrl: String) { * Expected answers: * code 200 : String (successful operation) * Headers : + * Set-Cookie - Cookie authentication key for use with the `auth_cookie` apiKey authentication. * X-Rate-Limit - calls per hour allowed by the user * X-Expires-After - date in UTC when toekn expires * code 400 : (Invalid username/password supplied) @@ -112,6 +129,7 @@ class UserApi(baseUrl: String) { .withErrorResponse[Unit](400) object LoginUserHeaders { + def setCookie(r: ApiReturnWithHeaders) = r.getStringHeader("Set-Cookie") def xRateLimit(r: ApiReturnWithHeaders) = r.getIntHeader("X-Rate-Limit") def xExpiresAfter(r: ApiReturnWithHeaders) = r.getDateTimeHeader("X-Expires-After") } @@ -119,9 +137,13 @@ class UserApi(baseUrl: String) { /** * Expected answers: * code 0 : (successful operation) + * + * Available security schemes: + * auth_cookie (apiKey) */ - def logoutUser(): ApiRequest[Unit] = + def logoutUser()(implicit apiKey: ApiKeyValue): ApiRequest[Unit] = ApiRequest[Unit](ApiMethods.GET, "http://petstore.swagger.io/v2", "/user/logout", "application/json") + .withApiKey(apiKey, "AUTH_KEY", ) .withDefaultSuccessResponse[Unit] @@ -132,12 +154,16 @@ class UserApi(baseUrl: String) { * code 400 : (Invalid user supplied) * code 404 : (User not found) * + * Available security schemes: + * auth_cookie (apiKey) + * * @param username name that need to be deleted - * @param body Updated user object + * @param user Updated user object */ - def updateUser(username: String, body: User): ApiRequest[Unit] = + def updateUser(username: String, user: User)(implicit apiKey: ApiKeyValue): ApiRequest[Unit] = ApiRequest[Unit](ApiMethods.PUT, "http://petstore.swagger.io/v2", "/user/{username}", "application/json") - .withBody(body) + .withApiKey(apiKey, "AUTH_KEY", ) + .withBody(user) .withPathParam("username", username) .withErrorResponse[Unit](400) .withErrorResponse[Unit](404) diff --git a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/core/ApiInvoker.scala b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/core/ApiInvoker.scala index 6b9b04d37458..8b6eeee0bb51 100644 --- a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/core/ApiInvoker.scala +++ b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/core/ApiInvoker.scala @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/core/ApiRequest.scala b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/core/ApiRequest.scala index 2378d8c5fe00..3dfa61094de0 100644 --- a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/core/ApiRequest.scala +++ b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/core/ApiRequest.scala @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/core/ApiSettings.scala b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/core/ApiSettings.scala index 448cd25f089c..2553aeb3c875 100644 --- a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/core/ApiSettings.scala +++ b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/core/ApiSettings.scala @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/core/requests.scala b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/core/requests.scala index ff715e3eb298..155a86dcf112 100644 --- a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/core/requests.scala +++ b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/core/requests.scala @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/ApiResponse.scala b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/ApiResponse.scala index 81370edb740c..0ef406429cbb 100644 --- a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/ApiResponse.scala +++ b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/ApiResponse.scala @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/Category.scala b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/Category.scala index 8d609a555229..23ba74821501 100644 --- a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/Category.scala +++ b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/Category.scala @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/InlineObject.scala b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/InlineObject.scala new file mode 100644 index 000000000000..0fb5ae0e80c3 --- /dev/null +++ b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/InlineObject.scala @@ -0,0 +1,25 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.client.model + +import org.openapitools.client.core.ApiModel +import org.joda.time.DateTime +import java.util.UUID + +case class InlineObject ( + /* Updated name of the pet */ + name: Option[String] = None, + /* Updated status of the pet */ + status: Option[String] = None +) extends ApiModel + + diff --git a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/InlineObject1.scala b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/InlineObject1.scala new file mode 100644 index 000000000000..11bdc8eb96cd --- /dev/null +++ b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/InlineObject1.scala @@ -0,0 +1,25 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.client.model + +import org.openapitools.client.core.ApiModel +import org.joda.time.DateTime +import java.util.UUID + +case class InlineObject1 ( + /* Additional data to pass to server */ + additionalMetadata: Option[String] = None, + /* file to upload */ + file: Option[File] = None +) extends ApiModel + + diff --git a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/Order.scala b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/Order.scala index fe4daa9c3597..83055706fd1d 100644 --- a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/Order.scala +++ b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/Order.scala @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/Pet.scala b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/Pet.scala index e5df29f24671..1f78a72e57ba 100644 --- a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/Pet.scala +++ b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/Pet.scala @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/Tag.scala b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/Tag.scala index e46602f84f43..30dfbf441914 100644 --- a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/Tag.scala +++ b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/Tag.scala @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/User.scala b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/User.scala index ef8eb6b4a0d2..0d33ce64753e 100644 --- a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/User.scala +++ b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/User.scala @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/scala-gatling/.openapi-generator/VERSION b/samples/client/petstore/scala-gatling/.openapi-generator/VERSION index 096bf47efe31..83a328a9227e 100644 --- a/samples/client/petstore/scala-gatling/.openapi-generator/VERSION +++ b/samples/client/petstore/scala-gatling/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.0-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/scala-gatling/bin/gatling/loginUser-queryParams.csv b/samples/client/petstore/scala-gatling/bin/gatling/loginUser-queryParams.csv index d8bc9aec67d0..418fd574de51 100644 --- a/samples/client/petstore/scala-gatling/bin/gatling/loginUser-queryParams.csv +++ b/samples/client/petstore/scala-gatling/bin/gatling/loginUser-queryParams.csv @@ -1 +1 @@ -username,password \ No newline at end of file +password,username \ No newline at end of file diff --git a/samples/client/petstore/scala-gatling/bin/gatling/org/openapitools/client/api/UserApiSimulation.scala b/samples/client/petstore/scala-gatling/bin/gatling/org/openapitools/client/api/UserApiSimulation.scala index c12112e8b0da..6b97d7c04907 100644 --- a/samples/client/petstore/scala-gatling/bin/gatling/org/openapitools/client/api/UserApiSimulation.scala +++ b/samples/client/petstore/scala-gatling/bin/gatling/org/openapitools/client/api/UserApiSimulation.scala @@ -147,8 +147,8 @@ class UserApiSimulation extends Simulation { .feed(loginUserQUERYFeeder) .exec(http("loginUser") .httpRequest("GET","/user/login") - .queryParam("username","${username}") .queryParam("password","${password}") + .queryParam("username","${username}") ) // Run scnloginUser with warm up and reach a constant rate for entire duration diff --git a/samples/client/petstore/scala-gatling/src/gatling/resources/data/loginUser-queryParams.csv b/samples/client/petstore/scala-gatling/src/gatling/resources/data/loginUser-queryParams.csv index d8bc9aec67d0..418fd574de51 100644 --- a/samples/client/petstore/scala-gatling/src/gatling/resources/data/loginUser-queryParams.csv +++ b/samples/client/petstore/scala-gatling/src/gatling/resources/data/loginUser-queryParams.csv @@ -1 +1 @@ -username,password \ No newline at end of file +password,username \ No newline at end of file diff --git a/samples/client/petstore/scala-gatling/src/gatling/scala/org/openapitools/client/api/UserApiSimulation.scala b/samples/client/petstore/scala-gatling/src/gatling/scala/org/openapitools/client/api/UserApiSimulation.scala index c12112e8b0da..6b97d7c04907 100644 --- a/samples/client/petstore/scala-gatling/src/gatling/scala/org/openapitools/client/api/UserApiSimulation.scala +++ b/samples/client/petstore/scala-gatling/src/gatling/scala/org/openapitools/client/api/UserApiSimulation.scala @@ -147,8 +147,8 @@ class UserApiSimulation extends Simulation { .feed(loginUserQUERYFeeder) .exec(http("loginUser") .httpRequest("GET","/user/login") - .queryParam("username","${username}") .queryParam("password","${password}") + .queryParam("username","${username}") ) // Run scnloginUser with warm up and reach a constant rate for entire duration diff --git a/samples/client/petstore/scala-httpclient/.openapi-generator/VERSION b/samples/client/petstore/scala-httpclient/.openapi-generator/VERSION index 06b5019af3f4..83a328a9227e 100644 --- a/samples/client/petstore/scala-httpclient/.openapi-generator/VERSION +++ b/samples/client/petstore/scala-httpclient/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.1-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/scala-httpclient/src/main/scala/org/openapitools/client/api/PetApi.scala b/samples/client/petstore/scala-httpclient/src/main/scala/org/openapitools/client/api/PetApi.scala index 768cb5c0b5f3..f836cad30099 100644 --- a/samples/client/petstore/scala-httpclient/src/main/scala/org/openapitools/client/api/PetApi.scala +++ b/samples/client/petstore/scala-httpclient/src/main/scala/org/openapitools/client/api/PetApi.scala @@ -80,11 +80,11 @@ class PetApi( * Add a new pet to the store * * - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store * @return void */ - def addPet(body: Pet) = { - val await = Try(Await.result(addPetAsync(body), Duration.Inf)) + def addPet(pet: Pet) = { + val await = Try(Await.result(addPetAsync(pet), Duration.Inf)) await match { case Success(i) => Some(await.get) case Failure(t) => None @@ -95,11 +95,11 @@ class PetApi( * Add a new pet to the store asynchronously * * - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store * @return Future(void) */ - def addPetAsync(body: Pet) = { - helper.addPet(body) + def addPetAsync(pet: Pet) = { + helper.addPet(pet) } /** @@ -161,10 +161,11 @@ class PetApi( * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * * @param tags Tags to filter by + * @param maxCount Maximum number of items to return (optional) * @return List[Pet] */ - def findPetsByTags(tags: List[String]): Option[List[Pet]] = { - val await = Try(Await.result(findPetsByTagsAsync(tags), Duration.Inf)) + def findPetsByTags(tags: List[String], maxCount: Option[Integer] = None): Option[List[Pet]] = { + val await = Try(Await.result(findPetsByTagsAsync(tags, maxCount), Duration.Inf)) await match { case Success(i) => Some(await.get) case Failure(t) => None @@ -176,10 +177,11 @@ class PetApi( * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * * @param tags Tags to filter by + * @param maxCount Maximum number of items to return (optional) * @return Future(List[Pet]) */ - def findPetsByTagsAsync(tags: List[String]): Future[List[Pet]] = { - helper.findPetsByTags(tags) + def findPetsByTagsAsync(tags: List[String], maxCount: Option[Integer] = None): Future[List[Pet]] = { + helper.findPetsByTags(tags, maxCount) } /** @@ -212,11 +214,11 @@ class PetApi( * Update an existing pet * * - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store * @return void */ - def updatePet(body: Pet) = { - val await = Try(Await.result(updatePetAsync(body), Duration.Inf)) + def updatePet(pet: Pet) = { + val await = Try(Await.result(updatePetAsync(pet), Duration.Inf)) await match { case Success(i) => Some(await.get) case Failure(t) => None @@ -227,11 +229,11 @@ class PetApi( * Update an existing pet asynchronously * * - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store * @return Future(void) */ - def updatePetAsync(body: Pet) = { - helper.updatePet(body) + def updatePetAsync(pet: Pet) = { + helper.updatePet(pet) } /** @@ -298,7 +300,7 @@ class PetApi( class PetApiAsyncHelper(client: TransportClient, config: SwaggerConfig) extends ApiClient(client, config) { - def addPet(body: Pet)(implicit reader: ClientResponseReader[Unit], writer: RequestWriter[Pet]): Future[Unit] = { + def addPet(pet: Pet)(implicit reader: ClientResponseReader[Unit], writer: RequestWriter[Pet]): Future[Unit] = { // create path and map variables val path = (addFmt("/pet")) @@ -306,9 +308,9 @@ class PetApiAsyncHelper(client: TransportClient, config: SwaggerConfig) extends val queryParams = new mutable.HashMap[String, String] val headerParams = new mutable.HashMap[String, String] - if (body == null) throw new Exception("Missing required parameter 'body' when calling PetApi->addPet") + if (pet == null) throw new Exception("Missing required parameter 'pet' when calling PetApi->addPet") - val resFuture = client.submit("POST", path, queryParams.toMap, headerParams.toMap, writer.write(body)) + val resFuture = client.submit("POST", path, queryParams.toMap, headerParams.toMap, writer.write(pet)) resFuture flatMap { resp => val status = Response.Status.fromStatusCode(resp.statusCode) status.getFamily match { @@ -365,7 +367,9 @@ class PetApiAsyncHelper(client: TransportClient, config: SwaggerConfig) extends } } - def findPetsByTags(tags: List[String])(implicit reader: ClientResponseReader[List[Pet]]): Future[List[Pet]] = { + def findPetsByTags(tags: List[String], + maxCount: Option[Integer] = None + )(implicit reader: ClientResponseReader[List[Pet]]): Future[List[Pet]] = { // create path and map variables val path = (addFmt("/pet/findByTags")) @@ -375,6 +379,10 @@ class PetApiAsyncHelper(client: TransportClient, config: SwaggerConfig) extends if (tags == null) throw new Exception("Missing required parameter 'tags' when calling PetApi->findPetsByTags") queryParams += "tags" -> tags.toString + maxCount match { + case Some(param) => queryParams += "maxCount" -> param.toString + case _ => queryParams + } val resFuture = client.submit("GET", path, queryParams.toMap, headerParams.toMap, "") resFuture flatMap { resp => @@ -406,7 +414,7 @@ class PetApiAsyncHelper(client: TransportClient, config: SwaggerConfig) extends } } - def updatePet(body: Pet)(implicit reader: ClientResponseReader[Unit], writer: RequestWriter[Pet]): Future[Unit] = { + def updatePet(pet: Pet)(implicit reader: ClientResponseReader[Unit], writer: RequestWriter[Pet]): Future[Unit] = { // create path and map variables val path = (addFmt("/pet")) @@ -414,9 +422,9 @@ class PetApiAsyncHelper(client: TransportClient, config: SwaggerConfig) extends val queryParams = new mutable.HashMap[String, String] val headerParams = new mutable.HashMap[String, String] - if (body == null) throw new Exception("Missing required parameter 'body' when calling PetApi->updatePet") + if (pet == null) throw new Exception("Missing required parameter 'pet' when calling PetApi->updatePet") - val resFuture = client.submit("PUT", path, queryParams.toMap, headerParams.toMap, writer.write(body)) + val resFuture = client.submit("PUT", path, queryParams.toMap, headerParams.toMap, writer.write(pet)) resFuture flatMap { resp => val status = Response.Status.fromStatusCode(resp.statusCode) status.getFamily match { diff --git a/samples/client/petstore/scala-httpclient/src/main/scala/org/openapitools/client/api/StoreApi.scala b/samples/client/petstore/scala-httpclient/src/main/scala/org/openapitools/client/api/StoreApi.scala index 4328080db938..51b392338505 100644 --- a/samples/client/petstore/scala-httpclient/src/main/scala/org/openapitools/client/api/StoreApi.scala +++ b/samples/client/petstore/scala-httpclient/src/main/scala/org/openapitools/client/api/StoreApi.scala @@ -154,11 +154,11 @@ class StoreApi( * Place an order for a pet * * - * @param body order placed for purchasing the pet + * @param order order placed for purchasing the pet * @return Order */ - def placeOrder(body: Order): Option[Order] = { - val await = Try(Await.result(placeOrderAsync(body), Duration.Inf)) + def placeOrder(order: Order): Option[Order] = { + val await = Try(Await.result(placeOrderAsync(order), Duration.Inf)) await match { case Success(i) => Some(await.get) case Failure(t) => None @@ -169,11 +169,11 @@ class StoreApi( * Place an order for a pet asynchronously * * - * @param body order placed for purchasing the pet + * @param order order placed for purchasing the pet * @return Future(Order) */ - def placeOrderAsync(body: Order): Future[Order] = { - helper.placeOrder(body) + def placeOrderAsync(order: Order): Future[Order] = { + helper.placeOrder(order) } } @@ -241,7 +241,7 @@ class StoreApiAsyncHelper(client: TransportClient, config: SwaggerConfig) extend } } - def placeOrder(body: Order)(implicit reader: ClientResponseReader[Order], writer: RequestWriter[Order]): Future[Order] = { + def placeOrder(order: Order)(implicit reader: ClientResponseReader[Order], writer: RequestWriter[Order]): Future[Order] = { // create path and map variables val path = (addFmt("/store/order")) @@ -249,9 +249,9 @@ class StoreApiAsyncHelper(client: TransportClient, config: SwaggerConfig) extend val queryParams = new mutable.HashMap[String, String] val headerParams = new mutable.HashMap[String, String] - if (body == null) throw new Exception("Missing required parameter 'body' when calling StoreApi->placeOrder") + if (order == null) throw new Exception("Missing required parameter 'order' when calling StoreApi->placeOrder") - val resFuture = client.submit("POST", path, queryParams.toMap, headerParams.toMap, writer.write(body)) + val resFuture = client.submit("POST", path, queryParams.toMap, headerParams.toMap, writer.write(order)) resFuture flatMap { resp => val status = Response.Status.fromStatusCode(resp.statusCode) status.getFamily match { diff --git a/samples/client/petstore/scala-httpclient/src/main/scala/org/openapitools/client/api/UserApi.scala b/samples/client/petstore/scala-httpclient/src/main/scala/org/openapitools/client/api/UserApi.scala index efd7f1ef97fa..585fd19ee512 100644 --- a/samples/client/petstore/scala-httpclient/src/main/scala/org/openapitools/client/api/UserApi.scala +++ b/samples/client/petstore/scala-httpclient/src/main/scala/org/openapitools/client/api/UserApi.scala @@ -78,11 +78,11 @@ class UserApi( * Create user * This can only be done by the logged in user. * - * @param body Created user object + * @param user Created user object * @return void */ - def createUser(body: User) = { - val await = Try(Await.result(createUserAsync(body), Duration.Inf)) + def createUser(user: User) = { + val await = Try(Await.result(createUserAsync(user), Duration.Inf)) await match { case Success(i) => Some(await.get) case Failure(t) => None @@ -93,22 +93,22 @@ class UserApi( * Create user asynchronously * This can only be done by the logged in user. * - * @param body Created user object + * @param user Created user object * @return Future(void) */ - def createUserAsync(body: User) = { - helper.createUser(body) + def createUserAsync(user: User) = { + helper.createUser(user) } /** * Creates list of users with given input array * * - * @param body List of user object + * @param user List of user object * @return void */ - def createUsersWithArrayInput(body: List[User]) = { - val await = Try(Await.result(createUsersWithArrayInputAsync(body), Duration.Inf)) + def createUsersWithArrayInput(user: List[User]) = { + val await = Try(Await.result(createUsersWithArrayInputAsync(user), Duration.Inf)) await match { case Success(i) => Some(await.get) case Failure(t) => None @@ -119,22 +119,22 @@ class UserApi( * Creates list of users with given input array asynchronously * * - * @param body List of user object + * @param user List of user object * @return Future(void) */ - def createUsersWithArrayInputAsync(body: List[User]) = { - helper.createUsersWithArrayInput(body) + def createUsersWithArrayInputAsync(user: List[User]) = { + helper.createUsersWithArrayInput(user) } /** * Creates list of users with given input array * * - * @param body List of user object + * @param user List of user object * @return void */ - def createUsersWithListInput(body: List[User]) = { - val await = Try(Await.result(createUsersWithListInputAsync(body), Duration.Inf)) + def createUsersWithListInput(user: List[User]) = { + val await = Try(Await.result(createUsersWithListInputAsync(user), Duration.Inf)) await match { case Success(i) => Some(await.get) case Failure(t) => None @@ -145,11 +145,11 @@ class UserApi( * Creates list of users with given input array asynchronously * * - * @param body List of user object + * @param user List of user object * @return Future(void) */ - def createUsersWithListInputAsync(body: List[User]) = { - helper.createUsersWithListInput(body) + def createUsersWithListInputAsync(user: List[User]) = { + helper.createUsersWithListInput(user) } /** @@ -261,11 +261,11 @@ class UserApi( * This can only be done by the logged in user. * * @param username name that need to be deleted - * @param body Updated user object + * @param user Updated user object * @return void */ - def updateUser(username: String, body: User) = { - val await = Try(Await.result(updateUserAsync(username, body), Duration.Inf)) + def updateUser(username: String, user: User) = { + val await = Try(Await.result(updateUserAsync(username, user), Duration.Inf)) await match { case Success(i) => Some(await.get) case Failure(t) => None @@ -277,18 +277,18 @@ class UserApi( * This can only be done by the logged in user. * * @param username name that need to be deleted - * @param body Updated user object + * @param user Updated user object * @return Future(void) */ - def updateUserAsync(username: String, body: User) = { - helper.updateUser(username, body) + def updateUserAsync(username: String, user: User) = { + helper.updateUser(username, user) } } class UserApiAsyncHelper(client: TransportClient, config: SwaggerConfig) extends ApiClient(client, config) { - def createUser(body: User)(implicit reader: ClientResponseReader[Unit], writer: RequestWriter[User]): Future[Unit] = { + def createUser(user: User)(implicit reader: ClientResponseReader[Unit], writer: RequestWriter[User]): Future[Unit] = { // create path and map variables val path = (addFmt("/user")) @@ -296,9 +296,9 @@ class UserApiAsyncHelper(client: TransportClient, config: SwaggerConfig) extends val queryParams = new mutable.HashMap[String, String] val headerParams = new mutable.HashMap[String, String] - if (body == null) throw new Exception("Missing required parameter 'body' when calling UserApi->createUser") + if (user == null) throw new Exception("Missing required parameter 'user' when calling UserApi->createUser") - val resFuture = client.submit("POST", path, queryParams.toMap, headerParams.toMap, writer.write(body)) + val resFuture = client.submit("POST", path, queryParams.toMap, headerParams.toMap, writer.write(user)) resFuture flatMap { resp => val status = Response.Status.fromStatusCode(resp.statusCode) status.getFamily match { @@ -308,7 +308,7 @@ class UserApiAsyncHelper(client: TransportClient, config: SwaggerConfig) extends } } - def createUsersWithArrayInput(body: List[User])(implicit reader: ClientResponseReader[Unit], writer: RequestWriter[List[User]]): Future[Unit] = { + def createUsersWithArrayInput(user: List[User])(implicit reader: ClientResponseReader[Unit], writer: RequestWriter[List[User]]): Future[Unit] = { // create path and map variables val path = (addFmt("/user/createWithArray")) @@ -316,9 +316,9 @@ class UserApiAsyncHelper(client: TransportClient, config: SwaggerConfig) extends val queryParams = new mutable.HashMap[String, String] val headerParams = new mutable.HashMap[String, String] - if (body == null) throw new Exception("Missing required parameter 'body' when calling UserApi->createUsersWithArrayInput") + if (user == null) throw new Exception("Missing required parameter 'user' when calling UserApi->createUsersWithArrayInput") - val resFuture = client.submit("POST", path, queryParams.toMap, headerParams.toMap, writer.write(body)) + val resFuture = client.submit("POST", path, queryParams.toMap, headerParams.toMap, writer.write(user)) resFuture flatMap { resp => val status = Response.Status.fromStatusCode(resp.statusCode) status.getFamily match { @@ -328,7 +328,7 @@ class UserApiAsyncHelper(client: TransportClient, config: SwaggerConfig) extends } } - def createUsersWithListInput(body: List[User])(implicit reader: ClientResponseReader[Unit], writer: RequestWriter[List[User]]): Future[Unit] = { + def createUsersWithListInput(user: List[User])(implicit reader: ClientResponseReader[Unit], writer: RequestWriter[List[User]]): Future[Unit] = { // create path and map variables val path = (addFmt("/user/createWithList")) @@ -336,9 +336,9 @@ class UserApiAsyncHelper(client: TransportClient, config: SwaggerConfig) extends val queryParams = new mutable.HashMap[String, String] val headerParams = new mutable.HashMap[String, String] - if (body == null) throw new Exception("Missing required parameter 'body' when calling UserApi->createUsersWithListInput") + if (user == null) throw new Exception("Missing required parameter 'user' when calling UserApi->createUsersWithListInput") - val resFuture = client.submit("POST", path, queryParams.toMap, headerParams.toMap, writer.write(body)) + val resFuture = client.submit("POST", path, queryParams.toMap, headerParams.toMap, writer.write(user)) resFuture flatMap { resp => val status = Response.Status.fromStatusCode(resp.statusCode) status.getFamily match { @@ -438,7 +438,7 @@ class UserApiAsyncHelper(client: TransportClient, config: SwaggerConfig) extends } def updateUser(username: String, - body: User)(implicit reader: ClientResponseReader[Unit], writer: RequestWriter[User]): Future[Unit] = { + user: User)(implicit reader: ClientResponseReader[Unit], writer: RequestWriter[User]): Future[Unit] = { // create path and map variables val path = (addFmt("/user/{username}") replaceAll("\\{" + "username" + "\\}", username.toString)) @@ -449,9 +449,9 @@ class UserApiAsyncHelper(client: TransportClient, config: SwaggerConfig) extends if (username == null) throw new Exception("Missing required parameter 'username' when calling UserApi->updateUser") - if (body == null) throw new Exception("Missing required parameter 'body' when calling UserApi->updateUser") + if (user == null) throw new Exception("Missing required parameter 'user' when calling UserApi->updateUser") - val resFuture = client.submit("PUT", path, queryParams.toMap, headerParams.toMap, writer.write(body)) + val resFuture = client.submit("PUT", path, queryParams.toMap, headerParams.toMap, writer.write(user)) resFuture flatMap { resp => val status = Response.Status.fromStatusCode(resp.statusCode) status.getFamily match { diff --git a/samples/client/petstore/scala-httpclient/src/main/scala/org/openapitools/client/model/InlineObject.scala b/samples/client/petstore/scala-httpclient/src/main/scala/org/openapitools/client/model/InlineObject.scala new file mode 100644 index 000000000000..071b023e1a57 --- /dev/null +++ b/samples/client/petstore/scala-httpclient/src/main/scala/org/openapitools/client/model/InlineObject.scala @@ -0,0 +1,22 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model + + +case class InlineObject ( + // Updated name of the pet + name: Option[String] = None, + // Updated status of the pet + status: Option[String] = None +) + diff --git a/samples/client/petstore/scala-httpclient/src/main/scala/org/openapitools/client/model/InlineObject1.scala b/samples/client/petstore/scala-httpclient/src/main/scala/org/openapitools/client/model/InlineObject1.scala new file mode 100644 index 000000000000..520d5858eb9a --- /dev/null +++ b/samples/client/petstore/scala-httpclient/src/main/scala/org/openapitools/client/model/InlineObject1.scala @@ -0,0 +1,23 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model + +import java.io.File + +case class InlineObject1 ( + // Additional data to pass to server + additionalMetadata: Option[String] = None, + // file to upload + file: Option[File] = None +) + diff --git a/samples/client/petstore/scalaz/.openapi-generator/VERSION b/samples/client/petstore/scalaz/.openapi-generator/VERSION index 096bf47efe31..83a328a9227e 100644 --- a/samples/client/petstore/scalaz/.openapi-generator/VERSION +++ b/samples/client/petstore/scalaz/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.0-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/InlineObject.scala b/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/InlineObject.scala new file mode 100644 index 000000000000..e8e7f2f90e65 --- /dev/null +++ b/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/InlineObject.scala @@ -0,0 +1,24 @@ +package org.openapitools.client.api + +import argonaut._ +import argonaut.EncodeJson._ +import argonaut.DecodeJson._ + +import org.http4s.{EntityDecoder, EntityEncoder} +import org.http4s.argonaut._ +import org.joda.time.DateTime +import InlineObject._ + +case class InlineObject ( + /* Updated name of the pet */ + name: Option[String], +/* Updated status of the pet */ + status: Option[String]) + +object InlineObject { + import DateTimeCodecs._ + + implicit val InlineObjectCodecJson: CodecJson[InlineObject] = CodecJson.derive[InlineObject] + implicit val InlineObjectDecoder: EntityDecoder[InlineObject] = jsonOf[InlineObject] + implicit val InlineObjectEncoder: EntityEncoder[InlineObject] = jsonEncoderOf[InlineObject] +} diff --git a/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/InlineObject1.scala b/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/InlineObject1.scala new file mode 100644 index 000000000000..f9e1b7f2660a --- /dev/null +++ b/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/InlineObject1.scala @@ -0,0 +1,24 @@ +package org.openapitools.client.api + +import argonaut._ +import argonaut.EncodeJson._ +import argonaut.DecodeJson._ + +import org.http4s.{EntityDecoder, EntityEncoder} +import org.http4s.argonaut._ +import org.joda.time.DateTime +import InlineObject1._ + +case class InlineObject1 ( + /* Additional data to pass to server */ + additionalMetadata: Option[String], +/* file to upload */ + file: Option[File]) + +object InlineObject1 { + import DateTimeCodecs._ + + implicit val InlineObject1CodecJson: CodecJson[InlineObject1] = CodecJson.derive[InlineObject1] + implicit val InlineObject1Decoder: EntityDecoder[InlineObject1] = jsonOf[InlineObject1] + implicit val InlineObject1Encoder: EntityEncoder[InlineObject1] = jsonEncoderOf[InlineObject1] +} diff --git a/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/PetApi.scala b/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/PetApi.scala index bafe205709cd..590859177213 100644 --- a/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/PetApi.scala +++ b/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/PetApi.scala @@ -65,7 +65,7 @@ object PetApi { } yield resp } - def findPetsByStatus(host: String, status: List[String])(implicit statusQuery: QueryParam[List[String]]): Task[List[Pet]] = { + def findPetsByStatus(host: String, status: List[String] = new ListBuffer[String]() )(implicit statusQuery: QueryParam[List[String]]): Task[List[Pet]] = { implicit val returnTypeDecoder: EntityDecoder[List[Pet]] = jsonOf[List[Pet]] val path = "/pet/findByStatus" @@ -86,7 +86,7 @@ object PetApi { } yield resp } - def findPetsByTags(host: String, tags: List[String])(implicit tagsQuery: QueryParam[List[String]]): Task[List[Pet]] = { + def findPetsByTags(host: String, tags: List[String] = new ListBuffer[String]() , maxCount: Integer)(implicit tagsQuery: QueryParam[List[String]], maxCountQuery: QueryParam[Integer]): Task[List[Pet]] = { implicit val returnTypeDecoder: EntityDecoder[List[Pet]] = jsonOf[List[Pet]] val path = "/pet/findByTags" @@ -96,7 +96,7 @@ object PetApi { val headers = Headers( ) val queryParams = Query( - ("tags", Some(tagsQuery.toParamString(tags)))) + ("tags", Some(tagsQuery.toParamString(tags))), ("maxCount", Some(maxCountQuery.toParamString(maxCount)))) for { uri <- Task.fromDisjunction(Uri.fromString(host + path)) @@ -232,7 +232,7 @@ class HttpServicePetApi(service: HttpService) { } yield resp } - def findPetsByStatus(status: List[String])(implicit statusQuery: QueryParam[List[String]]): Task[List[Pet]] = { + def findPetsByStatus(status: List[String] = new ListBuffer[String]() )(implicit statusQuery: QueryParam[List[String]]): Task[List[Pet]] = { implicit val returnTypeDecoder: EntityDecoder[List[Pet]] = jsonOf[List[Pet]] val path = "/pet/findByStatus" @@ -253,7 +253,7 @@ class HttpServicePetApi(service: HttpService) { } yield resp } - def findPetsByTags(tags: List[String])(implicit tagsQuery: QueryParam[List[String]]): Task[List[Pet]] = { + def findPetsByTags(tags: List[String] = new ListBuffer[String]() , maxCount: Integer)(implicit tagsQuery: QueryParam[List[String]], maxCountQuery: QueryParam[Integer]): Task[List[Pet]] = { implicit val returnTypeDecoder: EntityDecoder[List[Pet]] = jsonOf[List[Pet]] val path = "/pet/findByTags" @@ -263,7 +263,7 @@ class HttpServicePetApi(service: HttpService) { val headers = Headers( ) val queryParams = Query( - ("tags", Some(tagsQuery.toParamString(tags)))) + ("tags", Some(tagsQuery.toParamString(tags))), ("maxCount", Some(maxCountQuery.toParamString(maxCount)))) for { uri <- Task.fromDisjunction(Uri.fromString(path)) diff --git a/samples/client/petstore/swift/default/.openapi-generator/VERSION b/samples/client/petstore/swift/default/.openapi-generator/VERSION index 6d94c9c2e12a..83a328a9227e 100644 --- a/samples/client/petstore/swift/default/.openapi-generator/VERSION +++ b/samples/client/petstore/swift/default/.openapi-generator/VERSION @@ -1 +1 @@ -3.3.0-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index bb190adbd4db..81af6c0d6292 100644 --- a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -13,11 +13,11 @@ public class PetAPI: APIBase { /** Add a new pet to the store - - parameter pet: (body) Pet object that needs to be added to the store (optional) + - parameter body: (body) Pet object that needs to be added to the store (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func addPet(pet pet: Pet? = nil, completion: ((error: ErrorType?) -> Void)) { - addPetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in + public class func addPet(body body: Pet? = nil, completion: ((error: ErrorType?) -> Void)) { + addPetWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error: error); } } @@ -28,14 +28,14 @@ public class PetAPI: APIBase { - POST /pet - OAuth: - type: oauth2 - name: petstore_auth - - parameter pet: (body) Pet object that needs to be added to the store (optional) + - parameter body: (body) Pet object that needs to be added to the store (optional) - returns: RequestBuilder */ - public class func addPetWithRequestBuilder(pet pet: Pet? = nil) -> RequestBuilder { + public class func addPetWithRequestBuilder(body body: Pet? = nil) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = pet?.encodeToJSON() as? [String:AnyObject] + let parameters = body?.encodeToJSON() as? [String:AnyObject] let convertedParameters = APIHelper.convertBoolToString(parameters) @@ -123,7 +123,7 @@ public class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 doggie @@ -132,7 +132,7 @@ public class PetAPI: APIBase { aeiou -}] +, statusCode=200}] - examples: [{contentType=application/json, example={ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", @@ -149,7 +149,7 @@ public class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 doggie @@ -158,7 +158,7 @@ public class PetAPI: APIBase { aeiou -}] +, statusCode=200}] - parameter status: (query) Status values that need to be considered for filter (optional) - returns: RequestBuilder<[Pet]> @@ -215,7 +215,7 @@ public class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 doggie @@ -224,7 +224,7 @@ public class PetAPI: APIBase { aeiou -}] +, statusCode=200}] - examples: [{contentType=application/json, example={ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", @@ -241,7 +241,7 @@ public class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 doggie @@ -250,7 +250,7 @@ public class PetAPI: APIBase { aeiou -}] +, statusCode=200}] - parameter tags: (query) Tags to filter by (optional) - returns: RequestBuilder<[Pet]> @@ -310,7 +310,7 @@ public class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 doggie @@ -319,7 +319,7 @@ public class PetAPI: APIBase { aeiou -}] +, statusCode=200}] - examples: [{contentType=application/json, example={ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", @@ -336,7 +336,7 @@ public class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 doggie @@ -345,7 +345,7 @@ public class PetAPI: APIBase { aeiou -}] +, statusCode=200}] - parameter petId: (path) ID of pet that needs to be fetched - returns: RequestBuilder @@ -369,11 +369,11 @@ public class PetAPI: APIBase { /** Update an existing pet - - parameter pet: (body) Pet object that needs to be added to the store (optional) + - parameter body: (body) Pet object that needs to be added to the store (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func updatePet(pet pet: Pet? = nil, completion: ((error: ErrorType?) -> Void)) { - updatePetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in + public class func updatePet(body body: Pet? = nil, completion: ((error: ErrorType?) -> Void)) { + updatePetWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error: error); } } @@ -384,14 +384,14 @@ public class PetAPI: APIBase { - PUT /pet - OAuth: - type: oauth2 - name: petstore_auth - - parameter pet: (body) Pet object that needs to be added to the store (optional) + - parameter body: (body) Pet object that needs to be added to the store (optional) - returns: RequestBuilder */ - public class func updatePetWithRequestBuilder(pet pet: Pet? = nil) -> RequestBuilder { + public class func updatePetWithRequestBuilder(body body: Pet? = nil) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = pet?.encodeToJSON() as? [String:AnyObject] + let parameters = body?.encodeToJSON() as? [String:AnyObject] let convertedParameters = APIHelper.convertBoolToString(parameters) diff --git a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 8a3133a8f8c4..eef30d2814c7 100644 --- a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -105,14 +105,14 @@ public class StoreAPI: APIBase { "shipDate" : "2000-01-23T04:56:07.000+00:00", "complete" : true, "status" : "placed" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true -}] +, statusCode=200}] - examples: [{contentType=application/json, example={ "petId" : 6, "quantity" : 1, @@ -120,14 +120,14 @@ public class StoreAPI: APIBase { "shipDate" : "2000-01-23T04:56:07.000+00:00", "complete" : true, "status" : "placed" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true -}] +, statusCode=200}] - parameter orderId: (path) ID of pet that needs to be fetched - returns: RequestBuilder @@ -151,11 +151,11 @@ public class StoreAPI: APIBase { /** Place an order for a pet - - parameter order: (body) order placed for purchasing the pet (optional) + - parameter body: (body) order placed for purchasing the pet (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func placeOrder(order order: Order? = nil, completion: ((data: Order?, error: ErrorType?) -> Void)) { - placeOrderWithRequestBuilder(order: order).execute { (response, error) -> Void in + public class func placeOrder(body body: Order? = nil, completion: ((data: Order?, error: ErrorType?) -> Void)) { + placeOrderWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(data: response?.body, error: error); } } @@ -170,14 +170,14 @@ public class StoreAPI: APIBase { "shipDate" : "2000-01-23T04:56:07.000+00:00", "complete" : true, "status" : "placed" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true -}] +, statusCode=200}] - examples: [{contentType=application/json, example={ "petId" : 6, "quantity" : 1, @@ -185,22 +185,22 @@ public class StoreAPI: APIBase { "shipDate" : "2000-01-23T04:56:07.000+00:00", "complete" : true, "status" : "placed" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true -}] - - parameter order: (body) order placed for purchasing the pet (optional) +, statusCode=200}] + - parameter body: (body) order placed for purchasing the pet (optional) - returns: RequestBuilder */ - public class func placeOrderWithRequestBuilder(order order: Order? = nil) -> RequestBuilder { + public class func placeOrderWithRequestBuilder(body body: Order? = nil) -> RequestBuilder { let path = "/store/order" let URLString = PetstoreClientAPI.basePath + path - let parameters = order?.encodeToJSON() as? [String:AnyObject] + let parameters = body?.encodeToJSON() as? [String:AnyObject] let convertedParameters = APIHelper.convertBoolToString(parameters) diff --git a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index fa0db1bc5262..73760fe6268d 100644 --- a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -13,11 +13,11 @@ public class UserAPI: APIBase { /** Create user - - parameter user: (body) Created user object (optional) + - parameter body: (body) Created user object (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func createUser(user user: User? = nil, completion: ((error: ErrorType?) -> Void)) { - createUserWithRequestBuilder(user: user).execute { (response, error) -> Void in + public class func createUser(body body: User? = nil, completion: ((error: ErrorType?) -> Void)) { + createUserWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error: error); } } @@ -26,14 +26,14 @@ public class UserAPI: APIBase { /** Create user - POST /user - - This can only be done by the logged in user. - parameter user: (body) Created user object (optional) + - This can only be done by the logged in user. - parameter body: (body) Created user object (optional) - returns: RequestBuilder */ - public class func createUserWithRequestBuilder(user user: User? = nil) -> RequestBuilder { + public class func createUserWithRequestBuilder(body body: User? = nil) -> RequestBuilder { let path = "/user" let URLString = PetstoreClientAPI.basePath + path - let parameters = user?.encodeToJSON() as? [String:AnyObject] + let parameters = body?.encodeToJSON() as? [String:AnyObject] let convertedParameters = APIHelper.convertBoolToString(parameters) @@ -45,11 +45,11 @@ public class UserAPI: APIBase { /** Creates list of users with given input array - - parameter user: (body) List of user object (optional) + - parameter body: (body) List of user object (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func createUsersWithArrayInput(user user: [User]? = nil, completion: ((error: ErrorType?) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(user: user).execute { (response, error) -> Void in + public class func createUsersWithArrayInput(body body: [User]? = nil, completion: ((error: ErrorType?) -> Void)) { + createUsersWithArrayInputWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error: error); } } @@ -57,14 +57,14 @@ public class UserAPI: APIBase { /** Creates list of users with given input array - - POST /user/createWithArray - parameter user: (body) List of user object (optional) + - POST /user/createWithArray - parameter body: (body) List of user object (optional) - returns: RequestBuilder */ - public class func createUsersWithArrayInputWithRequestBuilder(user user: [User]? = nil) -> RequestBuilder { + public class func createUsersWithArrayInputWithRequestBuilder(body body: [User]? = nil) -> RequestBuilder { let path = "/user/createWithArray" let URLString = PetstoreClientAPI.basePath + path - let parameters = user?.encodeToJSON() as? [String:AnyObject] + let parameters = body?.encodeToJSON() as? [String:AnyObject] let convertedParameters = APIHelper.convertBoolToString(parameters) @@ -76,11 +76,11 @@ public class UserAPI: APIBase { /** Creates list of users with given input array - - parameter user: (body) List of user object (optional) + - parameter body: (body) List of user object (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func createUsersWithListInput(user user: [User]? = nil, completion: ((error: ErrorType?) -> Void)) { - createUsersWithListInputWithRequestBuilder(user: user).execute { (response, error) -> Void in + public class func createUsersWithListInput(body body: [User]? = nil, completion: ((error: ErrorType?) -> Void)) { + createUsersWithListInputWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error: error); } } @@ -88,14 +88,14 @@ public class UserAPI: APIBase { /** Creates list of users with given input array - - POST /user/createWithList - parameter user: (body) List of user object (optional) + - POST /user/createWithList - parameter body: (body) List of user object (optional) - returns: RequestBuilder */ - public class func createUsersWithListInputWithRequestBuilder(user user: [User]? = nil) -> RequestBuilder { + public class func createUsersWithListInputWithRequestBuilder(body body: [User]? = nil) -> RequestBuilder { let path = "/user/createWithList" let URLString = PetstoreClientAPI.basePath + path - let parameters = user?.encodeToJSON() as? [String:AnyObject] + let parameters = body?.encodeToJSON() as? [String:AnyObject] let convertedParameters = APIHelper.convertBoolToString(parameters) @@ -164,7 +164,7 @@ public class UserAPI: APIBase { "id" : 0, "email" : "email", "username" : "username" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 aeiou aeiou @@ -173,7 +173,7 @@ public class UserAPI: APIBase { aeiou aeiou 123 -}] +, statusCode=200}] - examples: [{contentType=application/json, example={ "firstName" : "firstName", "lastName" : "lastName", @@ -183,7 +183,7 @@ public class UserAPI: APIBase { "id" : 0, "email" : "email", "username" : "username" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 aeiou aeiou @@ -192,7 +192,7 @@ public class UserAPI: APIBase { aeiou aeiou 123 -}] +, statusCode=200}] - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - returns: RequestBuilder @@ -288,11 +288,11 @@ public class UserAPI: APIBase { Updated user - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object (optional) + - parameter body: (body) Updated user object (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func updateUser(username username: String, user: User? = nil, completion: ((error: ErrorType?) -> Void)) { - updateUserWithRequestBuilder(username: username, user: user).execute { (response, error) -> Void in + public class func updateUser(username username: String, body: User? = nil, completion: ((error: ErrorType?) -> Void)) { + updateUserWithRequestBuilder(username: username, body: body).execute { (response, error) -> Void in completion(error: error); } } @@ -302,15 +302,15 @@ public class UserAPI: APIBase { Updated user - PUT /user/{username} - This can only be done by the logged in user. - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object (optional) + - parameter body: (body) Updated user object (optional) - returns: RequestBuilder */ - public class func updateUserWithRequestBuilder(username username: String, user: User? = nil) -> RequestBuilder { + public class func updateUserWithRequestBuilder(username username: String, body: User? = nil) -> RequestBuilder { var path = "/user/{username}" path = path.stringByReplacingOccurrencesOfString("{username}", withString: "\(username)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters = user?.encodeToJSON() as? [String:AnyObject] + let parameters = body?.encodeToJSON() as? [String:AnyObject] let convertedParameters = APIHelper.convertBoolToString(parameters) diff --git a/samples/client/petstore/swift/promisekit/.openapi-generator/VERSION b/samples/client/petstore/swift/promisekit/.openapi-generator/VERSION index 6d94c9c2e12a..83a328a9227e 100644 --- a/samples/client/petstore/swift/promisekit/.openapi-generator/VERSION +++ b/samples/client/petstore/swift/promisekit/.openapi-generator/VERSION @@ -1 +1 @@ -3.3.0-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index d7402b386123..ce762b3a138d 100644 --- a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -14,11 +14,11 @@ public class PetAPI: APIBase { /** Add a new pet to the store - - parameter pet: (body) Pet object that needs to be added to the store (optional) + - parameter body: (body) Pet object that needs to be added to the store (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func addPet(pet pet: Pet? = nil, completion: ((error: ErrorType?) -> Void)) { - addPetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in + public class func addPet(body body: Pet? = nil, completion: ((error: ErrorType?) -> Void)) { + addPetWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error: error); } } @@ -26,12 +26,12 @@ public class PetAPI: APIBase { /** Add a new pet to the store - - parameter pet: (body) Pet object that needs to be added to the store (optional) + - parameter body: (body) Pet object that needs to be added to the store (optional) - returns: Promise */ - public class func addPet(pet pet: Pet? = nil) -> Promise { + public class func addPet(body body: Pet? = nil) -> Promise { let deferred = Promise.pendingPromise() - addPet(pet: pet) { error in + addPet(body: body) { error in if let error = error { deferred.reject(error) } else { @@ -46,14 +46,14 @@ public class PetAPI: APIBase { - POST /pet - OAuth: - type: oauth2 - name: petstore_auth - - parameter pet: (body) Pet object that needs to be added to the store (optional) + - parameter body: (body) Pet object that needs to be added to the store (optional) - returns: RequestBuilder */ - public class func addPetWithRequestBuilder(pet pet: Pet? = nil) -> RequestBuilder { + public class func addPetWithRequestBuilder(body body: Pet? = nil) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = pet?.encodeToJSON() as? [String:AnyObject] + let parameters = body?.encodeToJSON() as? [String:AnyObject] let convertedParameters = APIHelper.convertBoolToString(parameters) @@ -176,7 +176,7 @@ public class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 doggie @@ -185,7 +185,7 @@ public class PetAPI: APIBase { aeiou -}] +, statusCode=200}] - examples: [{contentType=application/json, example={ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", @@ -202,7 +202,7 @@ public class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 doggie @@ -211,7 +211,7 @@ public class PetAPI: APIBase { aeiou -}] +, statusCode=200}] - parameter status: (query) Status values that need to be considered for filter (optional) - returns: RequestBuilder<[Pet]> @@ -285,7 +285,7 @@ public class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 doggie @@ -294,7 +294,7 @@ public class PetAPI: APIBase { aeiou -}] +, statusCode=200}] - examples: [{contentType=application/json, example={ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", @@ -311,7 +311,7 @@ public class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 doggie @@ -320,7 +320,7 @@ public class PetAPI: APIBase { aeiou -}] +, statusCode=200}] - parameter tags: (query) Tags to filter by (optional) - returns: RequestBuilder<[Pet]> @@ -397,7 +397,7 @@ public class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 doggie @@ -406,7 +406,7 @@ public class PetAPI: APIBase { aeiou -}] +, statusCode=200}] - examples: [{contentType=application/json, example={ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", @@ -423,7 +423,7 @@ public class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 doggie @@ -432,7 +432,7 @@ public class PetAPI: APIBase { aeiou -}] +, statusCode=200}] - parameter petId: (path) ID of pet that needs to be fetched - returns: RequestBuilder @@ -456,11 +456,11 @@ public class PetAPI: APIBase { /** Update an existing pet - - parameter pet: (body) Pet object that needs to be added to the store (optional) + - parameter body: (body) Pet object that needs to be added to the store (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func updatePet(pet pet: Pet? = nil, completion: ((error: ErrorType?) -> Void)) { - updatePetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in + public class func updatePet(body body: Pet? = nil, completion: ((error: ErrorType?) -> Void)) { + updatePetWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error: error); } } @@ -468,12 +468,12 @@ public class PetAPI: APIBase { /** Update an existing pet - - parameter pet: (body) Pet object that needs to be added to the store (optional) + - parameter body: (body) Pet object that needs to be added to the store (optional) - returns: Promise */ - public class func updatePet(pet pet: Pet? = nil) -> Promise { + public class func updatePet(body body: Pet? = nil) -> Promise { let deferred = Promise.pendingPromise() - updatePet(pet: pet) { error in + updatePet(body: body) { error in if let error = error { deferred.reject(error) } else { @@ -488,14 +488,14 @@ public class PetAPI: APIBase { - PUT /pet - OAuth: - type: oauth2 - name: petstore_auth - - parameter pet: (body) Pet object that needs to be added to the store (optional) + - parameter body: (body) Pet object that needs to be added to the store (optional) - returns: RequestBuilder */ - public class func updatePetWithRequestBuilder(pet pet: Pet? = nil) -> RequestBuilder { + public class func updatePetWithRequestBuilder(body body: Pet? = nil) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = pet?.encodeToJSON() as? [String:AnyObject] + let parameters = body?.encodeToJSON() as? [String:AnyObject] let convertedParameters = APIHelper.convertBoolToString(parameters) diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 3f3834a0422a..b9ae6984e129 100644 --- a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -156,14 +156,14 @@ public class StoreAPI: APIBase { "shipDate" : "2000-01-23T04:56:07.000+00:00", "complete" : true, "status" : "placed" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true -}] +, statusCode=200}] - examples: [{contentType=application/json, example={ "petId" : 6, "quantity" : 1, @@ -171,14 +171,14 @@ public class StoreAPI: APIBase { "shipDate" : "2000-01-23T04:56:07.000+00:00", "complete" : true, "status" : "placed" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true -}] +, statusCode=200}] - parameter orderId: (path) ID of pet that needs to be fetched - returns: RequestBuilder @@ -202,11 +202,11 @@ public class StoreAPI: APIBase { /** Place an order for a pet - - parameter order: (body) order placed for purchasing the pet (optional) + - parameter body: (body) order placed for purchasing the pet (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func placeOrder(order order: Order? = nil, completion: ((data: Order?, error: ErrorType?) -> Void)) { - placeOrderWithRequestBuilder(order: order).execute { (response, error) -> Void in + public class func placeOrder(body body: Order? = nil, completion: ((data: Order?, error: ErrorType?) -> Void)) { + placeOrderWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(data: response?.body, error: error); } } @@ -214,12 +214,12 @@ public class StoreAPI: APIBase { /** Place an order for a pet - - parameter order: (body) order placed for purchasing the pet (optional) + - parameter body: (body) order placed for purchasing the pet (optional) - returns: Promise */ - public class func placeOrder(order order: Order? = nil) -> Promise { + public class func placeOrder(body body: Order? = nil) -> Promise { let deferred = Promise.pendingPromise() - placeOrder(order: order) { data, error in + placeOrder(body: body) { data, error in if let error = error { deferred.reject(error) } else { @@ -238,14 +238,14 @@ public class StoreAPI: APIBase { "shipDate" : "2000-01-23T04:56:07.000+00:00", "complete" : true, "status" : "placed" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true -}] +, statusCode=200}] - examples: [{contentType=application/json, example={ "petId" : 6, "quantity" : 1, @@ -253,22 +253,22 @@ public class StoreAPI: APIBase { "shipDate" : "2000-01-23T04:56:07.000+00:00", "complete" : true, "status" : "placed" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true -}] - - parameter order: (body) order placed for purchasing the pet (optional) +, statusCode=200}] + - parameter body: (body) order placed for purchasing the pet (optional) - returns: RequestBuilder */ - public class func placeOrderWithRequestBuilder(order order: Order? = nil) -> RequestBuilder { + public class func placeOrderWithRequestBuilder(body body: Order? = nil) -> RequestBuilder { let path = "/store/order" let URLString = PetstoreClientAPI.basePath + path - let parameters = order?.encodeToJSON() as? [String:AnyObject] + let parameters = body?.encodeToJSON() as? [String:AnyObject] let convertedParameters = APIHelper.convertBoolToString(parameters) diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index d5ebe76cfe17..573b8fe14bc7 100644 --- a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -14,11 +14,11 @@ public class UserAPI: APIBase { /** Create user - - parameter user: (body) Created user object (optional) + - parameter body: (body) Created user object (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func createUser(user user: User? = nil, completion: ((error: ErrorType?) -> Void)) { - createUserWithRequestBuilder(user: user).execute { (response, error) -> Void in + public class func createUser(body body: User? = nil, completion: ((error: ErrorType?) -> Void)) { + createUserWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error: error); } } @@ -26,12 +26,12 @@ public class UserAPI: APIBase { /** Create user - - parameter user: (body) Created user object (optional) + - parameter body: (body) Created user object (optional) - returns: Promise */ - public class func createUser(user user: User? = nil) -> Promise { + public class func createUser(body body: User? = nil) -> Promise { let deferred = Promise.pendingPromise() - createUser(user: user) { error in + createUser(body: body) { error in if let error = error { deferred.reject(error) } else { @@ -44,14 +44,14 @@ public class UserAPI: APIBase { /** Create user - POST /user - - This can only be done by the logged in user. - parameter user: (body) Created user object (optional) + - This can only be done by the logged in user. - parameter body: (body) Created user object (optional) - returns: RequestBuilder */ - public class func createUserWithRequestBuilder(user user: User? = nil) -> RequestBuilder { + public class func createUserWithRequestBuilder(body body: User? = nil) -> RequestBuilder { let path = "/user" let URLString = PetstoreClientAPI.basePath + path - let parameters = user?.encodeToJSON() as? [String:AnyObject] + let parameters = body?.encodeToJSON() as? [String:AnyObject] let convertedParameters = APIHelper.convertBoolToString(parameters) @@ -63,11 +63,11 @@ public class UserAPI: APIBase { /** Creates list of users with given input array - - parameter user: (body) List of user object (optional) + - parameter body: (body) List of user object (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func createUsersWithArrayInput(user user: [User]? = nil, completion: ((error: ErrorType?) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(user: user).execute { (response, error) -> Void in + public class func createUsersWithArrayInput(body body: [User]? = nil, completion: ((error: ErrorType?) -> Void)) { + createUsersWithArrayInputWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error: error); } } @@ -75,12 +75,12 @@ public class UserAPI: APIBase { /** Creates list of users with given input array - - parameter user: (body) List of user object (optional) + - parameter body: (body) List of user object (optional) - returns: Promise */ - public class func createUsersWithArrayInput(user user: [User]? = nil) -> Promise { + public class func createUsersWithArrayInput(body body: [User]? = nil) -> Promise { let deferred = Promise.pendingPromise() - createUsersWithArrayInput(user: user) { error in + createUsersWithArrayInput(body: body) { error in if let error = error { deferred.reject(error) } else { @@ -92,14 +92,14 @@ public class UserAPI: APIBase { /** Creates list of users with given input array - - POST /user/createWithArray - parameter user: (body) List of user object (optional) + - POST /user/createWithArray - parameter body: (body) List of user object (optional) - returns: RequestBuilder */ - public class func createUsersWithArrayInputWithRequestBuilder(user user: [User]? = nil) -> RequestBuilder { + public class func createUsersWithArrayInputWithRequestBuilder(body body: [User]? = nil) -> RequestBuilder { let path = "/user/createWithArray" let URLString = PetstoreClientAPI.basePath + path - let parameters = user?.encodeToJSON() as? [String:AnyObject] + let parameters = body?.encodeToJSON() as? [String:AnyObject] let convertedParameters = APIHelper.convertBoolToString(parameters) @@ -111,11 +111,11 @@ public class UserAPI: APIBase { /** Creates list of users with given input array - - parameter user: (body) List of user object (optional) + - parameter body: (body) List of user object (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func createUsersWithListInput(user user: [User]? = nil, completion: ((error: ErrorType?) -> Void)) { - createUsersWithListInputWithRequestBuilder(user: user).execute { (response, error) -> Void in + public class func createUsersWithListInput(body body: [User]? = nil, completion: ((error: ErrorType?) -> Void)) { + createUsersWithListInputWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error: error); } } @@ -123,12 +123,12 @@ public class UserAPI: APIBase { /** Creates list of users with given input array - - parameter user: (body) List of user object (optional) + - parameter body: (body) List of user object (optional) - returns: Promise */ - public class func createUsersWithListInput(user user: [User]? = nil) -> Promise { + public class func createUsersWithListInput(body body: [User]? = nil) -> Promise { let deferred = Promise.pendingPromise() - createUsersWithListInput(user: user) { error in + createUsersWithListInput(body: body) { error in if let error = error { deferred.reject(error) } else { @@ -140,14 +140,14 @@ public class UserAPI: APIBase { /** Creates list of users with given input array - - POST /user/createWithList - parameter user: (body) List of user object (optional) + - POST /user/createWithList - parameter body: (body) List of user object (optional) - returns: RequestBuilder */ - public class func createUsersWithListInputWithRequestBuilder(user user: [User]? = nil) -> RequestBuilder { + public class func createUsersWithListInputWithRequestBuilder(body body: [User]? = nil) -> RequestBuilder { let path = "/user/createWithList" let URLString = PetstoreClientAPI.basePath + path - let parameters = user?.encodeToJSON() as? [String:AnyObject] + let parameters = body?.encodeToJSON() as? [String:AnyObject] let convertedParameters = APIHelper.convertBoolToString(parameters) @@ -250,7 +250,7 @@ public class UserAPI: APIBase { "id" : 0, "email" : "email", "username" : "username" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 aeiou aeiou @@ -259,7 +259,7 @@ public class UserAPI: APIBase { aeiou aeiou 123 -}] +, statusCode=200}] - examples: [{contentType=application/json, example={ "firstName" : "firstName", "lastName" : "lastName", @@ -269,7 +269,7 @@ public class UserAPI: APIBase { "id" : 0, "email" : "email", "username" : "username" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 aeiou aeiou @@ -278,7 +278,7 @@ public class UserAPI: APIBase { aeiou aeiou 123 -}] +, statusCode=200}] - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - returns: RequestBuilder @@ -408,11 +408,11 @@ public class UserAPI: APIBase { Updated user - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object (optional) + - parameter body: (body) Updated user object (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func updateUser(username username: String, user: User? = nil, completion: ((error: ErrorType?) -> Void)) { - updateUserWithRequestBuilder(username: username, user: user).execute { (response, error) -> Void in + public class func updateUser(username username: String, body: User? = nil, completion: ((error: ErrorType?) -> Void)) { + updateUserWithRequestBuilder(username: username, body: body).execute { (response, error) -> Void in completion(error: error); } } @@ -421,12 +421,12 @@ public class UserAPI: APIBase { Updated user - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object (optional) + - parameter body: (body) Updated user object (optional) - returns: Promise */ - public class func updateUser(username username: String, user: User? = nil) -> Promise { + public class func updateUser(username username: String, body: User? = nil) -> Promise { let deferred = Promise.pendingPromise() - updateUser(username: username, user: user) { error in + updateUser(username: username, body: body) { error in if let error = error { deferred.reject(error) } else { @@ -440,15 +440,15 @@ public class UserAPI: APIBase { Updated user - PUT /user/{username} - This can only be done by the logged in user. - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object (optional) + - parameter body: (body) Updated user object (optional) - returns: RequestBuilder */ - public class func updateUserWithRequestBuilder(username username: String, user: User? = nil) -> RequestBuilder { + public class func updateUserWithRequestBuilder(username username: String, body: User? = nil) -> RequestBuilder { var path = "/user/{username}" path = path.stringByReplacingOccurrencesOfString("{username}", withString: "\(username)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters = user?.encodeToJSON() as? [String:AnyObject] + let parameters = body?.encodeToJSON() as? [String:AnyObject] let convertedParameters = APIHelper.convertBoolToString(parameters) diff --git a/samples/client/petstore/swift/rxswift/.openapi-generator/VERSION b/samples/client/petstore/swift/rxswift/.openapi-generator/VERSION index 6d94c9c2e12a..83a328a9227e 100644 --- a/samples/client/petstore/swift/rxswift/.openapi-generator/VERSION +++ b/samples/client/petstore/swift/rxswift/.openapi-generator/VERSION @@ -1 +1 @@ -3.3.0-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index aa63567858cf..3ac74dad3240 100644 --- a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -14,11 +14,11 @@ public class PetAPI: APIBase { /** Add a new pet to the store - - parameter pet: (body) Pet object that needs to be added to the store (optional) + - parameter body: (body) Pet object that needs to be added to the store (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func addPet(pet pet: Pet? = nil, completion: ((error: ErrorType?) -> Void)) { - addPetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in + public class func addPet(body body: Pet? = nil, completion: ((error: ErrorType?) -> Void)) { + addPetWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error: error); } } @@ -26,12 +26,12 @@ public class PetAPI: APIBase { /** Add a new pet to the store - - parameter pet: (body) Pet object that needs to be added to the store (optional) + - parameter body: (body) Pet object that needs to be added to the store (optional) - returns: Observable */ - public class func addPet(pet pet: Pet? = nil) -> Observable { + public class func addPet(body body: Pet? = nil) -> Observable { return Observable.create { observer -> Disposable in - addPet(pet: pet) { error in + addPet(body: body) { error in if let error = error { observer.on(.Error(error as ErrorType)) } else { @@ -48,14 +48,14 @@ public class PetAPI: APIBase { - POST /pet - OAuth: - type: oauth2 - name: petstore_auth - - parameter pet: (body) Pet object that needs to be added to the store (optional) + - parameter body: (body) Pet object that needs to be added to the store (optional) - returns: RequestBuilder */ - public class func addPetWithRequestBuilder(pet pet: Pet? = nil) -> RequestBuilder { + public class func addPetWithRequestBuilder(body body: Pet? = nil) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = pet?.encodeToJSON() as? [String:AnyObject] + let parameters = body?.encodeToJSON() as? [String:AnyObject] let convertedParameters = APIHelper.convertBoolToString(parameters) @@ -182,7 +182,7 @@ public class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 doggie @@ -191,7 +191,7 @@ public class PetAPI: APIBase { aeiou -}] +, statusCode=200}] - examples: [{contentType=application/json, example={ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", @@ -208,7 +208,7 @@ public class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 doggie @@ -217,7 +217,7 @@ public class PetAPI: APIBase { aeiou -}] +, statusCode=200}] - parameter status: (query) Status values that need to be considered for filter (optional) - returns: RequestBuilder<[Pet]> @@ -293,7 +293,7 @@ public class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 doggie @@ -302,7 +302,7 @@ public class PetAPI: APIBase { aeiou -}] +, statusCode=200}] - examples: [{contentType=application/json, example={ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", @@ -319,7 +319,7 @@ public class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 doggie @@ -328,7 +328,7 @@ public class PetAPI: APIBase { aeiou -}] +, statusCode=200}] - parameter tags: (query) Tags to filter by (optional) - returns: RequestBuilder<[Pet]> @@ -407,7 +407,7 @@ public class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 doggie @@ -416,7 +416,7 @@ public class PetAPI: APIBase { aeiou -}] +, statusCode=200}] - examples: [{contentType=application/json, example={ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", @@ -433,7 +433,7 @@ public class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 doggie @@ -442,7 +442,7 @@ public class PetAPI: APIBase { aeiou -}] +, statusCode=200}] - parameter petId: (path) ID of pet that needs to be fetched - returns: RequestBuilder @@ -466,11 +466,11 @@ public class PetAPI: APIBase { /** Update an existing pet - - parameter pet: (body) Pet object that needs to be added to the store (optional) + - parameter body: (body) Pet object that needs to be added to the store (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func updatePet(pet pet: Pet? = nil, completion: ((error: ErrorType?) -> Void)) { - updatePetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in + public class func updatePet(body body: Pet? = nil, completion: ((error: ErrorType?) -> Void)) { + updatePetWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error: error); } } @@ -478,12 +478,12 @@ public class PetAPI: APIBase { /** Update an existing pet - - parameter pet: (body) Pet object that needs to be added to the store (optional) + - parameter body: (body) Pet object that needs to be added to the store (optional) - returns: Observable */ - public class func updatePet(pet pet: Pet? = nil) -> Observable { + public class func updatePet(body body: Pet? = nil) -> Observable { return Observable.create { observer -> Disposable in - updatePet(pet: pet) { error in + updatePet(body: body) { error in if let error = error { observer.on(.Error(error as ErrorType)) } else { @@ -500,14 +500,14 @@ public class PetAPI: APIBase { - PUT /pet - OAuth: - type: oauth2 - name: petstore_auth - - parameter pet: (body) Pet object that needs to be added to the store (optional) + - parameter body: (body) Pet object that needs to be added to the store (optional) - returns: RequestBuilder */ - public class func updatePetWithRequestBuilder(pet pet: Pet? = nil) -> RequestBuilder { + public class func updatePetWithRequestBuilder(body body: Pet? = nil) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = pet?.encodeToJSON() as? [String:AnyObject] + let parameters = body?.encodeToJSON() as? [String:AnyObject] let convertedParameters = APIHelper.convertBoolToString(parameters) diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 8e0a210ed7e9..42eafcf8e6b1 100644 --- a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -162,14 +162,14 @@ public class StoreAPI: APIBase { "shipDate" : "2000-01-23T04:56:07.000+00:00", "complete" : true, "status" : "placed" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true -}] +, statusCode=200}] - examples: [{contentType=application/json, example={ "petId" : 6, "quantity" : 1, @@ -177,14 +177,14 @@ public class StoreAPI: APIBase { "shipDate" : "2000-01-23T04:56:07.000+00:00", "complete" : true, "status" : "placed" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true -}] +, statusCode=200}] - parameter orderId: (path) ID of pet that needs to be fetched - returns: RequestBuilder @@ -208,11 +208,11 @@ public class StoreAPI: APIBase { /** Place an order for a pet - - parameter order: (body) order placed for purchasing the pet (optional) + - parameter body: (body) order placed for purchasing the pet (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func placeOrder(order order: Order? = nil, completion: ((data: Order?, error: ErrorType?) -> Void)) { - placeOrderWithRequestBuilder(order: order).execute { (response, error) -> Void in + public class func placeOrder(body body: Order? = nil, completion: ((data: Order?, error: ErrorType?) -> Void)) { + placeOrderWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(data: response?.body, error: error); } } @@ -220,12 +220,12 @@ public class StoreAPI: APIBase { /** Place an order for a pet - - parameter order: (body) order placed for purchasing the pet (optional) + - parameter body: (body) order placed for purchasing the pet (optional) - returns: Observable */ - public class func placeOrder(order order: Order? = nil) -> Observable { + public class func placeOrder(body body: Order? = nil) -> Observable { return Observable.create { observer -> Disposable in - placeOrder(order: order) { data, error in + placeOrder(body: body) { data, error in if let error = error { observer.on(.Error(error as ErrorType)) } else { @@ -246,14 +246,14 @@ public class StoreAPI: APIBase { "shipDate" : "2000-01-23T04:56:07.000+00:00", "complete" : true, "status" : "placed" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true -}] +, statusCode=200}] - examples: [{contentType=application/json, example={ "petId" : 6, "quantity" : 1, @@ -261,22 +261,22 @@ public class StoreAPI: APIBase { "shipDate" : "2000-01-23T04:56:07.000+00:00", "complete" : true, "status" : "placed" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true -}] - - parameter order: (body) order placed for purchasing the pet (optional) +, statusCode=200}] + - parameter body: (body) order placed for purchasing the pet (optional) - returns: RequestBuilder */ - public class func placeOrderWithRequestBuilder(order order: Order? = nil) -> RequestBuilder { + public class func placeOrderWithRequestBuilder(body body: Order? = nil) -> RequestBuilder { let path = "/store/order" let URLString = PetstoreClientAPI.basePath + path - let parameters = order?.encodeToJSON() as? [String:AnyObject] + let parameters = body?.encodeToJSON() as? [String:AnyObject] let convertedParameters = APIHelper.convertBoolToString(parameters) diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index a3a0e0b2d337..c0db2bfc8ea0 100644 --- a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -14,11 +14,11 @@ public class UserAPI: APIBase { /** Create user - - parameter user: (body) Created user object (optional) + - parameter body: (body) Created user object (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func createUser(user user: User? = nil, completion: ((error: ErrorType?) -> Void)) { - createUserWithRequestBuilder(user: user).execute { (response, error) -> Void in + public class func createUser(body body: User? = nil, completion: ((error: ErrorType?) -> Void)) { + createUserWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error: error); } } @@ -26,12 +26,12 @@ public class UserAPI: APIBase { /** Create user - - parameter user: (body) Created user object (optional) + - parameter body: (body) Created user object (optional) - returns: Observable */ - public class func createUser(user user: User? = nil) -> Observable { + public class func createUser(body body: User? = nil) -> Observable { return Observable.create { observer -> Disposable in - createUser(user: user) { error in + createUser(body: body) { error in if let error = error { observer.on(.Error(error as ErrorType)) } else { @@ -46,14 +46,14 @@ public class UserAPI: APIBase { /** Create user - POST /user - - This can only be done by the logged in user. - parameter user: (body) Created user object (optional) + - This can only be done by the logged in user. - parameter body: (body) Created user object (optional) - returns: RequestBuilder */ - public class func createUserWithRequestBuilder(user user: User? = nil) -> RequestBuilder { + public class func createUserWithRequestBuilder(body body: User? = nil) -> RequestBuilder { let path = "/user" let URLString = PetstoreClientAPI.basePath + path - let parameters = user?.encodeToJSON() as? [String:AnyObject] + let parameters = body?.encodeToJSON() as? [String:AnyObject] let convertedParameters = APIHelper.convertBoolToString(parameters) @@ -65,11 +65,11 @@ public class UserAPI: APIBase { /** Creates list of users with given input array - - parameter user: (body) List of user object (optional) + - parameter body: (body) List of user object (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func createUsersWithArrayInput(user user: [User]? = nil, completion: ((error: ErrorType?) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(user: user).execute { (response, error) -> Void in + public class func createUsersWithArrayInput(body body: [User]? = nil, completion: ((error: ErrorType?) -> Void)) { + createUsersWithArrayInputWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error: error); } } @@ -77,12 +77,12 @@ public class UserAPI: APIBase { /** Creates list of users with given input array - - parameter user: (body) List of user object (optional) + - parameter body: (body) List of user object (optional) - returns: Observable */ - public class func createUsersWithArrayInput(user user: [User]? = nil) -> Observable { + public class func createUsersWithArrayInput(body body: [User]? = nil) -> Observable { return Observable.create { observer -> Disposable in - createUsersWithArrayInput(user: user) { error in + createUsersWithArrayInput(body: body) { error in if let error = error { observer.on(.Error(error as ErrorType)) } else { @@ -96,14 +96,14 @@ public class UserAPI: APIBase { /** Creates list of users with given input array - - POST /user/createWithArray - parameter user: (body) List of user object (optional) + - POST /user/createWithArray - parameter body: (body) List of user object (optional) - returns: RequestBuilder */ - public class func createUsersWithArrayInputWithRequestBuilder(user user: [User]? = nil) -> RequestBuilder { + public class func createUsersWithArrayInputWithRequestBuilder(body body: [User]? = nil) -> RequestBuilder { let path = "/user/createWithArray" let URLString = PetstoreClientAPI.basePath + path - let parameters = user?.encodeToJSON() as? [String:AnyObject] + let parameters = body?.encodeToJSON() as? [String:AnyObject] let convertedParameters = APIHelper.convertBoolToString(parameters) @@ -115,11 +115,11 @@ public class UserAPI: APIBase { /** Creates list of users with given input array - - parameter user: (body) List of user object (optional) + - parameter body: (body) List of user object (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func createUsersWithListInput(user user: [User]? = nil, completion: ((error: ErrorType?) -> Void)) { - createUsersWithListInputWithRequestBuilder(user: user).execute { (response, error) -> Void in + public class func createUsersWithListInput(body body: [User]? = nil, completion: ((error: ErrorType?) -> Void)) { + createUsersWithListInputWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error: error); } } @@ -127,12 +127,12 @@ public class UserAPI: APIBase { /** Creates list of users with given input array - - parameter user: (body) List of user object (optional) + - parameter body: (body) List of user object (optional) - returns: Observable */ - public class func createUsersWithListInput(user user: [User]? = nil) -> Observable { + public class func createUsersWithListInput(body body: [User]? = nil) -> Observable { return Observable.create { observer -> Disposable in - createUsersWithListInput(user: user) { error in + createUsersWithListInput(body: body) { error in if let error = error { observer.on(.Error(error as ErrorType)) } else { @@ -146,14 +146,14 @@ public class UserAPI: APIBase { /** Creates list of users with given input array - - POST /user/createWithList - parameter user: (body) List of user object (optional) + - POST /user/createWithList - parameter body: (body) List of user object (optional) - returns: RequestBuilder */ - public class func createUsersWithListInputWithRequestBuilder(user user: [User]? = nil) -> RequestBuilder { + public class func createUsersWithListInputWithRequestBuilder(body body: [User]? = nil) -> RequestBuilder { let path = "/user/createWithList" let URLString = PetstoreClientAPI.basePath + path - let parameters = user?.encodeToJSON() as? [String:AnyObject] + let parameters = body?.encodeToJSON() as? [String:AnyObject] let convertedParameters = APIHelper.convertBoolToString(parameters) @@ -260,7 +260,7 @@ public class UserAPI: APIBase { "id" : 0, "email" : "email", "username" : "username" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 aeiou aeiou @@ -269,7 +269,7 @@ public class UserAPI: APIBase { aeiou aeiou 123 -}] +, statusCode=200}] - examples: [{contentType=application/json, example={ "firstName" : "firstName", "lastName" : "lastName", @@ -279,7 +279,7 @@ public class UserAPI: APIBase { "id" : 0, "email" : "email", "username" : "username" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 aeiou aeiou @@ -288,7 +288,7 @@ public class UserAPI: APIBase { aeiou aeiou 123 -}] +, statusCode=200}] - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - returns: RequestBuilder @@ -422,11 +422,11 @@ public class UserAPI: APIBase { Updated user - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object (optional) + - parameter body: (body) Updated user object (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func updateUser(username username: String, user: User? = nil, completion: ((error: ErrorType?) -> Void)) { - updateUserWithRequestBuilder(username: username, user: user).execute { (response, error) -> Void in + public class func updateUser(username username: String, body: User? = nil, completion: ((error: ErrorType?) -> Void)) { + updateUserWithRequestBuilder(username: username, body: body).execute { (response, error) -> Void in completion(error: error); } } @@ -435,12 +435,12 @@ public class UserAPI: APIBase { Updated user - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object (optional) + - parameter body: (body) Updated user object (optional) - returns: Observable */ - public class func updateUser(username username: String, user: User? = nil) -> Observable { + public class func updateUser(username username: String, body: User? = nil) -> Observable { return Observable.create { observer -> Disposable in - updateUser(username: username, user: user) { error in + updateUser(username: username, body: body) { error in if let error = error { observer.on(.Error(error as ErrorType)) } else { @@ -456,15 +456,15 @@ public class UserAPI: APIBase { Updated user - PUT /user/{username} - This can only be done by the logged in user. - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object (optional) + - parameter body: (body) Updated user object (optional) - returns: RequestBuilder */ - public class func updateUserWithRequestBuilder(username username: String, user: User? = nil) -> RequestBuilder { + public class func updateUserWithRequestBuilder(username username: String, body: User? = nil) -> RequestBuilder { var path = "/user/{username}" path = path.stringByReplacingOccurrencesOfString("{username}", withString: "\(username)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters = user?.encodeToJSON() as? [String:AnyObject] + let parameters = body?.encodeToJSON() as? [String:AnyObject] let convertedParameters = APIHelper.convertBoolToString(parameters) diff --git a/samples/client/petstore/swift3/default/.openapi-generator/VERSION b/samples/client/petstore/swift3/default/.openapi-generator/VERSION index 6d94c9c2e12a..83a328a9227e 100644 --- a/samples/client/petstore/swift3/default/.openapi-generator/VERSION +++ b/samples/client/petstore/swift3/default/.openapi-generator/VERSION @@ -1 +1 @@ -3.3.0-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index ea37e8c5966d..e95f9ab1efaf 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -12,11 +12,11 @@ import Alamofire open class AnotherFakeAPI: APIBase { /** To test special tags - - parameter client: (body) client model + - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testSpecialTags(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { - testSpecialTagsWithRequestBuilder(client: client).execute { (response, error) -> Void in + open class func call123testSpecialTags(body: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + call123testSpecialTagsWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -25,14 +25,14 @@ open class AnotherFakeAPI: APIBase { /** To test special tags - PATCH /another-fake/dummy - - To test special tags - - parameter client: (body) client model + - To test special tags and operation ID starting with number + - parameter body: (body) client model - returns: RequestBuilder */ - open class func testSpecialTagsWithRequestBuilder(client: Client) -> RequestBuilder { + open class func call123testSpecialTagsWithRequestBuilder(body: Client) -> RequestBuilder { let path = "/another-fake/dummy" let URLString = PetstoreClientAPI.basePath + path - let parameters = client.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index e44709f2459f..189479d0c386 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -40,11 +40,11 @@ open class FakeAPI: APIBase { } /** - - parameter outerComposite: (body) Input composite as post body (optional) + - parameter body: (body) Input composite as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterCompositeSerialize(outerComposite: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: ErrorResponse?) -> Void)) { - fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: outerComposite).execute { (response, error) -> Void in + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: ErrorResponse?) -> Void)) { + fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -53,13 +53,13 @@ open class FakeAPI: APIBase { /** - POST /fake/outer/composite - Test serialization of object with outer number type - - parameter outerComposite: (body) Input composite as post body (optional) + - parameter body: (body) Input composite as post body (optional) - returns: RequestBuilder */ - open class func fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: OuterComposite? = nil) -> RequestBuilder { + open class func fakeOuterCompositeSerializeWithRequestBuilder(body: OuterComposite? = nil) -> RequestBuilder { let path = "/fake/outer/composite" let URLString = PetstoreClientAPI.basePath + path - let parameters = outerComposite?.encodeToJSON() + let parameters = body?.encodeToJSON() let url = URLComponents(string: URLString) @@ -126,13 +126,75 @@ open class FakeAPI: APIBase { return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) } + /** + - parameter body: (body) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testBodyWithFileSchema(body: FileSchemaTestClass, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(error) + } + } + + + /** + - PUT /fake/body-with-file-schema + - For this test, the body for this request much reference a schema named `File`. + - parameter body: (body) + - returns: RequestBuilder + */ + open class func testBodyWithFileSchemaWithRequestBuilder(body: FileSchemaTestClass) -> RequestBuilder { + let path = "/fake/body-with-file-schema" + let URLString = PetstoreClientAPI.basePath + path + let parameters = body.encodeToJSON() + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + - parameter query: (query) + - parameter body: (body) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testBodyWithQueryParams(query: String, body: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (response, error) -> Void in + completion(error) + } + } + + + /** + - PUT /fake/body-with-query-params + - parameter query: (query) + - parameter body: (body) + - returns: RequestBuilder + */ + open class func testBodyWithQueryParamsWithRequestBuilder(query: String, body: User) -> RequestBuilder { + let path = "/fake/body-with-query-params" + let URLString = PetstoreClientAPI.basePath + path + let parameters = body.encodeToJSON() + + var url = URLComponents(string: URLString) + url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ + "query": query + ]) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + /** To test \"client\" model - - parameter client: (body) client model + - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testClientModel(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { - testClientModelWithRequestBuilder(client: client).execute { (response, error) -> Void in + open class func testClientModel(body: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testClientModelWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -142,13 +204,13 @@ open class FakeAPI: APIBase { To test \"client\" model - PATCH /fake - To test \"client\" model - - parameter client: (body) client model + - parameter body: (body) client model - returns: RequestBuilder */ - open class func testClientModelWithRequestBuilder(client: Client) -> RequestBuilder { + open class func testClientModelWithRequestBuilder(body: Client) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters = client.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -277,6 +339,14 @@ open class FakeAPI: APIBase { case number2 = -2 } + /** + * enum for parameter enumQueryDouble + */ + public enum EnumQueryDouble_testEnumParameters: Double { + case _11 = 1.1 + case number12 = -1.2 + } + /** * enum for parameter enumFormStringArray */ @@ -294,14 +364,6 @@ open class FakeAPI: APIBase { case xyz = "(xyz)" } - /** - * enum for parameter enumQueryDouble - */ - public enum EnumQueryDouble_testEnumParameters: Double { - case _11 = 1.1 - case number12 = -1.2 - } - /** To test enum parameters - parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional) @@ -309,13 +371,13 @@ open class FakeAPI: APIBase { - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) + - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) - parameter enumFormString: (form) Form parameter enum test (string) (optional) - - parameter enumQueryDouble: (form) Query parameter enum test (double) (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString, enumQueryDouble: enumQueryDouble).execute { (response, error) -> Void in + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (response, error) -> Void in completion(error) } } @@ -330,18 +392,17 @@ open class FakeAPI: APIBase { - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) + - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) - parameter enumFormString: (form) Form parameter enum test (string) (optional) - - parameter enumQueryDouble: (form) Query parameter enum test (double) (optional) - returns: RequestBuilder */ - open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil) -> RequestBuilder { + open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path let formParams: [String:Any?] = [ "enum_form_string_array": enumFormStringArray, - "enum_form_string": enumFormString?.rawValue, - "enum_query_double": enumQueryDouble?.rawValue + "enum_form_string": enumFormString?.rawValue ] let nonNullParameters = APIHelper.rejectNil(formParams) @@ -351,7 +412,8 @@ open class FakeAPI: APIBase { url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ "enum_query_string_array": enumQueryStringArray, "enum_query_string": enumQueryString?.rawValue, - "enum_query_integer": enumQueryInteger?.rawValue + "enum_query_integer": enumQueryInteger?.rawValue, + "enum_query_double": enumQueryDouble?.rawValue ]) let nillableHeaders: [String: Any?] = [ "enum_header_string_array": enumHeaderStringArray, @@ -364,6 +426,88 @@ open class FakeAPI: APIBase { return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) } + /** + Fake endpoint to test group parameters (optional) + - parameter requiredStringGroup: (query) Required String in group parameters + - parameter requiredBooleanGroup: (header) Required Boolean in group parameters + - parameter requiredInt64Group: (query) Required Integer in group parameters + - parameter stringGroup: (query) String in group parameters (optional) + - parameter booleanGroup: (header) Boolean in group parameters (optional) + - parameter int64Group: (query) Integer in group parameters (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testGroupParameters(requiredStringGroup: Int32, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int32? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (response, error) -> Void in + completion(error) + } + } + + + /** + Fake endpoint to test group parameters (optional) + - DELETE /fake + - Fake endpoint to test group parameters (optional) + - parameter requiredStringGroup: (query) Required String in group parameters + - parameter requiredBooleanGroup: (header) Required Boolean in group parameters + - parameter requiredInt64Group: (query) Required Integer in group parameters + - parameter stringGroup: (query) String in group parameters (optional) + - parameter booleanGroup: (header) Boolean in group parameters (optional) + - parameter int64Group: (query) Integer in group parameters (optional) + - returns: RequestBuilder + */ + open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int32, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int32? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { + let path = "/fake" + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + var url = URLComponents(string: URLString) + url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), + "int64_group": int64Group?.encodeToJSON() + ]) + let nillableHeaders: [String: Any?] = [ + "required_boolean_group": requiredBooleanGroup, + "boolean_group": booleanGroup + ] + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) + } + + /** + test inline additionalProperties + - parameter param: (body) request body + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testInlineAdditionalProperties(param: [String:String], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (response, error) -> Void in + completion(error) + } + } + + + /** + test inline additionalProperties + - POST /fake/inline-additionalProperties + - parameter param: (body) request body + - returns: RequestBuilder + */ + open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { + let path = "/fake/inline-additionalProperties" + let URLString = PetstoreClientAPI.basePath + path + let parameters = param.encodeToJSON() + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + /** test json serialization of form data - parameter param: (form) field1 diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 20514a3b6e6b..79a28854094c 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -12,11 +12,11 @@ import Alamofire open class FakeClassnameTags123API: APIBase { /** To test class name in snake case - - parameter client: (body) client model + - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testClassname(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { - testClassnameWithRequestBuilder(client: client).execute { (response, error) -> Void in + open class func testClassname(body: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testClassnameWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -29,13 +29,13 @@ open class FakeClassnameTags123API: APIBase { - API Key: - type: apiKey api_key_query (QUERY) - name: api_key_query - - parameter client: (body) client model + - parameter body: (body) client model - returns: RequestBuilder */ - open class func testClassnameWithRequestBuilder(client: Client) -> RequestBuilder { + open class func testClassnameWithRequestBuilder(body: Client) -> RequestBuilder { let path = "/fake_classname_test" let URLString = PetstoreClientAPI.basePath + path - let parameters = client.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 8648214c7309..495468f63e35 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -12,11 +12,11 @@ import Alamofire open class PetAPI: APIBase { /** Add a new pet to the store - - parameter pet: (body) Pet object that needs to be added to the store + - parameter body: (body) Pet object that needs to be added to the store - parameter completion: completion handler to receive the data and the error objects */ - open class func addPet(pet: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - addPetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in + open class func addPet(body: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + addPetWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error) } } @@ -28,13 +28,13 @@ open class PetAPI: APIBase { - OAuth: - type: oauth2 - name: petstore_auth - - parameter pet: (body) Pet object that needs to be added to the store + - parameter body: (body) Pet object that needs to be added to the store - returns: RequestBuilder */ - open class func addPetWithRequestBuilder(pet: Pet) -> RequestBuilder { + open class func addPetWithRequestBuilder(body: Pet) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = pet.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -207,11 +207,11 @@ open class PetAPI: APIBase { /** Update an existing pet - - parameter pet: (body) Pet object that needs to be added to the store + - parameter body: (body) Pet object that needs to be added to the store - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePet(pet: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - updatePetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in + open class func updatePet(body: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + updatePetWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error) } } @@ -223,13 +223,13 @@ open class PetAPI: APIBase { - OAuth: - type: oauth2 - name: petstore_auth - - parameter pet: (body) Pet object that needs to be added to the store + - parameter body: (body) Pet object that needs to be added to the store - returns: RequestBuilder */ - open class func updatePetWithRequestBuilder(pet: Pet) -> RequestBuilder { + open class func updatePetWithRequestBuilder(body: Pet) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = pet.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -330,4 +330,50 @@ open class PetAPI: APIBase { return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } + /** + uploads an image (required) + - parameter petId: (path) ID of pet to update + - parameter requiredFile: (form) file to upload + - parameter additionalMetadata: (form) Additional data to pass to server (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, completion: @escaping ((_ data: ApiResponse?, _ error: ErrorResponse?) -> Void)) { + uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + + /** + uploads an image (required) + - POST /fake/{petId}/uploadImageWithRequiredFile + - OAuth: + - type: oauth2 + - name: petstore_auth + - parameter petId: (path) ID of pet to update + - parameter requiredFile: (form) file to upload + - parameter additionalMetadata: (form) Additional data to pass to server (optional) + - returns: RequestBuilder + */ + open class func uploadFileWithRequiredFileWithRequestBuilder(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil) -> RequestBuilder { + var path = "/fake/{petId}/uploadImageWithRequiredFile" + let petIdPreEscape = "\(petId)" + let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let formParams: [String:Any?] = [ + "additionalMetadata": additionalMetadata, + "requiredFile": requiredFile + ] + + let nonNullParameters = APIHelper.rejectNil(formParams) + let parameters = APIHelper.convertBoolToString(nonNullParameters) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + } diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 66dbd6f25d8c..84cea5213bab 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -112,11 +112,11 @@ open class StoreAPI: APIBase { /** Place an order for a pet - - parameter order: (body) order placed for purchasing the pet + - parameter body: (body) order placed for purchasing the pet - parameter completion: completion handler to receive the data and the error objects */ - open class func placeOrder(order: Order, completion: @escaping ((_ data: Order?, _ error: ErrorResponse?) -> Void)) { - placeOrderWithRequestBuilder(order: order).execute { (response, error) -> Void in + open class func placeOrder(body: Order, completion: @escaping ((_ data: Order?, _ error: ErrorResponse?) -> Void)) { + placeOrderWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -125,13 +125,13 @@ open class StoreAPI: APIBase { /** Place an order for a pet - POST /store/order - - parameter order: (body) order placed for purchasing the pet + - parameter body: (body) order placed for purchasing the pet - returns: RequestBuilder */ - open class func placeOrderWithRequestBuilder(order: Order) -> RequestBuilder { + open class func placeOrderWithRequestBuilder(body: Order) -> RequestBuilder { let path = "/store/order" let URLString = PetstoreClientAPI.basePath + path - let parameters = order.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index eee28ea249ac..7abdf0b76cd7 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -12,11 +12,11 @@ import Alamofire open class UserAPI: APIBase { /** Create user - - parameter user: (body) Created user object + - parameter body: (body) Created user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUser(user: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - createUserWithRequestBuilder(user: user).execute { (response, error) -> Void in + open class func createUser(body: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUserWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error) } } @@ -26,13 +26,13 @@ open class UserAPI: APIBase { Create user - POST /user - This can only be done by the logged in user. - - parameter user: (body) Created user object + - parameter body: (body) Created user object - returns: RequestBuilder */ - open class func createUserWithRequestBuilder(user: User) -> RequestBuilder { + open class func createUserWithRequestBuilder(body: User) -> RequestBuilder { let path = "/user" let URLString = PetstoreClientAPI.basePath + path - let parameters = user.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -43,11 +43,11 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - - parameter user: (body) List of user object + - parameter body: (body) List of user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithArrayInput(user: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(user: user).execute { (response, error) -> Void in + open class func createUsersWithArrayInput(body: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUsersWithArrayInputWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error) } } @@ -56,13 +56,13 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - POST /user/createWithArray - - parameter user: (body) List of user object + - parameter body: (body) List of user object - returns: RequestBuilder */ - open class func createUsersWithArrayInputWithRequestBuilder(user: [User]) -> RequestBuilder { + open class func createUsersWithArrayInputWithRequestBuilder(body: [User]) -> RequestBuilder { let path = "/user/createWithArray" let URLString = PetstoreClientAPI.basePath + path - let parameters = user.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -73,11 +73,11 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - - parameter user: (body) List of user object + - parameter body: (body) List of user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithListInput(user: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - createUsersWithListInputWithRequestBuilder(user: user).execute { (response, error) -> Void in + open class func createUsersWithListInput(body: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUsersWithListInputWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error) } } @@ -86,13 +86,13 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - POST /user/createWithList - - parameter user: (body) List of user object + - parameter body: (body) List of user object - returns: RequestBuilder */ - open class func createUsersWithListInputWithRequestBuilder(user: [User]) -> RequestBuilder { + open class func createUsersWithListInputWithRequestBuilder(body: [User]) -> RequestBuilder { let path = "/user/createWithList" let URLString = PetstoreClientAPI.basePath + path - let parameters = user.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -137,7 +137,7 @@ open class UserAPI: APIBase { /** Get user by user name - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. + - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - parameter completion: completion handler to receive the data and the error objects */ open class func getUserByName(username: String, completion: @escaping ((_ data: User?, _ error: ErrorResponse?) -> Void)) { @@ -150,7 +150,7 @@ open class UserAPI: APIBase { /** Get user by user name - GET /user/{username} - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. + - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - returns: RequestBuilder */ open class func getUserByNameWithRequestBuilder(username: String) -> RequestBuilder { @@ -236,11 +236,11 @@ open class UserAPI: APIBase { /** Updated user - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object + - parameter body: (body) Updated user object - parameter completion: completion handler to receive the data and the error objects */ - open class func updateUser(username: String, user: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - updateUserWithRequestBuilder(username: username, user: user).execute { (response, error) -> Void in + open class func updateUser(username: String, body: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + updateUserWithRequestBuilder(username: username, body: body).execute { (response, error) -> Void in completion(error) } } @@ -251,16 +251,16 @@ open class UserAPI: APIBase { - PUT /user/{username} - This can only be done by the logged in user. - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object + - parameter body: (body) Updated user object - returns: RequestBuilder */ - open class func updateUserWithRequestBuilder(username: String, user: User) -> RequestBuilder { + open class func updateUserWithRequestBuilder(username: String, body: User) -> RequestBuilder { var path = "/user/{username}" let usernamePreEscape = "\(username)" let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters = user.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models.swift index d1465fe4cbe4..264241b7d139 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -297,15 +297,15 @@ class Decoders { Decoders.addDecoder(clazz: AdditionalPropertiesClass.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in if let sourceDictionary = source as? [AnyHashable: Any] { let _result = instance == nil ? AdditionalPropertiesClass() : instance as! AdditionalPropertiesClass - switch Decoders.decodeOptional(clazz: [String:String].self, source: sourceDictionary["map_property"] as AnyObject?) { + switch Decoders.decodeOptional(clazz: [String:String].self, source: sourceDictionary["map_string"] as AnyObject?) { - case let .success(value): _result.mapProperty = value + case let .success(value): _result.mapString = value case let .failure(error): break } - switch Decoders.decodeOptional(clazz: [String:[String:String]].self, source: sourceDictionary["map_of_map_property"] as AnyObject?) { + switch Decoders.decodeOptional(clazz: [String:[String:String]].self, source: sourceDictionary["map_map_string"] as AnyObject?) { - case let .success(value): _result.mapOfMapProperty = value + case let .success(value): _result.mapMapString = value case let .failure(error): break } @@ -533,6 +533,26 @@ class Decoders { return .failure(.typeMismatch(expected: "Cat", actual: "\(source)")) } } + // Decoder for [CatAllOf] + Decoders.addDecoder(clazz: [CatAllOf].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[CatAllOf]> in + return Decoders.decode(clazz: [CatAllOf].self, source: source) + } + + // Decoder for CatAllOf + Decoders.addDecoder(clazz: CatAllOf.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = instance == nil ? CatAllOf() : instance as! CatAllOf + switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["declawed"] as AnyObject?) { + + case let .success(value): _result.declawed = value + case let .failure(error): break + + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "CatAllOf", actual: "\(source)")) + } + } // Decoder for [Category] Decoders.addDecoder(clazz: [Category].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Category]> in return Decoders.decode(clazz: [Category].self, source: source) @@ -634,6 +654,26 @@ class Decoders { return .failure(.typeMismatch(expected: "Dog", actual: "\(source)")) } } + // Decoder for [DogAllOf] + Decoders.addDecoder(clazz: [DogAllOf].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[DogAllOf]> in + return Decoders.decode(clazz: [DogAllOf].self, source: source) + } + + // Decoder for DogAllOf + Decoders.addDecoder(clazz: DogAllOf.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = instance == nil ? DogAllOf() : instance as! DogAllOf + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["breed"] as AnyObject?) { + + case let .success(value): _result.breed = value + case let .failure(error): break + + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "DogAllOf", actual: "\(source)")) + } + } // Decoder for [EnumArrays] Decoders.addDecoder(clazz: [EnumArrays].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[EnumArrays]> in return Decoders.decode(clazz: [EnumArrays].self, source: source) @@ -684,6 +724,12 @@ class Decoders { case let .success(value): _result.enumString = value case let .failure(error): break + } + switch Decoders.decodeOptional(clazz: EnumTest.EnumStringRequired.self, source: sourceDictionary["enum_string_required"] as AnyObject?) { + + case let .success(value): _result.enumStringRequired = value + case let .failure(error): break + } switch Decoders.decodeOptional(clazz: EnumTest.EnumInteger.self, source: sourceDictionary["enum_integer"] as AnyObject?) { @@ -708,6 +754,52 @@ class Decoders { return .failure(.typeMismatch(expected: "EnumTest", actual: "\(source)")) } } + // Decoder for [File] + Decoders.addDecoder(clazz: [File].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[File]> in + return Decoders.decode(clazz: [File].self, source: source) + } + + // Decoder for File + Decoders.addDecoder(clazz: File.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = instance == nil ? File() : instance as! File + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["sourceURI"] as AnyObject?) { + + case let .success(value): _result.sourceURI = value + case let .failure(error): break + + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "File", actual: "\(source)")) + } + } + // Decoder for [FileSchemaTestClass] + Decoders.addDecoder(clazz: [FileSchemaTestClass].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[FileSchemaTestClass]> in + return Decoders.decode(clazz: [FileSchemaTestClass].self, source: source) + } + + // Decoder for FileSchemaTestClass + Decoders.addDecoder(clazz: FileSchemaTestClass.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = instance == nil ? FileSchemaTestClass() : instance as! FileSchemaTestClass + switch Decoders.decodeOptional(clazz: File.self, source: sourceDictionary["file"] as AnyObject?) { + + case let .success(value): _result.file = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: [File].self, source: sourceDictionary["files"] as AnyObject?) { + + case let .success(value): _result.files = value + case let .failure(error): break + + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "FileSchemaTestClass", actual: "\(source)")) + } + } // Decoder for [FormatTest] Decoders.addDecoder(clazz: [FormatTest].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[FormatTest]> in return Decoders.decode(clazz: [FormatTest].self, source: source) @@ -866,6 +958,18 @@ class Decoders { case let .success(value): _result.mapOfEnumString = value case let .failure(error): break */ default: break //TODO: handle enum map scenario + } + switch Decoders.decodeOptional(clazz: [String:Bool].self, source: sourceDictionary["direct_map"] as AnyObject?) { + + case let .success(value): _result.directMap = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: [String:Bool].self, source: sourceDictionary["indirect_map"] as AnyObject?) { + + case let .success(value): _result.indirectMap = value + case let .failure(error): break + } return .success(_result) } else { @@ -1222,6 +1326,94 @@ class Decoders { return .failure(.typeMismatch(expected: "Tag", actual: "\(source)")) } } + // Decoder for [TypeHolderDefault] + Decoders.addDecoder(clazz: [TypeHolderDefault].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[TypeHolderDefault]> in + return Decoders.decode(clazz: [TypeHolderDefault].self, source: source) + } + + // Decoder for TypeHolderDefault + Decoders.addDecoder(clazz: TypeHolderDefault.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = instance == nil ? TypeHolderDefault() : instance as! TypeHolderDefault + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["string_item"] as AnyObject?) { + + case let .success(value): _result.stringItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: Double.self, source: sourceDictionary["number_item"] as AnyObject?) { + + case let .success(value): _result.numberItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["integer_item"] as AnyObject?) { + + case let .success(value): _result.integerItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["bool_item"] as AnyObject?) { + + case let .success(value): _result.boolItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: [Int32].self, source: sourceDictionary["array_item"] as AnyObject?) { + + case let .success(value): _result.arrayItem = value + case let .failure(error): break + + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "TypeHolderDefault", actual: "\(source)")) + } + } + // Decoder for [TypeHolderExample] + Decoders.addDecoder(clazz: [TypeHolderExample].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[TypeHolderExample]> in + return Decoders.decode(clazz: [TypeHolderExample].self, source: source) + } + + // Decoder for TypeHolderExample + Decoders.addDecoder(clazz: TypeHolderExample.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = instance == nil ? TypeHolderExample() : instance as! TypeHolderExample + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["string_item"] as AnyObject?) { + + case let .success(value): _result.stringItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: Double.self, source: sourceDictionary["number_item"] as AnyObject?) { + + case let .success(value): _result.numberItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["integer_item"] as AnyObject?) { + + case let .success(value): _result.integerItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["bool_item"] as AnyObject?) { + + case let .success(value): _result.boolItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: [Int32].self, source: sourceDictionary["array_item"] as AnyObject?) { + + case let .success(value): _result.arrayItem = value + case let .failure(error): break + + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "TypeHolderExample", actual: "\(source)")) + } + } // Decoder for [User] Decoders.addDecoder(clazz: [User].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[User]> in return Decoders.decode(clazz: [User].self, source: source) diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 48724b45a3d2..18238c78e35e 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -10,16 +10,16 @@ import Foundation open class AdditionalPropertiesClass: JSONEncodable { - public var mapProperty: [String:String]? - public var mapOfMapProperty: [String:[String:String]]? + public var mapString: [String:String]? + public var mapMapString: [String:[String:String]]? public init() {} // MARK: JSONEncodable open func encodeToJSON() -> Any { var nillableDictionary = [String:Any?]() - nillableDictionary["map_property"] = self.mapProperty?.encodeToJSON() - nillableDictionary["map_of_map_property"] = self.mapOfMapProperty?.encodeToJSON() + nillableDictionary["map_string"] = self.mapString?.encodeToJSON() + nillableDictionary["map_map_string"] = self.mapMapString?.encodeToJSON() let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift new file mode 100644 index 000000000000..4e59d9d26591 --- /dev/null +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -0,0 +1,26 @@ +// +// CatAllOf.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +open class CatAllOf: JSONEncodable { + + public var declawed: Bool? + + public init() {} + + // MARK: JSONEncodable + open func encodeToJSON() -> Any { + var nillableDictionary = [String:Any?]() + nillableDictionary["declawed"] = self.declawed + + let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] + return dictionary + } +} + diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift new file mode 100644 index 000000000000..6deb04c034e9 --- /dev/null +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -0,0 +1,26 @@ +// +// DogAllOf.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +open class DogAllOf: JSONEncodable { + + public var breed: String? + + public init() {} + + // MARK: JSONEncodable + open func encodeToJSON() -> Any { + var nillableDictionary = [String:Any?]() + nillableDictionary["breed"] = self.breed + + let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] + return dictionary + } +} + diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 59c0660b900d..0478bff2d394 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -15,6 +15,11 @@ open class EnumTest: JSONEncodable { case lower = "lower" case empty = "" } + public enum EnumStringRequired: String { + case upper = "UPPER" + case lower = "lower" + case empty = "" + } public enum EnumInteger: Int32 { case _1 = 1 case number1 = -1 @@ -24,6 +29,7 @@ open class EnumTest: JSONEncodable { case number12 = -1.2 } public var enumString: EnumString? + public var enumStringRequired: EnumStringRequired? public var enumInteger: EnumInteger? public var enumNumber: EnumNumber? public var outerEnum: OuterEnum? @@ -34,6 +40,7 @@ open class EnumTest: JSONEncodable { open func encodeToJSON() -> Any { var nillableDictionary = [String:Any?]() nillableDictionary["enum_string"] = self.enumString?.rawValue + nillableDictionary["enum_string_required"] = self.enumStringRequired?.rawValue nillableDictionary["enum_integer"] = self.enumInteger?.rawValue nillableDictionary["enum_number"] = self.enumNumber?.rawValue nillableDictionary["outerEnum"] = self.outerEnum?.encodeToJSON() diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/File.swift new file mode 100644 index 000000000000..86c8c66e9a4c --- /dev/null +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -0,0 +1,28 @@ +// +// File.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +/** Must be named `File` for test. */ +open class File: JSONEncodable { + + /** Test capitalization */ + public var sourceURI: String? + + public init() {} + + // MARK: JSONEncodable + open func encodeToJSON() -> Any { + var nillableDictionary = [String:Any?]() + nillableDictionary["sourceURI"] = self.sourceURI + + let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] + return dictionary + } +} + diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift new file mode 100644 index 000000000000..7cfb65481058 --- /dev/null +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -0,0 +1,28 @@ +// +// FileSchemaTestClass.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +open class FileSchemaTestClass: JSONEncodable { + + public var file: File? + public var files: [File]? + + public init() {} + + // MARK: JSONEncodable + open func encodeToJSON() -> Any { + var nillableDictionary = [String:Any?]() + nillableDictionary["file"] = self.file?.encodeToJSON() + nillableDictionary["files"] = self.files?.encodeToJSON() + + let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] + return dictionary + } +} + diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 7b6af62b0576..bbc87e81cc75 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -16,6 +16,8 @@ open class MapTest: JSONEncodable { } public var mapMapOfString: [String:[String:String]]? public var mapOfEnumString: [String:String]? + public var directMap: [String:Bool]? + public var indirectMap: [String:Bool]? public init() {} @@ -23,6 +25,8 @@ open class MapTest: JSONEncodable { open func encodeToJSON() -> Any { var nillableDictionary = [String:Any?]() nillableDictionary["map_map_of_string"] = self.mapMapOfString?.encodeToJSON()//TODO: handle enum map scenario + nillableDictionary["direct_map"] = self.directMap?.encodeToJSON() + nillableDictionary["indirect_map"] = self.indirectMap?.encodeToJSON() let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift new file mode 100644 index 000000000000..787c1ad682be --- /dev/null +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -0,0 +1,34 @@ +// +// TypeHolderDefault.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +open class TypeHolderDefault: JSONEncodable { + + public var stringItem: String? + public var numberItem: Double? + public var integerItem: Int32? + public var boolItem: Bool? + public var arrayItem: [Int32]? + + public init() {} + + // MARK: JSONEncodable + open func encodeToJSON() -> Any { + var nillableDictionary = [String:Any?]() + nillableDictionary["string_item"] = self.stringItem + nillableDictionary["number_item"] = self.numberItem + nillableDictionary["integer_item"] = self.integerItem?.encodeToJSON() + nillableDictionary["bool_item"] = self.boolItem + nillableDictionary["array_item"] = self.arrayItem?.encodeToJSON() + + let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] + return dictionary + } +} + diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift new file mode 100644 index 000000000000..5edab128d2b9 --- /dev/null +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -0,0 +1,34 @@ +// +// TypeHolderExample.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +open class TypeHolderExample: JSONEncodable { + + public var stringItem: String? + public var numberItem: Double? + public var integerItem: Int32? + public var boolItem: Bool? + public var arrayItem: [Int32]? + + public init() {} + + // MARK: JSONEncodable + open func encodeToJSON() -> Any { + var nillableDictionary = [String:Any?]() + nillableDictionary["string_item"] = self.stringItem + nillableDictionary["number_item"] = self.numberItem + nillableDictionary["integer_item"] = self.integerItem?.encodeToJSON() + nillableDictionary["bool_item"] = self.boolItem + nillableDictionary["array_item"] = self.arrayItem?.encodeToJSON() + + let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] + return dictionary + } +} + diff --git a/samples/client/petstore/swift3/objcCompatible/.openapi-generator/VERSION b/samples/client/petstore/swift3/objcCompatible/.openapi-generator/VERSION index 6d94c9c2e12a..83a328a9227e 100644 --- a/samples/client/petstore/swift3/objcCompatible/.openapi-generator/VERSION +++ b/samples/client/petstore/swift3/objcCompatible/.openapi-generator/VERSION @@ -1 +1 @@ -3.3.0-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index ea37e8c5966d..e95f9ab1efaf 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -12,11 +12,11 @@ import Alamofire open class AnotherFakeAPI: APIBase { /** To test special tags - - parameter client: (body) client model + - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testSpecialTags(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { - testSpecialTagsWithRequestBuilder(client: client).execute { (response, error) -> Void in + open class func call123testSpecialTags(body: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + call123testSpecialTagsWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -25,14 +25,14 @@ open class AnotherFakeAPI: APIBase { /** To test special tags - PATCH /another-fake/dummy - - To test special tags - - parameter client: (body) client model + - To test special tags and operation ID starting with number + - parameter body: (body) client model - returns: RequestBuilder */ - open class func testSpecialTagsWithRequestBuilder(client: Client) -> RequestBuilder { + open class func call123testSpecialTagsWithRequestBuilder(body: Client) -> RequestBuilder { let path = "/another-fake/dummy" let URLString = PetstoreClientAPI.basePath + path - let parameters = client.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index e44709f2459f..189479d0c386 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -40,11 +40,11 @@ open class FakeAPI: APIBase { } /** - - parameter outerComposite: (body) Input composite as post body (optional) + - parameter body: (body) Input composite as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterCompositeSerialize(outerComposite: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: ErrorResponse?) -> Void)) { - fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: outerComposite).execute { (response, error) -> Void in + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: ErrorResponse?) -> Void)) { + fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -53,13 +53,13 @@ open class FakeAPI: APIBase { /** - POST /fake/outer/composite - Test serialization of object with outer number type - - parameter outerComposite: (body) Input composite as post body (optional) + - parameter body: (body) Input composite as post body (optional) - returns: RequestBuilder */ - open class func fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: OuterComposite? = nil) -> RequestBuilder { + open class func fakeOuterCompositeSerializeWithRequestBuilder(body: OuterComposite? = nil) -> RequestBuilder { let path = "/fake/outer/composite" let URLString = PetstoreClientAPI.basePath + path - let parameters = outerComposite?.encodeToJSON() + let parameters = body?.encodeToJSON() let url = URLComponents(string: URLString) @@ -126,13 +126,75 @@ open class FakeAPI: APIBase { return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) } + /** + - parameter body: (body) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testBodyWithFileSchema(body: FileSchemaTestClass, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(error) + } + } + + + /** + - PUT /fake/body-with-file-schema + - For this test, the body for this request much reference a schema named `File`. + - parameter body: (body) + - returns: RequestBuilder + */ + open class func testBodyWithFileSchemaWithRequestBuilder(body: FileSchemaTestClass) -> RequestBuilder { + let path = "/fake/body-with-file-schema" + let URLString = PetstoreClientAPI.basePath + path + let parameters = body.encodeToJSON() + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + - parameter query: (query) + - parameter body: (body) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testBodyWithQueryParams(query: String, body: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (response, error) -> Void in + completion(error) + } + } + + + /** + - PUT /fake/body-with-query-params + - parameter query: (query) + - parameter body: (body) + - returns: RequestBuilder + */ + open class func testBodyWithQueryParamsWithRequestBuilder(query: String, body: User) -> RequestBuilder { + let path = "/fake/body-with-query-params" + let URLString = PetstoreClientAPI.basePath + path + let parameters = body.encodeToJSON() + + var url = URLComponents(string: URLString) + url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ + "query": query + ]) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + /** To test \"client\" model - - parameter client: (body) client model + - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testClientModel(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { - testClientModelWithRequestBuilder(client: client).execute { (response, error) -> Void in + open class func testClientModel(body: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testClientModelWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -142,13 +204,13 @@ open class FakeAPI: APIBase { To test \"client\" model - PATCH /fake - To test \"client\" model - - parameter client: (body) client model + - parameter body: (body) client model - returns: RequestBuilder */ - open class func testClientModelWithRequestBuilder(client: Client) -> RequestBuilder { + open class func testClientModelWithRequestBuilder(body: Client) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters = client.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -277,6 +339,14 @@ open class FakeAPI: APIBase { case number2 = -2 } + /** + * enum for parameter enumQueryDouble + */ + public enum EnumQueryDouble_testEnumParameters: Double { + case _11 = 1.1 + case number12 = -1.2 + } + /** * enum for parameter enumFormStringArray */ @@ -294,14 +364,6 @@ open class FakeAPI: APIBase { case xyz = "(xyz)" } - /** - * enum for parameter enumQueryDouble - */ - public enum EnumQueryDouble_testEnumParameters: Double { - case _11 = 1.1 - case number12 = -1.2 - } - /** To test enum parameters - parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional) @@ -309,13 +371,13 @@ open class FakeAPI: APIBase { - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) + - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) - parameter enumFormString: (form) Form parameter enum test (string) (optional) - - parameter enumQueryDouble: (form) Query parameter enum test (double) (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString, enumQueryDouble: enumQueryDouble).execute { (response, error) -> Void in + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (response, error) -> Void in completion(error) } } @@ -330,18 +392,17 @@ open class FakeAPI: APIBase { - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) + - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) - parameter enumFormString: (form) Form parameter enum test (string) (optional) - - parameter enumQueryDouble: (form) Query parameter enum test (double) (optional) - returns: RequestBuilder */ - open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil) -> RequestBuilder { + open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path let formParams: [String:Any?] = [ "enum_form_string_array": enumFormStringArray, - "enum_form_string": enumFormString?.rawValue, - "enum_query_double": enumQueryDouble?.rawValue + "enum_form_string": enumFormString?.rawValue ] let nonNullParameters = APIHelper.rejectNil(formParams) @@ -351,7 +412,8 @@ open class FakeAPI: APIBase { url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ "enum_query_string_array": enumQueryStringArray, "enum_query_string": enumQueryString?.rawValue, - "enum_query_integer": enumQueryInteger?.rawValue + "enum_query_integer": enumQueryInteger?.rawValue, + "enum_query_double": enumQueryDouble?.rawValue ]) let nillableHeaders: [String: Any?] = [ "enum_header_string_array": enumHeaderStringArray, @@ -364,6 +426,88 @@ open class FakeAPI: APIBase { return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) } + /** + Fake endpoint to test group parameters (optional) + - parameter requiredStringGroup: (query) Required String in group parameters + - parameter requiredBooleanGroup: (header) Required Boolean in group parameters + - parameter requiredInt64Group: (query) Required Integer in group parameters + - parameter stringGroup: (query) String in group parameters (optional) + - parameter booleanGroup: (header) Boolean in group parameters (optional) + - parameter int64Group: (query) Integer in group parameters (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testGroupParameters(requiredStringGroup: Int32, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int32? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (response, error) -> Void in + completion(error) + } + } + + + /** + Fake endpoint to test group parameters (optional) + - DELETE /fake + - Fake endpoint to test group parameters (optional) + - parameter requiredStringGroup: (query) Required String in group parameters + - parameter requiredBooleanGroup: (header) Required Boolean in group parameters + - parameter requiredInt64Group: (query) Required Integer in group parameters + - parameter stringGroup: (query) String in group parameters (optional) + - parameter booleanGroup: (header) Boolean in group parameters (optional) + - parameter int64Group: (query) Integer in group parameters (optional) + - returns: RequestBuilder + */ + open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int32, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int32? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { + let path = "/fake" + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + var url = URLComponents(string: URLString) + url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), + "int64_group": int64Group?.encodeToJSON() + ]) + let nillableHeaders: [String: Any?] = [ + "required_boolean_group": requiredBooleanGroup, + "boolean_group": booleanGroup + ] + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) + } + + /** + test inline additionalProperties + - parameter param: (body) request body + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testInlineAdditionalProperties(param: [String:String], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (response, error) -> Void in + completion(error) + } + } + + + /** + test inline additionalProperties + - POST /fake/inline-additionalProperties + - parameter param: (body) request body + - returns: RequestBuilder + */ + open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { + let path = "/fake/inline-additionalProperties" + let URLString = PetstoreClientAPI.basePath + path + let parameters = param.encodeToJSON() + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + /** test json serialization of form data - parameter param: (form) field1 diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 20514a3b6e6b..79a28854094c 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -12,11 +12,11 @@ import Alamofire open class FakeClassnameTags123API: APIBase { /** To test class name in snake case - - parameter client: (body) client model + - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testClassname(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { - testClassnameWithRequestBuilder(client: client).execute { (response, error) -> Void in + open class func testClassname(body: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testClassnameWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -29,13 +29,13 @@ open class FakeClassnameTags123API: APIBase { - API Key: - type: apiKey api_key_query (QUERY) - name: api_key_query - - parameter client: (body) client model + - parameter body: (body) client model - returns: RequestBuilder */ - open class func testClassnameWithRequestBuilder(client: Client) -> RequestBuilder { + open class func testClassnameWithRequestBuilder(body: Client) -> RequestBuilder { let path = "/fake_classname_test" let URLString = PetstoreClientAPI.basePath + path - let parameters = client.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 8648214c7309..495468f63e35 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -12,11 +12,11 @@ import Alamofire open class PetAPI: APIBase { /** Add a new pet to the store - - parameter pet: (body) Pet object that needs to be added to the store + - parameter body: (body) Pet object that needs to be added to the store - parameter completion: completion handler to receive the data and the error objects */ - open class func addPet(pet: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - addPetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in + open class func addPet(body: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + addPetWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error) } } @@ -28,13 +28,13 @@ open class PetAPI: APIBase { - OAuth: - type: oauth2 - name: petstore_auth - - parameter pet: (body) Pet object that needs to be added to the store + - parameter body: (body) Pet object that needs to be added to the store - returns: RequestBuilder */ - open class func addPetWithRequestBuilder(pet: Pet) -> RequestBuilder { + open class func addPetWithRequestBuilder(body: Pet) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = pet.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -207,11 +207,11 @@ open class PetAPI: APIBase { /** Update an existing pet - - parameter pet: (body) Pet object that needs to be added to the store + - parameter body: (body) Pet object that needs to be added to the store - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePet(pet: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - updatePetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in + open class func updatePet(body: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + updatePetWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error) } } @@ -223,13 +223,13 @@ open class PetAPI: APIBase { - OAuth: - type: oauth2 - name: petstore_auth - - parameter pet: (body) Pet object that needs to be added to the store + - parameter body: (body) Pet object that needs to be added to the store - returns: RequestBuilder */ - open class func updatePetWithRequestBuilder(pet: Pet) -> RequestBuilder { + open class func updatePetWithRequestBuilder(body: Pet) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = pet.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -330,4 +330,50 @@ open class PetAPI: APIBase { return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } + /** + uploads an image (required) + - parameter petId: (path) ID of pet to update + - parameter requiredFile: (form) file to upload + - parameter additionalMetadata: (form) Additional data to pass to server (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, completion: @escaping ((_ data: ApiResponse?, _ error: ErrorResponse?) -> Void)) { + uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + + /** + uploads an image (required) + - POST /fake/{petId}/uploadImageWithRequiredFile + - OAuth: + - type: oauth2 + - name: petstore_auth + - parameter petId: (path) ID of pet to update + - parameter requiredFile: (form) file to upload + - parameter additionalMetadata: (form) Additional data to pass to server (optional) + - returns: RequestBuilder + */ + open class func uploadFileWithRequiredFileWithRequestBuilder(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil) -> RequestBuilder { + var path = "/fake/{petId}/uploadImageWithRequiredFile" + let petIdPreEscape = "\(petId)" + let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let formParams: [String:Any?] = [ + "additionalMetadata": additionalMetadata, + "requiredFile": requiredFile + ] + + let nonNullParameters = APIHelper.rejectNil(formParams) + let parameters = APIHelper.convertBoolToString(nonNullParameters) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + } diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 66dbd6f25d8c..84cea5213bab 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -112,11 +112,11 @@ open class StoreAPI: APIBase { /** Place an order for a pet - - parameter order: (body) order placed for purchasing the pet + - parameter body: (body) order placed for purchasing the pet - parameter completion: completion handler to receive the data and the error objects */ - open class func placeOrder(order: Order, completion: @escaping ((_ data: Order?, _ error: ErrorResponse?) -> Void)) { - placeOrderWithRequestBuilder(order: order).execute { (response, error) -> Void in + open class func placeOrder(body: Order, completion: @escaping ((_ data: Order?, _ error: ErrorResponse?) -> Void)) { + placeOrderWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -125,13 +125,13 @@ open class StoreAPI: APIBase { /** Place an order for a pet - POST /store/order - - parameter order: (body) order placed for purchasing the pet + - parameter body: (body) order placed for purchasing the pet - returns: RequestBuilder */ - open class func placeOrderWithRequestBuilder(order: Order) -> RequestBuilder { + open class func placeOrderWithRequestBuilder(body: Order) -> RequestBuilder { let path = "/store/order" let URLString = PetstoreClientAPI.basePath + path - let parameters = order.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index eee28ea249ac..7abdf0b76cd7 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -12,11 +12,11 @@ import Alamofire open class UserAPI: APIBase { /** Create user - - parameter user: (body) Created user object + - parameter body: (body) Created user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUser(user: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - createUserWithRequestBuilder(user: user).execute { (response, error) -> Void in + open class func createUser(body: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUserWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error) } } @@ -26,13 +26,13 @@ open class UserAPI: APIBase { Create user - POST /user - This can only be done by the logged in user. - - parameter user: (body) Created user object + - parameter body: (body) Created user object - returns: RequestBuilder */ - open class func createUserWithRequestBuilder(user: User) -> RequestBuilder { + open class func createUserWithRequestBuilder(body: User) -> RequestBuilder { let path = "/user" let URLString = PetstoreClientAPI.basePath + path - let parameters = user.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -43,11 +43,11 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - - parameter user: (body) List of user object + - parameter body: (body) List of user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithArrayInput(user: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(user: user).execute { (response, error) -> Void in + open class func createUsersWithArrayInput(body: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUsersWithArrayInputWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error) } } @@ -56,13 +56,13 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - POST /user/createWithArray - - parameter user: (body) List of user object + - parameter body: (body) List of user object - returns: RequestBuilder */ - open class func createUsersWithArrayInputWithRequestBuilder(user: [User]) -> RequestBuilder { + open class func createUsersWithArrayInputWithRequestBuilder(body: [User]) -> RequestBuilder { let path = "/user/createWithArray" let URLString = PetstoreClientAPI.basePath + path - let parameters = user.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -73,11 +73,11 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - - parameter user: (body) List of user object + - parameter body: (body) List of user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithListInput(user: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - createUsersWithListInputWithRequestBuilder(user: user).execute { (response, error) -> Void in + open class func createUsersWithListInput(body: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUsersWithListInputWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error) } } @@ -86,13 +86,13 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - POST /user/createWithList - - parameter user: (body) List of user object + - parameter body: (body) List of user object - returns: RequestBuilder */ - open class func createUsersWithListInputWithRequestBuilder(user: [User]) -> RequestBuilder { + open class func createUsersWithListInputWithRequestBuilder(body: [User]) -> RequestBuilder { let path = "/user/createWithList" let URLString = PetstoreClientAPI.basePath + path - let parameters = user.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -137,7 +137,7 @@ open class UserAPI: APIBase { /** Get user by user name - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. + - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - parameter completion: completion handler to receive the data and the error objects */ open class func getUserByName(username: String, completion: @escaping ((_ data: User?, _ error: ErrorResponse?) -> Void)) { @@ -150,7 +150,7 @@ open class UserAPI: APIBase { /** Get user by user name - GET /user/{username} - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. + - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - returns: RequestBuilder */ open class func getUserByNameWithRequestBuilder(username: String) -> RequestBuilder { @@ -236,11 +236,11 @@ open class UserAPI: APIBase { /** Updated user - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object + - parameter body: (body) Updated user object - parameter completion: completion handler to receive the data and the error objects */ - open class func updateUser(username: String, user: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - updateUserWithRequestBuilder(username: username, user: user).execute { (response, error) -> Void in + open class func updateUser(username: String, body: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + updateUserWithRequestBuilder(username: username, body: body).execute { (response, error) -> Void in completion(error) } } @@ -251,16 +251,16 @@ open class UserAPI: APIBase { - PUT /user/{username} - This can only be done by the logged in user. - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object + - parameter body: (body) Updated user object - returns: RequestBuilder */ - open class func updateUserWithRequestBuilder(username: String, user: User) -> RequestBuilder { + open class func updateUserWithRequestBuilder(username: String, body: User) -> RequestBuilder { var path = "/user/{username}" let usernamePreEscape = "\(username)" let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters = user.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift index d1465fe4cbe4..264241b7d139 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -297,15 +297,15 @@ class Decoders { Decoders.addDecoder(clazz: AdditionalPropertiesClass.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in if let sourceDictionary = source as? [AnyHashable: Any] { let _result = instance == nil ? AdditionalPropertiesClass() : instance as! AdditionalPropertiesClass - switch Decoders.decodeOptional(clazz: [String:String].self, source: sourceDictionary["map_property"] as AnyObject?) { + switch Decoders.decodeOptional(clazz: [String:String].self, source: sourceDictionary["map_string"] as AnyObject?) { - case let .success(value): _result.mapProperty = value + case let .success(value): _result.mapString = value case let .failure(error): break } - switch Decoders.decodeOptional(clazz: [String:[String:String]].self, source: sourceDictionary["map_of_map_property"] as AnyObject?) { + switch Decoders.decodeOptional(clazz: [String:[String:String]].self, source: sourceDictionary["map_map_string"] as AnyObject?) { - case let .success(value): _result.mapOfMapProperty = value + case let .success(value): _result.mapMapString = value case let .failure(error): break } @@ -533,6 +533,26 @@ class Decoders { return .failure(.typeMismatch(expected: "Cat", actual: "\(source)")) } } + // Decoder for [CatAllOf] + Decoders.addDecoder(clazz: [CatAllOf].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[CatAllOf]> in + return Decoders.decode(clazz: [CatAllOf].self, source: source) + } + + // Decoder for CatAllOf + Decoders.addDecoder(clazz: CatAllOf.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = instance == nil ? CatAllOf() : instance as! CatAllOf + switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["declawed"] as AnyObject?) { + + case let .success(value): _result.declawed = value + case let .failure(error): break + + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "CatAllOf", actual: "\(source)")) + } + } // Decoder for [Category] Decoders.addDecoder(clazz: [Category].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Category]> in return Decoders.decode(clazz: [Category].self, source: source) @@ -634,6 +654,26 @@ class Decoders { return .failure(.typeMismatch(expected: "Dog", actual: "\(source)")) } } + // Decoder for [DogAllOf] + Decoders.addDecoder(clazz: [DogAllOf].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[DogAllOf]> in + return Decoders.decode(clazz: [DogAllOf].self, source: source) + } + + // Decoder for DogAllOf + Decoders.addDecoder(clazz: DogAllOf.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = instance == nil ? DogAllOf() : instance as! DogAllOf + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["breed"] as AnyObject?) { + + case let .success(value): _result.breed = value + case let .failure(error): break + + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "DogAllOf", actual: "\(source)")) + } + } // Decoder for [EnumArrays] Decoders.addDecoder(clazz: [EnumArrays].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[EnumArrays]> in return Decoders.decode(clazz: [EnumArrays].self, source: source) @@ -684,6 +724,12 @@ class Decoders { case let .success(value): _result.enumString = value case let .failure(error): break + } + switch Decoders.decodeOptional(clazz: EnumTest.EnumStringRequired.self, source: sourceDictionary["enum_string_required"] as AnyObject?) { + + case let .success(value): _result.enumStringRequired = value + case let .failure(error): break + } switch Decoders.decodeOptional(clazz: EnumTest.EnumInteger.self, source: sourceDictionary["enum_integer"] as AnyObject?) { @@ -708,6 +754,52 @@ class Decoders { return .failure(.typeMismatch(expected: "EnumTest", actual: "\(source)")) } } + // Decoder for [File] + Decoders.addDecoder(clazz: [File].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[File]> in + return Decoders.decode(clazz: [File].self, source: source) + } + + // Decoder for File + Decoders.addDecoder(clazz: File.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = instance == nil ? File() : instance as! File + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["sourceURI"] as AnyObject?) { + + case let .success(value): _result.sourceURI = value + case let .failure(error): break + + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "File", actual: "\(source)")) + } + } + // Decoder for [FileSchemaTestClass] + Decoders.addDecoder(clazz: [FileSchemaTestClass].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[FileSchemaTestClass]> in + return Decoders.decode(clazz: [FileSchemaTestClass].self, source: source) + } + + // Decoder for FileSchemaTestClass + Decoders.addDecoder(clazz: FileSchemaTestClass.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = instance == nil ? FileSchemaTestClass() : instance as! FileSchemaTestClass + switch Decoders.decodeOptional(clazz: File.self, source: sourceDictionary["file"] as AnyObject?) { + + case let .success(value): _result.file = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: [File].self, source: sourceDictionary["files"] as AnyObject?) { + + case let .success(value): _result.files = value + case let .failure(error): break + + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "FileSchemaTestClass", actual: "\(source)")) + } + } // Decoder for [FormatTest] Decoders.addDecoder(clazz: [FormatTest].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[FormatTest]> in return Decoders.decode(clazz: [FormatTest].self, source: source) @@ -866,6 +958,18 @@ class Decoders { case let .success(value): _result.mapOfEnumString = value case let .failure(error): break */ default: break //TODO: handle enum map scenario + } + switch Decoders.decodeOptional(clazz: [String:Bool].self, source: sourceDictionary["direct_map"] as AnyObject?) { + + case let .success(value): _result.directMap = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: [String:Bool].self, source: sourceDictionary["indirect_map"] as AnyObject?) { + + case let .success(value): _result.indirectMap = value + case let .failure(error): break + } return .success(_result) } else { @@ -1222,6 +1326,94 @@ class Decoders { return .failure(.typeMismatch(expected: "Tag", actual: "\(source)")) } } + // Decoder for [TypeHolderDefault] + Decoders.addDecoder(clazz: [TypeHolderDefault].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[TypeHolderDefault]> in + return Decoders.decode(clazz: [TypeHolderDefault].self, source: source) + } + + // Decoder for TypeHolderDefault + Decoders.addDecoder(clazz: TypeHolderDefault.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = instance == nil ? TypeHolderDefault() : instance as! TypeHolderDefault + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["string_item"] as AnyObject?) { + + case let .success(value): _result.stringItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: Double.self, source: sourceDictionary["number_item"] as AnyObject?) { + + case let .success(value): _result.numberItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["integer_item"] as AnyObject?) { + + case let .success(value): _result.integerItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["bool_item"] as AnyObject?) { + + case let .success(value): _result.boolItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: [Int32].self, source: sourceDictionary["array_item"] as AnyObject?) { + + case let .success(value): _result.arrayItem = value + case let .failure(error): break + + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "TypeHolderDefault", actual: "\(source)")) + } + } + // Decoder for [TypeHolderExample] + Decoders.addDecoder(clazz: [TypeHolderExample].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[TypeHolderExample]> in + return Decoders.decode(clazz: [TypeHolderExample].self, source: source) + } + + // Decoder for TypeHolderExample + Decoders.addDecoder(clazz: TypeHolderExample.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = instance == nil ? TypeHolderExample() : instance as! TypeHolderExample + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["string_item"] as AnyObject?) { + + case let .success(value): _result.stringItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: Double.self, source: sourceDictionary["number_item"] as AnyObject?) { + + case let .success(value): _result.numberItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["integer_item"] as AnyObject?) { + + case let .success(value): _result.integerItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["bool_item"] as AnyObject?) { + + case let .success(value): _result.boolItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: [Int32].self, source: sourceDictionary["array_item"] as AnyObject?) { + + case let .success(value): _result.arrayItem = value + case let .failure(error): break + + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "TypeHolderExample", actual: "\(source)")) + } + } // Decoder for [User] Decoders.addDecoder(clazz: [User].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[User]> in return Decoders.decode(clazz: [User].self, source: source) diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 48724b45a3d2..18238c78e35e 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -10,16 +10,16 @@ import Foundation open class AdditionalPropertiesClass: JSONEncodable { - public var mapProperty: [String:String]? - public var mapOfMapProperty: [String:[String:String]]? + public var mapString: [String:String]? + public var mapMapString: [String:[String:String]]? public init() {} // MARK: JSONEncodable open func encodeToJSON() -> Any { var nillableDictionary = [String:Any?]() - nillableDictionary["map_property"] = self.mapProperty?.encodeToJSON() - nillableDictionary["map_of_map_property"] = self.mapOfMapProperty?.encodeToJSON() + nillableDictionary["map_string"] = self.mapString?.encodeToJSON() + nillableDictionary["map_map_string"] = self.mapMapString?.encodeToJSON() let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift new file mode 100644 index 000000000000..42d540ee9494 --- /dev/null +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -0,0 +1,31 @@ +// +// CatAllOf.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +open class CatAllOf: JSONEncodable { + + public var declawed: Bool? + public var declawedNum: NSNumber? { + get { + return declawed.map({ return NSNumber(value: $0) }) + } + } + + public init() {} + + // MARK: JSONEncodable + open func encodeToJSON() -> Any { + var nillableDictionary = [String:Any?]() + nillableDictionary["declawed"] = self.declawed + + let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] + return dictionary + } +} + diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift new file mode 100644 index 000000000000..6deb04c034e9 --- /dev/null +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -0,0 +1,26 @@ +// +// DogAllOf.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +open class DogAllOf: JSONEncodable { + + public var breed: String? + + public init() {} + + // MARK: JSONEncodable + open func encodeToJSON() -> Any { + var nillableDictionary = [String:Any?]() + nillableDictionary["breed"] = self.breed + + let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] + return dictionary + } +} + diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 59c0660b900d..0478bff2d394 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -15,6 +15,11 @@ open class EnumTest: JSONEncodable { case lower = "lower" case empty = "" } + public enum EnumStringRequired: String { + case upper = "UPPER" + case lower = "lower" + case empty = "" + } public enum EnumInteger: Int32 { case _1 = 1 case number1 = -1 @@ -24,6 +29,7 @@ open class EnumTest: JSONEncodable { case number12 = -1.2 } public var enumString: EnumString? + public var enumStringRequired: EnumStringRequired? public var enumInteger: EnumInteger? public var enumNumber: EnumNumber? public var outerEnum: OuterEnum? @@ -34,6 +40,7 @@ open class EnumTest: JSONEncodable { open func encodeToJSON() -> Any { var nillableDictionary = [String:Any?]() nillableDictionary["enum_string"] = self.enumString?.rawValue + nillableDictionary["enum_string_required"] = self.enumStringRequired?.rawValue nillableDictionary["enum_integer"] = self.enumInteger?.rawValue nillableDictionary["enum_number"] = self.enumNumber?.rawValue nillableDictionary["outerEnum"] = self.outerEnum?.encodeToJSON() diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/File.swift new file mode 100644 index 000000000000..86c8c66e9a4c --- /dev/null +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -0,0 +1,28 @@ +// +// File.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +/** Must be named `File` for test. */ +open class File: JSONEncodable { + + /** Test capitalization */ + public var sourceURI: String? + + public init() {} + + // MARK: JSONEncodable + open func encodeToJSON() -> Any { + var nillableDictionary = [String:Any?]() + nillableDictionary["sourceURI"] = self.sourceURI + + let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] + return dictionary + } +} + diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift new file mode 100644 index 000000000000..7cfb65481058 --- /dev/null +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -0,0 +1,28 @@ +// +// FileSchemaTestClass.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +open class FileSchemaTestClass: JSONEncodable { + + public var file: File? + public var files: [File]? + + public init() {} + + // MARK: JSONEncodable + open func encodeToJSON() -> Any { + var nillableDictionary = [String:Any?]() + nillableDictionary["file"] = self.file?.encodeToJSON() + nillableDictionary["files"] = self.files?.encodeToJSON() + + let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] + return dictionary + } +} + diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index 099ecb1da5e6..b5533babdd4c 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -29,11 +29,6 @@ open class FormatTest: JSONEncodable { } } public var number: Double? - public var numberNum: NSNumber? { - get { - return number.map({ return NSNumber(value: $0) }) - } - } public var float: Float? public var floatNum: NSNumber? { get { diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 7b6af62b0576..bbc87e81cc75 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -16,6 +16,8 @@ open class MapTest: JSONEncodable { } public var mapMapOfString: [String:[String:String]]? public var mapOfEnumString: [String:String]? + public var directMap: [String:Bool]? + public var indirectMap: [String:Bool]? public init() {} @@ -23,6 +25,8 @@ open class MapTest: JSONEncodable { open func encodeToJSON() -> Any { var nillableDictionary = [String:Any?]() nillableDictionary["map_map_of_string"] = self.mapMapOfString?.encodeToJSON()//TODO: handle enum map scenario + nillableDictionary["direct_map"] = self.directMap?.encodeToJSON() + nillableDictionary["indirect_map"] = self.indirectMap?.encodeToJSON() let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 342d6796d8d9..bbcf6dc330cd 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -11,11 +11,6 @@ import Foundation open class NumberOnly: JSONEncodable { public var justNumber: Double? - public var justNumberNum: NSNumber? { - get { - return justNumber.map({ return NSNumber(value: $0) }) - } - } public init() {} diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index ba3fa230f344..2ffa447b561e 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -11,11 +11,6 @@ import Foundation open class OuterComposite: JSONEncodable { public var myNumber: Double? - public var myNumberNum: NSNumber? { - get { - return myNumber.map({ return NSNumber(value: $0) }) - } - } public var myString: String? public var myBoolean: Bool? public var myBooleanNum: NSNumber? { diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift new file mode 100644 index 000000000000..1be918ebda94 --- /dev/null +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -0,0 +1,44 @@ +// +// TypeHolderDefault.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +open class TypeHolderDefault: JSONEncodable { + + public var stringItem: String? + public var numberItem: Double? + public var integerItem: Int32? + public var integerItemNum: NSNumber? { + get { + return integerItem.map({ return NSNumber(value: $0) }) + } + } + public var boolItem: Bool? + public var boolItemNum: NSNumber? { + get { + return boolItem.map({ return NSNumber(value: $0) }) + } + } + public var arrayItem: [Int32]? + + public init() {} + + // MARK: JSONEncodable + open func encodeToJSON() -> Any { + var nillableDictionary = [String:Any?]() + nillableDictionary["string_item"] = self.stringItem + nillableDictionary["number_item"] = self.numberItem + nillableDictionary["integer_item"] = self.integerItem?.encodeToJSON() + nillableDictionary["bool_item"] = self.boolItem + nillableDictionary["array_item"] = self.arrayItem?.encodeToJSON() + + let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] + return dictionary + } +} + diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift new file mode 100644 index 000000000000..d25f2fe97b90 --- /dev/null +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -0,0 +1,44 @@ +// +// TypeHolderExample.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +open class TypeHolderExample: JSONEncodable { + + public var stringItem: String? + public var numberItem: Double? + public var integerItem: Int32? + public var integerItemNum: NSNumber? { + get { + return integerItem.map({ return NSNumber(value: $0) }) + } + } + public var boolItem: Bool? + public var boolItemNum: NSNumber? { + get { + return boolItem.map({ return NSNumber(value: $0) }) + } + } + public var arrayItem: [Int32]? + + public init() {} + + // MARK: JSONEncodable + open func encodeToJSON() -> Any { + var nillableDictionary = [String:Any?]() + nillableDictionary["string_item"] = self.stringItem + nillableDictionary["number_item"] = self.numberItem + nillableDictionary["integer_item"] = self.integerItem?.encodeToJSON() + nillableDictionary["bool_item"] = self.boolItem + nillableDictionary["array_item"] = self.arrayItem?.encodeToJSON() + + let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] + return dictionary + } +} + diff --git a/samples/client/petstore/swift3/promisekit/.openapi-generator/VERSION b/samples/client/petstore/swift3/promisekit/.openapi-generator/VERSION index 6d94c9c2e12a..83a328a9227e 100644 --- a/samples/client/petstore/swift3/promisekit/.openapi-generator/VERSION +++ b/samples/client/petstore/swift3/promisekit/.openapi-generator/VERSION @@ -1 +1 @@ -3.3.0-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 1c087005acac..9fbe015fba16 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -13,23 +13,23 @@ import PromiseKit open class AnotherFakeAPI: APIBase { /** To test special tags - - parameter client: (body) client model + - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testSpecialTags(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { - testSpecialTagsWithRequestBuilder(client: client).execute { (response, error) -> Void in + open class func call123testSpecialTags(body: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + call123testSpecialTagsWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } } /** To test special tags - - parameter client: (body) client model + - parameter body: (body) client model - returns: Promise */ - open class func testSpecialTags( client: Client) -> Promise { + open class func call123testSpecialTags( body: Client) -> Promise { let deferred = Promise.pending() - testSpecialTags(client: client) { data, error in + call123testSpecialTags(body: body) { data, error in if let error = error { deferred.reject(error) } else { @@ -42,14 +42,14 @@ open class AnotherFakeAPI: APIBase { /** To test special tags - PATCH /another-fake/dummy - - To test special tags - - parameter client: (body) client model + - To test special tags and operation ID starting with number + - parameter body: (body) client model - returns: RequestBuilder */ - open class func testSpecialTagsWithRequestBuilder(client: Client) -> RequestBuilder { + open class func call123testSpecialTagsWithRequestBuilder(body: Client) -> RequestBuilder { let path = "/another-fake/dummy" let URLString = PetstoreClientAPI.basePath + path - let parameters = client.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index d9ab85604de4..a08e9f722524 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -56,22 +56,22 @@ open class FakeAPI: APIBase { } /** - - parameter outerComposite: (body) Input composite as post body (optional) + - parameter body: (body) Input composite as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterCompositeSerialize(outerComposite: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: ErrorResponse?) -> Void)) { - fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: outerComposite).execute { (response, error) -> Void in + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: ErrorResponse?) -> Void)) { + fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } } /** - - parameter outerComposite: (body) Input composite as post body (optional) + - parameter body: (body) Input composite as post body (optional) - returns: Promise */ - open class func fakeOuterCompositeSerialize( outerComposite: OuterComposite? = nil) -> Promise { + open class func fakeOuterCompositeSerialize( body: OuterComposite? = nil) -> Promise { let deferred = Promise.pending() - fakeOuterCompositeSerialize(outerComposite: outerComposite) { data, error in + fakeOuterCompositeSerialize(body: body) { data, error in if let error = error { deferred.reject(error) } else { @@ -84,13 +84,13 @@ open class FakeAPI: APIBase { /** - POST /fake/outer/composite - Test serialization of object with outer number type - - parameter outerComposite: (body) Input composite as post body (optional) + - parameter body: (body) Input composite as post body (optional) - returns: RequestBuilder */ - open class func fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: OuterComposite? = nil) -> RequestBuilder { + open class func fakeOuterCompositeSerializeWithRequestBuilder(body: OuterComposite? = nil) -> RequestBuilder { let path = "/fake/outer/composite" let URLString = PetstoreClientAPI.basePath + path - let parameters = outerComposite?.encodeToJSON() + let parameters = body?.encodeToJSON() let url = URLComponents(string: URLString) @@ -187,25 +187,118 @@ open class FakeAPI: APIBase { return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) } + /** + - parameter body: (body) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testBodyWithFileSchema(body: FileSchemaTestClass, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(error) + } + } + + /** + - parameter body: (body) + - returns: Promise + */ + open class func testBodyWithFileSchema( body: FileSchemaTestClass) -> Promise { + let deferred = Promise.pending() + testBodyWithFileSchema(body: body) { error in + if let error = error { + deferred.reject(error) + } else { + deferred.fulfill() + } + } + return deferred.promise + } + + /** + - PUT /fake/body-with-file-schema + - For this test, the body for this request much reference a schema named `File`. + - parameter body: (body) + - returns: RequestBuilder + */ + open class func testBodyWithFileSchemaWithRequestBuilder(body: FileSchemaTestClass) -> RequestBuilder { + let path = "/fake/body-with-file-schema" + let URLString = PetstoreClientAPI.basePath + path + let parameters = body.encodeToJSON() + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + - parameter query: (query) + - parameter body: (body) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testBodyWithQueryParams(query: String, body: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (response, error) -> Void in + completion(error) + } + } + + /** + - parameter query: (query) + - parameter body: (body) + - returns: Promise + */ + open class func testBodyWithQueryParams( query: String, body: User) -> Promise { + let deferred = Promise.pending() + testBodyWithQueryParams(query: query, body: body) { error in + if let error = error { + deferred.reject(error) + } else { + deferred.fulfill() + } + } + return deferred.promise + } + + /** + - PUT /fake/body-with-query-params + - parameter query: (query) + - parameter body: (body) + - returns: RequestBuilder + */ + open class func testBodyWithQueryParamsWithRequestBuilder(query: String, body: User) -> RequestBuilder { + let path = "/fake/body-with-query-params" + let URLString = PetstoreClientAPI.basePath + path + let parameters = body.encodeToJSON() + + var url = URLComponents(string: URLString) + url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ + "query": query + ]) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + /** To test \"client\" model - - parameter client: (body) client model + - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testClientModel(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { - testClientModelWithRequestBuilder(client: client).execute { (response, error) -> Void in + open class func testClientModel(body: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testClientModelWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } } /** To test \"client\" model - - parameter client: (body) client model + - parameter body: (body) client model - returns: Promise */ - open class func testClientModel( client: Client) -> Promise { + open class func testClientModel( body: Client) -> Promise { let deferred = Promise.pending() - testClientModel(client: client) { data, error in + testClientModel(body: body) { data, error in if let error = error { deferred.reject(error) } else { @@ -219,13 +312,13 @@ open class FakeAPI: APIBase { To test \"client\" model - PATCH /fake - To test \"client\" model - - parameter client: (body) client model + - parameter body: (body) client model - returns: RequestBuilder */ - open class func testClientModelWithRequestBuilder(client: Client) -> RequestBuilder { + open class func testClientModelWithRequestBuilder(body: Client) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters = client.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -383,6 +476,14 @@ open class FakeAPI: APIBase { case number2 = -2 } + /** + * enum for parameter enumQueryDouble + */ + public enum EnumQueryDouble_testEnumParameters: Double { + case _11 = 1.1 + case number12 = -1.2 + } + /** * enum for parameter enumFormStringArray */ @@ -400,14 +501,6 @@ open class FakeAPI: APIBase { case xyz = "(xyz)" } - /** - * enum for parameter enumQueryDouble - */ - public enum EnumQueryDouble_testEnumParameters: Double { - case _11 = 1.1 - case number12 = -1.2 - } - /** To test enum parameters - parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional) @@ -415,13 +508,13 @@ open class FakeAPI: APIBase { - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) + - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) - parameter enumFormString: (form) Form parameter enum test (string) (optional) - - parameter enumQueryDouble: (form) Query parameter enum test (double) (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString, enumQueryDouble: enumQueryDouble).execute { (response, error) -> Void in + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (response, error) -> Void in completion(error) } } @@ -433,14 +526,14 @@ open class FakeAPI: APIBase { - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) + - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) - parameter enumFormString: (form) Form parameter enum test (string) (optional) - - parameter enumQueryDouble: (form) Query parameter enum test (double) (optional) - returns: Promise */ - open class func testEnumParameters( enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil) -> Promise { + open class func testEnumParameters( enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> Promise { let deferred = Promise.pending() - testEnumParameters(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString, enumQueryDouble: enumQueryDouble) { error in + testEnumParameters(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString) { error in if let error = error { deferred.reject(error) } else { @@ -459,18 +552,17 @@ open class FakeAPI: APIBase { - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) + - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) - parameter enumFormString: (form) Form parameter enum test (string) (optional) - - parameter enumQueryDouble: (form) Query parameter enum test (double) (optional) - returns: RequestBuilder */ - open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil) -> RequestBuilder { + open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path let formParams: [String:Any?] = [ "enum_form_string_array": enumFormStringArray, - "enum_form_string": enumFormString?.rawValue, - "enum_query_double": enumQueryDouble?.rawValue + "enum_form_string": enumFormString?.rawValue ] let nonNullParameters = APIHelper.rejectNil(formParams) @@ -480,7 +572,8 @@ open class FakeAPI: APIBase { url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ "enum_query_string_array": enumQueryStringArray, "enum_query_string": enumQueryString?.rawValue, - "enum_query_integer": enumQueryInteger?.rawValue + "enum_query_integer": enumQueryInteger?.rawValue, + "enum_query_double": enumQueryDouble?.rawValue ]) let nillableHeaders: [String: Any?] = [ "enum_header_string_array": enumHeaderStringArray, @@ -493,6 +586,125 @@ open class FakeAPI: APIBase { return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) } + /** + Fake endpoint to test group parameters (optional) + - parameter requiredStringGroup: (query) Required String in group parameters + - parameter requiredBooleanGroup: (header) Required Boolean in group parameters + - parameter requiredInt64Group: (query) Required Integer in group parameters + - parameter stringGroup: (query) String in group parameters (optional) + - parameter booleanGroup: (header) Boolean in group parameters (optional) + - parameter int64Group: (query) Integer in group parameters (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testGroupParameters(requiredStringGroup: Int32, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int32? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (response, error) -> Void in + completion(error) + } + } + + /** + Fake endpoint to test group parameters (optional) + - parameter requiredStringGroup: (query) Required String in group parameters + - parameter requiredBooleanGroup: (header) Required Boolean in group parameters + - parameter requiredInt64Group: (query) Required Integer in group parameters + - parameter stringGroup: (query) String in group parameters (optional) + - parameter booleanGroup: (header) Boolean in group parameters (optional) + - parameter int64Group: (query) Integer in group parameters (optional) + - returns: Promise + */ + open class func testGroupParameters( requiredStringGroup: Int32, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int32? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> Promise { + let deferred = Promise.pending() + testGroupParameters(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group) { error in + if let error = error { + deferred.reject(error) + } else { + deferred.fulfill() + } + } + return deferred.promise + } + + /** + Fake endpoint to test group parameters (optional) + - DELETE /fake + - Fake endpoint to test group parameters (optional) + - parameter requiredStringGroup: (query) Required String in group parameters + - parameter requiredBooleanGroup: (header) Required Boolean in group parameters + - parameter requiredInt64Group: (query) Required Integer in group parameters + - parameter stringGroup: (query) String in group parameters (optional) + - parameter booleanGroup: (header) Boolean in group parameters (optional) + - parameter int64Group: (query) Integer in group parameters (optional) + - returns: RequestBuilder + */ + open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int32, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int32? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { + let path = "/fake" + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + var url = URLComponents(string: URLString) + url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), + "int64_group": int64Group?.encodeToJSON() + ]) + let nillableHeaders: [String: Any?] = [ + "required_boolean_group": requiredBooleanGroup, + "boolean_group": booleanGroup + ] + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) + } + + /** + test inline additionalProperties + - parameter param: (body) request body + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testInlineAdditionalProperties(param: [String:String], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (response, error) -> Void in + completion(error) + } + } + + /** + test inline additionalProperties + - parameter param: (body) request body + - returns: Promise + */ + open class func testInlineAdditionalProperties( param: [String:String]) -> Promise { + let deferred = Promise.pending() + testInlineAdditionalProperties(param: param) { error in + if let error = error { + deferred.reject(error) + } else { + deferred.fulfill() + } + } + return deferred.promise + } + + /** + test inline additionalProperties + - POST /fake/inline-additionalProperties + - parameter param: (body) request body + - returns: RequestBuilder + */ + open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { + let path = "/fake/inline-additionalProperties" + let URLString = PetstoreClientAPI.basePath + path + let parameters = param.encodeToJSON() + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + /** test json serialization of form data - parameter param: (form) field1 diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 7bf28fcfb2c5..ca9038656923 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -13,23 +13,23 @@ import PromiseKit open class FakeClassnameTags123API: APIBase { /** To test class name in snake case - - parameter client: (body) client model + - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testClassname(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { - testClassnameWithRequestBuilder(client: client).execute { (response, error) -> Void in + open class func testClassname(body: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testClassnameWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } } /** To test class name in snake case - - parameter client: (body) client model + - parameter body: (body) client model - returns: Promise */ - open class func testClassname( client: Client) -> Promise { + open class func testClassname( body: Client) -> Promise { let deferred = Promise.pending() - testClassname(client: client) { data, error in + testClassname(body: body) { data, error in if let error = error { deferred.reject(error) } else { @@ -46,13 +46,13 @@ open class FakeClassnameTags123API: APIBase { - API Key: - type: apiKey api_key_query (QUERY) - name: api_key_query - - parameter client: (body) client model + - parameter body: (body) client model - returns: RequestBuilder */ - open class func testClassnameWithRequestBuilder(client: Client) -> RequestBuilder { + open class func testClassnameWithRequestBuilder(body: Client) -> RequestBuilder { let path = "/fake_classname_test" let URLString = PetstoreClientAPI.basePath + path - let parameters = client.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 36338aafb974..2a938c60474e 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -13,23 +13,23 @@ import PromiseKit open class PetAPI: APIBase { /** Add a new pet to the store - - parameter pet: (body) Pet object that needs to be added to the store + - parameter body: (body) Pet object that needs to be added to the store - parameter completion: completion handler to receive the data and the error objects */ - open class func addPet(pet: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - addPetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in + open class func addPet(body: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + addPetWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error) } } /** Add a new pet to the store - - parameter pet: (body) Pet object that needs to be added to the store + - parameter body: (body) Pet object that needs to be added to the store - returns: Promise */ - open class func addPet( pet: Pet) -> Promise { + open class func addPet( body: Pet) -> Promise { let deferred = Promise.pending() - addPet(pet: pet) { error in + addPet(body: body) { error in if let error = error { deferred.reject(error) } else { @@ -45,13 +45,13 @@ open class PetAPI: APIBase { - OAuth: - type: oauth2 - name: petstore_auth - - parameter pet: (body) Pet object that needs to be added to the store + - parameter body: (body) Pet object that needs to be added to the store - returns: RequestBuilder */ - open class func addPetWithRequestBuilder(pet: Pet) -> RequestBuilder { + open class func addPetWithRequestBuilder(body: Pet) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = pet.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -289,23 +289,23 @@ open class PetAPI: APIBase { /** Update an existing pet - - parameter pet: (body) Pet object that needs to be added to the store + - parameter body: (body) Pet object that needs to be added to the store - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePet(pet: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - updatePetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in + open class func updatePet(body: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + updatePetWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error) } } /** Update an existing pet - - parameter pet: (body) Pet object that needs to be added to the store + - parameter body: (body) Pet object that needs to be added to the store - returns: Promise */ - open class func updatePet( pet: Pet) -> Promise { + open class func updatePet( body: Pet) -> Promise { let deferred = Promise.pending() - updatePet(pet: pet) { error in + updatePet(body: body) { error in if let error = error { deferred.reject(error) } else { @@ -321,13 +321,13 @@ open class PetAPI: APIBase { - OAuth: - type: oauth2 - name: petstore_auth - - parameter pet: (body) Pet object that needs to be added to the store + - parameter body: (body) Pet object that needs to be added to the store - returns: RequestBuilder */ - open class func updatePetWithRequestBuilder(pet: Pet) -> RequestBuilder { + open class func updatePetWithRequestBuilder(body: Pet) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = pet.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -464,4 +464,68 @@ open class PetAPI: APIBase { return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } + /** + uploads an image (required) + - parameter petId: (path) ID of pet to update + - parameter requiredFile: (form) file to upload + - parameter additionalMetadata: (form) Additional data to pass to server (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, completion: @escaping ((_ data: ApiResponse?, _ error: ErrorResponse?) -> Void)) { + uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + uploads an image (required) + - parameter petId: (path) ID of pet to update + - parameter requiredFile: (form) file to upload + - parameter additionalMetadata: (form) Additional data to pass to server (optional) + - returns: Promise + */ + open class func uploadFileWithRequiredFile( petId: Int64, requiredFile: URL, additionalMetadata: String? = nil) -> Promise { + let deferred = Promise.pending() + uploadFileWithRequiredFile(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata) { data, error in + if let error = error { + deferred.reject(error) + } else { + deferred.fulfill(data!) + } + } + return deferred.promise + } + + /** + uploads an image (required) + - POST /fake/{petId}/uploadImageWithRequiredFile + - OAuth: + - type: oauth2 + - name: petstore_auth + - parameter petId: (path) ID of pet to update + - parameter requiredFile: (form) file to upload + - parameter additionalMetadata: (form) Additional data to pass to server (optional) + - returns: RequestBuilder + */ + open class func uploadFileWithRequiredFileWithRequestBuilder(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil) -> RequestBuilder { + var path = "/fake/{petId}/uploadImageWithRequiredFile" + let petIdPreEscape = "\(petId)" + let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let formParams: [String:Any?] = [ + "additionalMetadata": additionalMetadata, + "requiredFile": requiredFile + ] + + let nonNullParameters = APIHelper.rejectNil(formParams) + let parameters = APIHelper.convertBoolToString(nonNullParameters) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + } diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 67fe5e9bacf8..7bbc30fa301c 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -160,23 +160,23 @@ open class StoreAPI: APIBase { /** Place an order for a pet - - parameter order: (body) order placed for purchasing the pet + - parameter body: (body) order placed for purchasing the pet - parameter completion: completion handler to receive the data and the error objects */ - open class func placeOrder(order: Order, completion: @escaping ((_ data: Order?, _ error: ErrorResponse?) -> Void)) { - placeOrderWithRequestBuilder(order: order).execute { (response, error) -> Void in + open class func placeOrder(body: Order, completion: @escaping ((_ data: Order?, _ error: ErrorResponse?) -> Void)) { + placeOrderWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } } /** Place an order for a pet - - parameter order: (body) order placed for purchasing the pet + - parameter body: (body) order placed for purchasing the pet - returns: Promise */ - open class func placeOrder( order: Order) -> Promise { + open class func placeOrder( body: Order) -> Promise { let deferred = Promise.pending() - placeOrder(order: order) { data, error in + placeOrder(body: body) { data, error in if let error = error { deferred.reject(error) } else { @@ -189,13 +189,13 @@ open class StoreAPI: APIBase { /** Place an order for a pet - POST /store/order - - parameter order: (body) order placed for purchasing the pet + - parameter body: (body) order placed for purchasing the pet - returns: RequestBuilder */ - open class func placeOrderWithRequestBuilder(order: Order) -> RequestBuilder { + open class func placeOrderWithRequestBuilder(body: Order) -> RequestBuilder { let path = "/store/order" let URLString = PetstoreClientAPI.basePath + path - let parameters = order.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 90a131ebe8b8..a4b01fb86bed 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -13,23 +13,23 @@ import PromiseKit open class UserAPI: APIBase { /** Create user - - parameter user: (body) Created user object + - parameter body: (body) Created user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUser(user: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - createUserWithRequestBuilder(user: user).execute { (response, error) -> Void in + open class func createUser(body: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUserWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error) } } /** Create user - - parameter user: (body) Created user object + - parameter body: (body) Created user object - returns: Promise */ - open class func createUser( user: User) -> Promise { + open class func createUser( body: User) -> Promise { let deferred = Promise.pending() - createUser(user: user) { error in + createUser(body: body) { error in if let error = error { deferred.reject(error) } else { @@ -43,13 +43,13 @@ open class UserAPI: APIBase { Create user - POST /user - This can only be done by the logged in user. - - parameter user: (body) Created user object + - parameter body: (body) Created user object - returns: RequestBuilder */ - open class func createUserWithRequestBuilder(user: User) -> RequestBuilder { + open class func createUserWithRequestBuilder(body: User) -> RequestBuilder { let path = "/user" let URLString = PetstoreClientAPI.basePath + path - let parameters = user.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -60,23 +60,23 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - - parameter user: (body) List of user object + - parameter body: (body) List of user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithArrayInput(user: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(user: user).execute { (response, error) -> Void in + open class func createUsersWithArrayInput(body: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUsersWithArrayInputWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error) } } /** Creates list of users with given input array - - parameter user: (body) List of user object + - parameter body: (body) List of user object - returns: Promise */ - open class func createUsersWithArrayInput( user: [User]) -> Promise { + open class func createUsersWithArrayInput( body: [User]) -> Promise { let deferred = Promise.pending() - createUsersWithArrayInput(user: user) { error in + createUsersWithArrayInput(body: body) { error in if let error = error { deferred.reject(error) } else { @@ -89,13 +89,13 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - POST /user/createWithArray - - parameter user: (body) List of user object + - parameter body: (body) List of user object - returns: RequestBuilder */ - open class func createUsersWithArrayInputWithRequestBuilder(user: [User]) -> RequestBuilder { + open class func createUsersWithArrayInputWithRequestBuilder(body: [User]) -> RequestBuilder { let path = "/user/createWithArray" let URLString = PetstoreClientAPI.basePath + path - let parameters = user.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -106,23 +106,23 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - - parameter user: (body) List of user object + - parameter body: (body) List of user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithListInput(user: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - createUsersWithListInputWithRequestBuilder(user: user).execute { (response, error) -> Void in + open class func createUsersWithListInput(body: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUsersWithListInputWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error) } } /** Creates list of users with given input array - - parameter user: (body) List of user object + - parameter body: (body) List of user object - returns: Promise */ - open class func createUsersWithListInput( user: [User]) -> Promise { + open class func createUsersWithListInput( body: [User]) -> Promise { let deferred = Promise.pending() - createUsersWithListInput(user: user) { error in + createUsersWithListInput(body: body) { error in if let error = error { deferred.reject(error) } else { @@ -135,13 +135,13 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - POST /user/createWithList - - parameter user: (body) List of user object + - parameter body: (body) List of user object - returns: RequestBuilder */ - open class func createUsersWithListInputWithRequestBuilder(user: [User]) -> RequestBuilder { + open class func createUsersWithListInputWithRequestBuilder(body: [User]) -> RequestBuilder { let path = "/user/createWithList" let URLString = PetstoreClientAPI.basePath + path - let parameters = user.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -202,7 +202,7 @@ open class UserAPI: APIBase { /** Get user by user name - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. + - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - parameter completion: completion handler to receive the data and the error objects */ open class func getUserByName(username: String, completion: @escaping ((_ data: User?, _ error: ErrorResponse?) -> Void)) { @@ -213,7 +213,7 @@ open class UserAPI: APIBase { /** Get user by user name - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. + - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - returns: Promise */ open class func getUserByName( username: String) -> Promise { @@ -231,7 +231,7 @@ open class UserAPI: APIBase { /** Get user by user name - GET /user/{username} - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. + - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - returns: RequestBuilder */ open class func getUserByNameWithRequestBuilder(username: String) -> RequestBuilder { @@ -349,11 +349,11 @@ open class UserAPI: APIBase { /** Updated user - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object + - parameter body: (body) Updated user object - parameter completion: completion handler to receive the data and the error objects */ - open class func updateUser(username: String, user: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - updateUserWithRequestBuilder(username: username, user: user).execute { (response, error) -> Void in + open class func updateUser(username: String, body: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + updateUserWithRequestBuilder(username: username, body: body).execute { (response, error) -> Void in completion(error) } } @@ -361,12 +361,12 @@ open class UserAPI: APIBase { /** Updated user - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object + - parameter body: (body) Updated user object - returns: Promise */ - open class func updateUser( username: String, user: User) -> Promise { + open class func updateUser( username: String, body: User) -> Promise { let deferred = Promise.pending() - updateUser(username: username, user: user) { error in + updateUser(username: username, body: body) { error in if let error = error { deferred.reject(error) } else { @@ -381,16 +381,16 @@ open class UserAPI: APIBase { - PUT /user/{username} - This can only be done by the logged in user. - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object + - parameter body: (body) Updated user object - returns: RequestBuilder */ - open class func updateUserWithRequestBuilder(username: String, user: User) -> RequestBuilder { + open class func updateUserWithRequestBuilder(username: String, body: User) -> RequestBuilder { var path = "/user/{username}" let usernamePreEscape = "\(username)" let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters = user.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models.swift index d1465fe4cbe4..264241b7d139 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -297,15 +297,15 @@ class Decoders { Decoders.addDecoder(clazz: AdditionalPropertiesClass.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in if let sourceDictionary = source as? [AnyHashable: Any] { let _result = instance == nil ? AdditionalPropertiesClass() : instance as! AdditionalPropertiesClass - switch Decoders.decodeOptional(clazz: [String:String].self, source: sourceDictionary["map_property"] as AnyObject?) { + switch Decoders.decodeOptional(clazz: [String:String].self, source: sourceDictionary["map_string"] as AnyObject?) { - case let .success(value): _result.mapProperty = value + case let .success(value): _result.mapString = value case let .failure(error): break } - switch Decoders.decodeOptional(clazz: [String:[String:String]].self, source: sourceDictionary["map_of_map_property"] as AnyObject?) { + switch Decoders.decodeOptional(clazz: [String:[String:String]].self, source: sourceDictionary["map_map_string"] as AnyObject?) { - case let .success(value): _result.mapOfMapProperty = value + case let .success(value): _result.mapMapString = value case let .failure(error): break } @@ -533,6 +533,26 @@ class Decoders { return .failure(.typeMismatch(expected: "Cat", actual: "\(source)")) } } + // Decoder for [CatAllOf] + Decoders.addDecoder(clazz: [CatAllOf].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[CatAllOf]> in + return Decoders.decode(clazz: [CatAllOf].self, source: source) + } + + // Decoder for CatAllOf + Decoders.addDecoder(clazz: CatAllOf.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = instance == nil ? CatAllOf() : instance as! CatAllOf + switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["declawed"] as AnyObject?) { + + case let .success(value): _result.declawed = value + case let .failure(error): break + + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "CatAllOf", actual: "\(source)")) + } + } // Decoder for [Category] Decoders.addDecoder(clazz: [Category].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Category]> in return Decoders.decode(clazz: [Category].self, source: source) @@ -634,6 +654,26 @@ class Decoders { return .failure(.typeMismatch(expected: "Dog", actual: "\(source)")) } } + // Decoder for [DogAllOf] + Decoders.addDecoder(clazz: [DogAllOf].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[DogAllOf]> in + return Decoders.decode(clazz: [DogAllOf].self, source: source) + } + + // Decoder for DogAllOf + Decoders.addDecoder(clazz: DogAllOf.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = instance == nil ? DogAllOf() : instance as! DogAllOf + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["breed"] as AnyObject?) { + + case let .success(value): _result.breed = value + case let .failure(error): break + + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "DogAllOf", actual: "\(source)")) + } + } // Decoder for [EnumArrays] Decoders.addDecoder(clazz: [EnumArrays].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[EnumArrays]> in return Decoders.decode(clazz: [EnumArrays].self, source: source) @@ -684,6 +724,12 @@ class Decoders { case let .success(value): _result.enumString = value case let .failure(error): break + } + switch Decoders.decodeOptional(clazz: EnumTest.EnumStringRequired.self, source: sourceDictionary["enum_string_required"] as AnyObject?) { + + case let .success(value): _result.enumStringRequired = value + case let .failure(error): break + } switch Decoders.decodeOptional(clazz: EnumTest.EnumInteger.self, source: sourceDictionary["enum_integer"] as AnyObject?) { @@ -708,6 +754,52 @@ class Decoders { return .failure(.typeMismatch(expected: "EnumTest", actual: "\(source)")) } } + // Decoder for [File] + Decoders.addDecoder(clazz: [File].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[File]> in + return Decoders.decode(clazz: [File].self, source: source) + } + + // Decoder for File + Decoders.addDecoder(clazz: File.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = instance == nil ? File() : instance as! File + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["sourceURI"] as AnyObject?) { + + case let .success(value): _result.sourceURI = value + case let .failure(error): break + + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "File", actual: "\(source)")) + } + } + // Decoder for [FileSchemaTestClass] + Decoders.addDecoder(clazz: [FileSchemaTestClass].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[FileSchemaTestClass]> in + return Decoders.decode(clazz: [FileSchemaTestClass].self, source: source) + } + + // Decoder for FileSchemaTestClass + Decoders.addDecoder(clazz: FileSchemaTestClass.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = instance == nil ? FileSchemaTestClass() : instance as! FileSchemaTestClass + switch Decoders.decodeOptional(clazz: File.self, source: sourceDictionary["file"] as AnyObject?) { + + case let .success(value): _result.file = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: [File].self, source: sourceDictionary["files"] as AnyObject?) { + + case let .success(value): _result.files = value + case let .failure(error): break + + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "FileSchemaTestClass", actual: "\(source)")) + } + } // Decoder for [FormatTest] Decoders.addDecoder(clazz: [FormatTest].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[FormatTest]> in return Decoders.decode(clazz: [FormatTest].self, source: source) @@ -866,6 +958,18 @@ class Decoders { case let .success(value): _result.mapOfEnumString = value case let .failure(error): break */ default: break //TODO: handle enum map scenario + } + switch Decoders.decodeOptional(clazz: [String:Bool].self, source: sourceDictionary["direct_map"] as AnyObject?) { + + case let .success(value): _result.directMap = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: [String:Bool].self, source: sourceDictionary["indirect_map"] as AnyObject?) { + + case let .success(value): _result.indirectMap = value + case let .failure(error): break + } return .success(_result) } else { @@ -1222,6 +1326,94 @@ class Decoders { return .failure(.typeMismatch(expected: "Tag", actual: "\(source)")) } } + // Decoder for [TypeHolderDefault] + Decoders.addDecoder(clazz: [TypeHolderDefault].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[TypeHolderDefault]> in + return Decoders.decode(clazz: [TypeHolderDefault].self, source: source) + } + + // Decoder for TypeHolderDefault + Decoders.addDecoder(clazz: TypeHolderDefault.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = instance == nil ? TypeHolderDefault() : instance as! TypeHolderDefault + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["string_item"] as AnyObject?) { + + case let .success(value): _result.stringItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: Double.self, source: sourceDictionary["number_item"] as AnyObject?) { + + case let .success(value): _result.numberItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["integer_item"] as AnyObject?) { + + case let .success(value): _result.integerItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["bool_item"] as AnyObject?) { + + case let .success(value): _result.boolItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: [Int32].self, source: sourceDictionary["array_item"] as AnyObject?) { + + case let .success(value): _result.arrayItem = value + case let .failure(error): break + + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "TypeHolderDefault", actual: "\(source)")) + } + } + // Decoder for [TypeHolderExample] + Decoders.addDecoder(clazz: [TypeHolderExample].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[TypeHolderExample]> in + return Decoders.decode(clazz: [TypeHolderExample].self, source: source) + } + + // Decoder for TypeHolderExample + Decoders.addDecoder(clazz: TypeHolderExample.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = instance == nil ? TypeHolderExample() : instance as! TypeHolderExample + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["string_item"] as AnyObject?) { + + case let .success(value): _result.stringItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: Double.self, source: sourceDictionary["number_item"] as AnyObject?) { + + case let .success(value): _result.numberItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["integer_item"] as AnyObject?) { + + case let .success(value): _result.integerItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["bool_item"] as AnyObject?) { + + case let .success(value): _result.boolItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: [Int32].self, source: sourceDictionary["array_item"] as AnyObject?) { + + case let .success(value): _result.arrayItem = value + case let .failure(error): break + + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "TypeHolderExample", actual: "\(source)")) + } + } // Decoder for [User] Decoders.addDecoder(clazz: [User].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[User]> in return Decoders.decode(clazz: [User].self, source: source) diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 48724b45a3d2..18238c78e35e 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -10,16 +10,16 @@ import Foundation open class AdditionalPropertiesClass: JSONEncodable { - public var mapProperty: [String:String]? - public var mapOfMapProperty: [String:[String:String]]? + public var mapString: [String:String]? + public var mapMapString: [String:[String:String]]? public init() {} // MARK: JSONEncodable open func encodeToJSON() -> Any { var nillableDictionary = [String:Any?]() - nillableDictionary["map_property"] = self.mapProperty?.encodeToJSON() - nillableDictionary["map_of_map_property"] = self.mapOfMapProperty?.encodeToJSON() + nillableDictionary["map_string"] = self.mapString?.encodeToJSON() + nillableDictionary["map_map_string"] = self.mapMapString?.encodeToJSON() let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift new file mode 100644 index 000000000000..4e59d9d26591 --- /dev/null +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -0,0 +1,26 @@ +// +// CatAllOf.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +open class CatAllOf: JSONEncodable { + + public var declawed: Bool? + + public init() {} + + // MARK: JSONEncodable + open func encodeToJSON() -> Any { + var nillableDictionary = [String:Any?]() + nillableDictionary["declawed"] = self.declawed + + let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] + return dictionary + } +} + diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift new file mode 100644 index 000000000000..6deb04c034e9 --- /dev/null +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -0,0 +1,26 @@ +// +// DogAllOf.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +open class DogAllOf: JSONEncodable { + + public var breed: String? + + public init() {} + + // MARK: JSONEncodable + open func encodeToJSON() -> Any { + var nillableDictionary = [String:Any?]() + nillableDictionary["breed"] = self.breed + + let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] + return dictionary + } +} + diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 59c0660b900d..0478bff2d394 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -15,6 +15,11 @@ open class EnumTest: JSONEncodable { case lower = "lower" case empty = "" } + public enum EnumStringRequired: String { + case upper = "UPPER" + case lower = "lower" + case empty = "" + } public enum EnumInteger: Int32 { case _1 = 1 case number1 = -1 @@ -24,6 +29,7 @@ open class EnumTest: JSONEncodable { case number12 = -1.2 } public var enumString: EnumString? + public var enumStringRequired: EnumStringRequired? public var enumInteger: EnumInteger? public var enumNumber: EnumNumber? public var outerEnum: OuterEnum? @@ -34,6 +40,7 @@ open class EnumTest: JSONEncodable { open func encodeToJSON() -> Any { var nillableDictionary = [String:Any?]() nillableDictionary["enum_string"] = self.enumString?.rawValue + nillableDictionary["enum_string_required"] = self.enumStringRequired?.rawValue nillableDictionary["enum_integer"] = self.enumInteger?.rawValue nillableDictionary["enum_number"] = self.enumNumber?.rawValue nillableDictionary["outerEnum"] = self.outerEnum?.encodeToJSON() diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/File.swift new file mode 100644 index 000000000000..86c8c66e9a4c --- /dev/null +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -0,0 +1,28 @@ +// +// File.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +/** Must be named `File` for test. */ +open class File: JSONEncodable { + + /** Test capitalization */ + public var sourceURI: String? + + public init() {} + + // MARK: JSONEncodable + open func encodeToJSON() -> Any { + var nillableDictionary = [String:Any?]() + nillableDictionary["sourceURI"] = self.sourceURI + + let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] + return dictionary + } +} + diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift new file mode 100644 index 000000000000..7cfb65481058 --- /dev/null +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -0,0 +1,28 @@ +// +// FileSchemaTestClass.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +open class FileSchemaTestClass: JSONEncodable { + + public var file: File? + public var files: [File]? + + public init() {} + + // MARK: JSONEncodable + open func encodeToJSON() -> Any { + var nillableDictionary = [String:Any?]() + nillableDictionary["file"] = self.file?.encodeToJSON() + nillableDictionary["files"] = self.files?.encodeToJSON() + + let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] + return dictionary + } +} + diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 7b6af62b0576..bbc87e81cc75 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -16,6 +16,8 @@ open class MapTest: JSONEncodable { } public var mapMapOfString: [String:[String:String]]? public var mapOfEnumString: [String:String]? + public var directMap: [String:Bool]? + public var indirectMap: [String:Bool]? public init() {} @@ -23,6 +25,8 @@ open class MapTest: JSONEncodable { open func encodeToJSON() -> Any { var nillableDictionary = [String:Any?]() nillableDictionary["map_map_of_string"] = self.mapMapOfString?.encodeToJSON()//TODO: handle enum map scenario + nillableDictionary["direct_map"] = self.directMap?.encodeToJSON() + nillableDictionary["indirect_map"] = self.indirectMap?.encodeToJSON() let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift new file mode 100644 index 000000000000..787c1ad682be --- /dev/null +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -0,0 +1,34 @@ +// +// TypeHolderDefault.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +open class TypeHolderDefault: JSONEncodable { + + public var stringItem: String? + public var numberItem: Double? + public var integerItem: Int32? + public var boolItem: Bool? + public var arrayItem: [Int32]? + + public init() {} + + // MARK: JSONEncodable + open func encodeToJSON() -> Any { + var nillableDictionary = [String:Any?]() + nillableDictionary["string_item"] = self.stringItem + nillableDictionary["number_item"] = self.numberItem + nillableDictionary["integer_item"] = self.integerItem?.encodeToJSON() + nillableDictionary["bool_item"] = self.boolItem + nillableDictionary["array_item"] = self.arrayItem?.encodeToJSON() + + let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] + return dictionary + } +} + diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift new file mode 100644 index 000000000000..5edab128d2b9 --- /dev/null +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -0,0 +1,34 @@ +// +// TypeHolderExample.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +open class TypeHolderExample: JSONEncodable { + + public var stringItem: String? + public var numberItem: Double? + public var integerItem: Int32? + public var boolItem: Bool? + public var arrayItem: [Int32]? + + public init() {} + + // MARK: JSONEncodable + open func encodeToJSON() -> Any { + var nillableDictionary = [String:Any?]() + nillableDictionary["string_item"] = self.stringItem + nillableDictionary["number_item"] = self.numberItem + nillableDictionary["integer_item"] = self.integerItem?.encodeToJSON() + nillableDictionary["bool_item"] = self.boolItem + nillableDictionary["array_item"] = self.arrayItem?.encodeToJSON() + + let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] + return dictionary + } +} + diff --git a/samples/client/petstore/swift3/rxswift/.openapi-generator/VERSION b/samples/client/petstore/swift3/rxswift/.openapi-generator/VERSION index 6d94c9c2e12a..83a328a9227e 100644 --- a/samples/client/petstore/swift3/rxswift/.openapi-generator/VERSION +++ b/samples/client/petstore/swift3/rxswift/.openapi-generator/VERSION @@ -1 +1 @@ -3.3.0-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index c468f8a38288..be4174fd49bb 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -13,23 +13,23 @@ import RxSwift open class AnotherFakeAPI: APIBase { /** To test special tags - - parameter client: (body) client model + - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testSpecialTags(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { - testSpecialTagsWithRequestBuilder(client: client).execute { (response, error) -> Void in + open class func call123testSpecialTags(body: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + call123testSpecialTagsWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } } /** To test special tags - - parameter client: (body) client model + - parameter body: (body) client model - returns: Observable */ - open class func testSpecialTags(client: Client) -> Observable { + open class func call123testSpecialTags(body: Client) -> Observable { return Observable.create { observer -> Disposable in - testSpecialTags(client: client) { data, error in + call123testSpecialTags(body: body) { data, error in if let error = error { observer.on(.error(error as Error)) } else { @@ -44,14 +44,14 @@ open class AnotherFakeAPI: APIBase { /** To test special tags - PATCH /another-fake/dummy - - To test special tags - - parameter client: (body) client model + - To test special tags and operation ID starting with number + - parameter body: (body) client model - returns: RequestBuilder */ - open class func testSpecialTagsWithRequestBuilder(client: Client) -> RequestBuilder { + open class func call123testSpecialTagsWithRequestBuilder(body: Client) -> RequestBuilder { let path = "/another-fake/dummy" let URLString = PetstoreClientAPI.basePath + path - let parameters = client.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 9197924fff87..40bad0bb4ab6 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -58,22 +58,22 @@ open class FakeAPI: APIBase { } /** - - parameter outerComposite: (body) Input composite as post body (optional) + - parameter body: (body) Input composite as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterCompositeSerialize(outerComposite: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: ErrorResponse?) -> Void)) { - fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: outerComposite).execute { (response, error) -> Void in + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: ErrorResponse?) -> Void)) { + fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } } /** - - parameter outerComposite: (body) Input composite as post body (optional) + - parameter body: (body) Input composite as post body (optional) - returns: Observable */ - open class func fakeOuterCompositeSerialize(outerComposite: OuterComposite? = nil) -> Observable { + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil) -> Observable { return Observable.create { observer -> Disposable in - fakeOuterCompositeSerialize(outerComposite: outerComposite) { data, error in + fakeOuterCompositeSerialize(body: body) { data, error in if let error = error { observer.on(.error(error as Error)) } else { @@ -88,13 +88,13 @@ open class FakeAPI: APIBase { /** - POST /fake/outer/composite - Test serialization of object with outer number type - - parameter outerComposite: (body) Input composite as post body (optional) + - parameter body: (body) Input composite as post body (optional) - returns: RequestBuilder */ - open class func fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: OuterComposite? = nil) -> RequestBuilder { + open class func fakeOuterCompositeSerializeWithRequestBuilder(body: OuterComposite? = nil) -> RequestBuilder { let path = "/fake/outer/composite" let URLString = PetstoreClientAPI.basePath + path - let parameters = outerComposite?.encodeToJSON() + let parameters = body?.encodeToJSON() let url = URLComponents(string: URLString) @@ -195,25 +195,122 @@ open class FakeAPI: APIBase { return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) } + /** + - parameter body: (body) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testBodyWithFileSchema(body: FileSchemaTestClass, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(error) + } + } + + /** + - parameter body: (body) + - returns: Observable + */ + open class func testBodyWithFileSchema(body: FileSchemaTestClass) -> Observable { + return Observable.create { observer -> Disposable in + testBodyWithFileSchema(body: body) { error in + if let error = error { + observer.on(.error(error as Error)) + } else { + observer.on(.next()) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + - PUT /fake/body-with-file-schema + - For this test, the body for this request much reference a schema named `File`. + - parameter body: (body) + - returns: RequestBuilder + */ + open class func testBodyWithFileSchemaWithRequestBuilder(body: FileSchemaTestClass) -> RequestBuilder { + let path = "/fake/body-with-file-schema" + let URLString = PetstoreClientAPI.basePath + path + let parameters = body.encodeToJSON() + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + - parameter query: (query) + - parameter body: (body) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testBodyWithQueryParams(query: String, body: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (response, error) -> Void in + completion(error) + } + } + + /** + - parameter query: (query) + - parameter body: (body) + - returns: Observable + */ + open class func testBodyWithQueryParams(query: String, body: User) -> Observable { + return Observable.create { observer -> Disposable in + testBodyWithQueryParams(query: query, body: body) { error in + if let error = error { + observer.on(.error(error as Error)) + } else { + observer.on(.next()) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + - PUT /fake/body-with-query-params + - parameter query: (query) + - parameter body: (body) + - returns: RequestBuilder + */ + open class func testBodyWithQueryParamsWithRequestBuilder(query: String, body: User) -> RequestBuilder { + let path = "/fake/body-with-query-params" + let URLString = PetstoreClientAPI.basePath + path + let parameters = body.encodeToJSON() + + var url = URLComponents(string: URLString) + url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ + "query": query + ]) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + /** To test \"client\" model - - parameter client: (body) client model + - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testClientModel(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { - testClientModelWithRequestBuilder(client: client).execute { (response, error) -> Void in + open class func testClientModel(body: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testClientModelWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } } /** To test \"client\" model - - parameter client: (body) client model + - parameter body: (body) client model - returns: Observable */ - open class func testClientModel(client: Client) -> Observable { + open class func testClientModel(body: Client) -> Observable { return Observable.create { observer -> Disposable in - testClientModel(client: client) { data, error in + testClientModel(body: body) { data, error in if let error = error { observer.on(.error(error as Error)) } else { @@ -229,13 +326,13 @@ open class FakeAPI: APIBase { To test \"client\" model - PATCH /fake - To test \"client\" model - - parameter client: (body) client model + - parameter body: (body) client model - returns: RequestBuilder */ - open class func testClientModelWithRequestBuilder(client: Client) -> RequestBuilder { + open class func testClientModelWithRequestBuilder(body: Client) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters = client.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -395,6 +492,14 @@ open class FakeAPI: APIBase { case number2 = -2 } + /** + * enum for parameter enumQueryDouble + */ + public enum EnumQueryDouble_testEnumParameters: Double { + case _11 = 1.1 + case number12 = -1.2 + } + /** * enum for parameter enumFormStringArray */ @@ -412,14 +517,6 @@ open class FakeAPI: APIBase { case xyz = "(xyz)" } - /** - * enum for parameter enumQueryDouble - */ - public enum EnumQueryDouble_testEnumParameters: Double { - case _11 = 1.1 - case number12 = -1.2 - } - /** To test enum parameters - parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional) @@ -427,13 +524,13 @@ open class FakeAPI: APIBase { - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) + - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) - parameter enumFormString: (form) Form parameter enum test (string) (optional) - - parameter enumQueryDouble: (form) Query parameter enum test (double) (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString, enumQueryDouble: enumQueryDouble).execute { (response, error) -> Void in + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (response, error) -> Void in completion(error) } } @@ -445,14 +542,14 @@ open class FakeAPI: APIBase { - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) + - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) - parameter enumFormString: (form) Form parameter enum test (string) (optional) - - parameter enumQueryDouble: (form) Query parameter enum test (double) (optional) - returns: Observable */ - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil) -> Observable { + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> Observable { return Observable.create { observer -> Disposable in - testEnumParameters(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString, enumQueryDouble: enumQueryDouble) { error in + testEnumParameters(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString) { error in if let error = error { observer.on(.error(error as Error)) } else { @@ -473,18 +570,17 @@ open class FakeAPI: APIBase { - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) + - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) - parameter enumFormString: (form) Form parameter enum test (string) (optional) - - parameter enumQueryDouble: (form) Query parameter enum test (double) (optional) - returns: RequestBuilder */ - open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil) -> RequestBuilder { + open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path let formParams: [String:Any?] = [ "enum_form_string_array": enumFormStringArray, - "enum_form_string": enumFormString?.rawValue, - "enum_query_double": enumQueryDouble?.rawValue + "enum_form_string": enumFormString?.rawValue ] let nonNullParameters = APIHelper.rejectNil(formParams) @@ -494,7 +590,8 @@ open class FakeAPI: APIBase { url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ "enum_query_string_array": enumQueryStringArray, "enum_query_string": enumQueryString?.rawValue, - "enum_query_integer": enumQueryInteger?.rawValue + "enum_query_integer": enumQueryInteger?.rawValue, + "enum_query_double": enumQueryDouble?.rawValue ]) let nillableHeaders: [String: Any?] = [ "enum_header_string_array": enumHeaderStringArray, @@ -507,6 +604,129 @@ open class FakeAPI: APIBase { return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) } + /** + Fake endpoint to test group parameters (optional) + - parameter requiredStringGroup: (query) Required String in group parameters + - parameter requiredBooleanGroup: (header) Required Boolean in group parameters + - parameter requiredInt64Group: (query) Required Integer in group parameters + - parameter stringGroup: (query) String in group parameters (optional) + - parameter booleanGroup: (header) Boolean in group parameters (optional) + - parameter int64Group: (query) Integer in group parameters (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testGroupParameters(requiredStringGroup: Int32, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int32? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (response, error) -> Void in + completion(error) + } + } + + /** + Fake endpoint to test group parameters (optional) + - parameter requiredStringGroup: (query) Required String in group parameters + - parameter requiredBooleanGroup: (header) Required Boolean in group parameters + - parameter requiredInt64Group: (query) Required Integer in group parameters + - parameter stringGroup: (query) String in group parameters (optional) + - parameter booleanGroup: (header) Boolean in group parameters (optional) + - parameter int64Group: (query) Integer in group parameters (optional) + - returns: Observable + */ + open class func testGroupParameters(requiredStringGroup: Int32, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int32? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> Observable { + return Observable.create { observer -> Disposable in + testGroupParameters(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group) { error in + if let error = error { + observer.on(.error(error as Error)) + } else { + observer.on(.next()) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + Fake endpoint to test group parameters (optional) + - DELETE /fake + - Fake endpoint to test group parameters (optional) + - parameter requiredStringGroup: (query) Required String in group parameters + - parameter requiredBooleanGroup: (header) Required Boolean in group parameters + - parameter requiredInt64Group: (query) Required Integer in group parameters + - parameter stringGroup: (query) String in group parameters (optional) + - parameter booleanGroup: (header) Boolean in group parameters (optional) + - parameter int64Group: (query) Integer in group parameters (optional) + - returns: RequestBuilder + */ + open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int32, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int32? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { + let path = "/fake" + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + var url = URLComponents(string: URLString) + url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), + "int64_group": int64Group?.encodeToJSON() + ]) + let nillableHeaders: [String: Any?] = [ + "required_boolean_group": requiredBooleanGroup, + "boolean_group": booleanGroup + ] + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) + } + + /** + test inline additionalProperties + - parameter param: (body) request body + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testInlineAdditionalProperties(param: [String:String], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (response, error) -> Void in + completion(error) + } + } + + /** + test inline additionalProperties + - parameter param: (body) request body + - returns: Observable + */ + open class func testInlineAdditionalProperties(param: [String:String]) -> Observable { + return Observable.create { observer -> Disposable in + testInlineAdditionalProperties(param: param) { error in + if let error = error { + observer.on(.error(error as Error)) + } else { + observer.on(.next()) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + test inline additionalProperties + - POST /fake/inline-additionalProperties + - parameter param: (body) request body + - returns: RequestBuilder + */ + open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { + let path = "/fake/inline-additionalProperties" + let URLString = PetstoreClientAPI.basePath + path + let parameters = param.encodeToJSON() + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + /** test json serialization of form data - parameter param: (form) field1 diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index d2a6ecf21977..80fd6e47fd53 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -13,23 +13,23 @@ import RxSwift open class FakeClassnameTags123API: APIBase { /** To test class name in snake case - - parameter client: (body) client model + - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testClassname(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { - testClassnameWithRequestBuilder(client: client).execute { (response, error) -> Void in + open class func testClassname(body: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testClassnameWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } } /** To test class name in snake case - - parameter client: (body) client model + - parameter body: (body) client model - returns: Observable */ - open class func testClassname(client: Client) -> Observable { + open class func testClassname(body: Client) -> Observable { return Observable.create { observer -> Disposable in - testClassname(client: client) { data, error in + testClassname(body: body) { data, error in if let error = error { observer.on(.error(error as Error)) } else { @@ -48,13 +48,13 @@ open class FakeClassnameTags123API: APIBase { - API Key: - type: apiKey api_key_query (QUERY) - name: api_key_query - - parameter client: (body) client model + - parameter body: (body) client model - returns: RequestBuilder */ - open class func testClassnameWithRequestBuilder(client: Client) -> RequestBuilder { + open class func testClassnameWithRequestBuilder(body: Client) -> RequestBuilder { let path = "/fake_classname_test" let URLString = PetstoreClientAPI.basePath + path - let parameters = client.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 0cb25ffcbdb4..964c1ea0c06d 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -13,23 +13,23 @@ import RxSwift open class PetAPI: APIBase { /** Add a new pet to the store - - parameter pet: (body) Pet object that needs to be added to the store + - parameter body: (body) Pet object that needs to be added to the store - parameter completion: completion handler to receive the data and the error objects */ - open class func addPet(pet: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - addPetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in + open class func addPet(body: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + addPetWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error) } } /** Add a new pet to the store - - parameter pet: (body) Pet object that needs to be added to the store + - parameter body: (body) Pet object that needs to be added to the store - returns: Observable */ - open class func addPet(pet: Pet) -> Observable { + open class func addPet(body: Pet) -> Observable { return Observable.create { observer -> Disposable in - addPet(pet: pet) { error in + addPet(body: body) { error in if let error = error { observer.on(.error(error as Error)) } else { @@ -47,13 +47,13 @@ open class PetAPI: APIBase { - OAuth: - type: oauth2 - name: petstore_auth - - parameter pet: (body) Pet object that needs to be added to the store + - parameter body: (body) Pet object that needs to be added to the store - returns: RequestBuilder */ - open class func addPetWithRequestBuilder(pet: Pet) -> RequestBuilder { + open class func addPetWithRequestBuilder(body: Pet) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = pet.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -299,23 +299,23 @@ open class PetAPI: APIBase { /** Update an existing pet - - parameter pet: (body) Pet object that needs to be added to the store + - parameter body: (body) Pet object that needs to be added to the store - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePet(pet: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - updatePetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in + open class func updatePet(body: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + updatePetWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error) } } /** Update an existing pet - - parameter pet: (body) Pet object that needs to be added to the store + - parameter body: (body) Pet object that needs to be added to the store - returns: Observable */ - open class func updatePet(pet: Pet) -> Observable { + open class func updatePet(body: Pet) -> Observable { return Observable.create { observer -> Disposable in - updatePet(pet: pet) { error in + updatePet(body: body) { error in if let error = error { observer.on(.error(error as Error)) } else { @@ -333,13 +333,13 @@ open class PetAPI: APIBase { - OAuth: - type: oauth2 - name: petstore_auth - - parameter pet: (body) Pet object that needs to be added to the store + - parameter body: (body) Pet object that needs to be added to the store - returns: RequestBuilder */ - open class func updatePetWithRequestBuilder(pet: Pet) -> RequestBuilder { + open class func updatePetWithRequestBuilder(body: Pet) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = pet.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -480,4 +480,70 @@ open class PetAPI: APIBase { return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } + /** + uploads an image (required) + - parameter petId: (path) ID of pet to update + - parameter requiredFile: (form) file to upload + - parameter additionalMetadata: (form) Additional data to pass to server (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, completion: @escaping ((_ data: ApiResponse?, _ error: ErrorResponse?) -> Void)) { + uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + uploads an image (required) + - parameter petId: (path) ID of pet to update + - parameter requiredFile: (form) file to upload + - parameter additionalMetadata: (form) Additional data to pass to server (optional) + - returns: Observable + */ + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil) -> Observable { + return Observable.create { observer -> Disposable in + uploadFileWithRequiredFile(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata) { data, error in + if let error = error { + observer.on(.error(error as Error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + uploads an image (required) + - POST /fake/{petId}/uploadImageWithRequiredFile + - OAuth: + - type: oauth2 + - name: petstore_auth + - parameter petId: (path) ID of pet to update + - parameter requiredFile: (form) file to upload + - parameter additionalMetadata: (form) Additional data to pass to server (optional) + - returns: RequestBuilder + */ + open class func uploadFileWithRequiredFileWithRequestBuilder(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil) -> RequestBuilder { + var path = "/fake/{petId}/uploadImageWithRequiredFile" + let petIdPreEscape = "\(petId)" + let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let formParams: [String:Any?] = [ + "additionalMetadata": additionalMetadata, + "requiredFile": requiredFile + ] + + let nonNullParameters = APIHelper.rejectNil(formParams) + let parameters = APIHelper.convertBoolToString(nonNullParameters) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + } diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 1fc9de36c091..752f516020fd 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -166,23 +166,23 @@ open class StoreAPI: APIBase { /** Place an order for a pet - - parameter order: (body) order placed for purchasing the pet + - parameter body: (body) order placed for purchasing the pet - parameter completion: completion handler to receive the data and the error objects */ - open class func placeOrder(order: Order, completion: @escaping ((_ data: Order?, _ error: ErrorResponse?) -> Void)) { - placeOrderWithRequestBuilder(order: order).execute { (response, error) -> Void in + open class func placeOrder(body: Order, completion: @escaping ((_ data: Order?, _ error: ErrorResponse?) -> Void)) { + placeOrderWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } } /** Place an order for a pet - - parameter order: (body) order placed for purchasing the pet + - parameter body: (body) order placed for purchasing the pet - returns: Observable */ - open class func placeOrder(order: Order) -> Observable { + open class func placeOrder(body: Order) -> Observable { return Observable.create { observer -> Disposable in - placeOrder(order: order) { data, error in + placeOrder(body: body) { data, error in if let error = error { observer.on(.error(error as Error)) } else { @@ -197,13 +197,13 @@ open class StoreAPI: APIBase { /** Place an order for a pet - POST /store/order - - parameter order: (body) order placed for purchasing the pet + - parameter body: (body) order placed for purchasing the pet - returns: RequestBuilder */ - open class func placeOrderWithRequestBuilder(order: Order) -> RequestBuilder { + open class func placeOrderWithRequestBuilder(body: Order) -> RequestBuilder { let path = "/store/order" let URLString = PetstoreClientAPI.basePath + path - let parameters = order.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 0641d7201db4..8f69dfd4a4f9 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -13,23 +13,23 @@ import RxSwift open class UserAPI: APIBase { /** Create user - - parameter user: (body) Created user object + - parameter body: (body) Created user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUser(user: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - createUserWithRequestBuilder(user: user).execute { (response, error) -> Void in + open class func createUser(body: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUserWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error) } } /** Create user - - parameter user: (body) Created user object + - parameter body: (body) Created user object - returns: Observable */ - open class func createUser(user: User) -> Observable { + open class func createUser(body: User) -> Observable { return Observable.create { observer -> Disposable in - createUser(user: user) { error in + createUser(body: body) { error in if let error = error { observer.on(.error(error as Error)) } else { @@ -45,13 +45,13 @@ open class UserAPI: APIBase { Create user - POST /user - This can only be done by the logged in user. - - parameter user: (body) Created user object + - parameter body: (body) Created user object - returns: RequestBuilder */ - open class func createUserWithRequestBuilder(user: User) -> RequestBuilder { + open class func createUserWithRequestBuilder(body: User) -> RequestBuilder { let path = "/user" let URLString = PetstoreClientAPI.basePath + path - let parameters = user.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -62,23 +62,23 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - - parameter user: (body) List of user object + - parameter body: (body) List of user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithArrayInput(user: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(user: user).execute { (response, error) -> Void in + open class func createUsersWithArrayInput(body: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUsersWithArrayInputWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error) } } /** Creates list of users with given input array - - parameter user: (body) List of user object + - parameter body: (body) List of user object - returns: Observable */ - open class func createUsersWithArrayInput(user: [User]) -> Observable { + open class func createUsersWithArrayInput(body: [User]) -> Observable { return Observable.create { observer -> Disposable in - createUsersWithArrayInput(user: user) { error in + createUsersWithArrayInput(body: body) { error in if let error = error { observer.on(.error(error as Error)) } else { @@ -93,13 +93,13 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - POST /user/createWithArray - - parameter user: (body) List of user object + - parameter body: (body) List of user object - returns: RequestBuilder */ - open class func createUsersWithArrayInputWithRequestBuilder(user: [User]) -> RequestBuilder { + open class func createUsersWithArrayInputWithRequestBuilder(body: [User]) -> RequestBuilder { let path = "/user/createWithArray" let URLString = PetstoreClientAPI.basePath + path - let parameters = user.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -110,23 +110,23 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - - parameter user: (body) List of user object + - parameter body: (body) List of user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithListInput(user: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - createUsersWithListInputWithRequestBuilder(user: user).execute { (response, error) -> Void in + open class func createUsersWithListInput(body: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUsersWithListInputWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error) } } /** Creates list of users with given input array - - parameter user: (body) List of user object + - parameter body: (body) List of user object - returns: Observable */ - open class func createUsersWithListInput(user: [User]) -> Observable { + open class func createUsersWithListInput(body: [User]) -> Observable { return Observable.create { observer -> Disposable in - createUsersWithListInput(user: user) { error in + createUsersWithListInput(body: body) { error in if let error = error { observer.on(.error(error as Error)) } else { @@ -141,13 +141,13 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - POST /user/createWithList - - parameter user: (body) List of user object + - parameter body: (body) List of user object - returns: RequestBuilder */ - open class func createUsersWithListInputWithRequestBuilder(user: [User]) -> RequestBuilder { + open class func createUsersWithListInputWithRequestBuilder(body: [User]) -> RequestBuilder { let path = "/user/createWithList" let URLString = PetstoreClientAPI.basePath + path - let parameters = user.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -210,7 +210,7 @@ open class UserAPI: APIBase { /** Get user by user name - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. + - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - parameter completion: completion handler to receive the data and the error objects */ open class func getUserByName(username: String, completion: @escaping ((_ data: User?, _ error: ErrorResponse?) -> Void)) { @@ -221,7 +221,7 @@ open class UserAPI: APIBase { /** Get user by user name - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. + - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - returns: Observable */ open class func getUserByName(username: String) -> Observable { @@ -241,7 +241,7 @@ open class UserAPI: APIBase { /** Get user by user name - GET /user/{username} - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. + - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - returns: RequestBuilder */ open class func getUserByNameWithRequestBuilder(username: String) -> RequestBuilder { @@ -363,11 +363,11 @@ open class UserAPI: APIBase { /** Updated user - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object + - parameter body: (body) Updated user object - parameter completion: completion handler to receive the data and the error objects */ - open class func updateUser(username: String, user: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - updateUserWithRequestBuilder(username: username, user: user).execute { (response, error) -> Void in + open class func updateUser(username: String, body: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + updateUserWithRequestBuilder(username: username, body: body).execute { (response, error) -> Void in completion(error) } } @@ -375,12 +375,12 @@ open class UserAPI: APIBase { /** Updated user - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object + - parameter body: (body) Updated user object - returns: Observable */ - open class func updateUser(username: String, user: User) -> Observable { + open class func updateUser(username: String, body: User) -> Observable { return Observable.create { observer -> Disposable in - updateUser(username: username, user: user) { error in + updateUser(username: username, body: body) { error in if let error = error { observer.on(.error(error as Error)) } else { @@ -397,16 +397,16 @@ open class UserAPI: APIBase { - PUT /user/{username} - This can only be done by the logged in user. - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object + - parameter body: (body) Updated user object - returns: RequestBuilder */ - open class func updateUserWithRequestBuilder(username: String, user: User) -> RequestBuilder { + open class func updateUserWithRequestBuilder(username: String, body: User) -> RequestBuilder { var path = "/user/{username}" let usernamePreEscape = "\(username)" let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters = user.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models.swift index d1465fe4cbe4..264241b7d139 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -297,15 +297,15 @@ class Decoders { Decoders.addDecoder(clazz: AdditionalPropertiesClass.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in if let sourceDictionary = source as? [AnyHashable: Any] { let _result = instance == nil ? AdditionalPropertiesClass() : instance as! AdditionalPropertiesClass - switch Decoders.decodeOptional(clazz: [String:String].self, source: sourceDictionary["map_property"] as AnyObject?) { + switch Decoders.decodeOptional(clazz: [String:String].self, source: sourceDictionary["map_string"] as AnyObject?) { - case let .success(value): _result.mapProperty = value + case let .success(value): _result.mapString = value case let .failure(error): break } - switch Decoders.decodeOptional(clazz: [String:[String:String]].self, source: sourceDictionary["map_of_map_property"] as AnyObject?) { + switch Decoders.decodeOptional(clazz: [String:[String:String]].self, source: sourceDictionary["map_map_string"] as AnyObject?) { - case let .success(value): _result.mapOfMapProperty = value + case let .success(value): _result.mapMapString = value case let .failure(error): break } @@ -533,6 +533,26 @@ class Decoders { return .failure(.typeMismatch(expected: "Cat", actual: "\(source)")) } } + // Decoder for [CatAllOf] + Decoders.addDecoder(clazz: [CatAllOf].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[CatAllOf]> in + return Decoders.decode(clazz: [CatAllOf].self, source: source) + } + + // Decoder for CatAllOf + Decoders.addDecoder(clazz: CatAllOf.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = instance == nil ? CatAllOf() : instance as! CatAllOf + switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["declawed"] as AnyObject?) { + + case let .success(value): _result.declawed = value + case let .failure(error): break + + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "CatAllOf", actual: "\(source)")) + } + } // Decoder for [Category] Decoders.addDecoder(clazz: [Category].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Category]> in return Decoders.decode(clazz: [Category].self, source: source) @@ -634,6 +654,26 @@ class Decoders { return .failure(.typeMismatch(expected: "Dog", actual: "\(source)")) } } + // Decoder for [DogAllOf] + Decoders.addDecoder(clazz: [DogAllOf].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[DogAllOf]> in + return Decoders.decode(clazz: [DogAllOf].self, source: source) + } + + // Decoder for DogAllOf + Decoders.addDecoder(clazz: DogAllOf.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = instance == nil ? DogAllOf() : instance as! DogAllOf + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["breed"] as AnyObject?) { + + case let .success(value): _result.breed = value + case let .failure(error): break + + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "DogAllOf", actual: "\(source)")) + } + } // Decoder for [EnumArrays] Decoders.addDecoder(clazz: [EnumArrays].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[EnumArrays]> in return Decoders.decode(clazz: [EnumArrays].self, source: source) @@ -684,6 +724,12 @@ class Decoders { case let .success(value): _result.enumString = value case let .failure(error): break + } + switch Decoders.decodeOptional(clazz: EnumTest.EnumStringRequired.self, source: sourceDictionary["enum_string_required"] as AnyObject?) { + + case let .success(value): _result.enumStringRequired = value + case let .failure(error): break + } switch Decoders.decodeOptional(clazz: EnumTest.EnumInteger.self, source: sourceDictionary["enum_integer"] as AnyObject?) { @@ -708,6 +754,52 @@ class Decoders { return .failure(.typeMismatch(expected: "EnumTest", actual: "\(source)")) } } + // Decoder for [File] + Decoders.addDecoder(clazz: [File].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[File]> in + return Decoders.decode(clazz: [File].self, source: source) + } + + // Decoder for File + Decoders.addDecoder(clazz: File.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = instance == nil ? File() : instance as! File + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["sourceURI"] as AnyObject?) { + + case let .success(value): _result.sourceURI = value + case let .failure(error): break + + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "File", actual: "\(source)")) + } + } + // Decoder for [FileSchemaTestClass] + Decoders.addDecoder(clazz: [FileSchemaTestClass].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[FileSchemaTestClass]> in + return Decoders.decode(clazz: [FileSchemaTestClass].self, source: source) + } + + // Decoder for FileSchemaTestClass + Decoders.addDecoder(clazz: FileSchemaTestClass.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = instance == nil ? FileSchemaTestClass() : instance as! FileSchemaTestClass + switch Decoders.decodeOptional(clazz: File.self, source: sourceDictionary["file"] as AnyObject?) { + + case let .success(value): _result.file = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: [File].self, source: sourceDictionary["files"] as AnyObject?) { + + case let .success(value): _result.files = value + case let .failure(error): break + + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "FileSchemaTestClass", actual: "\(source)")) + } + } // Decoder for [FormatTest] Decoders.addDecoder(clazz: [FormatTest].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[FormatTest]> in return Decoders.decode(clazz: [FormatTest].self, source: source) @@ -866,6 +958,18 @@ class Decoders { case let .success(value): _result.mapOfEnumString = value case let .failure(error): break */ default: break //TODO: handle enum map scenario + } + switch Decoders.decodeOptional(clazz: [String:Bool].self, source: sourceDictionary["direct_map"] as AnyObject?) { + + case let .success(value): _result.directMap = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: [String:Bool].self, source: sourceDictionary["indirect_map"] as AnyObject?) { + + case let .success(value): _result.indirectMap = value + case let .failure(error): break + } return .success(_result) } else { @@ -1222,6 +1326,94 @@ class Decoders { return .failure(.typeMismatch(expected: "Tag", actual: "\(source)")) } } + // Decoder for [TypeHolderDefault] + Decoders.addDecoder(clazz: [TypeHolderDefault].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[TypeHolderDefault]> in + return Decoders.decode(clazz: [TypeHolderDefault].self, source: source) + } + + // Decoder for TypeHolderDefault + Decoders.addDecoder(clazz: TypeHolderDefault.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = instance == nil ? TypeHolderDefault() : instance as! TypeHolderDefault + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["string_item"] as AnyObject?) { + + case let .success(value): _result.stringItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: Double.self, source: sourceDictionary["number_item"] as AnyObject?) { + + case let .success(value): _result.numberItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["integer_item"] as AnyObject?) { + + case let .success(value): _result.integerItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["bool_item"] as AnyObject?) { + + case let .success(value): _result.boolItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: [Int32].self, source: sourceDictionary["array_item"] as AnyObject?) { + + case let .success(value): _result.arrayItem = value + case let .failure(error): break + + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "TypeHolderDefault", actual: "\(source)")) + } + } + // Decoder for [TypeHolderExample] + Decoders.addDecoder(clazz: [TypeHolderExample].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[TypeHolderExample]> in + return Decoders.decode(clazz: [TypeHolderExample].self, source: source) + } + + // Decoder for TypeHolderExample + Decoders.addDecoder(clazz: TypeHolderExample.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = instance == nil ? TypeHolderExample() : instance as! TypeHolderExample + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["string_item"] as AnyObject?) { + + case let .success(value): _result.stringItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: Double.self, source: sourceDictionary["number_item"] as AnyObject?) { + + case let .success(value): _result.numberItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["integer_item"] as AnyObject?) { + + case let .success(value): _result.integerItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["bool_item"] as AnyObject?) { + + case let .success(value): _result.boolItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: [Int32].self, source: sourceDictionary["array_item"] as AnyObject?) { + + case let .success(value): _result.arrayItem = value + case let .failure(error): break + + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "TypeHolderExample", actual: "\(source)")) + } + } // Decoder for [User] Decoders.addDecoder(clazz: [User].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[User]> in return Decoders.decode(clazz: [User].self, source: source) diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 48724b45a3d2..18238c78e35e 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -10,16 +10,16 @@ import Foundation open class AdditionalPropertiesClass: JSONEncodable { - public var mapProperty: [String:String]? - public var mapOfMapProperty: [String:[String:String]]? + public var mapString: [String:String]? + public var mapMapString: [String:[String:String]]? public init() {} // MARK: JSONEncodable open func encodeToJSON() -> Any { var nillableDictionary = [String:Any?]() - nillableDictionary["map_property"] = self.mapProperty?.encodeToJSON() - nillableDictionary["map_of_map_property"] = self.mapOfMapProperty?.encodeToJSON() + nillableDictionary["map_string"] = self.mapString?.encodeToJSON() + nillableDictionary["map_map_string"] = self.mapMapString?.encodeToJSON() let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift new file mode 100644 index 000000000000..4e59d9d26591 --- /dev/null +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -0,0 +1,26 @@ +// +// CatAllOf.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +open class CatAllOf: JSONEncodable { + + public var declawed: Bool? + + public init() {} + + // MARK: JSONEncodable + open func encodeToJSON() -> Any { + var nillableDictionary = [String:Any?]() + nillableDictionary["declawed"] = self.declawed + + let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] + return dictionary + } +} + diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift new file mode 100644 index 000000000000..6deb04c034e9 --- /dev/null +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -0,0 +1,26 @@ +// +// DogAllOf.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +open class DogAllOf: JSONEncodable { + + public var breed: String? + + public init() {} + + // MARK: JSONEncodable + open func encodeToJSON() -> Any { + var nillableDictionary = [String:Any?]() + nillableDictionary["breed"] = self.breed + + let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] + return dictionary + } +} + diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 59c0660b900d..0478bff2d394 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -15,6 +15,11 @@ open class EnumTest: JSONEncodable { case lower = "lower" case empty = "" } + public enum EnumStringRequired: String { + case upper = "UPPER" + case lower = "lower" + case empty = "" + } public enum EnumInteger: Int32 { case _1 = 1 case number1 = -1 @@ -24,6 +29,7 @@ open class EnumTest: JSONEncodable { case number12 = -1.2 } public var enumString: EnumString? + public var enumStringRequired: EnumStringRequired? public var enumInteger: EnumInteger? public var enumNumber: EnumNumber? public var outerEnum: OuterEnum? @@ -34,6 +40,7 @@ open class EnumTest: JSONEncodable { open func encodeToJSON() -> Any { var nillableDictionary = [String:Any?]() nillableDictionary["enum_string"] = self.enumString?.rawValue + nillableDictionary["enum_string_required"] = self.enumStringRequired?.rawValue nillableDictionary["enum_integer"] = self.enumInteger?.rawValue nillableDictionary["enum_number"] = self.enumNumber?.rawValue nillableDictionary["outerEnum"] = self.outerEnum?.encodeToJSON() diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/File.swift new file mode 100644 index 000000000000..86c8c66e9a4c --- /dev/null +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -0,0 +1,28 @@ +// +// File.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +/** Must be named `File` for test. */ +open class File: JSONEncodable { + + /** Test capitalization */ + public var sourceURI: String? + + public init() {} + + // MARK: JSONEncodable + open func encodeToJSON() -> Any { + var nillableDictionary = [String:Any?]() + nillableDictionary["sourceURI"] = self.sourceURI + + let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] + return dictionary + } +} + diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift new file mode 100644 index 000000000000..7cfb65481058 --- /dev/null +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -0,0 +1,28 @@ +// +// FileSchemaTestClass.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +open class FileSchemaTestClass: JSONEncodable { + + public var file: File? + public var files: [File]? + + public init() {} + + // MARK: JSONEncodable + open func encodeToJSON() -> Any { + var nillableDictionary = [String:Any?]() + nillableDictionary["file"] = self.file?.encodeToJSON() + nillableDictionary["files"] = self.files?.encodeToJSON() + + let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] + return dictionary + } +} + diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 7b6af62b0576..bbc87e81cc75 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -16,6 +16,8 @@ open class MapTest: JSONEncodable { } public var mapMapOfString: [String:[String:String]]? public var mapOfEnumString: [String:String]? + public var directMap: [String:Bool]? + public var indirectMap: [String:Bool]? public init() {} @@ -23,6 +25,8 @@ open class MapTest: JSONEncodable { open func encodeToJSON() -> Any { var nillableDictionary = [String:Any?]() nillableDictionary["map_map_of_string"] = self.mapMapOfString?.encodeToJSON()//TODO: handle enum map scenario + nillableDictionary["direct_map"] = self.directMap?.encodeToJSON() + nillableDictionary["indirect_map"] = self.indirectMap?.encodeToJSON() let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift new file mode 100644 index 000000000000..787c1ad682be --- /dev/null +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -0,0 +1,34 @@ +// +// TypeHolderDefault.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +open class TypeHolderDefault: JSONEncodable { + + public var stringItem: String? + public var numberItem: Double? + public var integerItem: Int32? + public var boolItem: Bool? + public var arrayItem: [Int32]? + + public init() {} + + // MARK: JSONEncodable + open func encodeToJSON() -> Any { + var nillableDictionary = [String:Any?]() + nillableDictionary["string_item"] = self.stringItem + nillableDictionary["number_item"] = self.numberItem + nillableDictionary["integer_item"] = self.integerItem?.encodeToJSON() + nillableDictionary["bool_item"] = self.boolItem + nillableDictionary["array_item"] = self.arrayItem?.encodeToJSON() + + let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] + return dictionary + } +} + diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift new file mode 100644 index 000000000000..5edab128d2b9 --- /dev/null +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -0,0 +1,34 @@ +// +// TypeHolderExample.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +open class TypeHolderExample: JSONEncodable { + + public var stringItem: String? + public var numberItem: Double? + public var integerItem: Int32? + public var boolItem: Bool? + public var arrayItem: [Int32]? + + public init() {} + + // MARK: JSONEncodable + open func encodeToJSON() -> Any { + var nillableDictionary = [String:Any?]() + nillableDictionary["string_item"] = self.stringItem + nillableDictionary["number_item"] = self.numberItem + nillableDictionary["integer_item"] = self.integerItem?.encodeToJSON() + nillableDictionary["bool_item"] = self.boolItem + nillableDictionary["array_item"] = self.arrayItem?.encodeToJSON() + + let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] + return dictionary + } +} + diff --git a/samples/client/petstore/swift3/unwraprequired/.openapi-generator/VERSION b/samples/client/petstore/swift3/unwraprequired/.openapi-generator/VERSION index 6d94c9c2e12a..83a328a9227e 100644 --- a/samples/client/petstore/swift3/unwraprequired/.openapi-generator/VERSION +++ b/samples/client/petstore/swift3/unwraprequired/.openapi-generator/VERSION @@ -1 +1 @@ -3.3.0-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index ea37e8c5966d..e95f9ab1efaf 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -12,11 +12,11 @@ import Alamofire open class AnotherFakeAPI: APIBase { /** To test special tags - - parameter client: (body) client model + - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testSpecialTags(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { - testSpecialTagsWithRequestBuilder(client: client).execute { (response, error) -> Void in + open class func call123testSpecialTags(body: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + call123testSpecialTagsWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -25,14 +25,14 @@ open class AnotherFakeAPI: APIBase { /** To test special tags - PATCH /another-fake/dummy - - To test special tags - - parameter client: (body) client model + - To test special tags and operation ID starting with number + - parameter body: (body) client model - returns: RequestBuilder */ - open class func testSpecialTagsWithRequestBuilder(client: Client) -> RequestBuilder { + open class func call123testSpecialTagsWithRequestBuilder(body: Client) -> RequestBuilder { let path = "/another-fake/dummy" let URLString = PetstoreClientAPI.basePath + path - let parameters = client.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index e44709f2459f..189479d0c386 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -40,11 +40,11 @@ open class FakeAPI: APIBase { } /** - - parameter outerComposite: (body) Input composite as post body (optional) + - parameter body: (body) Input composite as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterCompositeSerialize(outerComposite: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: ErrorResponse?) -> Void)) { - fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: outerComposite).execute { (response, error) -> Void in + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: ErrorResponse?) -> Void)) { + fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -53,13 +53,13 @@ open class FakeAPI: APIBase { /** - POST /fake/outer/composite - Test serialization of object with outer number type - - parameter outerComposite: (body) Input composite as post body (optional) + - parameter body: (body) Input composite as post body (optional) - returns: RequestBuilder */ - open class func fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: OuterComposite? = nil) -> RequestBuilder { + open class func fakeOuterCompositeSerializeWithRequestBuilder(body: OuterComposite? = nil) -> RequestBuilder { let path = "/fake/outer/composite" let URLString = PetstoreClientAPI.basePath + path - let parameters = outerComposite?.encodeToJSON() + let parameters = body?.encodeToJSON() let url = URLComponents(string: URLString) @@ -126,13 +126,75 @@ open class FakeAPI: APIBase { return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) } + /** + - parameter body: (body) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testBodyWithFileSchema(body: FileSchemaTestClass, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(error) + } + } + + + /** + - PUT /fake/body-with-file-schema + - For this test, the body for this request much reference a schema named `File`. + - parameter body: (body) + - returns: RequestBuilder + */ + open class func testBodyWithFileSchemaWithRequestBuilder(body: FileSchemaTestClass) -> RequestBuilder { + let path = "/fake/body-with-file-schema" + let URLString = PetstoreClientAPI.basePath + path + let parameters = body.encodeToJSON() + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + - parameter query: (query) + - parameter body: (body) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testBodyWithQueryParams(query: String, body: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (response, error) -> Void in + completion(error) + } + } + + + /** + - PUT /fake/body-with-query-params + - parameter query: (query) + - parameter body: (body) + - returns: RequestBuilder + */ + open class func testBodyWithQueryParamsWithRequestBuilder(query: String, body: User) -> RequestBuilder { + let path = "/fake/body-with-query-params" + let URLString = PetstoreClientAPI.basePath + path + let parameters = body.encodeToJSON() + + var url = URLComponents(string: URLString) + url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ + "query": query + ]) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + /** To test \"client\" model - - parameter client: (body) client model + - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testClientModel(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { - testClientModelWithRequestBuilder(client: client).execute { (response, error) -> Void in + open class func testClientModel(body: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testClientModelWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -142,13 +204,13 @@ open class FakeAPI: APIBase { To test \"client\" model - PATCH /fake - To test \"client\" model - - parameter client: (body) client model + - parameter body: (body) client model - returns: RequestBuilder */ - open class func testClientModelWithRequestBuilder(client: Client) -> RequestBuilder { + open class func testClientModelWithRequestBuilder(body: Client) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters = client.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -277,6 +339,14 @@ open class FakeAPI: APIBase { case number2 = -2 } + /** + * enum for parameter enumQueryDouble + */ + public enum EnumQueryDouble_testEnumParameters: Double { + case _11 = 1.1 + case number12 = -1.2 + } + /** * enum for parameter enumFormStringArray */ @@ -294,14 +364,6 @@ open class FakeAPI: APIBase { case xyz = "(xyz)" } - /** - * enum for parameter enumQueryDouble - */ - public enum EnumQueryDouble_testEnumParameters: Double { - case _11 = 1.1 - case number12 = -1.2 - } - /** To test enum parameters - parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional) @@ -309,13 +371,13 @@ open class FakeAPI: APIBase { - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) + - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) - parameter enumFormString: (form) Form parameter enum test (string) (optional) - - parameter enumQueryDouble: (form) Query parameter enum test (double) (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString, enumQueryDouble: enumQueryDouble).execute { (response, error) -> Void in + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (response, error) -> Void in completion(error) } } @@ -330,18 +392,17 @@ open class FakeAPI: APIBase { - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) + - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) - parameter enumFormString: (form) Form parameter enum test (string) (optional) - - parameter enumQueryDouble: (form) Query parameter enum test (double) (optional) - returns: RequestBuilder */ - open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil) -> RequestBuilder { + open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path let formParams: [String:Any?] = [ "enum_form_string_array": enumFormStringArray, - "enum_form_string": enumFormString?.rawValue, - "enum_query_double": enumQueryDouble?.rawValue + "enum_form_string": enumFormString?.rawValue ] let nonNullParameters = APIHelper.rejectNil(formParams) @@ -351,7 +412,8 @@ open class FakeAPI: APIBase { url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ "enum_query_string_array": enumQueryStringArray, "enum_query_string": enumQueryString?.rawValue, - "enum_query_integer": enumQueryInteger?.rawValue + "enum_query_integer": enumQueryInteger?.rawValue, + "enum_query_double": enumQueryDouble?.rawValue ]) let nillableHeaders: [String: Any?] = [ "enum_header_string_array": enumHeaderStringArray, @@ -364,6 +426,88 @@ open class FakeAPI: APIBase { return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) } + /** + Fake endpoint to test group parameters (optional) + - parameter requiredStringGroup: (query) Required String in group parameters + - parameter requiredBooleanGroup: (header) Required Boolean in group parameters + - parameter requiredInt64Group: (query) Required Integer in group parameters + - parameter stringGroup: (query) String in group parameters (optional) + - parameter booleanGroup: (header) Boolean in group parameters (optional) + - parameter int64Group: (query) Integer in group parameters (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testGroupParameters(requiredStringGroup: Int32, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int32? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (response, error) -> Void in + completion(error) + } + } + + + /** + Fake endpoint to test group parameters (optional) + - DELETE /fake + - Fake endpoint to test group parameters (optional) + - parameter requiredStringGroup: (query) Required String in group parameters + - parameter requiredBooleanGroup: (header) Required Boolean in group parameters + - parameter requiredInt64Group: (query) Required Integer in group parameters + - parameter stringGroup: (query) String in group parameters (optional) + - parameter booleanGroup: (header) Boolean in group parameters (optional) + - parameter int64Group: (query) Integer in group parameters (optional) + - returns: RequestBuilder + */ + open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int32, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int32? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { + let path = "/fake" + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + var url = URLComponents(string: URLString) + url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), + "int64_group": int64Group?.encodeToJSON() + ]) + let nillableHeaders: [String: Any?] = [ + "required_boolean_group": requiredBooleanGroup, + "boolean_group": booleanGroup + ] + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) + } + + /** + test inline additionalProperties + - parameter param: (body) request body + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testInlineAdditionalProperties(param: [String:String], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (response, error) -> Void in + completion(error) + } + } + + + /** + test inline additionalProperties + - POST /fake/inline-additionalProperties + - parameter param: (body) request body + - returns: RequestBuilder + */ + open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { + let path = "/fake/inline-additionalProperties" + let URLString = PetstoreClientAPI.basePath + path + let parameters = param.encodeToJSON() + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + /** test json serialization of form data - parameter param: (form) field1 diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 20514a3b6e6b..79a28854094c 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -12,11 +12,11 @@ import Alamofire open class FakeClassnameTags123API: APIBase { /** To test class name in snake case - - parameter client: (body) client model + - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testClassname(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { - testClassnameWithRequestBuilder(client: client).execute { (response, error) -> Void in + open class func testClassname(body: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testClassnameWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -29,13 +29,13 @@ open class FakeClassnameTags123API: APIBase { - API Key: - type: apiKey api_key_query (QUERY) - name: api_key_query - - parameter client: (body) client model + - parameter body: (body) client model - returns: RequestBuilder */ - open class func testClassnameWithRequestBuilder(client: Client) -> RequestBuilder { + open class func testClassnameWithRequestBuilder(body: Client) -> RequestBuilder { let path = "/fake_classname_test" let URLString = PetstoreClientAPI.basePath + path - let parameters = client.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 8648214c7309..495468f63e35 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -12,11 +12,11 @@ import Alamofire open class PetAPI: APIBase { /** Add a new pet to the store - - parameter pet: (body) Pet object that needs to be added to the store + - parameter body: (body) Pet object that needs to be added to the store - parameter completion: completion handler to receive the data and the error objects */ - open class func addPet(pet: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - addPetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in + open class func addPet(body: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + addPetWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error) } } @@ -28,13 +28,13 @@ open class PetAPI: APIBase { - OAuth: - type: oauth2 - name: petstore_auth - - parameter pet: (body) Pet object that needs to be added to the store + - parameter body: (body) Pet object that needs to be added to the store - returns: RequestBuilder */ - open class func addPetWithRequestBuilder(pet: Pet) -> RequestBuilder { + open class func addPetWithRequestBuilder(body: Pet) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = pet.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -207,11 +207,11 @@ open class PetAPI: APIBase { /** Update an existing pet - - parameter pet: (body) Pet object that needs to be added to the store + - parameter body: (body) Pet object that needs to be added to the store - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePet(pet: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - updatePetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in + open class func updatePet(body: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + updatePetWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error) } } @@ -223,13 +223,13 @@ open class PetAPI: APIBase { - OAuth: - type: oauth2 - name: petstore_auth - - parameter pet: (body) Pet object that needs to be added to the store + - parameter body: (body) Pet object that needs to be added to the store - returns: RequestBuilder */ - open class func updatePetWithRequestBuilder(pet: Pet) -> RequestBuilder { + open class func updatePetWithRequestBuilder(body: Pet) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = pet.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -330,4 +330,50 @@ open class PetAPI: APIBase { return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } + /** + uploads an image (required) + - parameter petId: (path) ID of pet to update + - parameter requiredFile: (form) file to upload + - parameter additionalMetadata: (form) Additional data to pass to server (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, completion: @escaping ((_ data: ApiResponse?, _ error: ErrorResponse?) -> Void)) { + uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + + /** + uploads an image (required) + - POST /fake/{petId}/uploadImageWithRequiredFile + - OAuth: + - type: oauth2 + - name: petstore_auth + - parameter petId: (path) ID of pet to update + - parameter requiredFile: (form) file to upload + - parameter additionalMetadata: (form) Additional data to pass to server (optional) + - returns: RequestBuilder + */ + open class func uploadFileWithRequiredFileWithRequestBuilder(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil) -> RequestBuilder { + var path = "/fake/{petId}/uploadImageWithRequiredFile" + let petIdPreEscape = "\(petId)" + let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let formParams: [String:Any?] = [ + "additionalMetadata": additionalMetadata, + "requiredFile": requiredFile + ] + + let nonNullParameters = APIHelper.rejectNil(formParams) + let parameters = APIHelper.convertBoolToString(nonNullParameters) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + } diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 66dbd6f25d8c..84cea5213bab 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -112,11 +112,11 @@ open class StoreAPI: APIBase { /** Place an order for a pet - - parameter order: (body) order placed for purchasing the pet + - parameter body: (body) order placed for purchasing the pet - parameter completion: completion handler to receive the data and the error objects */ - open class func placeOrder(order: Order, completion: @escaping ((_ data: Order?, _ error: ErrorResponse?) -> Void)) { - placeOrderWithRequestBuilder(order: order).execute { (response, error) -> Void in + open class func placeOrder(body: Order, completion: @escaping ((_ data: Order?, _ error: ErrorResponse?) -> Void)) { + placeOrderWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -125,13 +125,13 @@ open class StoreAPI: APIBase { /** Place an order for a pet - POST /store/order - - parameter order: (body) order placed for purchasing the pet + - parameter body: (body) order placed for purchasing the pet - returns: RequestBuilder */ - open class func placeOrderWithRequestBuilder(order: Order) -> RequestBuilder { + open class func placeOrderWithRequestBuilder(body: Order) -> RequestBuilder { let path = "/store/order" let URLString = PetstoreClientAPI.basePath + path - let parameters = order.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index eee28ea249ac..7abdf0b76cd7 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -12,11 +12,11 @@ import Alamofire open class UserAPI: APIBase { /** Create user - - parameter user: (body) Created user object + - parameter body: (body) Created user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUser(user: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - createUserWithRequestBuilder(user: user).execute { (response, error) -> Void in + open class func createUser(body: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUserWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error) } } @@ -26,13 +26,13 @@ open class UserAPI: APIBase { Create user - POST /user - This can only be done by the logged in user. - - parameter user: (body) Created user object + - parameter body: (body) Created user object - returns: RequestBuilder */ - open class func createUserWithRequestBuilder(user: User) -> RequestBuilder { + open class func createUserWithRequestBuilder(body: User) -> RequestBuilder { let path = "/user" let URLString = PetstoreClientAPI.basePath + path - let parameters = user.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -43,11 +43,11 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - - parameter user: (body) List of user object + - parameter body: (body) List of user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithArrayInput(user: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(user: user).execute { (response, error) -> Void in + open class func createUsersWithArrayInput(body: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUsersWithArrayInputWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error) } } @@ -56,13 +56,13 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - POST /user/createWithArray - - parameter user: (body) List of user object + - parameter body: (body) List of user object - returns: RequestBuilder */ - open class func createUsersWithArrayInputWithRequestBuilder(user: [User]) -> RequestBuilder { + open class func createUsersWithArrayInputWithRequestBuilder(body: [User]) -> RequestBuilder { let path = "/user/createWithArray" let URLString = PetstoreClientAPI.basePath + path - let parameters = user.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -73,11 +73,11 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - - parameter user: (body) List of user object + - parameter body: (body) List of user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithListInput(user: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - createUsersWithListInputWithRequestBuilder(user: user).execute { (response, error) -> Void in + open class func createUsersWithListInput(body: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUsersWithListInputWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error) } } @@ -86,13 +86,13 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - POST /user/createWithList - - parameter user: (body) List of user object + - parameter body: (body) List of user object - returns: RequestBuilder */ - open class func createUsersWithListInputWithRequestBuilder(user: [User]) -> RequestBuilder { + open class func createUsersWithListInputWithRequestBuilder(body: [User]) -> RequestBuilder { let path = "/user/createWithList" let URLString = PetstoreClientAPI.basePath + path - let parameters = user.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -137,7 +137,7 @@ open class UserAPI: APIBase { /** Get user by user name - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. + - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - parameter completion: completion handler to receive the data and the error objects */ open class func getUserByName(username: String, completion: @escaping ((_ data: User?, _ error: ErrorResponse?) -> Void)) { @@ -150,7 +150,7 @@ open class UserAPI: APIBase { /** Get user by user name - GET /user/{username} - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. + - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - returns: RequestBuilder */ open class func getUserByNameWithRequestBuilder(username: String) -> RequestBuilder { @@ -236,11 +236,11 @@ open class UserAPI: APIBase { /** Updated user - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object + - parameter body: (body) Updated user object - parameter completion: completion handler to receive the data and the error objects */ - open class func updateUser(username: String, user: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - updateUserWithRequestBuilder(username: username, user: user).execute { (response, error) -> Void in + open class func updateUser(username: String, body: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + updateUserWithRequestBuilder(username: username, body: body).execute { (response, error) -> Void in completion(error) } } @@ -251,16 +251,16 @@ open class UserAPI: APIBase { - PUT /user/{username} - This can only be done by the logged in user. - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object + - parameter body: (body) Updated user object - returns: RequestBuilder */ - open class func updateUserWithRequestBuilder(username: String, user: User) -> RequestBuilder { + open class func updateUserWithRequestBuilder(username: String, body: User) -> RequestBuilder { var path = "/user/{username}" let usernamePreEscape = "\(username)" let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters = user.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models.swift index ae32e6fab12c..a9eba8b46f3a 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -297,12 +297,12 @@ class Decoders { Decoders.addDecoder(clazz: AdditionalPropertiesClass.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in if let sourceDictionary = source as? [AnyHashable: Any] { let _result = AdditionalPropertiesClass() - switch Decoders.decodeOptional(clazz: [String:String].self, source: sourceDictionary["map_property"] as AnyObject?) { - case let .success(value): _result.mapProperty = value + switch Decoders.decodeOptional(clazz: [String:String].self, source: sourceDictionary["map_string"] as AnyObject?) { + case let .success(value): _result.mapString = value case let .failure(error): break } - switch Decoders.decodeOptional(clazz: [String:[String:String]].self, source: sourceDictionary["map_of_map_property"] as AnyObject?) { - case let .success(value): _result.mapOfMapProperty = value + switch Decoders.decodeOptional(clazz: [String:[String:String]].self, source: sourceDictionary["map_map_string"] as AnyObject?) { + case let .success(value): _result.mapMapString = value case let .failure(error): break } return .success(_result) @@ -492,6 +492,24 @@ class Decoders { return .failure(.typeMismatch(expected: "Cat", actual: "\(source)")) } } + // Decoder for [CatAllOf] + Decoders.addDecoder(clazz: [CatAllOf].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[CatAllOf]> in + return Decoders.decode(clazz: [CatAllOf].self, source: source) + } + + // Decoder for CatAllOf + Decoders.addDecoder(clazz: CatAllOf.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = CatAllOf() + switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["declawed"] as AnyObject?) { + case let .success(value): _result.declawed = value + case let .failure(error): break + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "CatAllOf", actual: "\(source)")) + } + } // Decoder for [Category] Decoders.addDecoder(clazz: [Category].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Category]> in return Decoders.decode(clazz: [Category].self, source: source) @@ -500,15 +518,17 @@ class Decoders { // Decoder for Category Decoders.addDecoder(clazz: Category.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = Category() + guard let nameSource = sourceDictionary["name"] as AnyObject? else { + return .failure(.missingKey(key: "name")) + } + guard let name = Decoders.decode(clazz: String.self.self, source: nameSource).value else { + return .failure(.typeMismatch(expected: "Category", actual: "\(nameSource)")) + } + let _result = Category(name: name) switch Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"] as AnyObject?) { case let .success(value): _result.id = value case let .failure(error): break } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["name"] as AnyObject?) { - case let .success(value): _result.name = value - case let .failure(error): break - } return .success(_result) } else { return .failure(.typeMismatch(expected: "Category", actual: "\(source)")) @@ -578,6 +598,24 @@ class Decoders { return .failure(.typeMismatch(expected: "Dog", actual: "\(source)")) } } + // Decoder for [DogAllOf] + Decoders.addDecoder(clazz: [DogAllOf].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[DogAllOf]> in + return Decoders.decode(clazz: [DogAllOf].self, source: source) + } + + // Decoder for DogAllOf + Decoders.addDecoder(clazz: DogAllOf.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = DogAllOf() + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["breed"] as AnyObject?) { + case let .success(value): _result.breed = value + case let .failure(error): break + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "DogAllOf", actual: "\(source)")) + } + } // Decoder for [EnumArrays] Decoders.addDecoder(clazz: [EnumArrays].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[EnumArrays]> in return Decoders.decode(clazz: [EnumArrays].self, source: source) @@ -618,7 +656,13 @@ class Decoders { // Decoder for EnumTest Decoders.addDecoder(clazz: EnumTest.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = EnumTest() + guard let enumStringRequiredSource = sourceDictionary["enum_string_required"] as AnyObject? else { + return .failure(.missingKey(key: "enum_string_required")) + } + guard let enumStringRequired = Decoders.decode(clazz: EnumTest.EnumStringRequired.self.self, source: enumStringRequiredSource).value else { + return .failure(.typeMismatch(expected: "EnumTest", actual: "\(enumStringRequiredSource)")) + } + let _result = EnumTest(enumStringRequired: enumStringRequired) switch Decoders.decodeOptional(clazz: EnumTest.EnumString.self, source: sourceDictionary["enum_string"] as AnyObject?) { case let .success(value): _result.enumString = value case let .failure(error): break @@ -640,6 +684,46 @@ class Decoders { return .failure(.typeMismatch(expected: "EnumTest", actual: "\(source)")) } } + // Decoder for [File] + Decoders.addDecoder(clazz: [File].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[File]> in + return Decoders.decode(clazz: [File].self, source: source) + } + + // Decoder for File + Decoders.addDecoder(clazz: File.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = File() + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["sourceURI"] as AnyObject?) { + case let .success(value): _result.sourceURI = value + case let .failure(error): break + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "File", actual: "\(source)")) + } + } + // Decoder for [FileSchemaTestClass] + Decoders.addDecoder(clazz: [FileSchemaTestClass].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[FileSchemaTestClass]> in + return Decoders.decode(clazz: [FileSchemaTestClass].self, source: source) + } + + // Decoder for FileSchemaTestClass + Decoders.addDecoder(clazz: FileSchemaTestClass.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = FileSchemaTestClass() + switch Decoders.decodeOptional(clazz: File.self, source: sourceDictionary["file"] as AnyObject?) { + case let .success(value): _result.file = value + case let .failure(error): break + } + switch Decoders.decodeOptional(clazz: [File].self, source: sourceDictionary["files"] as AnyObject?) { + case let .success(value): _result.files = value + case let .failure(error): break + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "FileSchemaTestClass", actual: "\(source)")) + } + } // Decoder for [FormatTest] Decoders.addDecoder(clazz: [FormatTest].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[FormatTest]> in return Decoders.decode(clazz: [FormatTest].self, source: source) @@ -771,6 +855,14 @@ class Decoders { case let .success(value): _result.mapOfEnumString = value case let .failure(error): break } + switch Decoders.decodeOptional(clazz: [String:Bool].self, source: sourceDictionary["direct_map"] as AnyObject?) { + case let .success(value): _result.directMap = value + case let .failure(error): break + } + switch Decoders.decodeOptional(clazz: [String:Bool].self, source: sourceDictionary["indirect_map"] as AnyObject?) { + case let .success(value): _result.indirectMap = value + case let .failure(error): break + } return .success(_result) } else { return .failure(.typeMismatch(expected: "MapTest", actual: "\(source)")) @@ -1070,6 +1162,94 @@ class Decoders { return .failure(.typeMismatch(expected: "Tag", actual: "\(source)")) } } + // Decoder for [TypeHolderDefault] + Decoders.addDecoder(clazz: [TypeHolderDefault].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[TypeHolderDefault]> in + return Decoders.decode(clazz: [TypeHolderDefault].self, source: source) + } + + // Decoder for TypeHolderDefault + Decoders.addDecoder(clazz: TypeHolderDefault.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + guard let stringItemSource = sourceDictionary["string_item"] as AnyObject? else { + return .failure(.missingKey(key: "string_item")) + } + guard let stringItem = Decoders.decode(clazz: String.self.self, source: stringItemSource).value else { + return .failure(.typeMismatch(expected: "TypeHolderDefault", actual: "\(stringItemSource)")) + } + guard let numberItemSource = sourceDictionary["number_item"] as AnyObject? else { + return .failure(.missingKey(key: "number_item")) + } + guard let numberItem = Decoders.decode(clazz: Double.self.self, source: numberItemSource).value else { + return .failure(.typeMismatch(expected: "TypeHolderDefault", actual: "\(numberItemSource)")) + } + guard let integerItemSource = sourceDictionary["integer_item"] as AnyObject? else { + return .failure(.missingKey(key: "integer_item")) + } + guard let integerItem = Decoders.decode(clazz: Int32.self.self, source: integerItemSource).value else { + return .failure(.typeMismatch(expected: "TypeHolderDefault", actual: "\(integerItemSource)")) + } + guard let boolItemSource = sourceDictionary["bool_item"] as AnyObject? else { + return .failure(.missingKey(key: "bool_item")) + } + guard let boolItem = Decoders.decode(clazz: Bool.self.self, source: boolItemSource).value else { + return .failure(.typeMismatch(expected: "TypeHolderDefault", actual: "\(boolItemSource)")) + } + guard let arrayItemSource = sourceDictionary["array_item"] as AnyObject? else { + return .failure(.missingKey(key: "array_item")) + } + guard let arrayItem = Decoders.decode(clazz: [Int32].self.self, source: arrayItemSource).value else { + return .failure(.typeMismatch(expected: "TypeHolderDefault", actual: "\(arrayItemSource)")) + } + let _result = TypeHolderDefault(stringItem: stringItem, numberItem: numberItem, integerItem: integerItem, boolItem: boolItem, arrayItem: arrayItem) + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "TypeHolderDefault", actual: "\(source)")) + } + } + // Decoder for [TypeHolderExample] + Decoders.addDecoder(clazz: [TypeHolderExample].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[TypeHolderExample]> in + return Decoders.decode(clazz: [TypeHolderExample].self, source: source) + } + + // Decoder for TypeHolderExample + Decoders.addDecoder(clazz: TypeHolderExample.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + guard let stringItemSource = sourceDictionary["string_item"] as AnyObject? else { + return .failure(.missingKey(key: "string_item")) + } + guard let stringItem = Decoders.decode(clazz: String.self.self, source: stringItemSource).value else { + return .failure(.typeMismatch(expected: "TypeHolderExample", actual: "\(stringItemSource)")) + } + guard let numberItemSource = sourceDictionary["number_item"] as AnyObject? else { + return .failure(.missingKey(key: "number_item")) + } + guard let numberItem = Decoders.decode(clazz: Double.self.self, source: numberItemSource).value else { + return .failure(.typeMismatch(expected: "TypeHolderExample", actual: "\(numberItemSource)")) + } + guard let integerItemSource = sourceDictionary["integer_item"] as AnyObject? else { + return .failure(.missingKey(key: "integer_item")) + } + guard let integerItem = Decoders.decode(clazz: Int32.self.self, source: integerItemSource).value else { + return .failure(.typeMismatch(expected: "TypeHolderExample", actual: "\(integerItemSource)")) + } + guard let boolItemSource = sourceDictionary["bool_item"] as AnyObject? else { + return .failure(.missingKey(key: "bool_item")) + } + guard let boolItem = Decoders.decode(clazz: Bool.self.self, source: boolItemSource).value else { + return .failure(.typeMismatch(expected: "TypeHolderExample", actual: "\(boolItemSource)")) + } + guard let arrayItemSource = sourceDictionary["array_item"] as AnyObject? else { + return .failure(.missingKey(key: "array_item")) + } + guard let arrayItem = Decoders.decode(clazz: [Int32].self.self, source: arrayItemSource).value else { + return .failure(.typeMismatch(expected: "TypeHolderExample", actual: "\(arrayItemSource)")) + } + let _result = TypeHolderExample(stringItem: stringItem, numberItem: numberItem, integerItem: integerItem, boolItem: boolItem, arrayItem: arrayItem) + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "TypeHolderExample", actual: "\(source)")) + } + } // Decoder for [User] Decoders.addDecoder(clazz: [User].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[User]> in return Decoders.decode(clazz: [User].self, source: source) diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index c36f0571b306..dc74e77f88cd 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -10,19 +10,19 @@ import Foundation open class AdditionalPropertiesClass: JSONEncodable { - public var mapProperty: [String:String]? - public var mapOfMapProperty: [String:[String:String]]? + public var mapString: [String:String]? + public var mapMapString: [String:[String:String]]? - public init(mapProperty: [String:String]?=nil, mapOfMapProperty: [String:[String:String]]?=nil) { - self.mapProperty = mapProperty - self.mapOfMapProperty = mapOfMapProperty + public init(mapString: [String:String]?=nil, mapMapString: [String:[String:String]]?=nil) { + self.mapString = mapString + self.mapMapString = mapMapString } // MARK: JSONEncodable open func encodeToJSON() -> Any { var nillableDictionary = [String:Any?]() - nillableDictionary["map_property"] = self.mapProperty?.encodeToJSON() - nillableDictionary["map_of_map_property"] = self.mapOfMapProperty?.encodeToJSON() + nillableDictionary["map_string"] = self.mapString?.encodeToJSON() + nillableDictionary["map_map_string"] = self.mapMapString?.encodeToJSON() let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift new file mode 100644 index 000000000000..4c083939dc49 --- /dev/null +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -0,0 +1,28 @@ +// +// CatAllOf.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +open class CatAllOf: JSONEncodable { + + public var declawed: Bool? + + + public init(declawed: Bool?=nil) { + self.declawed = declawed + } + // MARK: JSONEncodable + open func encodeToJSON() -> Any { + var nillableDictionary = [String:Any?]() + nillableDictionary["declawed"] = self.declawed + + let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] + return dictionary + } +} + diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index 61d01b5e094f..69cd8cd074e3 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -11,10 +11,10 @@ import Foundation open class Category: JSONEncodable { public var id: Int64? - public var name: String? + public var name: String - public init(id: Int64?=nil, name: String?=nil) { + public init(id: Int64?=nil, name: String) { self.id = id self.name = name } diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift new file mode 100644 index 000000000000..15af0a5ae6a0 --- /dev/null +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -0,0 +1,28 @@ +// +// DogAllOf.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +open class DogAllOf: JSONEncodable { + + public var breed: String? + + + public init(breed: String?=nil) { + self.breed = breed + } + // MARK: JSONEncodable + open func encodeToJSON() -> Any { + var nillableDictionary = [String:Any?]() + nillableDictionary["breed"] = self.breed + + let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] + return dictionary + } +} + diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 896b7d33b20a..57865687dd68 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -15,6 +15,11 @@ open class EnumTest: JSONEncodable { case lower = "lower" case empty = "" } + public enum EnumStringRequired: String { + case upper = "UPPER" + case lower = "lower" + case empty = "" + } public enum EnumInteger: Int32 { case _1 = 1 case number1 = -1 @@ -24,13 +29,15 @@ open class EnumTest: JSONEncodable { case number12 = -1.2 } public var enumString: EnumString? + public var enumStringRequired: EnumStringRequired public var enumInteger: EnumInteger? public var enumNumber: EnumNumber? public var outerEnum: OuterEnum? - public init(enumString: EnumString?=nil, enumInteger: EnumInteger?=nil, enumNumber: EnumNumber?=nil, outerEnum: OuterEnum?=nil) { + public init(enumString: EnumString?=nil, enumStringRequired: EnumStringRequired, enumInteger: EnumInteger?=nil, enumNumber: EnumNumber?=nil, outerEnum: OuterEnum?=nil) { self.enumString = enumString + self.enumStringRequired = enumStringRequired self.enumInteger = enumInteger self.enumNumber = enumNumber self.outerEnum = outerEnum @@ -39,6 +46,7 @@ open class EnumTest: JSONEncodable { open func encodeToJSON() -> Any { var nillableDictionary = [String:Any?]() nillableDictionary["enum_string"] = self.enumString?.rawValue + nillableDictionary["enum_string_required"] = self.enumStringRequired.rawValue nillableDictionary["enum_integer"] = self.enumInteger?.rawValue nillableDictionary["enum_number"] = self.enumNumber?.rawValue nillableDictionary["outerEnum"] = self.outerEnum?.encodeToJSON() diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/File.swift new file mode 100644 index 000000000000..aa9f7b4bd45e --- /dev/null +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -0,0 +1,30 @@ +// +// File.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +/** Must be named `File` for test. */ +open class File: JSONEncodable { + + /** Test capitalization */ + public var sourceURI: String? + + + public init(sourceURI: String?=nil) { + self.sourceURI = sourceURI + } + // MARK: JSONEncodable + open func encodeToJSON() -> Any { + var nillableDictionary = [String:Any?]() + nillableDictionary["sourceURI"] = self.sourceURI + + let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] + return dictionary + } +} + diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift new file mode 100644 index 000000000000..5751c16d0c1f --- /dev/null +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -0,0 +1,31 @@ +// +// FileSchemaTestClass.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +open class FileSchemaTestClass: JSONEncodable { + + public var file: File? + public var files: [File]? + + + public init(file: File?=nil, files: [File]?=nil) { + self.file = file + self.files = files + } + // MARK: JSONEncodable + open func encodeToJSON() -> Any { + var nillableDictionary = [String:Any?]() + nillableDictionary["file"] = self.file?.encodeToJSON() + nillableDictionary["files"] = self.files?.encodeToJSON() + + let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] + return dictionary + } +} + diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index b1f04aad6ce7..b5f10f5061bc 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -16,16 +16,22 @@ open class MapTest: JSONEncodable { } public var mapMapOfString: [String:[String:String]]? public var mapOfEnumString: [String:String]? + public var directMap: [String:Bool]? + public var indirectMap: [String:Bool]? - public init(mapMapOfString: [String:[String:String]]?=nil, mapOfEnumString: [String:String]?=nil) { + public init(mapMapOfString: [String:[String:String]]?=nil, mapOfEnumString: [String:String]?=nil, directMap: [String:Bool]?=nil, indirectMap: [String:Bool]?=nil) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString + self.directMap = directMap + self.indirectMap = indirectMap } // MARK: JSONEncodable open func encodeToJSON() -> Any { var nillableDictionary = [String:Any?]() nillableDictionary["map_map_of_string"] = self.mapMapOfString?.encodeToJSON()//TODO: handle enum map scenario + nillableDictionary["direct_map"] = self.directMap?.encodeToJSON() + nillableDictionary["indirect_map"] = self.indirectMap?.encodeToJSON() let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift new file mode 100644 index 000000000000..5cdf544a1bfc --- /dev/null +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -0,0 +1,40 @@ +// +// TypeHolderDefault.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +open class TypeHolderDefault: JSONEncodable { + + public var stringItem: String + public var numberItem: Double + public var integerItem: Int32 + public var boolItem: Bool + public var arrayItem: [Int32] + + + public init(stringItem: String, numberItem: Double, integerItem: Int32, boolItem: Bool, arrayItem: [Int32]) { + self.stringItem = stringItem + self.numberItem = numberItem + self.integerItem = integerItem + self.boolItem = boolItem + self.arrayItem = arrayItem + } + // MARK: JSONEncodable + open func encodeToJSON() -> Any { + var nillableDictionary = [String:Any?]() + nillableDictionary["string_item"] = self.stringItem + nillableDictionary["number_item"] = self.numberItem + nillableDictionary["integer_item"] = self.integerItem.encodeToJSON() + nillableDictionary["bool_item"] = self.boolItem + nillableDictionary["array_item"] = self.arrayItem.encodeToJSON() + + let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] + return dictionary + } +} + diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift new file mode 100644 index 000000000000..63b305a74f20 --- /dev/null +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -0,0 +1,40 @@ +// +// TypeHolderExample.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +open class TypeHolderExample: JSONEncodable { + + public var stringItem: String + public var numberItem: Double + public var integerItem: Int32 + public var boolItem: Bool + public var arrayItem: [Int32] + + + public init(stringItem: String, numberItem: Double, integerItem: Int32, boolItem: Bool, arrayItem: [Int32]) { + self.stringItem = stringItem + self.numberItem = numberItem + self.integerItem = integerItem + self.boolItem = boolItem + self.arrayItem = arrayItem + } + // MARK: JSONEncodable + open func encodeToJSON() -> Any { + var nillableDictionary = [String:Any?]() + nillableDictionary["string_item"] = self.stringItem + nillableDictionary["number_item"] = self.numberItem + nillableDictionary["integer_item"] = self.integerItem.encodeToJSON() + nillableDictionary["bool_item"] = self.boolItem + nillableDictionary["array_item"] = self.arrayItem.encodeToJSON() + + let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] + return dictionary + } +} + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 75dea2439575..d94614b34fc7 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -7,7 +7,7 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { + public static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { let destination = source.reduce(into: [String: Any]()) { (result, item) in if let value = item.value { result[item.key] = value @@ -20,17 +20,17 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { + public static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { return source.reduce(into: [String: String]()) { (result, item) in if let collection = item.value as? Array { - result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") + result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } } } - public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { + public static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { guard let source = source else { return nil } @@ -52,7 +52,7 @@ public struct APIHelper { return source } - public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { + public static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in if let collection = item.value as? Array { let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") @@ -68,3 +68,4 @@ public struct APIHelper { return destination } } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs.swift index 9e4312f685de..2890bffa2747 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -9,22 +9,22 @@ import Foundation open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io:80/v2" public static var credential: URLCredential? - public static var customHeaders: [String: String] = [:] + public static var customHeaders: [String:String] = [:] public static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() } open class RequestBuilder { var credential: URLCredential? - var headers: [String: String] - public let parameters: [String: Any]? + var headers: [String:String] + public let parameters: [String:Any]? public let isBody: Bool public let method: String public let URLString: String /// Optional block to obtain a reference to the request's progress instance when available. - public var onProgressReady: ((Progress) -> Void)? + public var onProgressReady: ((Progress) -> ())? - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters @@ -34,7 +34,7 @@ open class RequestBuilder { addHeaders(PetstoreClientAPI.customHeaders) } - open func addHeaders(_ aHeaders: [String: String]) { + open func addHeaders(_ aHeaders:[String:String]) { for (header, value) in aHeaders { headers[header] = value } @@ -57,5 +57,5 @@ open class RequestBuilder { public protocol RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 30b346de0e1d..ffecb66c48c2 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -8,6 +8,8 @@ import Foundation import Alamofire + + open class AnotherFakeAPI { /** To test special tags @@ -15,7 +17,7 @@ open class AnotherFakeAPI { - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func call123testSpecialTags(body: Client, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + open class func call123testSpecialTags(body: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { call123testSpecialTagsWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 1073935592c0..302767c2b0c2 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -8,13 +8,15 @@ import Foundation import Alamofire + + open class FakeAPI { /** - parameter body: (body) Input boolean as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterBooleanSerialize(body: Bool? = nil, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) { + open class func fakeOuterBooleanSerialize(body: Bool? = nil, completion: @escaping ((_ data: Bool?,_ error: Error?) -> Void)) { fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -43,7 +45,7 @@ open class FakeAPI { - parameter body: (body) Input composite as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) { + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?,_ error: Error?) -> Void)) { fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -72,7 +74,7 @@ open class FakeAPI { - parameter body: (body) Input number as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterNumberSerialize(body: Double? = nil, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) { + open class func fakeOuterNumberSerialize(body: Double? = nil, completion: @escaping ((_ data: Double?,_ error: Error?) -> Void)) { fakeOuterNumberSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -101,7 +103,7 @@ open class FakeAPI { - parameter body: (body) Input string as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterStringSerialize(body: String? = nil, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { + open class func fakeOuterStringSerialize(body: String? = nil, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { fakeOuterStringSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -130,7 +132,7 @@ open class FakeAPI { - parameter body: (body) - parameter completion: completion handler to receive the data and the error objects */ - open class func testBodyWithFileSchema(body: FileSchemaTestClass, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testBodyWithFileSchema(body: FileSchemaTestClass, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (response, error) -> Void in if error == nil { completion((), error) @@ -164,7 +166,7 @@ open class FakeAPI { - parameter body: (body) - parameter completion: completion handler to receive the data and the error objects */ - open class func testBodyWithQueryParams(query: String, body: User, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testBodyWithQueryParams(query: String, body: User, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (response, error) -> Void in if error == nil { completion((), error) @@ -201,7 +203,7 @@ open class FakeAPI { - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testClientModel(body: Client, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + open class func testClientModel(body: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { testClientModelWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -245,7 +247,7 @@ open class FakeAPI { - parameter callback: (form) None (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testEndpointParametersWithRequestBuilder(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback).execute { (response, error) -> Void in if error == nil { completion((), error) @@ -281,7 +283,7 @@ open class FakeAPI { open class func testEndpointParametersWithRequestBuilder(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "integer": integer?.encodeToJSON(), "int32": int32?.encodeToJSON(), "int64": int64?.encodeToJSON(), @@ -300,7 +302,7 @@ open class FakeAPI { let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -388,7 +390,7 @@ open class FakeAPI { - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to .-efg) - parameter completion: completion handler to receive the data and the error objects */ - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (response, error) -> Void in if error == nil { completion((), error) @@ -415,19 +417,19 @@ open class FakeAPI { open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "enum_form_string_array": enumFormStringArray, "enum_form_string": enumFormString?.rawValue ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": enumQueryStringArray, - "enum_query_string": enumQueryString?.rawValue, - "enum_query_integer": enumQueryInteger?.rawValue, + "enum_query_string_array": enumQueryStringArray, + "enum_query_string": enumQueryString?.rawValue, + "enum_query_integer": enumQueryInteger?.rawValue, "enum_query_double": enumQueryDouble?.rawValue ]) let nillableHeaders: [String: Any?] = [ @@ -452,7 +454,7 @@ open class FakeAPI { - parameter int64Group: (query) Integer in group parameters (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (response, error) -> Void in if error == nil { completion((), error) @@ -477,13 +479,13 @@ open class FakeAPI { open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), "int64_group": int64Group?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -503,7 +505,7 @@ open class FakeAPI { - parameter param: (body) request body - parameter completion: completion handler to receive the data and the error objects */ - open class func testInlineAdditionalProperties(param: [String: String], completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testInlineAdditionalProperties(param: [String:String], completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (response, error) -> Void in if error == nil { completion((), error) @@ -519,7 +521,7 @@ open class FakeAPI { - parameter param: (body) request body - returns: RequestBuilder */ - open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder { + open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { let path = "/fake/inline-additionalProperties" let URLString = PetstoreClientAPI.basePath + path let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param) @@ -538,7 +540,7 @@ open class FakeAPI { - parameter param2: (form) field2 - parameter completion: completion handler to receive the data and the error objects */ - open class func testJsonFormData(param: String, param2: String, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testJsonFormData(param: String, param2: String, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute { (response, error) -> Void in if error == nil { completion((), error) @@ -558,14 +560,14 @@ open class FakeAPI { open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { let path = "/fake/jsonFormData" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "param": param, "param2": param2 ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 6bfa09016f5a..ddfeae23edd0 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -8,6 +8,8 @@ import Foundation import Alamofire + + open class FakeClassnameTags123API { /** To test class name in snake case @@ -15,7 +17,7 @@ open class FakeClassnameTags123API { - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testClassname(body: Client, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + open class func testClassname(body: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { testClassnameWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 896f1511805f..0a5dfeb39b62 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -8,6 +8,8 @@ import Foundation import Alamofire + + open class PetAPI { /** Add a new pet to the store @@ -15,7 +17,7 @@ open class PetAPI { - parameter body: (body) Pet object that needs to be added to the store - parameter completion: completion handler to receive the data and the error objects */ - open class func addPet(body: Pet, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func addPet(body: Pet, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { addPetWithRequestBuilder(body: body).execute { (response, error) -> Void in if error == nil { completion((), error) @@ -53,7 +55,7 @@ open class PetAPI { - parameter apiKey: (header) (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func deletePet(petId: Int64, apiKey: String? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func deletePet(petId: Int64, apiKey: String? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (response, error) -> Void in if error == nil { completion((), error) @@ -79,8 +81,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let nillableHeaders: [String: Any?] = [ "api_key": apiKey @@ -107,7 +109,7 @@ open class PetAPI { - parameter status: (query) Status values that need to be considered for filter - parameter completion: completion handler to receive the data and the error objects */ - open class func findPetsByStatus(status: [String], completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { + open class func findPetsByStatus(status: [String], completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { findPetsByStatusWithRequestBuilder(status: status).execute { (response, error) -> Void in completion(response?.body, error) } @@ -126,8 +128,8 @@ open class PetAPI { open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByStatus" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "status": status @@ -144,7 +146,7 @@ open class PetAPI { - parameter tags: (query) Tags to filter by - parameter completion: completion handler to receive the data and the error objects */ - open class func findPetsByTags(tags: [String], completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { + open class func findPetsByTags(tags: [String], completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { findPetsByTagsWithRequestBuilder(tags: tags).execute { (response, error) -> Void in completion(response?.body, error) } @@ -163,8 +165,8 @@ open class PetAPI { open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "tags": tags @@ -181,7 +183,7 @@ open class PetAPI { - parameter petId: (path) ID of pet to return - parameter completion: completion handler to receive the data and the error objects */ - open class func getPetById(petId: Int64, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) { + open class func getPetById(petId: Int64, completion: @escaping ((_ data: Pet?,_ error: Error?) -> Void)) { getPetByIdWithRequestBuilder(petId: petId).execute { (response, error) -> Void in completion(response?.body, error) } @@ -203,8 +205,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -218,7 +220,7 @@ open class PetAPI { - parameter body: (body) Pet object that needs to be added to the store - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePet(body: Pet, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func updatePet(body: Pet, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { updatePetWithRequestBuilder(body: body).execute { (response, error) -> Void in if error == nil { completion((), error) @@ -257,7 +259,7 @@ open class PetAPI { - parameter status: (form) Updated status of the pet (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (response, error) -> Void in if error == nil { completion((), error) @@ -284,14 +286,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "name": name, "status": status ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -307,7 +309,7 @@ open class PetAPI { - parameter file: (form) file to upload (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute { (response, error) -> Void in completion(response?.body, error) } @@ -330,14 +332,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata, "file": file ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -353,7 +355,7 @@ open class PetAPI { - parameter additionalMetadata: (form) Additional data to pass to server (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute { (response, error) -> Void in completion(response?.body, error) } @@ -376,14 +378,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata, "requiredFile": requiredFile ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 71949b335d77..a2bced598f0d 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -8,6 +8,8 @@ import Foundation import Alamofire + + open class StoreAPI { /** Delete purchase order by ID @@ -15,7 +17,7 @@ open class StoreAPI { - parameter orderId: (path) ID of the order that needs to be deleted - parameter completion: completion handler to receive the data and the error objects */ - open class func deleteOrder(orderId: String, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func deleteOrder(orderId: String, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { deleteOrderWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in if error == nil { completion((), error) @@ -38,8 +40,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -52,7 +54,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ - open class func getInventory(completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) { + open class func getInventory(completion: @escaping ((_ data: [String:Int]?,_ error: Error?) -> Void)) { getInventoryWithRequestBuilder().execute { (response, error) -> Void in completion(response?.body, error) } @@ -67,14 +69,14 @@ open class StoreAPI { - name: api_key - returns: RequestBuilder<[String:Int]> */ - open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { + open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> { let path = "/store/inventory" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } @@ -85,7 +87,7 @@ open class StoreAPI { - parameter orderId: (path) ID of pet that needs to be fetched - parameter completion: completion handler to receive the data and the error objects */ - open class func getOrderById(orderId: Int64, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { + open class func getOrderById(orderId: Int64, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { getOrderByIdWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in completion(response?.body, error) } @@ -104,8 +106,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -119,7 +121,7 @@ open class StoreAPI { - parameter body: (body) order placed for purchasing the pet - parameter completion: completion handler to receive the data and the error objects */ - open class func placeOrder(body: Order, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { + open class func placeOrder(body: Order, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { placeOrderWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index efeb64468a5c..d8cafaf2c962 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -8,6 +8,8 @@ import Foundation import Alamofire + + open class UserAPI { /** Create user @@ -15,7 +17,7 @@ open class UserAPI { - parameter body: (body) Created user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUser(body: User, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func createUser(body: User, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { createUserWithRequestBuilder(body: body).execute { (response, error) -> Void in if error == nil { completion((), error) @@ -50,7 +52,7 @@ open class UserAPI { - parameter body: (body) List of user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithArrayInput(body: [User], completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func createUsersWithArrayInput(body: [User], completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { createUsersWithArrayInputWithRequestBuilder(body: body).execute { (response, error) -> Void in if error == nil { completion((), error) @@ -84,7 +86,7 @@ open class UserAPI { - parameter body: (body) List of user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithListInput(body: [User], completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func createUsersWithListInput(body: [User], completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { createUsersWithListInputWithRequestBuilder(body: body).execute { (response, error) -> Void in if error == nil { completion((), error) @@ -118,7 +120,7 @@ open class UserAPI { - parameter username: (path) The name that needs to be deleted - parameter completion: completion handler to receive the data and the error objects */ - open class func deleteUser(username: String, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func deleteUser(username: String, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { deleteUserWithRequestBuilder(username: username).execute { (response, error) -> Void in if error == nil { completion((), error) @@ -141,8 +143,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -156,7 +158,7 @@ open class UserAPI { - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - parameter completion: completion handler to receive the data and the error objects */ - open class func getUserByName(username: String, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) { + open class func getUserByName(username: String, completion: @escaping ((_ data: User?,_ error: Error?) -> Void)) { getUserByNameWithRequestBuilder(username: username).execute { (response, error) -> Void in completion(response?.body, error) } @@ -174,8 +176,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -190,7 +192,7 @@ open class UserAPI { - parameter password: (query) The password for login in clear text - parameter completion: completion handler to receive the data and the error objects */ - open class func loginUser(username: String, password: String, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { + open class func loginUser(username: String, password: String, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { loginUserWithRequestBuilder(username: username, password: password).execute { (response, error) -> Void in completion(response?.body, error) } @@ -207,11 +209,11 @@ open class UserAPI { open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { let path = "/user/login" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": username, + "username": username, "password": password ]) @@ -225,7 +227,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ - open class func logoutUser(completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func logoutUser(completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { logoutUserWithRequestBuilder().execute { (response, error) -> Void in if error == nil { completion((), error) @@ -243,8 +245,8 @@ open class UserAPI { open class func logoutUserWithRequestBuilder() -> RequestBuilder { let path = "/user/logout" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -259,7 +261,7 @@ open class UserAPI { - parameter body: (body) Updated user object - parameter completion: completion handler to receive the data and the error objects */ - open class func updateUser(username: String, body: User, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func updateUser(username: String, body: User, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { updateUserWithRequestBuilder(username: username, body: body).execute { (response, error) -> Void in if error == nil { completion((), error) diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift index 04ad02a5ce88..dac40e9a31cf 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift @@ -12,7 +12,7 @@ class AlamofireRequestBuilderFactory: RequestBuilderFactory { return AlamofireRequestBuilder.self } - func getBuilder() -> RequestBuilder.Type { + func getBuilder() -> RequestBuilder.Type { return AlamofireDecodableRequestBuilder.self } } @@ -50,7 +50,7 @@ private struct SynchronizedDictionary { private var managerStore = SynchronizedDictionary() open class AlamofireRequestBuilder: RequestBuilder { - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } @@ -88,17 +88,17 @@ open class AlamofireRequestBuilder: RequestBuilder { May be overridden by a subclass if you want to control the request configuration (e.g. to override the cache policy). */ - open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) -> DataRequest { + open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) -> DataRequest { return manager.request(URLString, method: method, parameters: parameters, encoding: encoding, headers: headers) } override open func execute(_ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { - let managerId: String = UUID().uuidString + let managerId:String = UUID().uuidString // Create a new manager for each request to customize its request header let manager = createSessionManager() managerStore[managerId] = manager - let encoding: ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() + let encoding:ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() let xMethod = Alamofire.HTTPMethod(rawValue: method) let fileKeys = parameters == nil ? [] : parameters!.filter { $1 is NSURL } @@ -111,7 +111,8 @@ open class AlamofireRequestBuilder: RequestBuilder { case let fileURL as URL: if let mimeType = self.contentTypeForFormPart(fileURL: fileURL) { mpForm.append(fileURL, withName: k, fileName: fileURL.lastPathComponent, mimeType: mimeType) - } else { + } + else { mpForm.append(fileURL, withName: k) } case let string as String: @@ -275,7 +276,7 @@ open class AlamofireRequestBuilder: RequestBuilder { return httpHeaders } - fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { + fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { guard let contentDisposition = contentDisposition else { return nil @@ -283,7 +284,7 @@ open class AlamofireRequestBuilder: RequestBuilder { let items = contentDisposition.components(separatedBy: ";") - var filename: String? = nil + var filename : String? = nil for contentItem in items { @@ -303,7 +304,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } - fileprivate func getPath(from url: URL) throws -> String { + fileprivate func getPath(from url : URL) throws -> String { guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { throw DownloadException.requestMissingPath @@ -317,7 +318,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } - fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { + fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { guard let url = urlRequest.url else { throw DownloadException.requestMissingURL @@ -328,7 +329,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } -private enum DownloadException: Error { +fileprivate enum DownloadException : Error { case responseDataMissing case responseFailed case requestMissing @@ -343,7 +344,7 @@ public enum AlamofireDecodableRequestBuilderError: Error { case generalError(Error) } -open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { +open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { override fileprivate func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { if let credential = self.credential { diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index 111d5a3a8cbe..584de8c3d57a 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -13,7 +13,7 @@ open class CodableHelper { public static var dateformatter: DateFormatter? - open class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T: Decodable { + open class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T : Decodable { var returnedDecodable: T? = nil var returnedError: Error? = nil @@ -39,7 +39,7 @@ open class CodableHelper { return (returnedDecodable, returnedError) } - open class func encode(_ value: T, prettyPrint: Bool = false) -> EncodeResult where T: Encodable { + open class func encode(_ value: T, prettyPrint: Bool = false) -> EncodeResult where T : Encodable { var returnedData: Data? var returnedError: Error? = nil diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Configuration.swift index e1ecb39726e7..516590da5d9e 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -7,9 +7,9 @@ import Foundation open class Configuration { - + // This value is used to configure the date formatter that is used to serialize dates into JSON format. // You must set it prior to encoding any dates, and it will only be read once. public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} + +} \ No newline at end of file diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 24c128daadef..8bf1829ba806 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -112,24 +112,24 @@ extension String: CodingKey { extension KeyedEncodingContainerProtocol { - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { var arrayContainer = nestedUnkeyedContainer(forKey: key) try arrayContainer.encode(contentsOf: values) } - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { if let values = values { try encodeArray(values, forKey: key) } } - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { for (key, value) in pairs { try encode(value, forKey: key) } } - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { if let pairs = pairs { try encodeMap(pairs) } @@ -139,7 +139,7 @@ extension KeyedEncodingContainerProtocol { extension KeyedDecodingContainerProtocol { - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { var tmpArray = [T]() var nestedContainer = try nestedUnkeyedContainer(forKey: key) @@ -151,7 +151,7 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { var tmpArray: [T]? = nil if contains(key) { @@ -161,8 +161,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { - var map: [Self.Key: T] = [:] + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { + var map: [Self.Key : T] = [:] for key in allKeys { if !excludedKeys.contains(key) { @@ -175,3 +175,5 @@ extension KeyedDecodingContainerProtocol { } } + + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift index 3e68bb5d4a9b..70449515842d 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -10,7 +10,7 @@ import Alamofire open class JSONEncodingHelper { - open class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { + open class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { var params: Parameters? = nil // Encode the Encodable object @@ -39,5 +39,5 @@ open class JSONEncodingHelper { return params } - + } diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models.swift index e87ce399c7c8..408563890359 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,7 +10,7 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -public enum ErrorResponse: Error { +public enum ErrorResponse : Error { case error(Int, Data?, Error) } diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 83a06951ccd6..4db39adae84c 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -7,19 +7,23 @@ import Foundation + + public struct AdditionalPropertiesClass: Codable { - public var mapString: [String: String]? - public var mapMapString: [String: [String: String]]? + public var mapString: [String:String]? + public var mapMapString: [String:[String:String]]? - public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { + public init(mapString: [String:String]?, mapMapString: [String:[String:String]]?) { self.mapString = mapString self.mapMapString = mapMapString } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case mapString = "map_string" case mapMapString = "map_map_string" } + } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index 5ed9f31e2a36..7221a1be099d 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -7,6 +7,8 @@ import Foundation + + public struct Animal: Codable { public var className: String @@ -17,4 +19,6 @@ public struct Animal: Codable { self.color = color } + } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift index e09b0e9efdc8..e7bea63f8ed2 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -7,4 +7,5 @@ import Foundation + public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index ec270da89074..a22e9aaebbb0 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -7,6 +7,8 @@ import Foundation + + public struct ApiResponse: Codable { public var code: Int? @@ -19,4 +21,6 @@ public struct ApiResponse: Codable { self.message = message } + } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 3843287630b1..4e5a5ca1445d 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,6 +7,8 @@ import Foundation + + public struct ArrayOfArrayOfNumberOnly: Codable { public var arrayArrayNumber: [[Double]]? @@ -15,8 +17,10 @@ public struct ArrayOfArrayOfNumberOnly: Codable { self.arrayArrayNumber = arrayArrayNumber } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case arrayArrayNumber = "ArrayArrayNumber" } + } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index f8b198e81f50..7d059d368339 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -7,6 +7,8 @@ import Foundation + + public struct ArrayOfNumberOnly: Codable { public var arrayNumber: [Double]? @@ -15,8 +17,10 @@ public struct ArrayOfNumberOnly: Codable { self.arrayNumber = arrayNumber } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case arrayNumber = "ArrayNumber" } + } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index 67f7f7e5151f..9c56fed50c2e 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -7,6 +7,8 @@ import Foundation + + public struct ArrayTest: Codable { public var arrayOfString: [String]? @@ -19,10 +21,12 @@ public struct ArrayTest: Codable { self.arrayArrayOfModel = arrayArrayOfModel } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" case arrayArrayOfModel = "array_array_of_model" } + } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index d576b50b1c9c..98cda23dac9e 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -7,6 +7,8 @@ import Foundation + + public struct Capitalization: Codable { public var smallCamel: String? @@ -26,7 +28,7 @@ public struct Capitalization: Codable { self.ATT_NAME = ATT_NAME } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case smallCamel case capitalCamel = "CapitalCamel" case smallSnake = "small_Snake" @@ -35,4 +37,6 @@ public struct Capitalization: Codable { case ATT_NAME } + } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 7ab887f3113f..a116d964ea84 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -7,6 +7,8 @@ import Foundation + + public struct Cat: Codable { public var className: String @@ -19,4 +21,6 @@ public struct Cat: Codable { self.declawed = declawed } + } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index a51ad0dffab1..b5404f052cb7 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -7,6 +7,8 @@ import Foundation + + public struct CatAllOf: Codable { public var declawed: Bool? @@ -15,4 +17,6 @@ public struct CatAllOf: Codable { self.declawed = declawed } + } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index eb8f7e5e1974..e8c489be4604 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,6 +7,8 @@ import Foundation + + public struct Category: Codable { public var id: Int64? @@ -17,4 +19,6 @@ public struct Category: Codable { self.name = name } + } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index 28cb30ce7b4b..f673ed127cd8 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -7,6 +7,7 @@ import Foundation + /** Model for testing model with \"_class\" property */ public struct ClassModel: Codable { @@ -17,4 +18,6 @@ public struct ClassModel: Codable { self._class = _class } + } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 00245ca37280..51390b6c4eac 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -7,6 +7,8 @@ import Foundation + + public struct Client: Codable { public var client: String? @@ -15,4 +17,6 @@ public struct Client: Codable { self.client = client } + } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 492c1228008e..239ce74dcc21 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -7,6 +7,8 @@ import Foundation + + public struct Dog: Codable { public var className: String @@ -19,4 +21,6 @@ public struct Dog: Codable { self.breed = breed } + } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 7786f8acc5ae..dc8bd63af9d6 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -7,6 +7,8 @@ import Foundation + + public struct DogAllOf: Codable { public var breed: String? @@ -15,4 +17,6 @@ public struct DogAllOf: Codable { self.breed = breed } + } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 5034ff0b8c68..8713961520e1 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -7,6 +7,8 @@ import Foundation + + public struct EnumArrays: Codable { public enum JustSymbol: String, Codable { @@ -25,9 +27,11 @@ public struct EnumArrays: Codable { self.arrayEnum = arrayEnum } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case justSymbol = "just_symbol" case arrayEnum = "array_enum" } + } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index 3c1dfcac577d..7280a621fec7 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -7,6 +7,7 @@ import Foundation + public enum EnumClass: String, Codable { case abc = "_abc" case efg = "-efg" diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 6db9b34d183b..0f546c76a218 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -7,6 +7,8 @@ import Foundation + + public struct EnumTest: Codable { public enum EnumString: String, Codable { @@ -41,7 +43,7 @@ public struct EnumTest: Codable { self.outerEnum = outerEnum } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case enumString = "enum_string" case enumStringRequired = "enum_string_required" case enumInteger = "enum_integer" @@ -49,4 +51,6 @@ public struct EnumTest: Codable { case outerEnum } + } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/File.swift index ea3520f053dd..c8bd1f19589b 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -7,6 +7,7 @@ import Foundation + /** Must be named `File` for test. */ public struct File: Codable { @@ -18,4 +19,6 @@ public struct File: Codable { self.sourceURI = sourceURI } + } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 532f1457939a..64d025068027 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -7,6 +7,8 @@ import Foundation + + public struct FileSchemaTestClass: Codable { public var file: File? @@ -17,4 +19,6 @@ public struct FileSchemaTestClass: Codable { self.files = files } + } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index 20bd6d103b3d..faa091b0658c 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -7,6 +7,8 @@ import Foundation + + public struct FormatTest: Codable { public var integer: Int? @@ -39,4 +41,6 @@ public struct FormatTest: Codable { self.password = password } + } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 906ddb06fb17..554aee1081aa 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -7,6 +7,8 @@ import Foundation + + public struct HasOnlyReadOnly: Codable { public var bar: String? @@ -17,4 +19,6 @@ public struct HasOnlyReadOnly: Codable { self.foo = foo } + } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/List.swift index 08d59953873e..8997340ff4be 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -7,6 +7,8 @@ import Foundation + + public struct List: Codable { public var _123list: String? @@ -15,8 +17,10 @@ public struct List: Codable { self._123list = _123list } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case _123list = "123-list" } + } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 3a10a7dfcaf6..2d3a45d35a0c 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -7,29 +7,33 @@ import Foundation + + public struct MapTest: Codable { public enum MapOfEnumString: String, Codable { case upper = "UPPER" case lower = "lower" } - public var mapMapOfString: [String: [String: String]]? - public var mapOfEnumString: [String: String]? - public var directMap: [String: Bool]? + public var mapMapOfString: [String:[String:String]]? + public var mapOfEnumString: [String:String]? + public var directMap: [String:Bool]? public var indirectMap: StringBooleanMap? - public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { + public init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?, directMap: [String:Bool]?, indirectMap: StringBooleanMap?) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap self.indirectMap = indirectMap } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" case directMap = "direct_map" case indirectMap = "indirect_map" } + } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index c3deb2f28932..7116108fd7a3 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,16 +7,20 @@ import Foundation + + public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { public var uuid: UUID? public var dateTime: Date? - public var map: [String: Animal]? + public var map: [String:Animal]? - public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { + public init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) { self.uuid = uuid self.dateTime = dateTime self.map = map } + } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index 7ed6aad907be..fc1d0606b7ba 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -7,6 +7,7 @@ import Foundation + /** Model for testing model name starting with number */ public struct Model200Response: Codable { @@ -19,9 +20,11 @@ public struct Model200Response: Codable { self._class = _class } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case name case _class = "class" } + } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index ce9ffe4fb38e..cc165d767d91 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -7,6 +7,7 @@ import Foundation + /** Model for testing model name same as property name */ public struct Name: Codable { @@ -23,11 +24,13 @@ public struct Name: Codable { self._123number = _123number } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case name case snakeCase = "snake_case" case property case _123number = "123Number" } + } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index abd2269e8e76..e6fb206093aa 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -7,6 +7,8 @@ import Foundation + + public struct NumberOnly: Codable { public var justNumber: Double? @@ -15,8 +17,10 @@ public struct NumberOnly: Codable { self.justNumber = justNumber } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case justNumber = "JustNumber" } + } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index a6e1b1d2e5e4..83c3b85e6629 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -7,6 +7,8 @@ import Foundation + + public struct Order: Codable { public enum Status: String, Codable { @@ -31,4 +33,6 @@ public struct Order: Codable { self.complete = complete } + } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 49aec001c5db..edc4523d9f00 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -7,6 +7,8 @@ import Foundation + + public struct OuterComposite: Codable { public var myNumber: Double? @@ -19,10 +21,12 @@ public struct OuterComposite: Codable { self.myBoolean = myBoolean } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case myNumber = "my_number" case myString = "my_string" case myBoolean = "my_boolean" } + } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index 9f80fc95ecf0..bd1643d279ed 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -7,6 +7,7 @@ import Foundation + public enum OuterEnum: String, Codable { case placed = "placed" case approved = "approved" diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index af60a550bb19..5e39abae6c8f 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,6 +7,8 @@ import Foundation + + public struct Pet: Codable { public enum Status: String, Codable { @@ -31,4 +33,6 @@ public struct Pet: Codable { self.status = status } + } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 0acd21fd1000..48b655a5b0aa 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -7,6 +7,8 @@ import Foundation + + public struct ReadOnlyFirst: Codable { public var bar: String? @@ -17,4 +19,6 @@ public struct ReadOnlyFirst: Codable { self.baz = baz } + } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index 076082af842f..de4b218999b7 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -7,6 +7,7 @@ import Foundation + /** Model for testing reserved words */ public struct Return: Codable { @@ -17,8 +18,10 @@ public struct Return: Codable { self._return = _return } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case _return = "return" } + } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index e79fc45c0e91..213d896ba988 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -7,6 +7,8 @@ import Foundation + + public struct SpecialModelName: Codable { public var specialPropertyName: Int64? @@ -15,8 +17,10 @@ public struct SpecialModelName: Codable { self.specialPropertyName = specialPropertyName } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case specialPropertyName = "$special[property.name]" } + } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index 3f1237fee477..ae15e87d94bb 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -7,9 +7,12 @@ import Foundation + + public struct StringBooleanMap: Codable { - public var additionalProperties: [String: Bool] = [:] + + public var additionalProperties: [String:Bool] = [:] public subscript(key: String) -> Bool? { get { @@ -42,4 +45,7 @@ public struct StringBooleanMap: Codable { additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } + + } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 4dd8a9a9f5a0..32ee33a1a1e0 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,6 +7,8 @@ import Foundation + + public struct Tag: Codable { public var id: Int64? @@ -17,4 +19,6 @@ public struct Tag: Codable { self.name = name } + } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index bf0006e1a266..be1afdf0266c 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -7,6 +7,8 @@ import Foundation + + public struct TypeHolderDefault: Codable { public var stringItem: String = "what" @@ -23,7 +25,7 @@ public struct TypeHolderDefault: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" @@ -31,4 +33,6 @@ public struct TypeHolderDefault: Codable { case arrayItem = "array_item" } + } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index 602a2a6d185a..f46c8952e13e 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -7,6 +7,8 @@ import Foundation + + public struct TypeHolderExample: Codable { public var stringItem: String @@ -23,7 +25,7 @@ public struct TypeHolderExample: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" @@ -31,4 +33,6 @@ public struct TypeHolderExample: Codable { case arrayItem = "array_item" } + } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 79f271ed7356..a61b5844201e 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -7,6 +7,8 @@ import Foundation + + public struct User: Codable { public var id: Int64? @@ -30,4 +32,6 @@ public struct User: Codable { self.userStatus = userStatus } + } + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 75dea2439575..d94614b34fc7 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -7,7 +7,7 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { + public static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { let destination = source.reduce(into: [String: Any]()) { (result, item) in if let value = item.value { result[item.key] = value @@ -20,17 +20,17 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { + public static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { return source.reduce(into: [String: String]()) { (result, item) in if let collection = item.value as? Array { - result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") + result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } } } - public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { + public static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { guard let source = source else { return nil } @@ -52,7 +52,7 @@ public struct APIHelper { return source } - public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { + public static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in if let collection = item.value as? Array { let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") @@ -68,3 +68,4 @@ public struct APIHelper { return destination } } + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs.swift index 9e4312f685de..2890bffa2747 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -9,22 +9,22 @@ import Foundation open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io:80/v2" public static var credential: URLCredential? - public static var customHeaders: [String: String] = [:] + public static var customHeaders: [String:String] = [:] public static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() } open class RequestBuilder { var credential: URLCredential? - var headers: [String: String] - public let parameters: [String: Any]? + var headers: [String:String] + public let parameters: [String:Any]? public let isBody: Bool public let method: String public let URLString: String /// Optional block to obtain a reference to the request's progress instance when available. - public var onProgressReady: ((Progress) -> Void)? + public var onProgressReady: ((Progress) -> ())? - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters @@ -34,7 +34,7 @@ open class RequestBuilder { addHeaders(PetstoreClientAPI.customHeaders) } - open func addHeaders(_ aHeaders: [String: String]) { + open func addHeaders(_ aHeaders:[String:String]) { for (header, value) in aHeaders { headers[header] = value } @@ -57,5 +57,5 @@ open class RequestBuilder { public protocol RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 30b346de0e1d..ffecb66c48c2 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -8,6 +8,8 @@ import Foundation import Alamofire + + open class AnotherFakeAPI { /** To test special tags @@ -15,7 +17,7 @@ open class AnotherFakeAPI { - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func call123testSpecialTags(body: Client, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + open class func call123testSpecialTags(body: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { call123testSpecialTagsWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 4198e7654650..2bfd5a21d7a3 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -8,6 +8,8 @@ import Foundation import Alamofire + + open class FakeAPI { /** creates an XmlItem @@ -15,7 +17,7 @@ open class FakeAPI { - parameter xmlItem: (body) XmlItem Body - parameter completion: completion handler to receive the data and the error objects */ - open class func createXmlItem(xmlItem: XmlItem, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func createXmlItem(xmlItem: XmlItem, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { createXmlItemWithRequestBuilder(xmlItem: xmlItem).execute { (response, error) -> Void in if error == nil { completion((), error) @@ -49,7 +51,7 @@ open class FakeAPI { - parameter body: (body) Input boolean as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterBooleanSerialize(body: Bool? = nil, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) { + open class func fakeOuterBooleanSerialize(body: Bool? = nil, completion: @escaping ((_ data: Bool?,_ error: Error?) -> Void)) { fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -78,7 +80,7 @@ open class FakeAPI { - parameter body: (body) Input composite as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) { + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?,_ error: Error?) -> Void)) { fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -107,7 +109,7 @@ open class FakeAPI { - parameter body: (body) Input number as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterNumberSerialize(body: Double? = nil, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) { + open class func fakeOuterNumberSerialize(body: Double? = nil, completion: @escaping ((_ data: Double?,_ error: Error?) -> Void)) { fakeOuterNumberSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -136,7 +138,7 @@ open class FakeAPI { - parameter body: (body) Input string as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterStringSerialize(body: String? = nil, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { + open class func fakeOuterStringSerialize(body: String? = nil, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { fakeOuterStringSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -165,7 +167,7 @@ open class FakeAPI { - parameter body: (body) - parameter completion: completion handler to receive the data and the error objects */ - open class func testBodyWithFileSchema(body: FileSchemaTestClass, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testBodyWithFileSchema(body: FileSchemaTestClass, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (response, error) -> Void in if error == nil { completion((), error) @@ -199,7 +201,7 @@ open class FakeAPI { - parameter body: (body) - parameter completion: completion handler to receive the data and the error objects */ - open class func testBodyWithQueryParams(query: String, body: User, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testBodyWithQueryParams(query: String, body: User, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (response, error) -> Void in if error == nil { completion((), error) @@ -236,7 +238,7 @@ open class FakeAPI { - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testClientModel(body: Client, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + open class func testClientModel(body: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { testClientModelWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -280,7 +282,7 @@ open class FakeAPI { - parameter callback: (form) None (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testEndpointParametersWithRequestBuilder(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback).execute { (response, error) -> Void in if error == nil { completion((), error) @@ -316,7 +318,7 @@ open class FakeAPI { open class func testEndpointParametersWithRequestBuilder(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "integer": integer?.encodeToJSON(), "int32": int32?.encodeToJSON(), "int64": int64?.encodeToJSON(), @@ -335,7 +337,7 @@ open class FakeAPI { let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -423,7 +425,7 @@ open class FakeAPI { - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to .-efg) - parameter completion: completion handler to receive the data and the error objects */ - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (response, error) -> Void in if error == nil { completion((), error) @@ -450,19 +452,19 @@ open class FakeAPI { open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "enum_form_string_array": enumFormStringArray, "enum_form_string": enumFormString?.rawValue ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": enumQueryStringArray, - "enum_query_string": enumQueryString?.rawValue, - "enum_query_integer": enumQueryInteger?.rawValue, + "enum_query_string_array": enumQueryStringArray, + "enum_query_string": enumQueryString?.rawValue, + "enum_query_integer": enumQueryInteger?.rawValue, "enum_query_double": enumQueryDouble?.rawValue ]) let nillableHeaders: [String: Any?] = [ @@ -487,7 +489,7 @@ open class FakeAPI { - parameter int64Group: (query) Integer in group parameters (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (response, error) -> Void in if error == nil { completion((), error) @@ -512,13 +514,13 @@ open class FakeAPI { open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), "int64_group": int64Group?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -538,7 +540,7 @@ open class FakeAPI { - parameter param: (body) request body - parameter completion: completion handler to receive the data and the error objects */ - open class func testInlineAdditionalProperties(param: [String: String], completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testInlineAdditionalProperties(param: [String:String], completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (response, error) -> Void in if error == nil { completion((), error) @@ -554,7 +556,7 @@ open class FakeAPI { - parameter param: (body) request body - returns: RequestBuilder */ - open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder { + open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { let path = "/fake/inline-additionalProperties" let URLString = PetstoreClientAPI.basePath + path let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param) @@ -573,7 +575,7 @@ open class FakeAPI { - parameter param2: (form) field2 - parameter completion: completion handler to receive the data and the error objects */ - open class func testJsonFormData(param: String, param2: String, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testJsonFormData(param: String, param2: String, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute { (response, error) -> Void in if error == nil { completion((), error) @@ -593,14 +595,14 @@ open class FakeAPI { open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { let path = "/fake/jsonFormData" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "param": param, "param2": param2 ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 6bfa09016f5a..ddfeae23edd0 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -8,6 +8,8 @@ import Foundation import Alamofire + + open class FakeClassnameTags123API { /** To test class name in snake case @@ -15,7 +17,7 @@ open class FakeClassnameTags123API { - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testClassname(body: Client, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + open class func testClassname(body: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { testClassnameWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 896f1511805f..0a5dfeb39b62 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -8,6 +8,8 @@ import Foundation import Alamofire + + open class PetAPI { /** Add a new pet to the store @@ -15,7 +17,7 @@ open class PetAPI { - parameter body: (body) Pet object that needs to be added to the store - parameter completion: completion handler to receive the data and the error objects */ - open class func addPet(body: Pet, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func addPet(body: Pet, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { addPetWithRequestBuilder(body: body).execute { (response, error) -> Void in if error == nil { completion((), error) @@ -53,7 +55,7 @@ open class PetAPI { - parameter apiKey: (header) (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func deletePet(petId: Int64, apiKey: String? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func deletePet(petId: Int64, apiKey: String? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (response, error) -> Void in if error == nil { completion((), error) @@ -79,8 +81,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let nillableHeaders: [String: Any?] = [ "api_key": apiKey @@ -107,7 +109,7 @@ open class PetAPI { - parameter status: (query) Status values that need to be considered for filter - parameter completion: completion handler to receive the data and the error objects */ - open class func findPetsByStatus(status: [String], completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { + open class func findPetsByStatus(status: [String], completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { findPetsByStatusWithRequestBuilder(status: status).execute { (response, error) -> Void in completion(response?.body, error) } @@ -126,8 +128,8 @@ open class PetAPI { open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByStatus" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "status": status @@ -144,7 +146,7 @@ open class PetAPI { - parameter tags: (query) Tags to filter by - parameter completion: completion handler to receive the data and the error objects */ - open class func findPetsByTags(tags: [String], completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { + open class func findPetsByTags(tags: [String], completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { findPetsByTagsWithRequestBuilder(tags: tags).execute { (response, error) -> Void in completion(response?.body, error) } @@ -163,8 +165,8 @@ open class PetAPI { open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "tags": tags @@ -181,7 +183,7 @@ open class PetAPI { - parameter petId: (path) ID of pet to return - parameter completion: completion handler to receive the data and the error objects */ - open class func getPetById(petId: Int64, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) { + open class func getPetById(petId: Int64, completion: @escaping ((_ data: Pet?,_ error: Error?) -> Void)) { getPetByIdWithRequestBuilder(petId: petId).execute { (response, error) -> Void in completion(response?.body, error) } @@ -203,8 +205,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -218,7 +220,7 @@ open class PetAPI { - parameter body: (body) Pet object that needs to be added to the store - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePet(body: Pet, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func updatePet(body: Pet, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { updatePetWithRequestBuilder(body: body).execute { (response, error) -> Void in if error == nil { completion((), error) @@ -257,7 +259,7 @@ open class PetAPI { - parameter status: (form) Updated status of the pet (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (response, error) -> Void in if error == nil { completion((), error) @@ -284,14 +286,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "name": name, "status": status ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -307,7 +309,7 @@ open class PetAPI { - parameter file: (form) file to upload (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute { (response, error) -> Void in completion(response?.body, error) } @@ -330,14 +332,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata, "file": file ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -353,7 +355,7 @@ open class PetAPI { - parameter additionalMetadata: (form) Additional data to pass to server (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute { (response, error) -> Void in completion(response?.body, error) } @@ -376,14 +378,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata, "requiredFile": requiredFile ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 71949b335d77..a2bced598f0d 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -8,6 +8,8 @@ import Foundation import Alamofire + + open class StoreAPI { /** Delete purchase order by ID @@ -15,7 +17,7 @@ open class StoreAPI { - parameter orderId: (path) ID of the order that needs to be deleted - parameter completion: completion handler to receive the data and the error objects */ - open class func deleteOrder(orderId: String, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func deleteOrder(orderId: String, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { deleteOrderWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in if error == nil { completion((), error) @@ -38,8 +40,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -52,7 +54,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ - open class func getInventory(completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) { + open class func getInventory(completion: @escaping ((_ data: [String:Int]?,_ error: Error?) -> Void)) { getInventoryWithRequestBuilder().execute { (response, error) -> Void in completion(response?.body, error) } @@ -67,14 +69,14 @@ open class StoreAPI { - name: api_key - returns: RequestBuilder<[String:Int]> */ - open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { + open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> { let path = "/store/inventory" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } @@ -85,7 +87,7 @@ open class StoreAPI { - parameter orderId: (path) ID of pet that needs to be fetched - parameter completion: completion handler to receive the data and the error objects */ - open class func getOrderById(orderId: Int64, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { + open class func getOrderById(orderId: Int64, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { getOrderByIdWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in completion(response?.body, error) } @@ -104,8 +106,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -119,7 +121,7 @@ open class StoreAPI { - parameter body: (body) order placed for purchasing the pet - parameter completion: completion handler to receive the data and the error objects */ - open class func placeOrder(body: Order, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { + open class func placeOrder(body: Order, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { placeOrderWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index efeb64468a5c..d8cafaf2c962 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -8,6 +8,8 @@ import Foundation import Alamofire + + open class UserAPI { /** Create user @@ -15,7 +17,7 @@ open class UserAPI { - parameter body: (body) Created user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUser(body: User, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func createUser(body: User, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { createUserWithRequestBuilder(body: body).execute { (response, error) -> Void in if error == nil { completion((), error) @@ -50,7 +52,7 @@ open class UserAPI { - parameter body: (body) List of user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithArrayInput(body: [User], completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func createUsersWithArrayInput(body: [User], completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { createUsersWithArrayInputWithRequestBuilder(body: body).execute { (response, error) -> Void in if error == nil { completion((), error) @@ -84,7 +86,7 @@ open class UserAPI { - parameter body: (body) List of user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithListInput(body: [User], completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func createUsersWithListInput(body: [User], completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { createUsersWithListInputWithRequestBuilder(body: body).execute { (response, error) -> Void in if error == nil { completion((), error) @@ -118,7 +120,7 @@ open class UserAPI { - parameter username: (path) The name that needs to be deleted - parameter completion: completion handler to receive the data and the error objects */ - open class func deleteUser(username: String, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func deleteUser(username: String, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { deleteUserWithRequestBuilder(username: username).execute { (response, error) -> Void in if error == nil { completion((), error) @@ -141,8 +143,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -156,7 +158,7 @@ open class UserAPI { - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - parameter completion: completion handler to receive the data and the error objects */ - open class func getUserByName(username: String, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) { + open class func getUserByName(username: String, completion: @escaping ((_ data: User?,_ error: Error?) -> Void)) { getUserByNameWithRequestBuilder(username: username).execute { (response, error) -> Void in completion(response?.body, error) } @@ -174,8 +176,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -190,7 +192,7 @@ open class UserAPI { - parameter password: (query) The password for login in clear text - parameter completion: completion handler to receive the data and the error objects */ - open class func loginUser(username: String, password: String, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { + open class func loginUser(username: String, password: String, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { loginUserWithRequestBuilder(username: username, password: password).execute { (response, error) -> Void in completion(response?.body, error) } @@ -207,11 +209,11 @@ open class UserAPI { open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { let path = "/user/login" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": username, + "username": username, "password": password ]) @@ -225,7 +227,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ - open class func logoutUser(completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func logoutUser(completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { logoutUserWithRequestBuilder().execute { (response, error) -> Void in if error == nil { completion((), error) @@ -243,8 +245,8 @@ open class UserAPI { open class func logoutUserWithRequestBuilder() -> RequestBuilder { let path = "/user/logout" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -259,7 +261,7 @@ open class UserAPI { - parameter body: (body) Updated user object - parameter completion: completion handler to receive the data and the error objects */ - open class func updateUser(username: String, body: User, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func updateUser(username: String, body: User, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { updateUserWithRequestBuilder(username: username, body: body).execute { (response, error) -> Void in if error == nil { completion((), error) diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift index 04ad02a5ce88..dac40e9a31cf 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift @@ -12,7 +12,7 @@ class AlamofireRequestBuilderFactory: RequestBuilderFactory { return AlamofireRequestBuilder.self } - func getBuilder() -> RequestBuilder.Type { + func getBuilder() -> RequestBuilder.Type { return AlamofireDecodableRequestBuilder.self } } @@ -50,7 +50,7 @@ private struct SynchronizedDictionary { private var managerStore = SynchronizedDictionary() open class AlamofireRequestBuilder: RequestBuilder { - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } @@ -88,17 +88,17 @@ open class AlamofireRequestBuilder: RequestBuilder { May be overridden by a subclass if you want to control the request configuration (e.g. to override the cache policy). */ - open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) -> DataRequest { + open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) -> DataRequest { return manager.request(URLString, method: method, parameters: parameters, encoding: encoding, headers: headers) } override open func execute(_ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { - let managerId: String = UUID().uuidString + let managerId:String = UUID().uuidString // Create a new manager for each request to customize its request header let manager = createSessionManager() managerStore[managerId] = manager - let encoding: ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() + let encoding:ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() let xMethod = Alamofire.HTTPMethod(rawValue: method) let fileKeys = parameters == nil ? [] : parameters!.filter { $1 is NSURL } @@ -111,7 +111,8 @@ open class AlamofireRequestBuilder: RequestBuilder { case let fileURL as URL: if let mimeType = self.contentTypeForFormPart(fileURL: fileURL) { mpForm.append(fileURL, withName: k, fileName: fileURL.lastPathComponent, mimeType: mimeType) - } else { + } + else { mpForm.append(fileURL, withName: k) } case let string as String: @@ -275,7 +276,7 @@ open class AlamofireRequestBuilder: RequestBuilder { return httpHeaders } - fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { + fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { guard let contentDisposition = contentDisposition else { return nil @@ -283,7 +284,7 @@ open class AlamofireRequestBuilder: RequestBuilder { let items = contentDisposition.components(separatedBy: ";") - var filename: String? = nil + var filename : String? = nil for contentItem in items { @@ -303,7 +304,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } - fileprivate func getPath(from url: URL) throws -> String { + fileprivate func getPath(from url : URL) throws -> String { guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { throw DownloadException.requestMissingPath @@ -317,7 +318,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } - fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { + fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { guard let url = urlRequest.url else { throw DownloadException.requestMissingURL @@ -328,7 +329,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } -private enum DownloadException: Error { +fileprivate enum DownloadException : Error { case responseDataMissing case responseFailed case requestMissing @@ -343,7 +344,7 @@ public enum AlamofireDecodableRequestBuilderError: Error { case generalError(Error) } -open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { +open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { override fileprivate func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { if let credential = self.credential { diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index 111d5a3a8cbe..584de8c3d57a 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -13,7 +13,7 @@ open class CodableHelper { public static var dateformatter: DateFormatter? - open class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T: Decodable { + open class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T : Decodable { var returnedDecodable: T? = nil var returnedError: Error? = nil @@ -39,7 +39,7 @@ open class CodableHelper { return (returnedDecodable, returnedError) } - open class func encode(_ value: T, prettyPrint: Bool = false) -> EncodeResult where T: Encodable { + open class func encode(_ value: T, prettyPrint: Bool = false) -> EncodeResult where T : Encodable { var returnedData: Data? var returnedError: Error? = nil diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Configuration.swift index e1ecb39726e7..516590da5d9e 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -7,9 +7,9 @@ import Foundation open class Configuration { - + // This value is used to configure the date formatter that is used to serialize dates into JSON format. // You must set it prior to encoding any dates, and it will only be read once. public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} + +} \ No newline at end of file diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 24c128daadef..8bf1829ba806 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -112,24 +112,24 @@ extension String: CodingKey { extension KeyedEncodingContainerProtocol { - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { var arrayContainer = nestedUnkeyedContainer(forKey: key) try arrayContainer.encode(contentsOf: values) } - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { if let values = values { try encodeArray(values, forKey: key) } } - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { for (key, value) in pairs { try encode(value, forKey: key) } } - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { if let pairs = pairs { try encodeMap(pairs) } @@ -139,7 +139,7 @@ extension KeyedEncodingContainerProtocol { extension KeyedDecodingContainerProtocol { - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { var tmpArray = [T]() var nestedContainer = try nestedUnkeyedContainer(forKey: key) @@ -151,7 +151,7 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { var tmpArray: [T]? = nil if contains(key) { @@ -161,8 +161,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { - var map: [Self.Key: T] = [:] + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { + var map: [Self.Key : T] = [:] for key in allKeys { if !excludedKeys.contains(key) { @@ -175,3 +175,5 @@ extension KeyedDecodingContainerProtocol { } } + + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift index 3e68bb5d4a9b..70449515842d 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -10,7 +10,7 @@ import Alamofire open class JSONEncodingHelper { - open class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { + open class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { var params: Parameters? = nil // Encode the Encodable object @@ -39,5 +39,5 @@ open class JSONEncodingHelper { return params } - + } diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift index e87ce399c7c8..408563890359 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,7 +10,7 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -public enum ErrorResponse: Error { +public enum ErrorResponse : Error { case error(Int, Data?, Error) } diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesAnyType.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesAnyType.swift index 94295c495c53..796e46eca247 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesAnyType.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesAnyType.swift @@ -7,6 +7,8 @@ import Foundation + + public struct AdditionalPropertiesAnyType: Codable { public var name: String? @@ -14,7 +16,7 @@ public struct AdditionalPropertiesAnyType: Codable { public init(name: String?) { self.name = name } - public var additionalProperties: [String: Any] = [:] + public var additionalProperties: [String:Any] = [:] public subscript(key: String) -> Any? { get { @@ -50,4 +52,7 @@ public struct AdditionalPropertiesAnyType: Codable { additionalProperties = try container.decodeMap(Any.self, excludedKeys: nonAdditionalPropertyKeys) } + + } + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesArray.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesArray.swift index cde9824ddb3a..5e58839b5a5f 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesArray.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesArray.swift @@ -7,6 +7,8 @@ import Foundation + + public struct AdditionalPropertiesArray: Codable { public var name: String? @@ -14,7 +16,7 @@ public struct AdditionalPropertiesArray: Codable { public init(name: String?) { self.name = name } - public var additionalProperties: [String: Array] = [:] + public var additionalProperties: [String:Array] = [:] public subscript(key: String) -> Array? { get { @@ -50,4 +52,7 @@ public struct AdditionalPropertiesArray: Codable { additionalProperties = try container.decodeMap(Array.self, excludedKeys: nonAdditionalPropertyKeys) } + + } + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesBoolean.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesBoolean.swift index 76791a9ddd3e..d4c90829b4c7 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesBoolean.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesBoolean.swift @@ -7,6 +7,8 @@ import Foundation + + public struct AdditionalPropertiesBoolean: Codable { public var name: String? @@ -14,7 +16,7 @@ public struct AdditionalPropertiesBoolean: Codable { public init(name: String?) { self.name = name } - public var additionalProperties: [String: Bool] = [:] + public var additionalProperties: [String:Bool] = [:] public subscript(key: String) -> Bool? { get { @@ -50,4 +52,7 @@ public struct AdditionalPropertiesBoolean: Codable { additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } + + } + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index a4e11337fb74..0e2263b14e67 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -7,21 +7,23 @@ import Foundation + + public struct AdditionalPropertiesClass: Codable { - public var mapString: [String: String]? - public var mapNumber: [String: Double]? - public var mapInteger: [String: Int]? - public var mapBoolean: [String: Bool]? - public var mapArrayInteger: [String: [Int]]? - public var mapArrayAnytype: [String: [Any]]? - public var mapMapString: [String: [String: String]]? - public var mapMapAnytype: [String: [String: Any]]? + public var mapString: [String:String]? + public var mapNumber: [String:Double]? + public var mapInteger: [String:Int]? + public var mapBoolean: [String:Bool]? + public var mapArrayInteger: [String:[Int]]? + public var mapArrayAnytype: [String:[Any]]? + public var mapMapString: [String:[String:String]]? + public var mapMapAnytype: [String:[String:Any]]? public var anytype1: Any? public var anytype2: Any? public var anytype3: Any? - public init(mapString: [String: String]?, mapNumber: [String: Double]?, mapInteger: [String: Int]?, mapBoolean: [String: Bool]?, mapArrayInteger: [String: [Int]]?, mapArrayAnytype: [String: [Any]]?, mapMapString: [String: [String: String]]?, mapMapAnytype: [String: [String: Any]]?, anytype1: Any?, anytype2: Any?, anytype3: Any?) { + public init(mapString: [String:String]?, mapNumber: [String:Double]?, mapInteger: [String:Int]?, mapBoolean: [String:Bool]?, mapArrayInteger: [String:[Int]]?, mapArrayAnytype: [String:[Any]]?, mapMapString: [String:[String:String]]?, mapMapAnytype: [String:[String:Any]]?, anytype1: Any?, anytype2: Any?, anytype3: Any?) { self.mapString = mapString self.mapNumber = mapNumber self.mapInteger = mapInteger @@ -35,7 +37,7 @@ public struct AdditionalPropertiesClass: Codable { self.anytype3 = anytype3 } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case mapString = "map_string" case mapNumber = "map_number" case mapInteger = "map_integer" @@ -49,4 +51,6 @@ public struct AdditionalPropertiesClass: Codable { case anytype3 = "anytype_3" } + } + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesInteger.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesInteger.swift index 4a0f2acaa417..b03bbe445653 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesInteger.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesInteger.swift @@ -7,6 +7,8 @@ import Foundation + + public struct AdditionalPropertiesInteger: Codable { public var name: String? @@ -14,7 +16,7 @@ public struct AdditionalPropertiesInteger: Codable { public init(name: String?) { self.name = name } - public var additionalProperties: [String: Int] = [:] + public var additionalProperties: [String:Int] = [:] public subscript(key: String) -> Int? { get { @@ -50,4 +52,7 @@ public struct AdditionalPropertiesInteger: Codable { additionalProperties = try container.decodeMap(Int.self, excludedKeys: nonAdditionalPropertyKeys) } + + } + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesNumber.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesNumber.swift index 95e491000ab7..9701d54c9b25 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesNumber.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesNumber.swift @@ -7,6 +7,8 @@ import Foundation + + public struct AdditionalPropertiesNumber: Codable { public var name: String? @@ -14,7 +16,7 @@ public struct AdditionalPropertiesNumber: Codable { public init(name: String?) { self.name = name } - public var additionalProperties: [String: Double] = [:] + public var additionalProperties: [String:Double] = [:] public subscript(key: String) -> Double? { get { @@ -50,4 +52,7 @@ public struct AdditionalPropertiesNumber: Codable { additionalProperties = try container.decodeMap(Double.self, excludedKeys: nonAdditionalPropertyKeys) } + + } + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesObject.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesObject.swift index f45888a41019..c6e1e670b8cc 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesObject.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesObject.swift @@ -7,6 +7,8 @@ import Foundation + + public struct AdditionalPropertiesObject: Codable { public var name: String? @@ -14,7 +16,7 @@ public struct AdditionalPropertiesObject: Codable { public init(name: String?) { self.name = name } - public var additionalProperties: [String: Dictionary] = [:] + public var additionalProperties: [String:Dictionary] = [:] public subscript(key: String) -> Dictionary? { get { @@ -50,4 +52,7 @@ public struct AdditionalPropertiesObject: Codable { additionalProperties = try container.decodeMap(Dictionary.self, excludedKeys: nonAdditionalPropertyKeys) } + + } + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesString.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesString.swift index 7af63cc7152e..6128dce7d422 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesString.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesString.swift @@ -7,6 +7,8 @@ import Foundation + + public struct AdditionalPropertiesString: Codable { public var name: String? @@ -14,7 +16,7 @@ public struct AdditionalPropertiesString: Codable { public init(name: String?) { self.name = name } - public var additionalProperties: [String: String] = [:] + public var additionalProperties: [String:String] = [:] public subscript(key: String) -> String? { get { @@ -50,4 +52,7 @@ public struct AdditionalPropertiesString: Codable { additionalProperties = try container.decodeMap(String.self, excludedKeys: nonAdditionalPropertyKeys) } + + } + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index 5ed9f31e2a36..7221a1be099d 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -7,6 +7,8 @@ import Foundation + + public struct Animal: Codable { public var className: String @@ -17,4 +19,6 @@ public struct Animal: Codable { self.color = color } + } + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index ec270da89074..a22e9aaebbb0 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -7,6 +7,8 @@ import Foundation + + public struct ApiResponse: Codable { public var code: Int? @@ -19,4 +21,6 @@ public struct ApiResponse: Codable { self.message = message } + } + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 3843287630b1..4e5a5ca1445d 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,6 +7,8 @@ import Foundation + + public struct ArrayOfArrayOfNumberOnly: Codable { public var arrayArrayNumber: [[Double]]? @@ -15,8 +17,10 @@ public struct ArrayOfArrayOfNumberOnly: Codable { self.arrayArrayNumber = arrayArrayNumber } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case arrayArrayNumber = "ArrayArrayNumber" } + } + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index f8b198e81f50..7d059d368339 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -7,6 +7,8 @@ import Foundation + + public struct ArrayOfNumberOnly: Codable { public var arrayNumber: [Double]? @@ -15,8 +17,10 @@ public struct ArrayOfNumberOnly: Codable { self.arrayNumber = arrayNumber } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case arrayNumber = "ArrayNumber" } + } + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index 67f7f7e5151f..9c56fed50c2e 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -7,6 +7,8 @@ import Foundation + + public struct ArrayTest: Codable { public var arrayOfString: [String]? @@ -19,10 +21,12 @@ public struct ArrayTest: Codable { self.arrayArrayOfModel = arrayArrayOfModel } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" case arrayArrayOfModel = "array_array_of_model" } + } + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index d576b50b1c9c..98cda23dac9e 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -7,6 +7,8 @@ import Foundation + + public struct Capitalization: Codable { public var smallCamel: String? @@ -26,7 +28,7 @@ public struct Capitalization: Codable { self.ATT_NAME = ATT_NAME } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case smallCamel case capitalCamel = "CapitalCamel" case smallSnake = "small_Snake" @@ -35,4 +37,6 @@ public struct Capitalization: Codable { case ATT_NAME } + } + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 7d819cbcc8f4..5675a0535064 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -7,6 +7,8 @@ import Foundation + + public struct Cat: Codable { public var className: String @@ -24,4 +26,6 @@ public struct Cat: Codable { self.declawed = declawed } + } + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index a51ad0dffab1..b5404f052cb7 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -7,6 +7,8 @@ import Foundation + + public struct CatAllOf: Codable { public var declawed: Bool? @@ -15,4 +17,6 @@ public struct CatAllOf: Codable { self.declawed = declawed } + } + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index abcd82b07837..afdc89b6dd06 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,6 +7,8 @@ import Foundation + + public struct Category: Codable { public var _id: Int64? @@ -17,9 +19,11 @@ public struct Category: Codable { self.name = name } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case _id = "id" case name } + } + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index 28cb30ce7b4b..f673ed127cd8 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -7,6 +7,7 @@ import Foundation + /** Model for testing model with \"_class\" property */ public struct ClassModel: Codable { @@ -17,4 +18,6 @@ public struct ClassModel: Codable { self._class = _class } + } + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 00245ca37280..51390b6c4eac 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -7,6 +7,8 @@ import Foundation + + public struct Client: Codable { public var client: String? @@ -15,4 +17,6 @@ public struct Client: Codable { self.client = client } + } + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 492c1228008e..239ce74dcc21 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -7,6 +7,8 @@ import Foundation + + public struct Dog: Codable { public var className: String @@ -19,4 +21,6 @@ public struct Dog: Codable { self.breed = breed } + } + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 7786f8acc5ae..dc8bd63af9d6 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -7,6 +7,8 @@ import Foundation + + public struct DogAllOf: Codable { public var breed: String? @@ -15,4 +17,6 @@ public struct DogAllOf: Codable { self.breed = breed } + } + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 5034ff0b8c68..8713961520e1 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -7,6 +7,8 @@ import Foundation + + public struct EnumArrays: Codable { public enum JustSymbol: String, Codable { @@ -25,9 +27,11 @@ public struct EnumArrays: Codable { self.arrayEnum = arrayEnum } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case justSymbol = "just_symbol" case arrayEnum = "array_enum" } + } + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index 3c1dfcac577d..7280a621fec7 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -7,6 +7,7 @@ import Foundation + public enum EnumClass: String, Codable { case abc = "_abc" case efg = "-efg" diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 6db9b34d183b..0f546c76a218 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -7,6 +7,8 @@ import Foundation + + public struct EnumTest: Codable { public enum EnumString: String, Codable { @@ -41,7 +43,7 @@ public struct EnumTest: Codable { self.outerEnum = outerEnum } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case enumString = "enum_string" case enumStringRequired = "enum_string_required" case enumInteger = "enum_integer" @@ -49,4 +51,6 @@ public struct EnumTest: Codable { case outerEnum } + } + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/File.swift index ea3520f053dd..c8bd1f19589b 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -7,6 +7,7 @@ import Foundation + /** Must be named `File` for test. */ public struct File: Codable { @@ -18,4 +19,6 @@ public struct File: Codable { self.sourceURI = sourceURI } + } + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 532f1457939a..64d025068027 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -7,6 +7,8 @@ import Foundation + + public struct FileSchemaTestClass: Codable { public var file: File? @@ -17,4 +19,6 @@ public struct FileSchemaTestClass: Codable { self.files = files } + } + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index 20bd6d103b3d..faa091b0658c 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -7,6 +7,8 @@ import Foundation + + public struct FormatTest: Codable { public var integer: Int? @@ -39,4 +41,6 @@ public struct FormatTest: Codable { self.password = password } + } + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 906ddb06fb17..554aee1081aa 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -7,6 +7,8 @@ import Foundation + + public struct HasOnlyReadOnly: Codable { public var bar: String? @@ -17,4 +19,6 @@ public struct HasOnlyReadOnly: Codable { self.foo = foo } + } + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/List.swift index 08d59953873e..8997340ff4be 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -7,6 +7,8 @@ import Foundation + + public struct List: Codable { public var _123list: String? @@ -15,8 +17,10 @@ public struct List: Codable { self._123list = _123list } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case _123list = "123-list" } + } + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 358ca7a58d12..392c1e443839 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -7,29 +7,33 @@ import Foundation + + public struct MapTest: Codable { public enum MapOfEnumString: String, Codable { case upper = "UPPER" case lower = "lower" } - public var mapMapOfString: [String: [String: String]]? - public var mapOfEnumString: [String: String]? - public var directMap: [String: Bool]? - public var indirectMap: [String: Bool]? + public var mapMapOfString: [String:[String:String]]? + public var mapOfEnumString: [String:String]? + public var directMap: [String:Bool]? + public var indirectMap: [String:Bool]? - public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: [String: Bool]?) { + public init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?, directMap: [String:Bool]?, indirectMap: [String:Bool]?) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap self.indirectMap = indirectMap } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" case directMap = "direct_map" case indirectMap = "indirect_map" } + } + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index c3deb2f28932..7116108fd7a3 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,16 +7,20 @@ import Foundation + + public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { public var uuid: UUID? public var dateTime: Date? - public var map: [String: Animal]? + public var map: [String:Animal]? - public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { + public init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) { self.uuid = uuid self.dateTime = dateTime self.map = map } + } + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index 7ed6aad907be..fc1d0606b7ba 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -7,6 +7,7 @@ import Foundation + /** Model for testing model name starting with number */ public struct Model200Response: Codable { @@ -19,9 +20,11 @@ public struct Model200Response: Codable { self._class = _class } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case name case _class = "class" } + } + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index ce9ffe4fb38e..cc165d767d91 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -7,6 +7,7 @@ import Foundation + /** Model for testing model name same as property name */ public struct Name: Codable { @@ -23,11 +24,13 @@ public struct Name: Codable { self._123number = _123number } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case name case snakeCase = "snake_case" case property case _123number = "123Number" } + } + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index abd2269e8e76..e6fb206093aa 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -7,6 +7,8 @@ import Foundation + + public struct NumberOnly: Codable { public var justNumber: Double? @@ -15,8 +17,10 @@ public struct NumberOnly: Codable { self.justNumber = justNumber } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case justNumber = "JustNumber" } + } + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index f2b7565e2d91..5cad29458b75 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -7,6 +7,8 @@ import Foundation + + public struct Order: Codable { public enum Status: String, Codable { @@ -31,7 +33,7 @@ public struct Order: Codable { self.complete = complete } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case _id = "id" case petId case quantity @@ -40,4 +42,6 @@ public struct Order: Codable { case complete } + } + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 49aec001c5db..edc4523d9f00 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -7,6 +7,8 @@ import Foundation + + public struct OuterComposite: Codable { public var myNumber: Double? @@ -19,10 +21,12 @@ public struct OuterComposite: Codable { self.myBoolean = myBoolean } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case myNumber = "my_number" case myString = "my_string" case myBoolean = "my_boolean" } + } + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index 9f80fc95ecf0..bd1643d279ed 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -7,6 +7,7 @@ import Foundation + public enum OuterEnum: String, Codable { case placed = "placed" case approved = "approved" diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index 971ce9d4db6e..3773bf53317e 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,6 +7,8 @@ import Foundation + + public struct Pet: Codable { public enum Status: String, Codable { @@ -31,7 +33,7 @@ public struct Pet: Codable { self.status = status } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case _id = "id" case category case name @@ -40,4 +42,6 @@ public struct Pet: Codable { case status } + } + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 0acd21fd1000..48b655a5b0aa 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -7,6 +7,8 @@ import Foundation + + public struct ReadOnlyFirst: Codable { public var bar: String? @@ -17,4 +19,6 @@ public struct ReadOnlyFirst: Codable { self.baz = baz } + } + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index 076082af842f..de4b218999b7 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -7,6 +7,7 @@ import Foundation + /** Model for testing reserved words */ public struct Return: Codable { @@ -17,8 +18,10 @@ public struct Return: Codable { self._return = _return } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case _return = "return" } + } + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index e79fc45c0e91..213d896ba988 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -7,6 +7,8 @@ import Foundation + + public struct SpecialModelName: Codable { public var specialPropertyName: Int64? @@ -15,8 +17,10 @@ public struct SpecialModelName: Codable { self.specialPropertyName = specialPropertyName } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case specialPropertyName = "$special[property.name]" } + } + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 83efe72b8a4e..20f50efd3ac0 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,6 +7,8 @@ import Foundation + + public struct Tag: Codable { public var _id: Int64? @@ -17,9 +19,11 @@ public struct Tag: Codable { self.name = name } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case _id = "id" case name } + } + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index bf0006e1a266..be1afdf0266c 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -7,6 +7,8 @@ import Foundation + + public struct TypeHolderDefault: Codable { public var stringItem: String = "what" @@ -23,7 +25,7 @@ public struct TypeHolderDefault: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" @@ -31,4 +33,6 @@ public struct TypeHolderDefault: Codable { case arrayItem = "array_item" } + } + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index 602a2a6d185a..f46c8952e13e 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -7,6 +7,8 @@ import Foundation + + public struct TypeHolderExample: Codable { public var stringItem: String @@ -23,7 +25,7 @@ public struct TypeHolderExample: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" @@ -31,4 +33,6 @@ public struct TypeHolderExample: Codable { case arrayItem = "array_item" } + } + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 7d6b24b9e100..d9c564d2a1fe 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -7,6 +7,8 @@ import Foundation + + public struct User: Codable { public var _id: Int64? @@ -30,7 +32,7 @@ public struct User: Codable { self.userStatus = userStatus } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case _id = "id" case username case firstName @@ -41,4 +43,6 @@ public struct User: Codable { case userStatus } + } + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/XmlItem.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/XmlItem.swift index aa016683503b..e1b1ace8b153 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/XmlItem.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/XmlItem.swift @@ -7,6 +7,8 @@ import Foundation + + public struct XmlItem: Codable { public var attributeString: String? @@ -71,7 +73,7 @@ public struct XmlItem: Codable { self.prefixNsWrappedArray = prefixNsWrappedArray } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case attributeString = "attribute_string" case attributeNumber = "attribute_number" case attributeInteger = "attribute_integer" @@ -103,4 +105,6 @@ public struct XmlItem: Codable { case prefixNsWrappedArray = "prefix_ns_wrapped_array" } + } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 75dea2439575..d94614b34fc7 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -7,7 +7,7 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { + public static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { let destination = source.reduce(into: [String: Any]()) { (result, item) in if let value = item.value { result[item.key] = value @@ -20,17 +20,17 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { + public static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { return source.reduce(into: [String: String]()) { (result, item) in if let collection = item.value as? Array { - result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") + result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } } } - public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { + public static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { guard let source = source else { return nil } @@ -52,7 +52,7 @@ public struct APIHelper { return source } - public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { + public static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in if let collection = item.value as? Array { let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") @@ -68,3 +68,4 @@ public struct APIHelper { return destination } } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs.swift index 9e4312f685de..2890bffa2747 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -9,22 +9,22 @@ import Foundation open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io:80/v2" public static var credential: URLCredential? - public static var customHeaders: [String: String] = [:] + public static var customHeaders: [String:String] = [:] public static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() } open class RequestBuilder { var credential: URLCredential? - var headers: [String: String] - public let parameters: [String: Any]? + var headers: [String:String] + public let parameters: [String:Any]? public let isBody: Bool public let method: String public let URLString: String /// Optional block to obtain a reference to the request's progress instance when available. - public var onProgressReady: ((Progress) -> Void)? + public var onProgressReady: ((Progress) -> ())? - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters @@ -34,7 +34,7 @@ open class RequestBuilder { addHeaders(PetstoreClientAPI.customHeaders) } - open func addHeaders(_ aHeaders: [String: String]) { + open func addHeaders(_ aHeaders:[String:String]) { for (header, value) in aHeaders { headers[header] = value } @@ -57,5 +57,5 @@ open class RequestBuilder { public protocol RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 2a2e7ab048a8..18204a2a7547 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -9,6 +9,8 @@ import Foundation import Alamofire import PromiseKit + + open class AnotherFakeAPI { /** To test special tags diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 3fdda64aa258..ed3c187e7279 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -9,6 +9,8 @@ import Foundation import Alamofire import PromiseKit + + open class FakeAPI { /** @@ -199,7 +201,7 @@ open class FakeAPI { - parameter body: (body) - returns: Promise */ - open class func testBodyWithQueryParams( query: String, body: User) -> Promise { + open class func testBodyWithQueryParams( query: String, body: User) -> Promise { let deferred = Promise.pending() testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (response, error) -> Void in if let error = error { @@ -290,7 +292,7 @@ open class FakeAPI { - parameter callback: (form) None (optional) - returns: Promise */ - open class func testEndpointParameters( number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> Promise { + open class func testEndpointParameters( number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> Promise { let deferred = Promise.pending() testEndpointParametersWithRequestBuilder(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback).execute { (response, error) -> Void in if let error = error { @@ -328,7 +330,7 @@ open class FakeAPI { open class func testEndpointParametersWithRequestBuilder(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "integer": integer?.encodeToJSON(), "int32": int32?.encodeToJSON(), "int64": int64?.encodeToJSON(), @@ -347,7 +349,7 @@ open class FakeAPI { let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -435,7 +437,7 @@ open class FakeAPI { - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to .-efg) - returns: Promise */ - open class func testEnumParameters( enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> Promise { + open class func testEnumParameters( enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> Promise { let deferred = Promise.pending() testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (response, error) -> Void in if let error = error { @@ -464,19 +466,19 @@ open class FakeAPI { open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "enum_form_string_array": enumFormStringArray, "enum_form_string": enumFormString?.rawValue ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": enumQueryStringArray, - "enum_query_string": enumQueryString?.rawValue, - "enum_query_integer": enumQueryInteger?.rawValue, + "enum_query_string_array": enumQueryStringArray, + "enum_query_string": enumQueryString?.rawValue, + "enum_query_integer": enumQueryInteger?.rawValue, "enum_query_double": enumQueryDouble?.rawValue ]) let nillableHeaders: [String: Any?] = [ @@ -501,7 +503,7 @@ open class FakeAPI { - parameter int64Group: (query) Integer in group parameters (optional) - returns: Promise */ - open class func testGroupParameters( requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> Promise { + open class func testGroupParameters( requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> Promise { let deferred = Promise.pending() testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (response, error) -> Void in if let error = error { @@ -528,13 +530,13 @@ open class FakeAPI { open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), "int64_group": int64Group?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -554,7 +556,7 @@ open class FakeAPI { - parameter param: (body) request body - returns: Promise */ - open class func testInlineAdditionalProperties( param: [String: String]) -> Promise { + open class func testInlineAdditionalProperties( param: [String:String]) -> Promise { let deferred = Promise.pending() testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (response, error) -> Void in if let error = error { @@ -572,7 +574,7 @@ open class FakeAPI { - parameter param: (body) request body - returns: RequestBuilder */ - open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder { + open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { let path = "/fake/inline-additionalProperties" let URLString = PetstoreClientAPI.basePath + path let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param) @@ -591,7 +593,7 @@ open class FakeAPI { - parameter param2: (form) field2 - returns: Promise */ - open class func testJsonFormData( param: String, param2: String) -> Promise { + open class func testJsonFormData( param: String, param2: String) -> Promise { let deferred = Promise.pending() testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute { (response, error) -> Void in if let error = error { @@ -613,14 +615,14 @@ open class FakeAPI { open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { let path = "/fake/jsonFormData" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "param": param, "param2": param2 ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index a6bb118c5823..51e1cd244bb0 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -9,6 +9,8 @@ import Foundation import Alamofire import PromiseKit + + open class FakeClassnameTags123API { /** To test class name in snake case diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index a9c64e897b6e..29fc9ba64f9e 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -9,6 +9,8 @@ import Foundation import Alamofire import PromiseKit + + open class PetAPI { /** Add a new pet to the store @@ -56,7 +58,7 @@ open class PetAPI { - parameter apiKey: (header) (optional) - returns: Promise */ - open class func deletePet( petId: Int64, apiKey: String? = nil) -> Promise { + open class func deletePet( petId: Int64, apiKey: String? = nil) -> Promise { let deferred = Promise.pending() deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (response, error) -> Void in if let error = error { @@ -84,8 +86,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let nillableHeaders: [String: Any?] = [ "api_key": apiKey @@ -139,8 +141,8 @@ open class PetAPI { open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByStatus" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "status": status @@ -184,8 +186,8 @@ open class PetAPI { open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "tags": tags @@ -232,8 +234,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -288,7 +290,7 @@ open class PetAPI { - parameter status: (form) Updated status of the pet (optional) - returns: Promise */ - open class func updatePetWithForm( petId: Int64, name: String? = nil, status: String? = nil) -> Promise { + open class func updatePetWithForm( petId: Int64, name: String? = nil, status: String? = nil) -> Promise { let deferred = Promise.pending() updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (response, error) -> Void in if let error = error { @@ -317,14 +319,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "name": name, "status": status ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -340,7 +342,7 @@ open class PetAPI { - parameter file: (form) file to upload (optional) - returns: Promise */ - open class func uploadFile( petId: Int64, additionalMetadata: String? = nil, file: URL? = nil) -> Promise { + open class func uploadFile( petId: Int64, additionalMetadata: String? = nil, file: URL? = nil) -> Promise { let deferred = Promise.pending() uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute { (response, error) -> Void in if let error = error { @@ -371,14 +373,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata, "file": file ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -394,7 +396,7 @@ open class PetAPI { - parameter additionalMetadata: (form) Additional data to pass to server (optional) - returns: Promise */ - open class func uploadFileWithRequiredFile( petId: Int64, requiredFile: URL, additionalMetadata: String? = nil) -> Promise { + open class func uploadFileWithRequiredFile( petId: Int64, requiredFile: URL, additionalMetadata: String? = nil) -> Promise { let deferred = Promise.pending() uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute { (response, error) -> Void in if let error = error { @@ -425,14 +427,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata, "requiredFile": requiredFile ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 502f44af60a6..2461befb0a23 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -9,6 +9,8 @@ import Foundation import Alamofire import PromiseKit + + open class StoreAPI { /** Delete purchase order by ID @@ -41,8 +43,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -55,8 +57,8 @@ open class StoreAPI { - returns: Promise<[String:Int]> */ - open class func getInventory() -> Promise<[String: Int]> { - let deferred = Promise<[String: Int]>.pending() + open class func getInventory() -> Promise<[String:Int]> { + let deferred = Promise<[String:Int]>.pending() getInventoryWithRequestBuilder().execute { (response, error) -> Void in if let error = error { deferred.reject(error) @@ -78,14 +80,14 @@ open class StoreAPI { - name: api_key - returns: RequestBuilder<[String:Int]> */ - open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { + open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> { let path = "/store/inventory" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } @@ -123,8 +125,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 793c47447ea2..a306c14e5908 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -9,6 +9,8 @@ import Foundation import Alamofire import PromiseKit + + open class UserAPI { /** Create user @@ -150,8 +152,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -191,8 +193,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -207,7 +209,7 @@ open class UserAPI { - parameter password: (query) The password for login in clear text - returns: Promise */ - open class func loginUser( username: String, password: String) -> Promise { + open class func loginUser( username: String, password: String) -> Promise { let deferred = Promise.pending() loginUserWithRequestBuilder(username: username, password: password).execute { (response, error) -> Void in if let error = error { @@ -232,11 +234,11 @@ open class UserAPI { open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { let path = "/user/login" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": username, + "username": username, "password": password ]) @@ -270,8 +272,8 @@ open class UserAPI { open class func logoutUserWithRequestBuilder() -> RequestBuilder { let path = "/user/logout" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -286,7 +288,7 @@ open class UserAPI { - parameter body: (body) Updated user object - returns: Promise */ - open class func updateUser( username: String, body: User) -> Promise { + open class func updateUser( username: String, body: User) -> Promise { let deferred = Promise.pending() updateUserWithRequestBuilder(username: username, body: body).execute { (response, error) -> Void in if let error = error { diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift index 04ad02a5ce88..dac40e9a31cf 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift @@ -12,7 +12,7 @@ class AlamofireRequestBuilderFactory: RequestBuilderFactory { return AlamofireRequestBuilder.self } - func getBuilder() -> RequestBuilder.Type { + func getBuilder() -> RequestBuilder.Type { return AlamofireDecodableRequestBuilder.self } } @@ -50,7 +50,7 @@ private struct SynchronizedDictionary { private var managerStore = SynchronizedDictionary() open class AlamofireRequestBuilder: RequestBuilder { - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } @@ -88,17 +88,17 @@ open class AlamofireRequestBuilder: RequestBuilder { May be overridden by a subclass if you want to control the request configuration (e.g. to override the cache policy). */ - open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) -> DataRequest { + open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) -> DataRequest { return manager.request(URLString, method: method, parameters: parameters, encoding: encoding, headers: headers) } override open func execute(_ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { - let managerId: String = UUID().uuidString + let managerId:String = UUID().uuidString // Create a new manager for each request to customize its request header let manager = createSessionManager() managerStore[managerId] = manager - let encoding: ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() + let encoding:ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() let xMethod = Alamofire.HTTPMethod(rawValue: method) let fileKeys = parameters == nil ? [] : parameters!.filter { $1 is NSURL } @@ -111,7 +111,8 @@ open class AlamofireRequestBuilder: RequestBuilder { case let fileURL as URL: if let mimeType = self.contentTypeForFormPart(fileURL: fileURL) { mpForm.append(fileURL, withName: k, fileName: fileURL.lastPathComponent, mimeType: mimeType) - } else { + } + else { mpForm.append(fileURL, withName: k) } case let string as String: @@ -275,7 +276,7 @@ open class AlamofireRequestBuilder: RequestBuilder { return httpHeaders } - fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { + fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { guard let contentDisposition = contentDisposition else { return nil @@ -283,7 +284,7 @@ open class AlamofireRequestBuilder: RequestBuilder { let items = contentDisposition.components(separatedBy: ";") - var filename: String? = nil + var filename : String? = nil for contentItem in items { @@ -303,7 +304,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } - fileprivate func getPath(from url: URL) throws -> String { + fileprivate func getPath(from url : URL) throws -> String { guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { throw DownloadException.requestMissingPath @@ -317,7 +318,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } - fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { + fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { guard let url = urlRequest.url else { throw DownloadException.requestMissingURL @@ -328,7 +329,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } -private enum DownloadException: Error { +fileprivate enum DownloadException : Error { case responseDataMissing case responseFailed case requestMissing @@ -343,7 +344,7 @@ public enum AlamofireDecodableRequestBuilderError: Error { case generalError(Error) } -open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { +open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { override fileprivate func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { if let credential = self.credential { diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index 111d5a3a8cbe..584de8c3d57a 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -13,7 +13,7 @@ open class CodableHelper { public static var dateformatter: DateFormatter? - open class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T: Decodable { + open class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T : Decodable { var returnedDecodable: T? = nil var returnedError: Error? = nil @@ -39,7 +39,7 @@ open class CodableHelper { return (returnedDecodable, returnedError) } - open class func encode(_ value: T, prettyPrint: Bool = false) -> EncodeResult where T: Encodable { + open class func encode(_ value: T, prettyPrint: Bool = false) -> EncodeResult where T : Encodable { var returnedData: Data? var returnedError: Error? = nil diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Configuration.swift index e1ecb39726e7..516590da5d9e 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -7,9 +7,9 @@ import Foundation open class Configuration { - + // This value is used to configure the date formatter that is used to serialize dates into JSON format. // You must set it prior to encoding any dates, and it will only be read once. public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} + +} \ No newline at end of file diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Extensions.swift index d6202ace079f..97a90f9af490 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -113,24 +113,24 @@ extension String: CodingKey { extension KeyedEncodingContainerProtocol { - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { var arrayContainer = nestedUnkeyedContainer(forKey: key) try arrayContainer.encode(contentsOf: values) } - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { if let values = values { try encodeArray(values, forKey: key) } } - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { for (key, value) in pairs { try encode(value, forKey: key) } } - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { if let pairs = pairs { try encodeMap(pairs) } @@ -140,7 +140,7 @@ extension KeyedEncodingContainerProtocol { extension KeyedDecodingContainerProtocol { - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { var tmpArray = [T]() var nestedContainer = try nestedUnkeyedContainer(forKey: key) @@ -152,7 +152,7 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { var tmpArray: [T]? = nil if contains(key) { @@ -162,8 +162,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { - var map: [Self.Key: T] = [:] + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { + var map: [Self.Key : T] = [:] for key in allKeys { if !excludedKeys.contains(key) { @@ -178,7 +178,7 @@ extension KeyedDecodingContainerProtocol { } extension RequestBuilder { - public func execute() -> Promise> { + public func execute() -> Promise> { let deferred = Promise>.pending() self.execute { (response: Response?, error: Error?) in if let response = response { diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift index 3e68bb5d4a9b..70449515842d 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -10,7 +10,7 @@ import Alamofire open class JSONEncodingHelper { - open class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { + open class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { var params: Parameters? = nil // Encode the Encodable object @@ -39,5 +39,5 @@ open class JSONEncodingHelper { return params } - + } diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models.swift index e87ce399c7c8..408563890359 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,7 +10,7 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -public enum ErrorResponse: Error { +public enum ErrorResponse : Error { case error(Int, Data?, Error) } diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 83a06951ccd6..4db39adae84c 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -7,19 +7,23 @@ import Foundation + + public struct AdditionalPropertiesClass: Codable { - public var mapString: [String: String]? - public var mapMapString: [String: [String: String]]? + public var mapString: [String:String]? + public var mapMapString: [String:[String:String]]? - public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { + public init(mapString: [String:String]?, mapMapString: [String:[String:String]]?) { self.mapString = mapString self.mapMapString = mapMapString } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case mapString = "map_string" case mapMapString = "map_map_string" } + } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index 5ed9f31e2a36..7221a1be099d 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -7,6 +7,8 @@ import Foundation + + public struct Animal: Codable { public var className: String @@ -17,4 +19,6 @@ public struct Animal: Codable { self.color = color } + } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift index e09b0e9efdc8..e7bea63f8ed2 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -7,4 +7,5 @@ import Foundation + public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index ec270da89074..a22e9aaebbb0 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -7,6 +7,8 @@ import Foundation + + public struct ApiResponse: Codable { public var code: Int? @@ -19,4 +21,6 @@ public struct ApiResponse: Codable { self.message = message } + } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 3843287630b1..4e5a5ca1445d 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,6 +7,8 @@ import Foundation + + public struct ArrayOfArrayOfNumberOnly: Codable { public var arrayArrayNumber: [[Double]]? @@ -15,8 +17,10 @@ public struct ArrayOfArrayOfNumberOnly: Codable { self.arrayArrayNumber = arrayArrayNumber } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case arrayArrayNumber = "ArrayArrayNumber" } + } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index f8b198e81f50..7d059d368339 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -7,6 +7,8 @@ import Foundation + + public struct ArrayOfNumberOnly: Codable { public var arrayNumber: [Double]? @@ -15,8 +17,10 @@ public struct ArrayOfNumberOnly: Codable { self.arrayNumber = arrayNumber } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case arrayNumber = "ArrayNumber" } + } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index 67f7f7e5151f..9c56fed50c2e 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -7,6 +7,8 @@ import Foundation + + public struct ArrayTest: Codable { public var arrayOfString: [String]? @@ -19,10 +21,12 @@ public struct ArrayTest: Codable { self.arrayArrayOfModel = arrayArrayOfModel } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" case arrayArrayOfModel = "array_array_of_model" } + } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index d576b50b1c9c..98cda23dac9e 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -7,6 +7,8 @@ import Foundation + + public struct Capitalization: Codable { public var smallCamel: String? @@ -26,7 +28,7 @@ public struct Capitalization: Codable { self.ATT_NAME = ATT_NAME } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case smallCamel case capitalCamel = "CapitalCamel" case smallSnake = "small_Snake" @@ -35,4 +37,6 @@ public struct Capitalization: Codable { case ATT_NAME } + } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 7ab887f3113f..a116d964ea84 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -7,6 +7,8 @@ import Foundation + + public struct Cat: Codable { public var className: String @@ -19,4 +21,6 @@ public struct Cat: Codable { self.declawed = declawed } + } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index a51ad0dffab1..b5404f052cb7 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -7,6 +7,8 @@ import Foundation + + public struct CatAllOf: Codable { public var declawed: Bool? @@ -15,4 +17,6 @@ public struct CatAllOf: Codable { self.declawed = declawed } + } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index eb8f7e5e1974..e8c489be4604 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,6 +7,8 @@ import Foundation + + public struct Category: Codable { public var id: Int64? @@ -17,4 +19,6 @@ public struct Category: Codable { self.name = name } + } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index 28cb30ce7b4b..f673ed127cd8 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -7,6 +7,7 @@ import Foundation + /** Model for testing model with \"_class\" property */ public struct ClassModel: Codable { @@ -17,4 +18,6 @@ public struct ClassModel: Codable { self._class = _class } + } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 00245ca37280..51390b6c4eac 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -7,6 +7,8 @@ import Foundation + + public struct Client: Codable { public var client: String? @@ -15,4 +17,6 @@ public struct Client: Codable { self.client = client } + } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 492c1228008e..239ce74dcc21 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -7,6 +7,8 @@ import Foundation + + public struct Dog: Codable { public var className: String @@ -19,4 +21,6 @@ public struct Dog: Codable { self.breed = breed } + } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 7786f8acc5ae..dc8bd63af9d6 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -7,6 +7,8 @@ import Foundation + + public struct DogAllOf: Codable { public var breed: String? @@ -15,4 +17,6 @@ public struct DogAllOf: Codable { self.breed = breed } + } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 5034ff0b8c68..8713961520e1 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -7,6 +7,8 @@ import Foundation + + public struct EnumArrays: Codable { public enum JustSymbol: String, Codable { @@ -25,9 +27,11 @@ public struct EnumArrays: Codable { self.arrayEnum = arrayEnum } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case justSymbol = "just_symbol" case arrayEnum = "array_enum" } + } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index 3c1dfcac577d..7280a621fec7 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -7,6 +7,7 @@ import Foundation + public enum EnumClass: String, Codable { case abc = "_abc" case efg = "-efg" diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 6db9b34d183b..0f546c76a218 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -7,6 +7,8 @@ import Foundation + + public struct EnumTest: Codable { public enum EnumString: String, Codable { @@ -41,7 +43,7 @@ public struct EnumTest: Codable { self.outerEnum = outerEnum } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case enumString = "enum_string" case enumStringRequired = "enum_string_required" case enumInteger = "enum_integer" @@ -49,4 +51,6 @@ public struct EnumTest: Codable { case outerEnum } + } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/File.swift index ea3520f053dd..c8bd1f19589b 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -7,6 +7,7 @@ import Foundation + /** Must be named `File` for test. */ public struct File: Codable { @@ -18,4 +19,6 @@ public struct File: Codable { self.sourceURI = sourceURI } + } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 532f1457939a..64d025068027 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -7,6 +7,8 @@ import Foundation + + public struct FileSchemaTestClass: Codable { public var file: File? @@ -17,4 +19,6 @@ public struct FileSchemaTestClass: Codable { self.files = files } + } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index 20bd6d103b3d..faa091b0658c 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -7,6 +7,8 @@ import Foundation + + public struct FormatTest: Codable { public var integer: Int? @@ -39,4 +41,6 @@ public struct FormatTest: Codable { self.password = password } + } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 906ddb06fb17..554aee1081aa 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -7,6 +7,8 @@ import Foundation + + public struct HasOnlyReadOnly: Codable { public var bar: String? @@ -17,4 +19,6 @@ public struct HasOnlyReadOnly: Codable { self.foo = foo } + } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/List.swift index 08d59953873e..8997340ff4be 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -7,6 +7,8 @@ import Foundation + + public struct List: Codable { public var _123list: String? @@ -15,8 +17,10 @@ public struct List: Codable { self._123list = _123list } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case _123list = "123-list" } + } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 3a10a7dfcaf6..2d3a45d35a0c 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -7,29 +7,33 @@ import Foundation + + public struct MapTest: Codable { public enum MapOfEnumString: String, Codable { case upper = "UPPER" case lower = "lower" } - public var mapMapOfString: [String: [String: String]]? - public var mapOfEnumString: [String: String]? - public var directMap: [String: Bool]? + public var mapMapOfString: [String:[String:String]]? + public var mapOfEnumString: [String:String]? + public var directMap: [String:Bool]? public var indirectMap: StringBooleanMap? - public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { + public init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?, directMap: [String:Bool]?, indirectMap: StringBooleanMap?) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap self.indirectMap = indirectMap } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" case directMap = "direct_map" case indirectMap = "indirect_map" } + } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index c3deb2f28932..7116108fd7a3 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,16 +7,20 @@ import Foundation + + public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { public var uuid: UUID? public var dateTime: Date? - public var map: [String: Animal]? + public var map: [String:Animal]? - public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { + public init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) { self.uuid = uuid self.dateTime = dateTime self.map = map } + } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index 7ed6aad907be..fc1d0606b7ba 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -7,6 +7,7 @@ import Foundation + /** Model for testing model name starting with number */ public struct Model200Response: Codable { @@ -19,9 +20,11 @@ public struct Model200Response: Codable { self._class = _class } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case name case _class = "class" } + } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index ce9ffe4fb38e..cc165d767d91 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -7,6 +7,7 @@ import Foundation + /** Model for testing model name same as property name */ public struct Name: Codable { @@ -23,11 +24,13 @@ public struct Name: Codable { self._123number = _123number } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case name case snakeCase = "snake_case" case property case _123number = "123Number" } + } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index abd2269e8e76..e6fb206093aa 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -7,6 +7,8 @@ import Foundation + + public struct NumberOnly: Codable { public var justNumber: Double? @@ -15,8 +17,10 @@ public struct NumberOnly: Codable { self.justNumber = justNumber } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case justNumber = "JustNumber" } + } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index a6e1b1d2e5e4..83c3b85e6629 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -7,6 +7,8 @@ import Foundation + + public struct Order: Codable { public enum Status: String, Codable { @@ -31,4 +33,6 @@ public struct Order: Codable { self.complete = complete } + } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 49aec001c5db..edc4523d9f00 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -7,6 +7,8 @@ import Foundation + + public struct OuterComposite: Codable { public var myNumber: Double? @@ -19,10 +21,12 @@ public struct OuterComposite: Codable { self.myBoolean = myBoolean } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case myNumber = "my_number" case myString = "my_string" case myBoolean = "my_boolean" } + } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index 9f80fc95ecf0..bd1643d279ed 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -7,6 +7,7 @@ import Foundation + public enum OuterEnum: String, Codable { case placed = "placed" case approved = "approved" diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index af60a550bb19..5e39abae6c8f 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,6 +7,8 @@ import Foundation + + public struct Pet: Codable { public enum Status: String, Codable { @@ -31,4 +33,6 @@ public struct Pet: Codable { self.status = status } + } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 0acd21fd1000..48b655a5b0aa 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -7,6 +7,8 @@ import Foundation + + public struct ReadOnlyFirst: Codable { public var bar: String? @@ -17,4 +19,6 @@ public struct ReadOnlyFirst: Codable { self.baz = baz } + } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index 076082af842f..de4b218999b7 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -7,6 +7,7 @@ import Foundation + /** Model for testing reserved words */ public struct Return: Codable { @@ -17,8 +18,10 @@ public struct Return: Codable { self._return = _return } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case _return = "return" } + } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index e79fc45c0e91..213d896ba988 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -7,6 +7,8 @@ import Foundation + + public struct SpecialModelName: Codable { public var specialPropertyName: Int64? @@ -15,8 +17,10 @@ public struct SpecialModelName: Codable { self.specialPropertyName = specialPropertyName } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case specialPropertyName = "$special[property.name]" } + } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index 3f1237fee477..ae15e87d94bb 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -7,9 +7,12 @@ import Foundation + + public struct StringBooleanMap: Codable { - public var additionalProperties: [String: Bool] = [:] + + public var additionalProperties: [String:Bool] = [:] public subscript(key: String) -> Bool? { get { @@ -42,4 +45,7 @@ public struct StringBooleanMap: Codable { additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } + + } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 4dd8a9a9f5a0..32ee33a1a1e0 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,6 +7,8 @@ import Foundation + + public struct Tag: Codable { public var id: Int64? @@ -17,4 +19,6 @@ public struct Tag: Codable { self.name = name } + } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index bf0006e1a266..be1afdf0266c 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -7,6 +7,8 @@ import Foundation + + public struct TypeHolderDefault: Codable { public var stringItem: String = "what" @@ -23,7 +25,7 @@ public struct TypeHolderDefault: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" @@ -31,4 +33,6 @@ public struct TypeHolderDefault: Codable { case arrayItem = "array_item" } + } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index 602a2a6d185a..f46c8952e13e 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -7,6 +7,8 @@ import Foundation + + public struct TypeHolderExample: Codable { public var stringItem: String @@ -23,7 +25,7 @@ public struct TypeHolderExample: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" @@ -31,4 +33,6 @@ public struct TypeHolderExample: Codable { case arrayItem = "array_item" } + } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 79f271ed7356..a61b5844201e 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -7,6 +7,8 @@ import Foundation + + public struct User: Codable { public var id: Int64? @@ -30,4 +32,6 @@ public struct User: Codable { self.userStatus = userStatus } + } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 75dea2439575..d94614b34fc7 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -7,7 +7,7 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { + public static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { let destination = source.reduce(into: [String: Any]()) { (result, item) in if let value = item.value { result[item.key] = value @@ -20,17 +20,17 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { + public static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { return source.reduce(into: [String: String]()) { (result, item) in if let collection = item.value as? Array { - result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") + result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } } } - public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { + public static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { guard let source = source else { return nil } @@ -52,7 +52,7 @@ public struct APIHelper { return source } - public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { + public static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in if let collection = item.value as? Array { let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") @@ -68,3 +68,4 @@ public struct APIHelper { return destination } } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs.swift index 9e4312f685de..2890bffa2747 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -9,22 +9,22 @@ import Foundation open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io:80/v2" public static var credential: URLCredential? - public static var customHeaders: [String: String] = [:] + public static var customHeaders: [String:String] = [:] public static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() } open class RequestBuilder { var credential: URLCredential? - var headers: [String: String] - public let parameters: [String: Any]? + var headers: [String:String] + public let parameters: [String:Any]? public let isBody: Bool public let method: String public let URLString: String /// Optional block to obtain a reference to the request's progress instance when available. - public var onProgressReady: ((Progress) -> Void)? + public var onProgressReady: ((Progress) -> ())? - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters @@ -34,7 +34,7 @@ open class RequestBuilder { addHeaders(PetstoreClientAPI.customHeaders) } - open func addHeaders(_ aHeaders: [String: String]) { + open func addHeaders(_ aHeaders:[String:String]) { for (header, value) in aHeaders { headers[header] = value } @@ -57,5 +57,5 @@ open class RequestBuilder { public protocol RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 0d88a4bad981..1a95322a6bae 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -9,6 +9,8 @@ import Foundation import Alamofire import RxSwift + + open class AnotherFakeAPI { /** To test special tags diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 8e6840eeaac4..05053aed92e2 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -9,6 +9,8 @@ import Foundation import Alamofire import RxSwift + + open class FakeAPI { /** @@ -344,7 +346,7 @@ open class FakeAPI { open class func testEndpointParametersWithRequestBuilder(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "integer": integer?.encodeToJSON(), "int32": int32?.encodeToJSON(), "int64": int64?.encodeToJSON(), @@ -363,7 +365,7 @@ open class FakeAPI { let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -482,19 +484,19 @@ open class FakeAPI { open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "enum_form_string_array": enumFormStringArray, "enum_form_string": enumFormString?.rawValue ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": enumQueryStringArray, - "enum_query_string": enumQueryString?.rawValue, - "enum_query_integer": enumQueryInteger?.rawValue, + "enum_query_string_array": enumQueryStringArray, + "enum_query_string": enumQueryString?.rawValue, + "enum_query_integer": enumQueryInteger?.rawValue, "enum_query_double": enumQueryDouble?.rawValue ]) let nillableHeaders: [String: Any?] = [ @@ -548,13 +550,13 @@ open class FakeAPI { open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), "int64_group": int64Group?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -574,7 +576,7 @@ open class FakeAPI { - parameter param: (body) request body - returns: Observable */ - open class func testInlineAdditionalProperties(param: [String: String]) -> Observable { + open class func testInlineAdditionalProperties(param: [String:String]) -> Observable { return Observable.create { observer -> Disposable in testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (response, error) -> Void in if let error = error { @@ -594,7 +596,7 @@ open class FakeAPI { - parameter param: (body) request body - returns: RequestBuilder */ - open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder { + open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { let path = "/fake/inline-additionalProperties" let URLString = PetstoreClientAPI.basePath + path let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param) @@ -637,14 +639,14 @@ open class FakeAPI { open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { let path = "/fake/jsonFormData" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "param": param, "param2": param2 ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index a4e7d073c9ab..2784d5cfb656 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -9,6 +9,8 @@ import Foundation import Alamofire import RxSwift + + open class FakeClassnameTags123API { /** To test class name in snake case diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index fcbd3f3b0022..b9ca8262f43f 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -9,6 +9,8 @@ import Foundation import Alamofire import RxSwift + + open class PetAPI { /** Add a new pet to the store @@ -88,8 +90,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let nillableHeaders: [String: Any?] = [ "api_key": apiKey @@ -145,8 +147,8 @@ open class PetAPI { open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByStatus" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "status": status @@ -192,8 +194,8 @@ open class PetAPI { open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "tags": tags @@ -242,8 +244,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -331,14 +333,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "name": name, "status": status ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -387,14 +389,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata, "file": file ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -443,14 +445,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata, "requiredFile": requiredFile ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 6171b68c85da..4af70c925307 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -9,6 +9,8 @@ import Foundation import Alamofire import RxSwift + + open class StoreAPI { /** Delete purchase order by ID @@ -43,8 +45,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -57,7 +59,7 @@ open class StoreAPI { - returns: Observable<[String:Int]> */ - open class func getInventory() -> Observable<[String: Int]> { + open class func getInventory() -> Observable<[String:Int]> { return Observable.create { observer -> Disposable in getInventoryWithRequestBuilder().execute { (response, error) -> Void in if let error = error { @@ -82,14 +84,14 @@ open class StoreAPI { - name: api_key - returns: RequestBuilder<[String:Int]> */ - open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { + open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> { let path = "/store/inventory" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } @@ -129,8 +131,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index baeb80933a9c..999b7791db8d 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -9,6 +9,8 @@ import Foundation import Alamofire import RxSwift + + open class UserAPI { /** Create user @@ -158,8 +160,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -201,8 +203,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -244,11 +246,11 @@ open class UserAPI { open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { let path = "/user/login" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": username, + "username": username, "password": password ]) @@ -284,8 +286,8 @@ open class UserAPI { open class func logoutUserWithRequestBuilder() -> RequestBuilder { let path = "/user/logout" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift index 04ad02a5ce88..dac40e9a31cf 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift @@ -12,7 +12,7 @@ class AlamofireRequestBuilderFactory: RequestBuilderFactory { return AlamofireRequestBuilder.self } - func getBuilder() -> RequestBuilder.Type { + func getBuilder() -> RequestBuilder.Type { return AlamofireDecodableRequestBuilder.self } } @@ -50,7 +50,7 @@ private struct SynchronizedDictionary { private var managerStore = SynchronizedDictionary() open class AlamofireRequestBuilder: RequestBuilder { - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } @@ -88,17 +88,17 @@ open class AlamofireRequestBuilder: RequestBuilder { May be overridden by a subclass if you want to control the request configuration (e.g. to override the cache policy). */ - open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) -> DataRequest { + open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) -> DataRequest { return manager.request(URLString, method: method, parameters: parameters, encoding: encoding, headers: headers) } override open func execute(_ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { - let managerId: String = UUID().uuidString + let managerId:String = UUID().uuidString // Create a new manager for each request to customize its request header let manager = createSessionManager() managerStore[managerId] = manager - let encoding: ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() + let encoding:ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() let xMethod = Alamofire.HTTPMethod(rawValue: method) let fileKeys = parameters == nil ? [] : parameters!.filter { $1 is NSURL } @@ -111,7 +111,8 @@ open class AlamofireRequestBuilder: RequestBuilder { case let fileURL as URL: if let mimeType = self.contentTypeForFormPart(fileURL: fileURL) { mpForm.append(fileURL, withName: k, fileName: fileURL.lastPathComponent, mimeType: mimeType) - } else { + } + else { mpForm.append(fileURL, withName: k) } case let string as String: @@ -275,7 +276,7 @@ open class AlamofireRequestBuilder: RequestBuilder { return httpHeaders } - fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { + fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { guard let contentDisposition = contentDisposition else { return nil @@ -283,7 +284,7 @@ open class AlamofireRequestBuilder: RequestBuilder { let items = contentDisposition.components(separatedBy: ";") - var filename: String? = nil + var filename : String? = nil for contentItem in items { @@ -303,7 +304,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } - fileprivate func getPath(from url: URL) throws -> String { + fileprivate func getPath(from url : URL) throws -> String { guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { throw DownloadException.requestMissingPath @@ -317,7 +318,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } - fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { + fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { guard let url = urlRequest.url else { throw DownloadException.requestMissingURL @@ -328,7 +329,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } -private enum DownloadException: Error { +fileprivate enum DownloadException : Error { case responseDataMissing case responseFailed case requestMissing @@ -343,7 +344,7 @@ public enum AlamofireDecodableRequestBuilderError: Error { case generalError(Error) } -open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { +open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { override fileprivate func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { if let credential = self.credential { diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index 111d5a3a8cbe..584de8c3d57a 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -13,7 +13,7 @@ open class CodableHelper { public static var dateformatter: DateFormatter? - open class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T: Decodable { + open class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T : Decodable { var returnedDecodable: T? = nil var returnedError: Error? = nil @@ -39,7 +39,7 @@ open class CodableHelper { return (returnedDecodable, returnedError) } - open class func encode(_ value: T, prettyPrint: Bool = false) -> EncodeResult where T: Encodable { + open class func encode(_ value: T, prettyPrint: Bool = false) -> EncodeResult where T : Encodable { var returnedData: Data? var returnedError: Error? = nil diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Configuration.swift index e1ecb39726e7..516590da5d9e 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -7,9 +7,9 @@ import Foundation open class Configuration { - + // This value is used to configure the date formatter that is used to serialize dates into JSON format. // You must set it prior to encoding any dates, and it will only be read once. public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} + +} \ No newline at end of file diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 24c128daadef..8bf1829ba806 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -112,24 +112,24 @@ extension String: CodingKey { extension KeyedEncodingContainerProtocol { - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { var arrayContainer = nestedUnkeyedContainer(forKey: key) try arrayContainer.encode(contentsOf: values) } - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { if let values = values { try encodeArray(values, forKey: key) } } - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { for (key, value) in pairs { try encode(value, forKey: key) } } - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { if let pairs = pairs { try encodeMap(pairs) } @@ -139,7 +139,7 @@ extension KeyedEncodingContainerProtocol { extension KeyedDecodingContainerProtocol { - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { var tmpArray = [T]() var nestedContainer = try nestedUnkeyedContainer(forKey: key) @@ -151,7 +151,7 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { var tmpArray: [T]? = nil if contains(key) { @@ -161,8 +161,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { - var map: [Self.Key: T] = [:] + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { + var map: [Self.Key : T] = [:] for key in allKeys { if !excludedKeys.contains(key) { @@ -175,3 +175,5 @@ extension KeyedDecodingContainerProtocol { } } + + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift index 3e68bb5d4a9b..70449515842d 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -10,7 +10,7 @@ import Alamofire open class JSONEncodingHelper { - open class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { + open class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { var params: Parameters? = nil // Encode the Encodable object @@ -39,5 +39,5 @@ open class JSONEncodingHelper { return params } - + } diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models.swift index e87ce399c7c8..408563890359 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,7 +10,7 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -public enum ErrorResponse: Error { +public enum ErrorResponse : Error { case error(Int, Data?, Error) } diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 83a06951ccd6..4db39adae84c 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -7,19 +7,23 @@ import Foundation + + public struct AdditionalPropertiesClass: Codable { - public var mapString: [String: String]? - public var mapMapString: [String: [String: String]]? + public var mapString: [String:String]? + public var mapMapString: [String:[String:String]]? - public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { + public init(mapString: [String:String]?, mapMapString: [String:[String:String]]?) { self.mapString = mapString self.mapMapString = mapMapString } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case mapString = "map_string" case mapMapString = "map_map_string" } + } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index 5ed9f31e2a36..7221a1be099d 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -7,6 +7,8 @@ import Foundation + + public struct Animal: Codable { public var className: String @@ -17,4 +19,6 @@ public struct Animal: Codable { self.color = color } + } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift index e09b0e9efdc8..e7bea63f8ed2 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -7,4 +7,5 @@ import Foundation + public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index ec270da89074..a22e9aaebbb0 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -7,6 +7,8 @@ import Foundation + + public struct ApiResponse: Codable { public var code: Int? @@ -19,4 +21,6 @@ public struct ApiResponse: Codable { self.message = message } + } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 3843287630b1..4e5a5ca1445d 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,6 +7,8 @@ import Foundation + + public struct ArrayOfArrayOfNumberOnly: Codable { public var arrayArrayNumber: [[Double]]? @@ -15,8 +17,10 @@ public struct ArrayOfArrayOfNumberOnly: Codable { self.arrayArrayNumber = arrayArrayNumber } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case arrayArrayNumber = "ArrayArrayNumber" } + } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index f8b198e81f50..7d059d368339 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -7,6 +7,8 @@ import Foundation + + public struct ArrayOfNumberOnly: Codable { public var arrayNumber: [Double]? @@ -15,8 +17,10 @@ public struct ArrayOfNumberOnly: Codable { self.arrayNumber = arrayNumber } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case arrayNumber = "ArrayNumber" } + } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index 67f7f7e5151f..9c56fed50c2e 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -7,6 +7,8 @@ import Foundation + + public struct ArrayTest: Codable { public var arrayOfString: [String]? @@ -19,10 +21,12 @@ public struct ArrayTest: Codable { self.arrayArrayOfModel = arrayArrayOfModel } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" case arrayArrayOfModel = "array_array_of_model" } + } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index d576b50b1c9c..98cda23dac9e 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -7,6 +7,8 @@ import Foundation + + public struct Capitalization: Codable { public var smallCamel: String? @@ -26,7 +28,7 @@ public struct Capitalization: Codable { self.ATT_NAME = ATT_NAME } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case smallCamel case capitalCamel = "CapitalCamel" case smallSnake = "small_Snake" @@ -35,4 +37,6 @@ public struct Capitalization: Codable { case ATT_NAME } + } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 7ab887f3113f..a116d964ea84 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -7,6 +7,8 @@ import Foundation + + public struct Cat: Codable { public var className: String @@ -19,4 +21,6 @@ public struct Cat: Codable { self.declawed = declawed } + } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index a51ad0dffab1..b5404f052cb7 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -7,6 +7,8 @@ import Foundation + + public struct CatAllOf: Codable { public var declawed: Bool? @@ -15,4 +17,6 @@ public struct CatAllOf: Codable { self.declawed = declawed } + } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index eb8f7e5e1974..e8c489be4604 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,6 +7,8 @@ import Foundation + + public struct Category: Codable { public var id: Int64? @@ -17,4 +19,6 @@ public struct Category: Codable { self.name = name } + } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index 28cb30ce7b4b..f673ed127cd8 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -7,6 +7,7 @@ import Foundation + /** Model for testing model with \"_class\" property */ public struct ClassModel: Codable { @@ -17,4 +18,6 @@ public struct ClassModel: Codable { self._class = _class } + } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 00245ca37280..51390b6c4eac 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -7,6 +7,8 @@ import Foundation + + public struct Client: Codable { public var client: String? @@ -15,4 +17,6 @@ public struct Client: Codable { self.client = client } + } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 492c1228008e..239ce74dcc21 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -7,6 +7,8 @@ import Foundation + + public struct Dog: Codable { public var className: String @@ -19,4 +21,6 @@ public struct Dog: Codable { self.breed = breed } + } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 7786f8acc5ae..dc8bd63af9d6 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -7,6 +7,8 @@ import Foundation + + public struct DogAllOf: Codable { public var breed: String? @@ -15,4 +17,6 @@ public struct DogAllOf: Codable { self.breed = breed } + } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 5034ff0b8c68..8713961520e1 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -7,6 +7,8 @@ import Foundation + + public struct EnumArrays: Codable { public enum JustSymbol: String, Codable { @@ -25,9 +27,11 @@ public struct EnumArrays: Codable { self.arrayEnum = arrayEnum } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case justSymbol = "just_symbol" case arrayEnum = "array_enum" } + } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index 3c1dfcac577d..7280a621fec7 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -7,6 +7,7 @@ import Foundation + public enum EnumClass: String, Codable { case abc = "_abc" case efg = "-efg" diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 6db9b34d183b..0f546c76a218 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -7,6 +7,8 @@ import Foundation + + public struct EnumTest: Codable { public enum EnumString: String, Codable { @@ -41,7 +43,7 @@ public struct EnumTest: Codable { self.outerEnum = outerEnum } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case enumString = "enum_string" case enumStringRequired = "enum_string_required" case enumInteger = "enum_integer" @@ -49,4 +51,6 @@ public struct EnumTest: Codable { case outerEnum } + } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/File.swift index ea3520f053dd..c8bd1f19589b 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -7,6 +7,7 @@ import Foundation + /** Must be named `File` for test. */ public struct File: Codable { @@ -18,4 +19,6 @@ public struct File: Codable { self.sourceURI = sourceURI } + } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 532f1457939a..64d025068027 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -7,6 +7,8 @@ import Foundation + + public struct FileSchemaTestClass: Codable { public var file: File? @@ -17,4 +19,6 @@ public struct FileSchemaTestClass: Codable { self.files = files } + } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index 20bd6d103b3d..faa091b0658c 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -7,6 +7,8 @@ import Foundation + + public struct FormatTest: Codable { public var integer: Int? @@ -39,4 +41,6 @@ public struct FormatTest: Codable { self.password = password } + } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 906ddb06fb17..554aee1081aa 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -7,6 +7,8 @@ import Foundation + + public struct HasOnlyReadOnly: Codable { public var bar: String? @@ -17,4 +19,6 @@ public struct HasOnlyReadOnly: Codable { self.foo = foo } + } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/List.swift index 08d59953873e..8997340ff4be 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -7,6 +7,8 @@ import Foundation + + public struct List: Codable { public var _123list: String? @@ -15,8 +17,10 @@ public struct List: Codable { self._123list = _123list } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case _123list = "123-list" } + } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 3a10a7dfcaf6..2d3a45d35a0c 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -7,29 +7,33 @@ import Foundation + + public struct MapTest: Codable { public enum MapOfEnumString: String, Codable { case upper = "UPPER" case lower = "lower" } - public var mapMapOfString: [String: [String: String]]? - public var mapOfEnumString: [String: String]? - public var directMap: [String: Bool]? + public var mapMapOfString: [String:[String:String]]? + public var mapOfEnumString: [String:String]? + public var directMap: [String:Bool]? public var indirectMap: StringBooleanMap? - public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { + public init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?, directMap: [String:Bool]?, indirectMap: StringBooleanMap?) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap self.indirectMap = indirectMap } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" case directMap = "direct_map" case indirectMap = "indirect_map" } + } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index c3deb2f28932..7116108fd7a3 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,16 +7,20 @@ import Foundation + + public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { public var uuid: UUID? public var dateTime: Date? - public var map: [String: Animal]? + public var map: [String:Animal]? - public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { + public init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) { self.uuid = uuid self.dateTime = dateTime self.map = map } + } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index 7ed6aad907be..fc1d0606b7ba 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -7,6 +7,7 @@ import Foundation + /** Model for testing model name starting with number */ public struct Model200Response: Codable { @@ -19,9 +20,11 @@ public struct Model200Response: Codable { self._class = _class } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case name case _class = "class" } + } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index ce9ffe4fb38e..cc165d767d91 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -7,6 +7,7 @@ import Foundation + /** Model for testing model name same as property name */ public struct Name: Codable { @@ -23,11 +24,13 @@ public struct Name: Codable { self._123number = _123number } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case name case snakeCase = "snake_case" case property case _123number = "123Number" } + } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index abd2269e8e76..e6fb206093aa 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -7,6 +7,8 @@ import Foundation + + public struct NumberOnly: Codable { public var justNumber: Double? @@ -15,8 +17,10 @@ public struct NumberOnly: Codable { self.justNumber = justNumber } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case justNumber = "JustNumber" } + } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index a6e1b1d2e5e4..83c3b85e6629 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -7,6 +7,8 @@ import Foundation + + public struct Order: Codable { public enum Status: String, Codable { @@ -31,4 +33,6 @@ public struct Order: Codable { self.complete = complete } + } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 49aec001c5db..edc4523d9f00 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -7,6 +7,8 @@ import Foundation + + public struct OuterComposite: Codable { public var myNumber: Double? @@ -19,10 +21,12 @@ public struct OuterComposite: Codable { self.myBoolean = myBoolean } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case myNumber = "my_number" case myString = "my_string" case myBoolean = "my_boolean" } + } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index 9f80fc95ecf0..bd1643d279ed 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -7,6 +7,7 @@ import Foundation + public enum OuterEnum: String, Codable { case placed = "placed" case approved = "approved" diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index af60a550bb19..5e39abae6c8f 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,6 +7,8 @@ import Foundation + + public struct Pet: Codable { public enum Status: String, Codable { @@ -31,4 +33,6 @@ public struct Pet: Codable { self.status = status } + } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 0acd21fd1000..48b655a5b0aa 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -7,6 +7,8 @@ import Foundation + + public struct ReadOnlyFirst: Codable { public var bar: String? @@ -17,4 +19,6 @@ public struct ReadOnlyFirst: Codable { self.baz = baz } + } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index 076082af842f..de4b218999b7 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -7,6 +7,7 @@ import Foundation + /** Model for testing reserved words */ public struct Return: Codable { @@ -17,8 +18,10 @@ public struct Return: Codable { self._return = _return } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case _return = "return" } + } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index e79fc45c0e91..213d896ba988 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -7,6 +7,8 @@ import Foundation + + public struct SpecialModelName: Codable { public var specialPropertyName: Int64? @@ -15,8 +17,10 @@ public struct SpecialModelName: Codable { self.specialPropertyName = specialPropertyName } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case specialPropertyName = "$special[property.name]" } + } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index 3f1237fee477..ae15e87d94bb 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -7,9 +7,12 @@ import Foundation + + public struct StringBooleanMap: Codable { - public var additionalProperties: [String: Bool] = [:] + + public var additionalProperties: [String:Bool] = [:] public subscript(key: String) -> Bool? { get { @@ -42,4 +45,7 @@ public struct StringBooleanMap: Codable { additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } + + } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 4dd8a9a9f5a0..32ee33a1a1e0 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,6 +7,8 @@ import Foundation + + public struct Tag: Codable { public var id: Int64? @@ -17,4 +19,6 @@ public struct Tag: Codable { self.name = name } + } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index bf0006e1a266..be1afdf0266c 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -7,6 +7,8 @@ import Foundation + + public struct TypeHolderDefault: Codable { public var stringItem: String = "what" @@ -23,7 +25,7 @@ public struct TypeHolderDefault: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" @@ -31,4 +33,6 @@ public struct TypeHolderDefault: Codable { case arrayItem = "array_item" } + } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index 602a2a6d185a..f46c8952e13e 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -7,6 +7,8 @@ import Foundation + + public struct TypeHolderExample: Codable { public var stringItem: String @@ -23,7 +25,7 @@ public struct TypeHolderExample: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" @@ -31,4 +33,6 @@ public struct TypeHolderExample: Codable { case arrayItem = "array_item" } + } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 79f271ed7356..a61b5844201e 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -7,6 +7,8 @@ import Foundation + + public struct User: Codable { public var id: Int64? @@ -30,4 +32,6 @@ public struct User: Codable { self.userStatus = userStatus } + } + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 75dea2439575..d94614b34fc7 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -7,7 +7,7 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { + public static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { let destination = source.reduce(into: [String: Any]()) { (result, item) in if let value = item.value { result[item.key] = value @@ -20,17 +20,17 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { + public static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { return source.reduce(into: [String: String]()) { (result, item) in if let collection = item.value as? Array { - result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") + result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } } } - public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { + public static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { guard let source = source else { return nil } @@ -52,7 +52,7 @@ public struct APIHelper { return source } - public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { + public static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in if let collection = item.value as? Array { let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") @@ -68,3 +68,4 @@ public struct APIHelper { return destination } } + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs.swift index 9e4312f685de..2890bffa2747 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -9,22 +9,22 @@ import Foundation open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io:80/v2" public static var credential: URLCredential? - public static var customHeaders: [String: String] = [:] + public static var customHeaders: [String:String] = [:] public static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() } open class RequestBuilder { var credential: URLCredential? - var headers: [String: String] - public let parameters: [String: Any]? + var headers: [String:String] + public let parameters: [String:Any]? public let isBody: Bool public let method: String public let URLString: String /// Optional block to obtain a reference to the request's progress instance when available. - public var onProgressReady: ((Progress) -> Void)? + public var onProgressReady: ((Progress) -> ())? - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters @@ -34,7 +34,7 @@ open class RequestBuilder { addHeaders(PetstoreClientAPI.customHeaders) } - open func addHeaders(_ aHeaders: [String: String]) { + open func addHeaders(_ aHeaders:[String:String]) { for (header, value) in aHeaders { headers[header] = value } @@ -57,5 +57,5 @@ open class RequestBuilder { public protocol RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 30b346de0e1d..ffecb66c48c2 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -8,6 +8,8 @@ import Foundation import Alamofire + + open class AnotherFakeAPI { /** To test special tags @@ -15,7 +17,7 @@ open class AnotherFakeAPI { - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func call123testSpecialTags(body: Client, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + open class func call123testSpecialTags(body: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { call123testSpecialTagsWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 1073935592c0..302767c2b0c2 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -8,13 +8,15 @@ import Foundation import Alamofire + + open class FakeAPI { /** - parameter body: (body) Input boolean as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterBooleanSerialize(body: Bool? = nil, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) { + open class func fakeOuterBooleanSerialize(body: Bool? = nil, completion: @escaping ((_ data: Bool?,_ error: Error?) -> Void)) { fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -43,7 +45,7 @@ open class FakeAPI { - parameter body: (body) Input composite as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) { + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?,_ error: Error?) -> Void)) { fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -72,7 +74,7 @@ open class FakeAPI { - parameter body: (body) Input number as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterNumberSerialize(body: Double? = nil, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) { + open class func fakeOuterNumberSerialize(body: Double? = nil, completion: @escaping ((_ data: Double?,_ error: Error?) -> Void)) { fakeOuterNumberSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -101,7 +103,7 @@ open class FakeAPI { - parameter body: (body) Input string as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterStringSerialize(body: String? = nil, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { + open class func fakeOuterStringSerialize(body: String? = nil, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { fakeOuterStringSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -130,7 +132,7 @@ open class FakeAPI { - parameter body: (body) - parameter completion: completion handler to receive the data and the error objects */ - open class func testBodyWithFileSchema(body: FileSchemaTestClass, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testBodyWithFileSchema(body: FileSchemaTestClass, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (response, error) -> Void in if error == nil { completion((), error) @@ -164,7 +166,7 @@ open class FakeAPI { - parameter body: (body) - parameter completion: completion handler to receive the data and the error objects */ - open class func testBodyWithQueryParams(query: String, body: User, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testBodyWithQueryParams(query: String, body: User, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (response, error) -> Void in if error == nil { completion((), error) @@ -201,7 +203,7 @@ open class FakeAPI { - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testClientModel(body: Client, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + open class func testClientModel(body: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { testClientModelWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -245,7 +247,7 @@ open class FakeAPI { - parameter callback: (form) None (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testEndpointParametersWithRequestBuilder(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback).execute { (response, error) -> Void in if error == nil { completion((), error) @@ -281,7 +283,7 @@ open class FakeAPI { open class func testEndpointParametersWithRequestBuilder(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "integer": integer?.encodeToJSON(), "int32": int32?.encodeToJSON(), "int64": int64?.encodeToJSON(), @@ -300,7 +302,7 @@ open class FakeAPI { let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -388,7 +390,7 @@ open class FakeAPI { - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to .-efg) - parameter completion: completion handler to receive the data and the error objects */ - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (response, error) -> Void in if error == nil { completion((), error) @@ -415,19 +417,19 @@ open class FakeAPI { open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "enum_form_string_array": enumFormStringArray, "enum_form_string": enumFormString?.rawValue ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": enumQueryStringArray, - "enum_query_string": enumQueryString?.rawValue, - "enum_query_integer": enumQueryInteger?.rawValue, + "enum_query_string_array": enumQueryStringArray, + "enum_query_string": enumQueryString?.rawValue, + "enum_query_integer": enumQueryInteger?.rawValue, "enum_query_double": enumQueryDouble?.rawValue ]) let nillableHeaders: [String: Any?] = [ @@ -452,7 +454,7 @@ open class FakeAPI { - parameter int64Group: (query) Integer in group parameters (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (response, error) -> Void in if error == nil { completion((), error) @@ -477,13 +479,13 @@ open class FakeAPI { open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), "int64_group": int64Group?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -503,7 +505,7 @@ open class FakeAPI { - parameter param: (body) request body - parameter completion: completion handler to receive the data and the error objects */ - open class func testInlineAdditionalProperties(param: [String: String], completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testInlineAdditionalProperties(param: [String:String], completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (response, error) -> Void in if error == nil { completion((), error) @@ -519,7 +521,7 @@ open class FakeAPI { - parameter param: (body) request body - returns: RequestBuilder */ - open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder { + open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { let path = "/fake/inline-additionalProperties" let URLString = PetstoreClientAPI.basePath + path let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param) @@ -538,7 +540,7 @@ open class FakeAPI { - parameter param2: (form) field2 - parameter completion: completion handler to receive the data and the error objects */ - open class func testJsonFormData(param: String, param2: String, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testJsonFormData(param: String, param2: String, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute { (response, error) -> Void in if error == nil { completion((), error) @@ -558,14 +560,14 @@ open class FakeAPI { open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { let path = "/fake/jsonFormData" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "param": param, "param2": param2 ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 6bfa09016f5a..ddfeae23edd0 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -8,6 +8,8 @@ import Foundation import Alamofire + + open class FakeClassnameTags123API { /** To test class name in snake case @@ -15,7 +17,7 @@ open class FakeClassnameTags123API { - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testClassname(body: Client, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + open class func testClassname(body: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { testClassnameWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 896f1511805f..0a5dfeb39b62 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -8,6 +8,8 @@ import Foundation import Alamofire + + open class PetAPI { /** Add a new pet to the store @@ -15,7 +17,7 @@ open class PetAPI { - parameter body: (body) Pet object that needs to be added to the store - parameter completion: completion handler to receive the data and the error objects */ - open class func addPet(body: Pet, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func addPet(body: Pet, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { addPetWithRequestBuilder(body: body).execute { (response, error) -> Void in if error == nil { completion((), error) @@ -53,7 +55,7 @@ open class PetAPI { - parameter apiKey: (header) (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func deletePet(petId: Int64, apiKey: String? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func deletePet(petId: Int64, apiKey: String? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (response, error) -> Void in if error == nil { completion((), error) @@ -79,8 +81,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let nillableHeaders: [String: Any?] = [ "api_key": apiKey @@ -107,7 +109,7 @@ open class PetAPI { - parameter status: (query) Status values that need to be considered for filter - parameter completion: completion handler to receive the data and the error objects */ - open class func findPetsByStatus(status: [String], completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { + open class func findPetsByStatus(status: [String], completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { findPetsByStatusWithRequestBuilder(status: status).execute { (response, error) -> Void in completion(response?.body, error) } @@ -126,8 +128,8 @@ open class PetAPI { open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByStatus" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "status": status @@ -144,7 +146,7 @@ open class PetAPI { - parameter tags: (query) Tags to filter by - parameter completion: completion handler to receive the data and the error objects */ - open class func findPetsByTags(tags: [String], completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { + open class func findPetsByTags(tags: [String], completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { findPetsByTagsWithRequestBuilder(tags: tags).execute { (response, error) -> Void in completion(response?.body, error) } @@ -163,8 +165,8 @@ open class PetAPI { open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "tags": tags @@ -181,7 +183,7 @@ open class PetAPI { - parameter petId: (path) ID of pet to return - parameter completion: completion handler to receive the data and the error objects */ - open class func getPetById(petId: Int64, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) { + open class func getPetById(petId: Int64, completion: @escaping ((_ data: Pet?,_ error: Error?) -> Void)) { getPetByIdWithRequestBuilder(petId: petId).execute { (response, error) -> Void in completion(response?.body, error) } @@ -203,8 +205,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -218,7 +220,7 @@ open class PetAPI { - parameter body: (body) Pet object that needs to be added to the store - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePet(body: Pet, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func updatePet(body: Pet, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { updatePetWithRequestBuilder(body: body).execute { (response, error) -> Void in if error == nil { completion((), error) @@ -257,7 +259,7 @@ open class PetAPI { - parameter status: (form) Updated status of the pet (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (response, error) -> Void in if error == nil { completion((), error) @@ -284,14 +286,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "name": name, "status": status ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -307,7 +309,7 @@ open class PetAPI { - parameter file: (form) file to upload (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute { (response, error) -> Void in completion(response?.body, error) } @@ -330,14 +332,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata, "file": file ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -353,7 +355,7 @@ open class PetAPI { - parameter additionalMetadata: (form) Additional data to pass to server (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute { (response, error) -> Void in completion(response?.body, error) } @@ -376,14 +378,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata, "requiredFile": requiredFile ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 71949b335d77..a2bced598f0d 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -8,6 +8,8 @@ import Foundation import Alamofire + + open class StoreAPI { /** Delete purchase order by ID @@ -15,7 +17,7 @@ open class StoreAPI { - parameter orderId: (path) ID of the order that needs to be deleted - parameter completion: completion handler to receive the data and the error objects */ - open class func deleteOrder(orderId: String, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func deleteOrder(orderId: String, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { deleteOrderWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in if error == nil { completion((), error) @@ -38,8 +40,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -52,7 +54,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ - open class func getInventory(completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) { + open class func getInventory(completion: @escaping ((_ data: [String:Int]?,_ error: Error?) -> Void)) { getInventoryWithRequestBuilder().execute { (response, error) -> Void in completion(response?.body, error) } @@ -67,14 +69,14 @@ open class StoreAPI { - name: api_key - returns: RequestBuilder<[String:Int]> */ - open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { + open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> { let path = "/store/inventory" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } @@ -85,7 +87,7 @@ open class StoreAPI { - parameter orderId: (path) ID of pet that needs to be fetched - parameter completion: completion handler to receive the data and the error objects */ - open class func getOrderById(orderId: Int64, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { + open class func getOrderById(orderId: Int64, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { getOrderByIdWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in completion(response?.body, error) } @@ -104,8 +106,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -119,7 +121,7 @@ open class StoreAPI { - parameter body: (body) order placed for purchasing the pet - parameter completion: completion handler to receive the data and the error objects */ - open class func placeOrder(body: Order, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { + open class func placeOrder(body: Order, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { placeOrderWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index efeb64468a5c..d8cafaf2c962 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -8,6 +8,8 @@ import Foundation import Alamofire + + open class UserAPI { /** Create user @@ -15,7 +17,7 @@ open class UserAPI { - parameter body: (body) Created user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUser(body: User, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func createUser(body: User, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { createUserWithRequestBuilder(body: body).execute { (response, error) -> Void in if error == nil { completion((), error) @@ -50,7 +52,7 @@ open class UserAPI { - parameter body: (body) List of user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithArrayInput(body: [User], completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func createUsersWithArrayInput(body: [User], completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { createUsersWithArrayInputWithRequestBuilder(body: body).execute { (response, error) -> Void in if error == nil { completion((), error) @@ -84,7 +86,7 @@ open class UserAPI { - parameter body: (body) List of user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithListInput(body: [User], completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func createUsersWithListInput(body: [User], completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { createUsersWithListInputWithRequestBuilder(body: body).execute { (response, error) -> Void in if error == nil { completion((), error) @@ -118,7 +120,7 @@ open class UserAPI { - parameter username: (path) The name that needs to be deleted - parameter completion: completion handler to receive the data and the error objects */ - open class func deleteUser(username: String, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func deleteUser(username: String, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { deleteUserWithRequestBuilder(username: username).execute { (response, error) -> Void in if error == nil { completion((), error) @@ -141,8 +143,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -156,7 +158,7 @@ open class UserAPI { - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - parameter completion: completion handler to receive the data and the error objects */ - open class func getUserByName(username: String, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) { + open class func getUserByName(username: String, completion: @escaping ((_ data: User?,_ error: Error?) -> Void)) { getUserByNameWithRequestBuilder(username: username).execute { (response, error) -> Void in completion(response?.body, error) } @@ -174,8 +176,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -190,7 +192,7 @@ open class UserAPI { - parameter password: (query) The password for login in clear text - parameter completion: completion handler to receive the data and the error objects */ - open class func loginUser(username: String, password: String, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { + open class func loginUser(username: String, password: String, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { loginUserWithRequestBuilder(username: username, password: password).execute { (response, error) -> Void in completion(response?.body, error) } @@ -207,11 +209,11 @@ open class UserAPI { open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { let path = "/user/login" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": username, + "username": username, "password": password ]) @@ -225,7 +227,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ - open class func logoutUser(completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func logoutUser(completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { logoutUserWithRequestBuilder().execute { (response, error) -> Void in if error == nil { completion((), error) @@ -243,8 +245,8 @@ open class UserAPI { open class func logoutUserWithRequestBuilder() -> RequestBuilder { let path = "/user/logout" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -259,7 +261,7 @@ open class UserAPI { - parameter body: (body) Updated user object - parameter completion: completion handler to receive the data and the error objects */ - open class func updateUser(username: String, body: User, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func updateUser(username: String, body: User, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { updateUserWithRequestBuilder(username: username, body: body).execute { (response, error) -> Void in if error == nil { completion((), error) diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift index 04ad02a5ce88..dac40e9a31cf 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift @@ -12,7 +12,7 @@ class AlamofireRequestBuilderFactory: RequestBuilderFactory { return AlamofireRequestBuilder.self } - func getBuilder() -> RequestBuilder.Type { + func getBuilder() -> RequestBuilder.Type { return AlamofireDecodableRequestBuilder.self } } @@ -50,7 +50,7 @@ private struct SynchronizedDictionary { private var managerStore = SynchronizedDictionary() open class AlamofireRequestBuilder: RequestBuilder { - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } @@ -88,17 +88,17 @@ open class AlamofireRequestBuilder: RequestBuilder { May be overridden by a subclass if you want to control the request configuration (e.g. to override the cache policy). */ - open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) -> DataRequest { + open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) -> DataRequest { return manager.request(URLString, method: method, parameters: parameters, encoding: encoding, headers: headers) } override open func execute(_ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { - let managerId: String = UUID().uuidString + let managerId:String = UUID().uuidString // Create a new manager for each request to customize its request header let manager = createSessionManager() managerStore[managerId] = manager - let encoding: ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() + let encoding:ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() let xMethod = Alamofire.HTTPMethod(rawValue: method) let fileKeys = parameters == nil ? [] : parameters!.filter { $1 is NSURL } @@ -111,7 +111,8 @@ open class AlamofireRequestBuilder: RequestBuilder { case let fileURL as URL: if let mimeType = self.contentTypeForFormPart(fileURL: fileURL) { mpForm.append(fileURL, withName: k, fileName: fileURL.lastPathComponent, mimeType: mimeType) - } else { + } + else { mpForm.append(fileURL, withName: k) } case let string as String: @@ -275,7 +276,7 @@ open class AlamofireRequestBuilder: RequestBuilder { return httpHeaders } - fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { + fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { guard let contentDisposition = contentDisposition else { return nil @@ -283,7 +284,7 @@ open class AlamofireRequestBuilder: RequestBuilder { let items = contentDisposition.components(separatedBy: ";") - var filename: String? = nil + var filename : String? = nil for contentItem in items { @@ -303,7 +304,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } - fileprivate func getPath(from url: URL) throws -> String { + fileprivate func getPath(from url : URL) throws -> String { guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { throw DownloadException.requestMissingPath @@ -317,7 +318,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } - fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { + fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { guard let url = urlRequest.url else { throw DownloadException.requestMissingURL @@ -328,7 +329,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } -private enum DownloadException: Error { +fileprivate enum DownloadException : Error { case responseDataMissing case responseFailed case requestMissing @@ -343,7 +344,7 @@ public enum AlamofireDecodableRequestBuilderError: Error { case generalError(Error) } -open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { +open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { override fileprivate func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { if let credential = self.credential { diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index 111d5a3a8cbe..584de8c3d57a 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -13,7 +13,7 @@ open class CodableHelper { public static var dateformatter: DateFormatter? - open class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T: Decodable { + open class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T : Decodable { var returnedDecodable: T? = nil var returnedError: Error? = nil @@ -39,7 +39,7 @@ open class CodableHelper { return (returnedDecodable, returnedError) } - open class func encode(_ value: T, prettyPrint: Bool = false) -> EncodeResult where T: Encodable { + open class func encode(_ value: T, prettyPrint: Bool = false) -> EncodeResult where T : Encodable { var returnedData: Data? var returnedError: Error? = nil diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Configuration.swift index e1ecb39726e7..516590da5d9e 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -7,9 +7,9 @@ import Foundation open class Configuration { - + // This value is used to configure the date formatter that is used to serialize dates into JSON format. // You must set it prior to encoding any dates, and it will only be read once. public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} + +} \ No newline at end of file diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 24c128daadef..8bf1829ba806 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -112,24 +112,24 @@ extension String: CodingKey { extension KeyedEncodingContainerProtocol { - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { var arrayContainer = nestedUnkeyedContainer(forKey: key) try arrayContainer.encode(contentsOf: values) } - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { if let values = values { try encodeArray(values, forKey: key) } } - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { for (key, value) in pairs { try encode(value, forKey: key) } } - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { if let pairs = pairs { try encodeMap(pairs) } @@ -139,7 +139,7 @@ extension KeyedEncodingContainerProtocol { extension KeyedDecodingContainerProtocol { - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { var tmpArray = [T]() var nestedContainer = try nestedUnkeyedContainer(forKey: key) @@ -151,7 +151,7 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { var tmpArray: [T]? = nil if contains(key) { @@ -161,8 +161,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { - var map: [Self.Key: T] = [:] + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { + var map: [Self.Key : T] = [:] for key in allKeys { if !excludedKeys.contains(key) { @@ -175,3 +175,5 @@ extension KeyedDecodingContainerProtocol { } } + + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift index 3e68bb5d4a9b..70449515842d 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -10,7 +10,7 @@ import Alamofire open class JSONEncodingHelper { - open class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { + open class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { var params: Parameters? = nil // Encode the Encodable object @@ -39,5 +39,5 @@ open class JSONEncodingHelper { return params } - + } diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models.swift index e87ce399c7c8..408563890359 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,7 +10,7 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -public enum ErrorResponse: Error { +public enum ErrorResponse : Error { case error(Int, Data?, Error) } diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 83a06951ccd6..4db39adae84c 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -7,19 +7,23 @@ import Foundation + + public struct AdditionalPropertiesClass: Codable { - public var mapString: [String: String]? - public var mapMapString: [String: [String: String]]? + public var mapString: [String:String]? + public var mapMapString: [String:[String:String]]? - public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { + public init(mapString: [String:String]?, mapMapString: [String:[String:String]]?) { self.mapString = mapString self.mapMapString = mapMapString } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case mapString = "map_string" case mapMapString = "map_map_string" } + } + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index 88eceebd2a2a..befb84b1dfa4 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -7,6 +7,8 @@ import Foundation + + public struct Animal: Codable { public var className: String? @@ -17,4 +19,6 @@ public struct Animal: Codable { self.color = color } + } + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift index e09b0e9efdc8..e7bea63f8ed2 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -7,4 +7,5 @@ import Foundation + public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index ec270da89074..a22e9aaebbb0 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -7,6 +7,8 @@ import Foundation + + public struct ApiResponse: Codable { public var code: Int? @@ -19,4 +21,6 @@ public struct ApiResponse: Codable { self.message = message } + } + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 3843287630b1..4e5a5ca1445d 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,6 +7,8 @@ import Foundation + + public struct ArrayOfArrayOfNumberOnly: Codable { public var arrayArrayNumber: [[Double]]? @@ -15,8 +17,10 @@ public struct ArrayOfArrayOfNumberOnly: Codable { self.arrayArrayNumber = arrayArrayNumber } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case arrayArrayNumber = "ArrayArrayNumber" } + } + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index f8b198e81f50..7d059d368339 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -7,6 +7,8 @@ import Foundation + + public struct ArrayOfNumberOnly: Codable { public var arrayNumber: [Double]? @@ -15,8 +17,10 @@ public struct ArrayOfNumberOnly: Codable { self.arrayNumber = arrayNumber } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case arrayNumber = "ArrayNumber" } + } + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index 67f7f7e5151f..9c56fed50c2e 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -7,6 +7,8 @@ import Foundation + + public struct ArrayTest: Codable { public var arrayOfString: [String]? @@ -19,10 +21,12 @@ public struct ArrayTest: Codable { self.arrayArrayOfModel = arrayArrayOfModel } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" case arrayArrayOfModel = "array_array_of_model" } + } + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index d576b50b1c9c..98cda23dac9e 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -7,6 +7,8 @@ import Foundation + + public struct Capitalization: Codable { public var smallCamel: String? @@ -26,7 +28,7 @@ public struct Capitalization: Codable { self.ATT_NAME = ATT_NAME } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case smallCamel case capitalCamel = "CapitalCamel" case smallSnake = "small_Snake" @@ -35,4 +37,6 @@ public struct Capitalization: Codable { case ATT_NAME } + } + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index d6133a3dd5ca..c83ab1d0d974 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -7,6 +7,8 @@ import Foundation + + public struct Cat: Codable { public var className: String? @@ -19,4 +21,6 @@ public struct Cat: Codable { self.declawed = declawed } + } + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index a51ad0dffab1..b5404f052cb7 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -7,6 +7,8 @@ import Foundation + + public struct CatAllOf: Codable { public var declawed: Bool? @@ -15,4 +17,6 @@ public struct CatAllOf: Codable { self.declawed = declawed } + } + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index 48b43fc318df..3c11cfb3bc5c 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,6 +7,8 @@ import Foundation + + public struct Category: Codable { public var id: Int64? @@ -17,4 +19,6 @@ public struct Category: Codable { self.name = name } + } + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index 28cb30ce7b4b..f673ed127cd8 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -7,6 +7,7 @@ import Foundation + /** Model for testing model with \"_class\" property */ public struct ClassModel: Codable { @@ -17,4 +18,6 @@ public struct ClassModel: Codable { self._class = _class } + } + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 00245ca37280..51390b6c4eac 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -7,6 +7,8 @@ import Foundation + + public struct Client: Codable { public var client: String? @@ -15,4 +17,6 @@ public struct Client: Codable { self.client = client } + } + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 35c8cea0dd04..9a3016495335 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -7,6 +7,8 @@ import Foundation + + public struct Dog: Codable { public var className: String? @@ -19,4 +21,6 @@ public struct Dog: Codable { self.breed = breed } + } + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 7786f8acc5ae..dc8bd63af9d6 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -7,6 +7,8 @@ import Foundation + + public struct DogAllOf: Codable { public var breed: String? @@ -15,4 +17,6 @@ public struct DogAllOf: Codable { self.breed = breed } + } + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 5034ff0b8c68..8713961520e1 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -7,6 +7,8 @@ import Foundation + + public struct EnumArrays: Codable { public enum JustSymbol: String, Codable { @@ -25,9 +27,11 @@ public struct EnumArrays: Codable { self.arrayEnum = arrayEnum } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case justSymbol = "just_symbol" case arrayEnum = "array_enum" } + } + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index 3c1dfcac577d..7280a621fec7 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -7,6 +7,7 @@ import Foundation + public enum EnumClass: String, Codable { case abc = "_abc" case efg = "-efg" diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index b1eb8e98f89a..ed93ec357bdf 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -7,6 +7,8 @@ import Foundation + + public struct EnumTest: Codable { public enum EnumString: String, Codable { @@ -41,7 +43,7 @@ public struct EnumTest: Codable { self.outerEnum = outerEnum } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case enumString = "enum_string" case enumStringRequired = "enum_string_required" case enumInteger = "enum_integer" @@ -49,4 +51,6 @@ public struct EnumTest: Codable { case outerEnum } + } + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/File.swift index ea3520f053dd..c8bd1f19589b 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -7,6 +7,7 @@ import Foundation + /** Must be named `File` for test. */ public struct File: Codable { @@ -18,4 +19,6 @@ public struct File: Codable { self.sourceURI = sourceURI } + } + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 532f1457939a..64d025068027 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -7,6 +7,8 @@ import Foundation + + public struct FileSchemaTestClass: Codable { public var file: File? @@ -17,4 +19,6 @@ public struct FileSchemaTestClass: Codable { self.files = files } + } + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index 4eed10b95a11..7b26d8d80e47 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -7,6 +7,8 @@ import Foundation + + public struct FormatTest: Codable { public var integer: Int? @@ -39,4 +41,6 @@ public struct FormatTest: Codable { self.password = password } + } + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 906ddb06fb17..554aee1081aa 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -7,6 +7,8 @@ import Foundation + + public struct HasOnlyReadOnly: Codable { public var bar: String? @@ -17,4 +19,6 @@ public struct HasOnlyReadOnly: Codable { self.foo = foo } + } + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/List.swift index 08d59953873e..8997340ff4be 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -7,6 +7,8 @@ import Foundation + + public struct List: Codable { public var _123list: String? @@ -15,8 +17,10 @@ public struct List: Codable { self._123list = _123list } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case _123list = "123-list" } + } + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 3a10a7dfcaf6..2d3a45d35a0c 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -7,29 +7,33 @@ import Foundation + + public struct MapTest: Codable { public enum MapOfEnumString: String, Codable { case upper = "UPPER" case lower = "lower" } - public var mapMapOfString: [String: [String: String]]? - public var mapOfEnumString: [String: String]? - public var directMap: [String: Bool]? + public var mapMapOfString: [String:[String:String]]? + public var mapOfEnumString: [String:String]? + public var directMap: [String:Bool]? public var indirectMap: StringBooleanMap? - public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { + public init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?, directMap: [String:Bool]?, indirectMap: StringBooleanMap?) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap self.indirectMap = indirectMap } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" case directMap = "direct_map" case indirectMap = "indirect_map" } + } + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index c3deb2f28932..7116108fd7a3 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,16 +7,20 @@ import Foundation + + public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { public var uuid: UUID? public var dateTime: Date? - public var map: [String: Animal]? + public var map: [String:Animal]? - public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { + public init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) { self.uuid = uuid self.dateTime = dateTime self.map = map } + } + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index 7ed6aad907be..fc1d0606b7ba 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -7,6 +7,7 @@ import Foundation + /** Model for testing model name starting with number */ public struct Model200Response: Codable { @@ -19,9 +20,11 @@ public struct Model200Response: Codable { self._class = _class } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case name case _class = "class" } + } + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 71ba4c05dcd8..bd7ad7ee6f78 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -7,6 +7,7 @@ import Foundation + /** Model for testing model name same as property name */ public struct Name: Codable { @@ -23,11 +24,13 @@ public struct Name: Codable { self._123number = _123number } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case name case snakeCase = "snake_case" case property case _123number = "123Number" } + } + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index abd2269e8e76..e6fb206093aa 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -7,6 +7,8 @@ import Foundation + + public struct NumberOnly: Codable { public var justNumber: Double? @@ -15,8 +17,10 @@ public struct NumberOnly: Codable { self.justNumber = justNumber } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case justNumber = "JustNumber" } + } + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index a6e1b1d2e5e4..83c3b85e6629 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -7,6 +7,8 @@ import Foundation + + public struct Order: Codable { public enum Status: String, Codable { @@ -31,4 +33,6 @@ public struct Order: Codable { self.complete = complete } + } + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 49aec001c5db..edc4523d9f00 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -7,6 +7,8 @@ import Foundation + + public struct OuterComposite: Codable { public var myNumber: Double? @@ -19,10 +21,12 @@ public struct OuterComposite: Codable { self.myBoolean = myBoolean } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case myNumber = "my_number" case myString = "my_string" case myBoolean = "my_boolean" } + } + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index 9f80fc95ecf0..bd1643d279ed 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -7,6 +7,7 @@ import Foundation + public enum OuterEnum: String, Codable { case placed = "placed" case approved = "approved" diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index 99eaa1329e48..9880907ec900 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,6 +7,8 @@ import Foundation + + public struct Pet: Codable { public enum Status: String, Codable { @@ -31,4 +33,6 @@ public struct Pet: Codable { self.status = status } + } + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 0acd21fd1000..48b655a5b0aa 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -7,6 +7,8 @@ import Foundation + + public struct ReadOnlyFirst: Codable { public var bar: String? @@ -17,4 +19,6 @@ public struct ReadOnlyFirst: Codable { self.baz = baz } + } + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index 076082af842f..de4b218999b7 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -7,6 +7,7 @@ import Foundation + /** Model for testing reserved words */ public struct Return: Codable { @@ -17,8 +18,10 @@ public struct Return: Codable { self._return = _return } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case _return = "return" } + } + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index e79fc45c0e91..213d896ba988 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -7,6 +7,8 @@ import Foundation + + public struct SpecialModelName: Codable { public var specialPropertyName: Int64? @@ -15,8 +17,10 @@ public struct SpecialModelName: Codable { self.specialPropertyName = specialPropertyName } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case specialPropertyName = "$special[property.name]" } + } + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index 3f1237fee477..ae15e87d94bb 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -7,9 +7,12 @@ import Foundation + + public struct StringBooleanMap: Codable { - public var additionalProperties: [String: Bool] = [:] + + public var additionalProperties: [String:Bool] = [:] public subscript(key: String) -> Bool? { get { @@ -42,4 +45,7 @@ public struct StringBooleanMap: Codable { additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } + + } + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 4dd8a9a9f5a0..32ee33a1a1e0 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,6 +7,8 @@ import Foundation + + public struct Tag: Codable { public var id: Int64? @@ -17,4 +19,6 @@ public struct Tag: Codable { self.name = name } + } + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index 07b590ab1079..a088a2ad87f5 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -7,6 +7,8 @@ import Foundation + + public struct TypeHolderDefault: Codable { public var stringItem: String? = "what" @@ -23,7 +25,7 @@ public struct TypeHolderDefault: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" @@ -31,4 +33,6 @@ public struct TypeHolderDefault: Codable { case arrayItem = "array_item" } + } + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index 29d005161783..3e91d9485cfe 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -7,6 +7,8 @@ import Foundation + + public struct TypeHolderExample: Codable { public var stringItem: String? @@ -23,7 +25,7 @@ public struct TypeHolderExample: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" @@ -31,4 +33,6 @@ public struct TypeHolderExample: Codable { case arrayItem = "array_item" } + } + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 79f271ed7356..a61b5844201e 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -7,6 +7,8 @@ import Foundation + + public struct User: Codable { public var id: Int64? @@ -30,4 +32,6 @@ public struct User: Codable { self.userStatus = userStatus } + } + diff --git a/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts index ff2ed68baa6a..e6929b7f5e6d 100644 --- a/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts @@ -63,10 +63,10 @@ export class PetService { /** * * @summary Add a new pet to the store - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store */ - public addPet(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { - return this.addPetWithHttpInfo(body, extraHttpRequestParams) + public addPet(pet: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { + return this.addPetWithHttpInfo(pet, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { return undefined; @@ -113,9 +113,10 @@ export class PetService { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @summary Finds Pets by tags * @param tags Tags to filter by + * @param maxCount Maximum number of items to return */ - public findPetsByTags(tags: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable> { - return this.findPetsByTagsWithHttpInfo(tags, extraHttpRequestParams) + public findPetsByTags(tags: Array, maxCount?: number, extraHttpRequestParams?: RequestOptionsArgs): Observable> { + return this.findPetsByTagsWithHttpInfo(tags, maxCount, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { return undefined; @@ -144,10 +145,10 @@ export class PetService { /** * * @summary Update an existing pet - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store */ - public updatePet(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { - return this.updatePetWithHttpInfo(body, extraHttpRequestParams) + public updatePet(pet: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { + return this.updatePetWithHttpInfo(pet, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { return undefined; @@ -197,12 +198,12 @@ export class PetService { /** * Add a new pet to the store * - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store */ - public addPetWithHttpInfo(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling addPet.'); + public addPetWithHttpInfo(pet: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable { + if (pet === null || pet === undefined) { + throw new Error('Required parameter pet was null or undefined when calling addPet.'); } let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -236,7 +237,7 @@ export class PetService { let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Post, headers: headers, - body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 + body: pet == null ? '' : JSON.stringify(pet), // https://github.com/angular/angular/issues/10612 withCredentials:this.configuration.withCredentials }); // issues#4037 @@ -355,9 +356,10 @@ export class PetService { * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by + * @param maxCount Maximum number of items to return */ - public findPetsByTagsWithHttpInfo(tags: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { + public findPetsByTagsWithHttpInfo(tags: Array, maxCount?: number, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (tags === null || tags === undefined) { throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); } @@ -366,6 +368,9 @@ export class PetService { if (tags) { queryParameters.set('tags', tags.join(COLLECTION_FORMATS['csv'])); } + if (maxCount !== undefined && maxCount !== null) { + queryParameters.set('maxCount', maxCount); + } let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -453,12 +458,12 @@ export class PetService { /** * Update an existing pet * - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store */ - public updatePetWithHttpInfo(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling updatePet.'); + public updatePetWithHttpInfo(pet: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable { + if (pet === null || pet === undefined) { + throw new Error('Required parameter pet was null or undefined when calling updatePet.'); } let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -492,7 +497,7 @@ export class PetService { let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Put, headers: headers, - body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 + body: pet == null ? '' : JSON.stringify(pet), // https://github.com/angular/angular/issues/10612 withCredentials:this.configuration.withCredentials }); // issues#4037 diff --git a/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts index e774b1f93acf..c557b2c6af0b 100644 --- a/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts @@ -109,10 +109,10 @@ export class StoreService { /** * * @summary Place an order for a pet - * @param body order placed for purchasing the pet + * @param order order placed for purchasing the pet */ - public placeOrder(body: Order, extraHttpRequestParams?: RequestOptionsArgs): Observable { - return this.placeOrderWithHttpInfo(body, extraHttpRequestParams) + public placeOrder(order: Order, extraHttpRequestParams?: RequestOptionsArgs): Observable { + return this.placeOrderWithHttpInfo(order, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { return undefined; @@ -244,12 +244,12 @@ export class StoreService { /** * Place an order for a pet * - * @param body order placed for purchasing the pet + * @param order order placed for purchasing the pet */ - public placeOrderWithHttpInfo(body: Order, extraHttpRequestParams?: RequestOptionsArgs): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling placeOrder.'); + public placeOrderWithHttpInfo(order: Order, extraHttpRequestParams?: RequestOptionsArgs): Observable { + if (order === null || order === undefined) { + throw new Error('Required parameter order was null or undefined when calling placeOrder.'); } let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -266,6 +266,7 @@ export class StoreService { // to determine the Content-Type header const consumes: string[] = [ + 'application/json' ]; const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { @@ -275,7 +276,7 @@ export class StoreService { let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Post, headers: headers, - body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 + body: order == null ? '' : JSON.stringify(order), // https://github.com/angular/angular/issues/10612 withCredentials:this.configuration.withCredentials }); // issues#4037 diff --git a/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts index a1ab3ad59524..37eefb7ceac8 100644 --- a/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts @@ -62,10 +62,10 @@ export class UserService { /** * This can only be done by the logged in user. * @summary Create user - * @param body Created user object + * @param user Created user object */ - public createUser(body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { - return this.createUserWithHttpInfo(body, extraHttpRequestParams) + public createUser(user: User, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { + return this.createUserWithHttpInfo(user, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { return undefined; @@ -78,10 +78,10 @@ export class UserService { /** * * @summary Creates list of users with given input array - * @param body List of user object + * @param user List of user object */ - public createUsersWithArrayInput(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { - return this.createUsersWithArrayInputWithHttpInfo(body, extraHttpRequestParams) + public createUsersWithArrayInput(user: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { + return this.createUsersWithArrayInputWithHttpInfo(user, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { return undefined; @@ -94,10 +94,10 @@ export class UserService { /** * * @summary Creates list of users with given input array - * @param body List of user object + * @param user List of user object */ - public createUsersWithListInput(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { - return this.createUsersWithListInputWithHttpInfo(body, extraHttpRequestParams) + public createUsersWithListInput(user: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { + return this.createUsersWithListInputWithHttpInfo(user, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { return undefined; @@ -175,10 +175,10 @@ export class UserService { * This can only be done by the logged in user. * @summary Updated user * @param username name that need to be deleted - * @param body Updated user object + * @param user Updated user object */ - public updateUser(username: string, body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { - return this.updateUserWithHttpInfo(username, body, extraHttpRequestParams) + public updateUser(username: string, user: User, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { + return this.updateUserWithHttpInfo(username, user, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { return undefined; @@ -192,16 +192,17 @@ export class UserService { /** * Create user * This can only be done by the logged in user. - * @param body Created user object + * @param user Created user object */ - public createUserWithHttpInfo(body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling createUser.'); + public createUserWithHttpInfo(user: User, extraHttpRequestParams?: RequestOptionsArgs): Observable { + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling createUser.'); } let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 + // authentication (auth_cookie) required // to determine the Accept header const httpHeaderAccepts: string[] = [ ]; @@ -212,6 +213,7 @@ export class UserService { // to determine the Content-Type header const consumes: string[] = [ + 'application/json' ]; const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { @@ -221,7 +223,7 @@ export class UserService { let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Post, headers: headers, - body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 + body: user == null ? '' : JSON.stringify(user), // https://github.com/angular/angular/issues/10612 withCredentials:this.configuration.withCredentials }); // issues#4037 @@ -235,16 +237,17 @@ export class UserService { /** * Creates list of users with given input array * - * @param body List of user object + * @param user List of user object */ - public createUsersWithArrayInputWithHttpInfo(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.'); + public createUsersWithArrayInputWithHttpInfo(user: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling createUsersWithArrayInput.'); } let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 + // authentication (auth_cookie) required // to determine the Accept header const httpHeaderAccepts: string[] = [ ]; @@ -255,6 +258,7 @@ export class UserService { // to determine the Content-Type header const consumes: string[] = [ + 'application/json' ]; const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { @@ -264,7 +268,7 @@ export class UserService { let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Post, headers: headers, - body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 + body: user == null ? '' : JSON.stringify(user), // https://github.com/angular/angular/issues/10612 withCredentials:this.configuration.withCredentials }); // issues#4037 @@ -278,16 +282,17 @@ export class UserService { /** * Creates list of users with given input array * - * @param body List of user object + * @param user List of user object */ - public createUsersWithListInputWithHttpInfo(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.'); + public createUsersWithListInputWithHttpInfo(user: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling createUsersWithListInput.'); } let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 + // authentication (auth_cookie) required // to determine the Accept header const httpHeaderAccepts: string[] = [ ]; @@ -298,6 +303,7 @@ export class UserService { // to determine the Content-Type header const consumes: string[] = [ + 'application/json' ]; const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { @@ -307,7 +313,7 @@ export class UserService { let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Post, headers: headers, - body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 + body: user == null ? '' : JSON.stringify(user), // https://github.com/angular/angular/issues/10612 withCredentials:this.configuration.withCredentials }); // issues#4037 @@ -331,6 +337,7 @@ export class UserService { let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 + // authentication (auth_cookie) required // to determine the Accept header const httpHeaderAccepts: string[] = [ ]; @@ -458,6 +465,7 @@ export class UserService { let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 + // authentication (auth_cookie) required // to determine the Accept header const httpHeaderAccepts: string[] = [ ]; @@ -487,19 +495,20 @@ export class UserService { * Updated user * This can only be done by the logged in user. * @param username name that need to be deleted - * @param body Updated user object + * @param user Updated user object */ - public updateUserWithHttpInfo(username: string, body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable { + public updateUserWithHttpInfo(username: string, user: User, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling updateUser.'); } - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling updateUser.'); + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling updateUser.'); } let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 + // authentication (auth_cookie) required // to determine the Accept header const httpHeaderAccepts: string[] = [ ]; @@ -510,6 +519,7 @@ export class UserService { // to determine the Content-Type header const consumes: string[] = [ + 'application/json' ]; const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { @@ -519,7 +529,7 @@ export class UserService { let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Put, headers: headers, - body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 + body: user == null ? '' : JSON.stringify(user), // https://github.com/angular/angular/issues/10612 withCredentials:this.configuration.withCredentials }); // issues#4037 diff --git a/samples/client/petstore/typescript-angular-v2/default/model/inlineObject.ts b/samples/client/petstore/typescript-angular-v2/default/model/inlineObject.ts new file mode 100644 index 000000000000..edb81448e92f --- /dev/null +++ b/samples/client/petstore/typescript-angular-v2/default/model/inlineObject.ts @@ -0,0 +1,24 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface InlineObject { + /** + * Updated name of the pet + */ + name?: string; + /** + * Updated status of the pet + */ + status?: string; +} + diff --git a/samples/client/petstore/typescript-angular-v2/default/model/inlineObject1.ts b/samples/client/petstore/typescript-angular-v2/default/model/inlineObject1.ts new file mode 100644 index 000000000000..a9d379c1a568 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v2/default/model/inlineObject1.ts @@ -0,0 +1,24 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface InlineObject1 { + /** + * Additional data to pass to server + */ + additionalMetadata?: string; + /** + * file to upload + */ + file?: Blob; +} + diff --git a/samples/client/petstore/typescript-angular-v2/default/model/models.ts b/samples/client/petstore/typescript-angular-v2/default/model/models.ts index 8607c5dabd0c..f83dbabedeb3 100644 --- a/samples/client/petstore/typescript-angular-v2/default/model/models.ts +++ b/samples/client/petstore/typescript-angular-v2/default/model/models.ts @@ -1,5 +1,7 @@ export * from './apiResponse'; export * from './category'; +export * from './inlineObject'; +export * from './inlineObject1'; export * from './order'; export * from './pet'; export * from './tag'; diff --git a/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts index ff2ed68baa6a..e6929b7f5e6d 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts @@ -63,10 +63,10 @@ export class PetService { /** * * @summary Add a new pet to the store - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store */ - public addPet(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { - return this.addPetWithHttpInfo(body, extraHttpRequestParams) + public addPet(pet: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { + return this.addPetWithHttpInfo(pet, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { return undefined; @@ -113,9 +113,10 @@ export class PetService { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @summary Finds Pets by tags * @param tags Tags to filter by + * @param maxCount Maximum number of items to return */ - public findPetsByTags(tags: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable> { - return this.findPetsByTagsWithHttpInfo(tags, extraHttpRequestParams) + public findPetsByTags(tags: Array, maxCount?: number, extraHttpRequestParams?: RequestOptionsArgs): Observable> { + return this.findPetsByTagsWithHttpInfo(tags, maxCount, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { return undefined; @@ -144,10 +145,10 @@ export class PetService { /** * * @summary Update an existing pet - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store */ - public updatePet(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { - return this.updatePetWithHttpInfo(body, extraHttpRequestParams) + public updatePet(pet: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { + return this.updatePetWithHttpInfo(pet, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { return undefined; @@ -197,12 +198,12 @@ export class PetService { /** * Add a new pet to the store * - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store */ - public addPetWithHttpInfo(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling addPet.'); + public addPetWithHttpInfo(pet: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable { + if (pet === null || pet === undefined) { + throw new Error('Required parameter pet was null or undefined when calling addPet.'); } let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -236,7 +237,7 @@ export class PetService { let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Post, headers: headers, - body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 + body: pet == null ? '' : JSON.stringify(pet), // https://github.com/angular/angular/issues/10612 withCredentials:this.configuration.withCredentials }); // issues#4037 @@ -355,9 +356,10 @@ export class PetService { * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by + * @param maxCount Maximum number of items to return */ - public findPetsByTagsWithHttpInfo(tags: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { + public findPetsByTagsWithHttpInfo(tags: Array, maxCount?: number, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (tags === null || tags === undefined) { throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); } @@ -366,6 +368,9 @@ export class PetService { if (tags) { queryParameters.set('tags', tags.join(COLLECTION_FORMATS['csv'])); } + if (maxCount !== undefined && maxCount !== null) { + queryParameters.set('maxCount', maxCount); + } let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -453,12 +458,12 @@ export class PetService { /** * Update an existing pet * - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store */ - public updatePetWithHttpInfo(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling updatePet.'); + public updatePetWithHttpInfo(pet: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable { + if (pet === null || pet === undefined) { + throw new Error('Required parameter pet was null or undefined when calling updatePet.'); } let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -492,7 +497,7 @@ export class PetService { let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Put, headers: headers, - body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 + body: pet == null ? '' : JSON.stringify(pet), // https://github.com/angular/angular/issues/10612 withCredentials:this.configuration.withCredentials }); // issues#4037 diff --git a/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts index e774b1f93acf..c557b2c6af0b 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts @@ -109,10 +109,10 @@ export class StoreService { /** * * @summary Place an order for a pet - * @param body order placed for purchasing the pet + * @param order order placed for purchasing the pet */ - public placeOrder(body: Order, extraHttpRequestParams?: RequestOptionsArgs): Observable { - return this.placeOrderWithHttpInfo(body, extraHttpRequestParams) + public placeOrder(order: Order, extraHttpRequestParams?: RequestOptionsArgs): Observable { + return this.placeOrderWithHttpInfo(order, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { return undefined; @@ -244,12 +244,12 @@ export class StoreService { /** * Place an order for a pet * - * @param body order placed for purchasing the pet + * @param order order placed for purchasing the pet */ - public placeOrderWithHttpInfo(body: Order, extraHttpRequestParams?: RequestOptionsArgs): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling placeOrder.'); + public placeOrderWithHttpInfo(order: Order, extraHttpRequestParams?: RequestOptionsArgs): Observable { + if (order === null || order === undefined) { + throw new Error('Required parameter order was null or undefined when calling placeOrder.'); } let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -266,6 +266,7 @@ export class StoreService { // to determine the Content-Type header const consumes: string[] = [ + 'application/json' ]; const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { @@ -275,7 +276,7 @@ export class StoreService { let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Post, headers: headers, - body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 + body: order == null ? '' : JSON.stringify(order), // https://github.com/angular/angular/issues/10612 withCredentials:this.configuration.withCredentials }); // issues#4037 diff --git a/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts index a1ab3ad59524..37eefb7ceac8 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts @@ -62,10 +62,10 @@ export class UserService { /** * This can only be done by the logged in user. * @summary Create user - * @param body Created user object + * @param user Created user object */ - public createUser(body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { - return this.createUserWithHttpInfo(body, extraHttpRequestParams) + public createUser(user: User, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { + return this.createUserWithHttpInfo(user, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { return undefined; @@ -78,10 +78,10 @@ export class UserService { /** * * @summary Creates list of users with given input array - * @param body List of user object + * @param user List of user object */ - public createUsersWithArrayInput(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { - return this.createUsersWithArrayInputWithHttpInfo(body, extraHttpRequestParams) + public createUsersWithArrayInput(user: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { + return this.createUsersWithArrayInputWithHttpInfo(user, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { return undefined; @@ -94,10 +94,10 @@ export class UserService { /** * * @summary Creates list of users with given input array - * @param body List of user object + * @param user List of user object */ - public createUsersWithListInput(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { - return this.createUsersWithListInputWithHttpInfo(body, extraHttpRequestParams) + public createUsersWithListInput(user: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { + return this.createUsersWithListInputWithHttpInfo(user, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { return undefined; @@ -175,10 +175,10 @@ export class UserService { * This can only be done by the logged in user. * @summary Updated user * @param username name that need to be deleted - * @param body Updated user object + * @param user Updated user object */ - public updateUser(username: string, body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { - return this.updateUserWithHttpInfo(username, body, extraHttpRequestParams) + public updateUser(username: string, user: User, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { + return this.updateUserWithHttpInfo(username, user, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { return undefined; @@ -192,16 +192,17 @@ export class UserService { /** * Create user * This can only be done by the logged in user. - * @param body Created user object + * @param user Created user object */ - public createUserWithHttpInfo(body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling createUser.'); + public createUserWithHttpInfo(user: User, extraHttpRequestParams?: RequestOptionsArgs): Observable { + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling createUser.'); } let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 + // authentication (auth_cookie) required // to determine the Accept header const httpHeaderAccepts: string[] = [ ]; @@ -212,6 +213,7 @@ export class UserService { // to determine the Content-Type header const consumes: string[] = [ + 'application/json' ]; const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { @@ -221,7 +223,7 @@ export class UserService { let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Post, headers: headers, - body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 + body: user == null ? '' : JSON.stringify(user), // https://github.com/angular/angular/issues/10612 withCredentials:this.configuration.withCredentials }); // issues#4037 @@ -235,16 +237,17 @@ export class UserService { /** * Creates list of users with given input array * - * @param body List of user object + * @param user List of user object */ - public createUsersWithArrayInputWithHttpInfo(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.'); + public createUsersWithArrayInputWithHttpInfo(user: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling createUsersWithArrayInput.'); } let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 + // authentication (auth_cookie) required // to determine the Accept header const httpHeaderAccepts: string[] = [ ]; @@ -255,6 +258,7 @@ export class UserService { // to determine the Content-Type header const consumes: string[] = [ + 'application/json' ]; const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { @@ -264,7 +268,7 @@ export class UserService { let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Post, headers: headers, - body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 + body: user == null ? '' : JSON.stringify(user), // https://github.com/angular/angular/issues/10612 withCredentials:this.configuration.withCredentials }); // issues#4037 @@ -278,16 +282,17 @@ export class UserService { /** * Creates list of users with given input array * - * @param body List of user object + * @param user List of user object */ - public createUsersWithListInputWithHttpInfo(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.'); + public createUsersWithListInputWithHttpInfo(user: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling createUsersWithListInput.'); } let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 + // authentication (auth_cookie) required // to determine the Accept header const httpHeaderAccepts: string[] = [ ]; @@ -298,6 +303,7 @@ export class UserService { // to determine the Content-Type header const consumes: string[] = [ + 'application/json' ]; const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { @@ -307,7 +313,7 @@ export class UserService { let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Post, headers: headers, - body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 + body: user == null ? '' : JSON.stringify(user), // https://github.com/angular/angular/issues/10612 withCredentials:this.configuration.withCredentials }); // issues#4037 @@ -331,6 +337,7 @@ export class UserService { let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 + // authentication (auth_cookie) required // to determine the Accept header const httpHeaderAccepts: string[] = [ ]; @@ -458,6 +465,7 @@ export class UserService { let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 + // authentication (auth_cookie) required // to determine the Accept header const httpHeaderAccepts: string[] = [ ]; @@ -487,19 +495,20 @@ export class UserService { * Updated user * This can only be done by the logged in user. * @param username name that need to be deleted - * @param body Updated user object + * @param user Updated user object */ - public updateUserWithHttpInfo(username: string, body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable { + public updateUserWithHttpInfo(username: string, user: User, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling updateUser.'); } - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling updateUser.'); + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling updateUser.'); } let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 + // authentication (auth_cookie) required // to determine the Accept header const httpHeaderAccepts: string[] = [ ]; @@ -510,6 +519,7 @@ export class UserService { // to determine the Content-Type header const consumes: string[] = [ + 'application/json' ]; const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { @@ -519,7 +529,7 @@ export class UserService { let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Put, headers: headers, - body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 + body: user == null ? '' : JSON.stringify(user), // https://github.com/angular/angular/issues/10612 withCredentials:this.configuration.withCredentials }); // issues#4037 diff --git a/samples/client/petstore/typescript-angular-v2/npm/model/inlineObject.ts b/samples/client/petstore/typescript-angular-v2/npm/model/inlineObject.ts new file mode 100644 index 000000000000..edb81448e92f --- /dev/null +++ b/samples/client/petstore/typescript-angular-v2/npm/model/inlineObject.ts @@ -0,0 +1,24 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface InlineObject { + /** + * Updated name of the pet + */ + name?: string; + /** + * Updated status of the pet + */ + status?: string; +} + diff --git a/samples/client/petstore/typescript-angular-v2/npm/model/inlineObject1.ts b/samples/client/petstore/typescript-angular-v2/npm/model/inlineObject1.ts new file mode 100644 index 000000000000..a9d379c1a568 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v2/npm/model/inlineObject1.ts @@ -0,0 +1,24 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface InlineObject1 { + /** + * Additional data to pass to server + */ + additionalMetadata?: string; + /** + * file to upload + */ + file?: Blob; +} + diff --git a/samples/client/petstore/typescript-angular-v2/npm/model/models.ts b/samples/client/petstore/typescript-angular-v2/npm/model/models.ts index 8607c5dabd0c..f83dbabedeb3 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/model/models.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/model/models.ts @@ -1,5 +1,7 @@ export * from './apiResponse'; export * from './category'; +export * from './inlineObject'; +export * from './inlineObject1'; export * from './order'; export * from './pet'; export * from './tag'; diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts index 5f26d9ad2b88..ecc8b55b79ca 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts @@ -64,10 +64,10 @@ export class PetService implements PetServiceInterface { /** * * @summary Add a new pet to the store - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store */ - public addPet(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { - return this.addPetWithHttpInfo(body, extraHttpRequestParams) + public addPet(pet: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { + return this.addPetWithHttpInfo(pet, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { return undefined; @@ -114,9 +114,10 @@ export class PetService implements PetServiceInterface { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @summary Finds Pets by tags * @param tags Tags to filter by + * @param maxCount Maximum number of items to return */ - public findPetsByTags(tags: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable> { - return this.findPetsByTagsWithHttpInfo(tags, extraHttpRequestParams) + public findPetsByTags(tags: Array, maxCount?: number, extraHttpRequestParams?: RequestOptionsArgs): Observable> { + return this.findPetsByTagsWithHttpInfo(tags, maxCount, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { return undefined; @@ -145,10 +146,10 @@ export class PetService implements PetServiceInterface { /** * * @summary Update an existing pet - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store */ - public updatePet(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { - return this.updatePetWithHttpInfo(body, extraHttpRequestParams) + public updatePet(pet: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { + return this.updatePetWithHttpInfo(pet, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { return undefined; @@ -198,12 +199,12 @@ export class PetService implements PetServiceInterface { /** * Add a new pet to the store * - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store */ - public addPetWithHttpInfo(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling addPet.'); + public addPetWithHttpInfo(pet: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable { + if (pet === null || pet === undefined) { + throw new Error('Required parameter pet was null or undefined when calling addPet.'); } let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -237,7 +238,7 @@ export class PetService implements PetServiceInterface { let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Post, headers: headers, - body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 + body: pet == null ? '' : JSON.stringify(pet), // https://github.com/angular/angular/issues/10612 withCredentials:this.configuration.withCredentials }); // issues#4037 @@ -356,9 +357,10 @@ export class PetService implements PetServiceInterface { * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by + * @param maxCount Maximum number of items to return */ - public findPetsByTagsWithHttpInfo(tags: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { + public findPetsByTagsWithHttpInfo(tags: Array, maxCount?: number, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (tags === null || tags === undefined) { throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); } @@ -367,6 +369,9 @@ export class PetService implements PetServiceInterface { if (tags) { queryParameters.set('tags', tags.join(COLLECTION_FORMATS['csv'])); } + if (maxCount !== undefined && maxCount !== null) { + queryParameters.set('maxCount', maxCount); + } let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -454,12 +459,12 @@ export class PetService implements PetServiceInterface { /** * Update an existing pet * - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store */ - public updatePetWithHttpInfo(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling updatePet.'); + public updatePetWithHttpInfo(pet: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable { + if (pet === null || pet === undefined) { + throw new Error('Required parameter pet was null or undefined when calling updatePet.'); } let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -493,7 +498,7 @@ export class PetService implements PetServiceInterface { let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Put, headers: headers, - body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 + body: pet == null ? '' : JSON.stringify(pet), // https://github.com/angular/angular/issues/10612 withCredentials:this.configuration.withCredentials }); // issues#4037 diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.serviceInterface.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.serviceInterface.ts index effb9d16d023..d8116db5e4d0 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.serviceInterface.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.serviceInterface.ts @@ -28,9 +28,9 @@ export interface PetServiceInterface { /** * Add a new pet to the store * - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store */ - addPet(body: Pet, extraHttpRequestParams?: any): Observable<{}>; + addPet(pet: Pet, extraHttpRequestParams?: any): Observable<{}>; /** * Deletes a pet @@ -51,8 +51,9 @@ export interface PetServiceInterface { * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by + * @param maxCount Maximum number of items to return */ - findPetsByTags(tags: Array, extraHttpRequestParams?: any): Observable>; + findPetsByTags(tags: Array, maxCount?: number, extraHttpRequestParams?: any): Observable>; /** * Find pet by ID @@ -64,9 +65,9 @@ export interface PetServiceInterface { /** * Update an existing pet * - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store */ - updatePet(body: Pet, extraHttpRequestParams?: any): Observable<{}>; + updatePet(pet: Pet, extraHttpRequestParams?: any): Observable<{}>; /** * Updates a pet in the store with form data diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts index f048d9575ecc..41f9b712c28c 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts @@ -110,10 +110,10 @@ export class StoreService implements StoreServiceInterface { /** * * @summary Place an order for a pet - * @param body order placed for purchasing the pet + * @param order order placed for purchasing the pet */ - public placeOrder(body: Order, extraHttpRequestParams?: RequestOptionsArgs): Observable { - return this.placeOrderWithHttpInfo(body, extraHttpRequestParams) + public placeOrder(order: Order, extraHttpRequestParams?: RequestOptionsArgs): Observable { + return this.placeOrderWithHttpInfo(order, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { return undefined; @@ -245,12 +245,12 @@ export class StoreService implements StoreServiceInterface { /** * Place an order for a pet * - * @param body order placed for purchasing the pet + * @param order order placed for purchasing the pet */ - public placeOrderWithHttpInfo(body: Order, extraHttpRequestParams?: RequestOptionsArgs): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling placeOrder.'); + public placeOrderWithHttpInfo(order: Order, extraHttpRequestParams?: RequestOptionsArgs): Observable { + if (order === null || order === undefined) { + throw new Error('Required parameter order was null or undefined when calling placeOrder.'); } let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -267,6 +267,7 @@ export class StoreService implements StoreServiceInterface { // to determine the Content-Type header const consumes: string[] = [ + 'application/json' ]; const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { @@ -276,7 +277,7 @@ export class StoreService implements StoreServiceInterface { let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Post, headers: headers, - body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 + body: order == null ? '' : JSON.stringify(order), // https://github.com/angular/angular/issues/10612 withCredentials:this.configuration.withCredentials }); // issues#4037 diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.serviceInterface.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.serviceInterface.ts index f03e6a2df3a7..ca4fcda44abb 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.serviceInterface.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.serviceInterface.ts @@ -47,8 +47,8 @@ export interface StoreServiceInterface { /** * Place an order for a pet * - * @param body order placed for purchasing the pet + * @param order order placed for purchasing the pet */ - placeOrder(body: Order, extraHttpRequestParams?: any): Observable; + placeOrder(order: Order, extraHttpRequestParams?: any): Observable; } diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts index d89810de1ea3..cf5325fe6007 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts @@ -63,10 +63,10 @@ export class UserService implements UserServiceInterface { /** * This can only be done by the logged in user. * @summary Create user - * @param body Created user object + * @param user Created user object */ - public createUser(body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { - return this.createUserWithHttpInfo(body, extraHttpRequestParams) + public createUser(user: User, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { + return this.createUserWithHttpInfo(user, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { return undefined; @@ -79,10 +79,10 @@ export class UserService implements UserServiceInterface { /** * * @summary Creates list of users with given input array - * @param body List of user object + * @param user List of user object */ - public createUsersWithArrayInput(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { - return this.createUsersWithArrayInputWithHttpInfo(body, extraHttpRequestParams) + public createUsersWithArrayInput(user: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { + return this.createUsersWithArrayInputWithHttpInfo(user, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { return undefined; @@ -95,10 +95,10 @@ export class UserService implements UserServiceInterface { /** * * @summary Creates list of users with given input array - * @param body List of user object + * @param user List of user object */ - public createUsersWithListInput(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { - return this.createUsersWithListInputWithHttpInfo(body, extraHttpRequestParams) + public createUsersWithListInput(user: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { + return this.createUsersWithListInputWithHttpInfo(user, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { return undefined; @@ -176,10 +176,10 @@ export class UserService implements UserServiceInterface { * This can only be done by the logged in user. * @summary Updated user * @param username name that need to be deleted - * @param body Updated user object + * @param user Updated user object */ - public updateUser(username: string, body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { - return this.updateUserWithHttpInfo(username, body, extraHttpRequestParams) + public updateUser(username: string, user: User, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { + return this.updateUserWithHttpInfo(username, user, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { return undefined; @@ -193,16 +193,17 @@ export class UserService implements UserServiceInterface { /** * Create user * This can only be done by the logged in user. - * @param body Created user object + * @param user Created user object */ - public createUserWithHttpInfo(body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling createUser.'); + public createUserWithHttpInfo(user: User, extraHttpRequestParams?: RequestOptionsArgs): Observable { + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling createUser.'); } let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 + // authentication (auth_cookie) required // to determine the Accept header const httpHeaderAccepts: string[] = [ ]; @@ -213,6 +214,7 @@ export class UserService implements UserServiceInterface { // to determine the Content-Type header const consumes: string[] = [ + 'application/json' ]; const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { @@ -222,7 +224,7 @@ export class UserService implements UserServiceInterface { let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Post, headers: headers, - body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 + body: user == null ? '' : JSON.stringify(user), // https://github.com/angular/angular/issues/10612 withCredentials:this.configuration.withCredentials }); // issues#4037 @@ -236,16 +238,17 @@ export class UserService implements UserServiceInterface { /** * Creates list of users with given input array * - * @param body List of user object + * @param user List of user object */ - public createUsersWithArrayInputWithHttpInfo(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.'); + public createUsersWithArrayInputWithHttpInfo(user: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling createUsersWithArrayInput.'); } let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 + // authentication (auth_cookie) required // to determine the Accept header const httpHeaderAccepts: string[] = [ ]; @@ -256,6 +259,7 @@ export class UserService implements UserServiceInterface { // to determine the Content-Type header const consumes: string[] = [ + 'application/json' ]; const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { @@ -265,7 +269,7 @@ export class UserService implements UserServiceInterface { let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Post, headers: headers, - body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 + body: user == null ? '' : JSON.stringify(user), // https://github.com/angular/angular/issues/10612 withCredentials:this.configuration.withCredentials }); // issues#4037 @@ -279,16 +283,17 @@ export class UserService implements UserServiceInterface { /** * Creates list of users with given input array * - * @param body List of user object + * @param user List of user object */ - public createUsersWithListInputWithHttpInfo(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.'); + public createUsersWithListInputWithHttpInfo(user: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling createUsersWithListInput.'); } let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 + // authentication (auth_cookie) required // to determine the Accept header const httpHeaderAccepts: string[] = [ ]; @@ -299,6 +304,7 @@ export class UserService implements UserServiceInterface { // to determine the Content-Type header const consumes: string[] = [ + 'application/json' ]; const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { @@ -308,7 +314,7 @@ export class UserService implements UserServiceInterface { let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Post, headers: headers, - body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 + body: user == null ? '' : JSON.stringify(user), // https://github.com/angular/angular/issues/10612 withCredentials:this.configuration.withCredentials }); // issues#4037 @@ -332,6 +338,7 @@ export class UserService implements UserServiceInterface { let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 + // authentication (auth_cookie) required // to determine the Accept header const httpHeaderAccepts: string[] = [ ]; @@ -459,6 +466,7 @@ export class UserService implements UserServiceInterface { let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 + // authentication (auth_cookie) required // to determine the Accept header const httpHeaderAccepts: string[] = [ ]; @@ -488,19 +496,20 @@ export class UserService implements UserServiceInterface { * Updated user * This can only be done by the logged in user. * @param username name that need to be deleted - * @param body Updated user object + * @param user Updated user object */ - public updateUserWithHttpInfo(username: string, body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable { + public updateUserWithHttpInfo(username: string, user: User, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling updateUser.'); } - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling updateUser.'); + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling updateUser.'); } let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 + // authentication (auth_cookie) required // to determine the Accept header const httpHeaderAccepts: string[] = [ ]; @@ -511,6 +520,7 @@ export class UserService implements UserServiceInterface { // to determine the Content-Type header const consumes: string[] = [ + 'application/json' ]; const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { @@ -520,7 +530,7 @@ export class UserService implements UserServiceInterface { let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Put, headers: headers, - body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 + body: user == null ? '' : JSON.stringify(user), // https://github.com/angular/angular/issues/10612 withCredentials:this.configuration.withCredentials }); // issues#4037 diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.serviceInterface.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.serviceInterface.ts index a067c872bd67..c6a4d54e3fe6 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.serviceInterface.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.serviceInterface.ts @@ -27,23 +27,23 @@ export interface UserServiceInterface { /** * Create user * This can only be done by the logged in user. - * @param body Created user object + * @param user Created user object */ - createUser(body: User, extraHttpRequestParams?: any): Observable<{}>; + createUser(user: User, extraHttpRequestParams?: any): Observable<{}>; /** * Creates list of users with given input array * - * @param body List of user object + * @param user List of user object */ - createUsersWithArrayInput(body: Array, extraHttpRequestParams?: any): Observable<{}>; + createUsersWithArrayInput(user: Array, extraHttpRequestParams?: any): Observable<{}>; /** * Creates list of users with given input array * - * @param body List of user object + * @param user List of user object */ - createUsersWithListInput(body: Array, extraHttpRequestParams?: any): Observable<{}>; + createUsersWithListInput(user: Array, extraHttpRequestParams?: any): Observable<{}>; /** * Delete user @@ -77,8 +77,8 @@ export interface UserServiceInterface { * Updated user * This can only be done by the logged in user. * @param username name that need to be deleted - * @param body Updated user object + * @param user Updated user object */ - updateUser(username: string, body: User, extraHttpRequestParams?: any): Observable<{}>; + updateUser(username: string, user: User, extraHttpRequestParams?: any): Observable<{}>; } diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/model/inlineObject.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/model/inlineObject.ts new file mode 100644 index 000000000000..edb81448e92f --- /dev/null +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/model/inlineObject.ts @@ -0,0 +1,24 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface InlineObject { + /** + * Updated name of the pet + */ + name?: string; + /** + * Updated status of the pet + */ + status?: string; +} + diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/model/inlineObject1.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/model/inlineObject1.ts new file mode 100644 index 000000000000..a9d379c1a568 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/model/inlineObject1.ts @@ -0,0 +1,24 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface InlineObject1 { + /** + * Additional data to pass to server + */ + additionalMetadata?: string; + /** + * file to upload + */ + file?: Blob; +} + diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/model/models.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/model/models.ts index 8607c5dabd0c..f83dbabedeb3 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/model/models.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/model/models.ts @@ -1,5 +1,7 @@ export * from './apiResponse'; export * from './category'; +export * from './inlineObject'; +export * from './inlineObject1'; export * from './order'; export * from './pet'; export * from './tag'; diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts index 5cd7568a7b0b..d901dfe430d7 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts @@ -62,16 +62,16 @@ export class PetService { /** * Add a new pet to the store * - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public addPet(body: Pet, observe?: 'body', reportProgress?: boolean): Observable; - public addPet(body: Pet, observe?: 'response', reportProgress?: boolean): Observable>; - public addPet(body: Pet, observe?: 'events', reportProgress?: boolean): Observable>; - public addPet(body: Pet, observe: any = 'body', reportProgress: boolean = false ): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling addPet.'); + public addPet(pet: Pet, observe?: 'body', reportProgress?: boolean): Observable; + public addPet(pet: Pet, observe?: 'response', reportProgress?: boolean): Observable>; + public addPet(pet: Pet, observe?: 'events', reportProgress?: boolean): Observable>; + public addPet(pet: Pet, observe: any = 'body', reportProgress: boolean = false ): Observable { + if (pet === null || pet === undefined) { + throw new Error('Required parameter pet was null or undefined when calling addPet.'); } let headers = this.defaultHeaders; @@ -103,7 +103,7 @@ export class PetService { } return this.httpClient.post(`${this.configuration.basePath}/pet`, - body, + pet, { withCredentials: this.configuration.withCredentials, headers: headers, @@ -223,13 +223,14 @@ export class PetService { * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by + * @param maxCount Maximum number of items to return * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean): Observable>; - public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean): Observable>>; - public findPetsByTags(tags: Array, observe?: 'events', reportProgress?: boolean): Observable>>; - public findPetsByTags(tags: Array, observe: any = 'body', reportProgress: boolean = false ): Observable { + public findPetsByTags(tags: Array, maxCount?: number, observe?: 'body', reportProgress?: boolean): Observable>; + public findPetsByTags(tags: Array, maxCount?: number, observe?: 'response', reportProgress?: boolean): Observable>>; + public findPetsByTags(tags: Array, maxCount?: number, observe?: 'events', reportProgress?: boolean): Observable>>; + public findPetsByTags(tags: Array, maxCount?: number, observe: any = 'body', reportProgress: boolean = false ): Observable { if (tags === null || tags === undefined) { throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); } @@ -238,6 +239,9 @@ export class PetService { if (tags) { queryParameters = queryParameters.set('tags', tags.join(COLLECTION_FORMATS['csv'])); } + if (maxCount !== undefined && maxCount !== null) { + queryParameters = queryParameters.set('maxCount', maxCount); + } let headers = this.defaultHeaders; @@ -323,16 +327,16 @@ export class PetService { /** * Update an existing pet * - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updatePet(body: Pet, observe?: 'body', reportProgress?: boolean): Observable; - public updatePet(body: Pet, observe?: 'response', reportProgress?: boolean): Observable>; - public updatePet(body: Pet, observe?: 'events', reportProgress?: boolean): Observable>; - public updatePet(body: Pet, observe: any = 'body', reportProgress: boolean = false ): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling updatePet.'); + public updatePet(pet: Pet, observe?: 'body', reportProgress?: boolean): Observable; + public updatePet(pet: Pet, observe?: 'response', reportProgress?: boolean): Observable>; + public updatePet(pet: Pet, observe?: 'events', reportProgress?: boolean): Observable>; + public updatePet(pet: Pet, observe: any = 'body', reportProgress: boolean = false ): Observable { + if (pet === null || pet === undefined) { + throw new Error('Required parameter pet was null or undefined when calling updatePet.'); } let headers = this.defaultHeaders; @@ -364,7 +368,7 @@ export class PetService { } return this.httpClient.put(`${this.configuration.basePath}/pet`, - body, + pet, { withCredentials: this.configuration.withCredentials, headers: headers, diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v4.3/npm/api/store.service.ts index 7f97217dc146..9cac22ff6459 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/api/store.service.ts @@ -182,16 +182,16 @@ export class StoreService { /** * Place an order for a pet * - * @param body order placed for purchasing the pet + * @param order order placed for purchasing the pet * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public placeOrder(body: Order, observe?: 'body', reportProgress?: boolean): Observable; - public placeOrder(body: Order, observe?: 'response', reportProgress?: boolean): Observable>; - public placeOrder(body: Order, observe?: 'events', reportProgress?: boolean): Observable>; - public placeOrder(body: Order, observe: any = 'body', reportProgress: boolean = false ): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling placeOrder.'); + public placeOrder(order: Order, observe?: 'body', reportProgress?: boolean): Observable; + public placeOrder(order: Order, observe?: 'response', reportProgress?: boolean): Observable>; + public placeOrder(order: Order, observe?: 'events', reportProgress?: boolean): Observable>; + public placeOrder(order: Order, observe: any = 'body', reportProgress: boolean = false ): Observable { + if (order === null || order === undefined) { + throw new Error('Required parameter order was null or undefined when calling placeOrder.'); } let headers = this.defaultHeaders; @@ -208,6 +208,7 @@ export class StoreService { // to determine the Content-Type header const consumes: string[] = [ + 'application/json' ]; const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { @@ -215,7 +216,7 @@ export class StoreService { } return this.httpClient.post(`${this.configuration.basePath}/store/order`, - body, + order, { withCredentials: this.configuration.withCredentials, headers: headers, diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v4.3/npm/api/user.service.ts index 34379e25ae63..b35c48072884 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/api/user.service.ts @@ -61,20 +61,21 @@ export class UserService { /** * Create user * This can only be done by the logged in user. - * @param body Created user object + * @param user Created user object * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUser(body: User, observe?: 'body', reportProgress?: boolean): Observable; - public createUser(body: User, observe?: 'response', reportProgress?: boolean): Observable>; - public createUser(body: User, observe?: 'events', reportProgress?: boolean): Observable>; - public createUser(body: User, observe: any = 'body', reportProgress: boolean = false ): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling createUser.'); + public createUser(user: User, observe?: 'body', reportProgress?: boolean): Observable; + public createUser(user: User, observe?: 'response', reportProgress?: boolean): Observable>; + public createUser(user: User, observe?: 'events', reportProgress?: boolean): Observable>; + public createUser(user: User, observe: any = 'body', reportProgress: boolean = false ): Observable { + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling createUser.'); } let headers = this.defaultHeaders; + // authentication (auth_cookie) required // to determine the Accept header const httpHeaderAccepts: string[] = [ ]; @@ -85,6 +86,7 @@ export class UserService { // to determine the Content-Type header const consumes: string[] = [ + 'application/json' ]; const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { @@ -92,7 +94,7 @@ export class UserService { } return this.httpClient.post(`${this.configuration.basePath}/user`, - body, + user, { withCredentials: this.configuration.withCredentials, headers: headers, @@ -105,20 +107,21 @@ export class UserService { /** * Creates list of users with given input array * - * @param body List of user object + * @param user List of user object * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUsersWithArrayInput(body: Array, observe?: 'body', reportProgress?: boolean): Observable; - public createUsersWithArrayInput(body: Array, observe?: 'response', reportProgress?: boolean): Observable>; - public createUsersWithArrayInput(body: Array, observe?: 'events', reportProgress?: boolean): Observable>; - public createUsersWithArrayInput(body: Array, observe: any = 'body', reportProgress: boolean = false ): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.'); + public createUsersWithArrayInput(user: Array, observe?: 'body', reportProgress?: boolean): Observable; + public createUsersWithArrayInput(user: Array, observe?: 'response', reportProgress?: boolean): Observable>; + public createUsersWithArrayInput(user: Array, observe?: 'events', reportProgress?: boolean): Observable>; + public createUsersWithArrayInput(user: Array, observe: any = 'body', reportProgress: boolean = false ): Observable { + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling createUsersWithArrayInput.'); } let headers = this.defaultHeaders; + // authentication (auth_cookie) required // to determine the Accept header const httpHeaderAccepts: string[] = [ ]; @@ -129,6 +132,7 @@ export class UserService { // to determine the Content-Type header const consumes: string[] = [ + 'application/json' ]; const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { @@ -136,7 +140,7 @@ export class UserService { } return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`, - body, + user, { withCredentials: this.configuration.withCredentials, headers: headers, @@ -149,20 +153,21 @@ export class UserService { /** * Creates list of users with given input array * - * @param body List of user object + * @param user List of user object * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUsersWithListInput(body: Array, observe?: 'body', reportProgress?: boolean): Observable; - public createUsersWithListInput(body: Array, observe?: 'response', reportProgress?: boolean): Observable>; - public createUsersWithListInput(body: Array, observe?: 'events', reportProgress?: boolean): Observable>; - public createUsersWithListInput(body: Array, observe: any = 'body', reportProgress: boolean = false ): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.'); + public createUsersWithListInput(user: Array, observe?: 'body', reportProgress?: boolean): Observable; + public createUsersWithListInput(user: Array, observe?: 'response', reportProgress?: boolean): Observable>; + public createUsersWithListInput(user: Array, observe?: 'events', reportProgress?: boolean): Observable>; + public createUsersWithListInput(user: Array, observe: any = 'body', reportProgress: boolean = false ): Observable { + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling createUsersWithListInput.'); } let headers = this.defaultHeaders; + // authentication (auth_cookie) required // to determine the Accept header const httpHeaderAccepts: string[] = [ ]; @@ -173,6 +178,7 @@ export class UserService { // to determine the Content-Type header const consumes: string[] = [ + 'application/json' ]; const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { @@ -180,7 +186,7 @@ export class UserService { } return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`, - body, + user, { withCredentials: this.configuration.withCredentials, headers: headers, @@ -207,6 +213,7 @@ export class UserService { let headers = this.defaultHeaders; + // authentication (auth_cookie) required // to determine the Accept header const httpHeaderAccepts: string[] = [ ]; @@ -337,6 +344,7 @@ export class UserService { let headers = this.defaultHeaders; + // authentication (auth_cookie) required // to determine the Accept header const httpHeaderAccepts: string[] = [ ]; @@ -363,23 +371,24 @@ export class UserService { * Updated user * This can only be done by the logged in user. * @param username name that need to be deleted - * @param body Updated user object + * @param user Updated user object * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updateUser(username: string, body: User, observe?: 'body', reportProgress?: boolean): Observable; - public updateUser(username: string, body: User, observe?: 'response', reportProgress?: boolean): Observable>; - public updateUser(username: string, body: User, observe?: 'events', reportProgress?: boolean): Observable>; - public updateUser(username: string, body: User, observe: any = 'body', reportProgress: boolean = false ): Observable { + public updateUser(username: string, user: User, observe?: 'body', reportProgress?: boolean): Observable; + public updateUser(username: string, user: User, observe?: 'response', reportProgress?: boolean): Observable>; + public updateUser(username: string, user: User, observe?: 'events', reportProgress?: boolean): Observable>; + public updateUser(username: string, user: User, observe: any = 'body', reportProgress: boolean = false ): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling updateUser.'); } - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling updateUser.'); + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling updateUser.'); } let headers = this.defaultHeaders; + // authentication (auth_cookie) required // to determine the Accept header const httpHeaderAccepts: string[] = [ ]; @@ -390,6 +399,7 @@ export class UserService { // to determine the Content-Type header const consumes: string[] = [ + 'application/json' ]; const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { @@ -397,7 +407,7 @@ export class UserService { } return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, - body, + user, { withCredentials: this.configuration.withCredentials, headers: headers, diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/model/inlineObject.ts b/samples/client/petstore/typescript-angular-v4.3/npm/model/inlineObject.ts new file mode 100644 index 000000000000..edb81448e92f --- /dev/null +++ b/samples/client/petstore/typescript-angular-v4.3/npm/model/inlineObject.ts @@ -0,0 +1,24 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface InlineObject { + /** + * Updated name of the pet + */ + name?: string; + /** + * Updated status of the pet + */ + status?: string; +} + diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/model/inlineObject1.ts b/samples/client/petstore/typescript-angular-v4.3/npm/model/inlineObject1.ts new file mode 100644 index 000000000000..a9d379c1a568 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v4.3/npm/model/inlineObject1.ts @@ -0,0 +1,24 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface InlineObject1 { + /** + * Additional data to pass to server + */ + additionalMetadata?: string; + /** + * file to upload + */ + file?: Blob; +} + diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/model/models.ts b/samples/client/petstore/typescript-angular-v4.3/npm/model/models.ts index 8607c5dabd0c..f83dbabedeb3 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/model/models.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/model/models.ts @@ -1,5 +1,7 @@ export * from './apiResponse'; export * from './category'; +export * from './inlineObject'; +export * from './inlineObject1'; export * from './order'; export * from './pet'; export * from './tag'; diff --git a/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts index ff2ed68baa6a..e6929b7f5e6d 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts @@ -63,10 +63,10 @@ export class PetService { /** * * @summary Add a new pet to the store - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store */ - public addPet(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { - return this.addPetWithHttpInfo(body, extraHttpRequestParams) + public addPet(pet: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { + return this.addPetWithHttpInfo(pet, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { return undefined; @@ -113,9 +113,10 @@ export class PetService { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @summary Finds Pets by tags * @param tags Tags to filter by + * @param maxCount Maximum number of items to return */ - public findPetsByTags(tags: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable> { - return this.findPetsByTagsWithHttpInfo(tags, extraHttpRequestParams) + public findPetsByTags(tags: Array, maxCount?: number, extraHttpRequestParams?: RequestOptionsArgs): Observable> { + return this.findPetsByTagsWithHttpInfo(tags, maxCount, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { return undefined; @@ -144,10 +145,10 @@ export class PetService { /** * * @summary Update an existing pet - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store */ - public updatePet(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { - return this.updatePetWithHttpInfo(body, extraHttpRequestParams) + public updatePet(pet: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { + return this.updatePetWithHttpInfo(pet, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { return undefined; @@ -197,12 +198,12 @@ export class PetService { /** * Add a new pet to the store * - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store */ - public addPetWithHttpInfo(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling addPet.'); + public addPetWithHttpInfo(pet: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable { + if (pet === null || pet === undefined) { + throw new Error('Required parameter pet was null or undefined when calling addPet.'); } let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -236,7 +237,7 @@ export class PetService { let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Post, headers: headers, - body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 + body: pet == null ? '' : JSON.stringify(pet), // https://github.com/angular/angular/issues/10612 withCredentials:this.configuration.withCredentials }); // issues#4037 @@ -355,9 +356,10 @@ export class PetService { * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by + * @param maxCount Maximum number of items to return */ - public findPetsByTagsWithHttpInfo(tags: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { + public findPetsByTagsWithHttpInfo(tags: Array, maxCount?: number, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (tags === null || tags === undefined) { throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); } @@ -366,6 +368,9 @@ export class PetService { if (tags) { queryParameters.set('tags', tags.join(COLLECTION_FORMATS['csv'])); } + if (maxCount !== undefined && maxCount !== null) { + queryParameters.set('maxCount', maxCount); + } let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -453,12 +458,12 @@ export class PetService { /** * Update an existing pet * - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store */ - public updatePetWithHttpInfo(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling updatePet.'); + public updatePetWithHttpInfo(pet: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable { + if (pet === null || pet === undefined) { + throw new Error('Required parameter pet was null or undefined when calling updatePet.'); } let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -492,7 +497,7 @@ export class PetService { let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Put, headers: headers, - body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 + body: pet == null ? '' : JSON.stringify(pet), // https://github.com/angular/angular/issues/10612 withCredentials:this.configuration.withCredentials }); // issues#4037 diff --git a/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts index e774b1f93acf..c557b2c6af0b 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts @@ -109,10 +109,10 @@ export class StoreService { /** * * @summary Place an order for a pet - * @param body order placed for purchasing the pet + * @param order order placed for purchasing the pet */ - public placeOrder(body: Order, extraHttpRequestParams?: RequestOptionsArgs): Observable { - return this.placeOrderWithHttpInfo(body, extraHttpRequestParams) + public placeOrder(order: Order, extraHttpRequestParams?: RequestOptionsArgs): Observable { + return this.placeOrderWithHttpInfo(order, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { return undefined; @@ -244,12 +244,12 @@ export class StoreService { /** * Place an order for a pet * - * @param body order placed for purchasing the pet + * @param order order placed for purchasing the pet */ - public placeOrderWithHttpInfo(body: Order, extraHttpRequestParams?: RequestOptionsArgs): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling placeOrder.'); + public placeOrderWithHttpInfo(order: Order, extraHttpRequestParams?: RequestOptionsArgs): Observable { + if (order === null || order === undefined) { + throw new Error('Required parameter order was null or undefined when calling placeOrder.'); } let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -266,6 +266,7 @@ export class StoreService { // to determine the Content-Type header const consumes: string[] = [ + 'application/json' ]; const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { @@ -275,7 +276,7 @@ export class StoreService { let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Post, headers: headers, - body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 + body: order == null ? '' : JSON.stringify(order), // https://github.com/angular/angular/issues/10612 withCredentials:this.configuration.withCredentials }); // issues#4037 diff --git a/samples/client/petstore/typescript-angular-v4/npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v4/npm/api/user.service.ts index a1ab3ad59524..37eefb7ceac8 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v4/npm/api/user.service.ts @@ -62,10 +62,10 @@ export class UserService { /** * This can only be done by the logged in user. * @summary Create user - * @param body Created user object + * @param user Created user object */ - public createUser(body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { - return this.createUserWithHttpInfo(body, extraHttpRequestParams) + public createUser(user: User, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { + return this.createUserWithHttpInfo(user, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { return undefined; @@ -78,10 +78,10 @@ export class UserService { /** * * @summary Creates list of users with given input array - * @param body List of user object + * @param user List of user object */ - public createUsersWithArrayInput(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { - return this.createUsersWithArrayInputWithHttpInfo(body, extraHttpRequestParams) + public createUsersWithArrayInput(user: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { + return this.createUsersWithArrayInputWithHttpInfo(user, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { return undefined; @@ -94,10 +94,10 @@ export class UserService { /** * * @summary Creates list of users with given input array - * @param body List of user object + * @param user List of user object */ - public createUsersWithListInput(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { - return this.createUsersWithListInputWithHttpInfo(body, extraHttpRequestParams) + public createUsersWithListInput(user: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { + return this.createUsersWithListInputWithHttpInfo(user, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { return undefined; @@ -175,10 +175,10 @@ export class UserService { * This can only be done by the logged in user. * @summary Updated user * @param username name that need to be deleted - * @param body Updated user object + * @param user Updated user object */ - public updateUser(username: string, body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { - return this.updateUserWithHttpInfo(username, body, extraHttpRequestParams) + public updateUser(username: string, user: User, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { + return this.updateUserWithHttpInfo(username, user, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { return undefined; @@ -192,16 +192,17 @@ export class UserService { /** * Create user * This can only be done by the logged in user. - * @param body Created user object + * @param user Created user object */ - public createUserWithHttpInfo(body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling createUser.'); + public createUserWithHttpInfo(user: User, extraHttpRequestParams?: RequestOptionsArgs): Observable { + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling createUser.'); } let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 + // authentication (auth_cookie) required // to determine the Accept header const httpHeaderAccepts: string[] = [ ]; @@ -212,6 +213,7 @@ export class UserService { // to determine the Content-Type header const consumes: string[] = [ + 'application/json' ]; const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { @@ -221,7 +223,7 @@ export class UserService { let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Post, headers: headers, - body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 + body: user == null ? '' : JSON.stringify(user), // https://github.com/angular/angular/issues/10612 withCredentials:this.configuration.withCredentials }); // issues#4037 @@ -235,16 +237,17 @@ export class UserService { /** * Creates list of users with given input array * - * @param body List of user object + * @param user List of user object */ - public createUsersWithArrayInputWithHttpInfo(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.'); + public createUsersWithArrayInputWithHttpInfo(user: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling createUsersWithArrayInput.'); } let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 + // authentication (auth_cookie) required // to determine the Accept header const httpHeaderAccepts: string[] = [ ]; @@ -255,6 +258,7 @@ export class UserService { // to determine the Content-Type header const consumes: string[] = [ + 'application/json' ]; const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { @@ -264,7 +268,7 @@ export class UserService { let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Post, headers: headers, - body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 + body: user == null ? '' : JSON.stringify(user), // https://github.com/angular/angular/issues/10612 withCredentials:this.configuration.withCredentials }); // issues#4037 @@ -278,16 +282,17 @@ export class UserService { /** * Creates list of users with given input array * - * @param body List of user object + * @param user List of user object */ - public createUsersWithListInputWithHttpInfo(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.'); + public createUsersWithListInputWithHttpInfo(user: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling createUsersWithListInput.'); } let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 + // authentication (auth_cookie) required // to determine the Accept header const httpHeaderAccepts: string[] = [ ]; @@ -298,6 +303,7 @@ export class UserService { // to determine the Content-Type header const consumes: string[] = [ + 'application/json' ]; const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { @@ -307,7 +313,7 @@ export class UserService { let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Post, headers: headers, - body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 + body: user == null ? '' : JSON.stringify(user), // https://github.com/angular/angular/issues/10612 withCredentials:this.configuration.withCredentials }); // issues#4037 @@ -331,6 +337,7 @@ export class UserService { let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 + // authentication (auth_cookie) required // to determine the Accept header const httpHeaderAccepts: string[] = [ ]; @@ -458,6 +465,7 @@ export class UserService { let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 + // authentication (auth_cookie) required // to determine the Accept header const httpHeaderAccepts: string[] = [ ]; @@ -487,19 +495,20 @@ export class UserService { * Updated user * This can only be done by the logged in user. * @param username name that need to be deleted - * @param body Updated user object + * @param user Updated user object */ - public updateUserWithHttpInfo(username: string, body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable { + public updateUserWithHttpInfo(username: string, user: User, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling updateUser.'); } - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling updateUser.'); + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling updateUser.'); } let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 + // authentication (auth_cookie) required // to determine the Accept header const httpHeaderAccepts: string[] = [ ]; @@ -510,6 +519,7 @@ export class UserService { // to determine the Content-Type header const consumes: string[] = [ + 'application/json' ]; const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { @@ -519,7 +529,7 @@ export class UserService { let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Put, headers: headers, - body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 + body: user == null ? '' : JSON.stringify(user), // https://github.com/angular/angular/issues/10612 withCredentials:this.configuration.withCredentials }); // issues#4037 diff --git a/samples/client/petstore/typescript-angular-v4/npm/model/inlineObject.ts b/samples/client/petstore/typescript-angular-v4/npm/model/inlineObject.ts new file mode 100644 index 000000000000..edb81448e92f --- /dev/null +++ b/samples/client/petstore/typescript-angular-v4/npm/model/inlineObject.ts @@ -0,0 +1,24 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface InlineObject { + /** + * Updated name of the pet + */ + name?: string; + /** + * Updated status of the pet + */ + status?: string; +} + diff --git a/samples/client/petstore/typescript-angular-v4/npm/model/inlineObject1.ts b/samples/client/petstore/typescript-angular-v4/npm/model/inlineObject1.ts new file mode 100644 index 000000000000..a9d379c1a568 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v4/npm/model/inlineObject1.ts @@ -0,0 +1,24 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface InlineObject1 { + /** + * Additional data to pass to server + */ + additionalMetadata?: string; + /** + * file to upload + */ + file?: Blob; +} + diff --git a/samples/client/petstore/typescript-angular-v4/npm/model/models.ts b/samples/client/petstore/typescript-angular-v4/npm/model/models.ts index 8607c5dabd0c..f83dbabedeb3 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/model/models.ts +++ b/samples/client/petstore/typescript-angular-v4/npm/model/models.ts @@ -1,5 +1,7 @@ export * from './apiResponse'; export * from './category'; +export * from './inlineObject'; +export * from './inlineObject1'; export * from './order'; export * from './pet'; export * from './tag'; diff --git a/samples/client/petstore/typescript-angularjs/api/PetApi.ts b/samples/client/petstore/typescript-angularjs/api/PetApi.ts index bf591c8ff135..edecd61272bc 100644 --- a/samples/client/petstore/typescript-angularjs/api/PetApi.ts +++ b/samples/client/petstore/typescript-angularjs/api/PetApi.ts @@ -29,22 +29,22 @@ export class PetApi { /** * * @summary Add a new pet to the store - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store */ - public addPet (body: models.Pet, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { + public addPet (pet: models.Pet, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { const localVarPath = this.basePath + '/pet'; let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling addPet.'); + // verify required parameter 'pet' is not null or undefined + if (pet === null || pet === undefined) { + throw new Error('Required parameter pet was null or undefined when calling addPet.'); } let httpRequestParams: ng.IRequestConfig = { method: 'POST', url: localVarPath, - data: body, + data: pet, params: queryParameters, headers: headerParams }; @@ -123,8 +123,9 @@ export class PetApi { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @summary Finds Pets by tags * @param tags Tags to filter by + * @param maxCount Maximum number of items to return */ - public findPetsByTags (tags: Array, extraHttpRequestParams?: any ) : ng.IHttpPromise> { + public findPetsByTags (tags: Array, maxCount?: number, extraHttpRequestParams?: any ) : ng.IHttpPromise> { const localVarPath = this.basePath + '/pet/findByTags'; let queryParameters: any = {}; @@ -138,6 +139,10 @@ export class PetApi { queryParameters['tags'] = tags; } + if (maxCount !== undefined) { + queryParameters['maxCount'] = maxCount; + } + let httpRequestParams: ng.IRequestConfig = { method: 'GET', url: localVarPath, @@ -183,22 +188,22 @@ export class PetApi { /** * * @summary Update an existing pet - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store */ - public updatePet (body: models.Pet, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { + public updatePet (pet: models.Pet, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { const localVarPath = this.basePath + '/pet'; let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling updatePet.'); + // verify required parameter 'pet' is not null or undefined + if (pet === null || pet === undefined) { + throw new Error('Required parameter pet was null or undefined when calling updatePet.'); } let httpRequestParams: ng.IRequestConfig = { method: 'PUT', url: localVarPath, - data: body, + data: pet, params: queryParameters, headers: headerParams }; diff --git a/samples/client/petstore/typescript-angularjs/api/StoreApi.ts b/samples/client/petstore/typescript-angularjs/api/StoreApi.ts index 3d5605655526..f823f0952dc2 100644 --- a/samples/client/petstore/typescript-angularjs/api/StoreApi.ts +++ b/samples/client/petstore/typescript-angularjs/api/StoreApi.ts @@ -109,22 +109,22 @@ export class StoreApi { /** * * @summary Place an order for a pet - * @param body order placed for purchasing the pet + * @param order order placed for purchasing the pet */ - public placeOrder (body: models.Order, extraHttpRequestParams?: any ) : ng.IHttpPromise { + public placeOrder (order: models.Order, extraHttpRequestParams?: any ) : ng.IHttpPromise { const localVarPath = this.basePath + '/store/order'; let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling placeOrder.'); + // verify required parameter 'order' is not null or undefined + if (order === null || order === undefined) { + throw new Error('Required parameter order was null or undefined when calling placeOrder.'); } let httpRequestParams: ng.IRequestConfig = { method: 'POST', url: localVarPath, - data: body, + data: order, params: queryParameters, headers: headerParams }; diff --git a/samples/client/petstore/typescript-angularjs/api/UserApi.ts b/samples/client/petstore/typescript-angularjs/api/UserApi.ts index f63bb64b8b11..c09a340b75a9 100644 --- a/samples/client/petstore/typescript-angularjs/api/UserApi.ts +++ b/samples/client/petstore/typescript-angularjs/api/UserApi.ts @@ -29,22 +29,22 @@ export class UserApi { /** * This can only be done by the logged in user. * @summary Create user - * @param body Created user object + * @param user Created user object */ - public createUser (body: models.User, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { + public createUser (user: models.User, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { const localVarPath = this.basePath + '/user'; let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling createUser.'); + // verify required parameter 'user' is not null or undefined + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling createUser.'); } let httpRequestParams: ng.IRequestConfig = { method: 'POST', url: localVarPath, - data: body, + data: user, params: queryParameters, headers: headerParams }; @@ -58,22 +58,22 @@ export class UserApi { /** * * @summary Creates list of users with given input array - * @param body List of user object + * @param modelsUser List of user object */ - public createUsersWithArrayInput (body: Array, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { + public createUsersWithArrayInput (modelsUser: Array, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { const localVarPath = this.basePath + '/user/createWithArray'; let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.'); + // verify required parameter 'modelsUser' is not null or undefined + if (modelsUser === null || modelsUser === undefined) { + throw new Error('Required parameter modelsUser was null or undefined when calling createUsersWithArrayInput.'); } let httpRequestParams: ng.IRequestConfig = { method: 'POST', url: localVarPath, - data: body, + data: modelsUser, params: queryParameters, headers: headerParams }; @@ -87,22 +87,22 @@ export class UserApi { /** * * @summary Creates list of users with given input array - * @param body List of user object + * @param modelsUser List of user object */ - public createUsersWithListInput (body: Array, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { + public createUsersWithListInput (modelsUser: Array, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { const localVarPath = this.basePath + '/user/createWithList'; let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.'); + // verify required parameter 'modelsUser' is not null or undefined + if (modelsUser === null || modelsUser === undefined) { + throw new Error('Required parameter modelsUser was null or undefined when calling createUsersWithListInput.'); } let httpRequestParams: ng.IRequestConfig = { method: 'POST', url: localVarPath, - data: body, + data: modelsUser, params: queryParameters, headers: headerParams }; @@ -239,9 +239,9 @@ export class UserApi { * This can only be done by the logged in user. * @summary Updated user * @param username name that need to be deleted - * @param body Updated user object + * @param user Updated user object */ - public updateUser (username: string, body: models.User, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { + public updateUser (username: string, user: models.User, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { const localVarPath = this.basePath + '/user/{username}' .replace('{' + 'username' + '}', encodeURIComponent(String(username))); @@ -252,15 +252,15 @@ export class UserApi { throw new Error('Required parameter username was null or undefined when calling updateUser.'); } - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling updateUser.'); + // verify required parameter 'user' is not null or undefined + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling updateUser.'); } let httpRequestParams: ng.IRequestConfig = { method: 'PUT', url: localVarPath, - data: body, + data: user, params: queryParameters, headers: headerParams }; diff --git a/samples/client/petstore/typescript-angularjs/model/InlineObject.ts b/samples/client/petstore/typescript-angularjs/model/InlineObject.ts new file mode 100644 index 000000000000..ee1497a9541f --- /dev/null +++ b/samples/client/petstore/typescript-angularjs/model/InlineObject.ts @@ -0,0 +1,25 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import * as models from './models'; + +export interface InlineObject { + /** + * Updated name of the pet + */ + "name"?: string; + /** + * Updated status of the pet + */ + "status"?: string; +} + diff --git a/samples/client/petstore/typescript-angularjs/model/InlineObject1.ts b/samples/client/petstore/typescript-angularjs/model/InlineObject1.ts new file mode 100644 index 000000000000..d8b11b28fccd --- /dev/null +++ b/samples/client/petstore/typescript-angularjs/model/InlineObject1.ts @@ -0,0 +1,25 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import * as models from './models'; + +export interface InlineObject1 { + /** + * Additional data to pass to server + */ + "additionalMetadata"?: string; + /** + * file to upload + */ + "file"?: any; +} + diff --git a/samples/client/petstore/typescript-angularjs/model/models.ts b/samples/client/petstore/typescript-angularjs/model/models.ts index f53c1dd42bdd..7f39cae301b7 100644 --- a/samples/client/petstore/typescript-angularjs/model/models.ts +++ b/samples/client/petstore/typescript-angularjs/model/models.ts @@ -1,5 +1,7 @@ export * from './ApiResponse'; export * from './Category'; +export * from './InlineObject'; +export * from './InlineObject1'; export * from './Order'; export * from './Pet'; export * from './Tag'; diff --git a/samples/client/petstore/typescript-aurelia/default/AuthStorage.ts b/samples/client/petstore/typescript-aurelia/default/AuthStorage.ts index 9758cc78ece5..f42e8b6c0265 100644 --- a/samples/client/petstore/typescript-aurelia/default/AuthStorage.ts +++ b/samples/client/petstore/typescript-aurelia/default/AuthStorage.ts @@ -45,6 +45,31 @@ export class AuthStorage { return this.storage.get('api_key') || null; } + /** + * Sets the auth_cookie auth method value. + * + * @param value The new value to set for auth_cookie. + */ + setauth_cookie(value: string): this { + this.storage.set('auth_cookie', value); + return this; + } + + /** + * Removes the auth_cookie auth method value. + */ + removeauth_cookie(): this { + this.storage.delete('auth_cookie'); + return this; + } + + /** + * Gets the auth_cookie auth method value. + */ + getauth_cookie(): null | string { + return this.storage.get('auth_cookie') || null; + } + /** * Sets the petstore_auth auth method value. * diff --git a/samples/client/petstore/typescript-aurelia/default/PetApi.ts b/samples/client/petstore/typescript-aurelia/default/PetApi.ts index 1ac19a00fb88..e334a3511e84 100644 --- a/samples/client/petstore/typescript-aurelia/default/PetApi.ts +++ b/samples/client/petstore/typescript-aurelia/default/PetApi.ts @@ -23,7 +23,7 @@ import { * addPet - parameters interface */ export interface IAddPetParams { - body: Pet; + pet: Pet; } /** @@ -46,6 +46,7 @@ export interface IFindPetsByStatusParams { */ export interface IFindPetsByTagsParams { tags: Array; + maxCount?: number; } /** @@ -59,7 +60,7 @@ export interface IGetPetByIdParams { * updatePet - parameters interface */ export interface IUpdatePetParams { - body: Pet; + pet: Pet; } /** @@ -98,11 +99,11 @@ export class PetApi extends Api { /** * Add a new pet to the store - * @param params.body Pet object that needs to be added to the store + * @param params.pet Pet object that needs to be added to the store */ async addPet(params: IAddPetParams): Promise { // Verify required parameters are set - this.ensureParamIsSet('addPet', params, 'body'); + this.ensureParamIsSet('addPet', params, 'pet'); // Create URL to call const url = `${this.basePath}/pet`; @@ -112,7 +113,7 @@ export class PetApi extends Api { .asPost() // Encode body parameter .withHeader('content-type', 'application/json') - .withContent(JSON.stringify(params['body'] || {})) + .withContent(JSON.stringify(params['pet'] || {})) // Authentication 'petstore_auth' required // Send the request @@ -191,6 +192,7 @@ export class PetApi extends Api { * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param params.tags Tags to filter by + * @param params.maxCount Maximum number of items to return */ async findPetsByTags(params: IFindPetsByTagsParams): Promise> { // Verify required parameters are set @@ -205,6 +207,7 @@ export class PetApi extends Api { // Set query parameters .withParams({ 'tags': params['tags'], + 'maxCount': params['maxCount'], }) // Authentication 'petstore_auth' required @@ -251,11 +254,11 @@ export class PetApi extends Api { /** * Update an existing pet - * @param params.body Pet object that needs to be added to the store + * @param params.pet Pet object that needs to be added to the store */ async updatePet(params: IUpdatePetParams): Promise { // Verify required parameters are set - this.ensureParamIsSet('updatePet', params, 'body'); + this.ensureParamIsSet('updatePet', params, 'pet'); // Create URL to call const url = `${this.basePath}/pet`; @@ -265,7 +268,7 @@ export class PetApi extends Api { .asPut() // Encode body parameter .withHeader('content-type', 'application/json') - .withContent(JSON.stringify(params['body'] || {})) + .withContent(JSON.stringify(params['pet'] || {})) // Authentication 'petstore_auth' required // Send the request diff --git a/samples/client/petstore/typescript-aurelia/default/StoreApi.ts b/samples/client/petstore/typescript-aurelia/default/StoreApi.ts index feaab4b09778..8d462058e8c0 100644 --- a/samples/client/petstore/typescript-aurelia/default/StoreApi.ts +++ b/samples/client/petstore/typescript-aurelia/default/StoreApi.ts @@ -42,7 +42,7 @@ export interface IGetOrderByIdParams { * placeOrder - parameters interface */ export interface IPlaceOrderParams { - body: Order; + order: Order; } /** @@ -146,11 +146,11 @@ export class StoreApi extends Api { /** * Place an order for a pet - * @param params.body order placed for purchasing the pet + * @param params.order order placed for purchasing the pet */ async placeOrder(params: IPlaceOrderParams): Promise { // Verify required parameters are set - this.ensureParamIsSet('placeOrder', params, 'body'); + this.ensureParamIsSet('placeOrder', params, 'order'); // Create URL to call const url = `${this.basePath}/store/order`; @@ -160,7 +160,7 @@ export class StoreApi extends Api { .asPost() // Encode body parameter .withHeader('content-type', 'application/json') - .withContent(JSON.stringify(params['body'] || {})) + .withContent(JSON.stringify(params['order'] || {})) // Send the request .send(); diff --git a/samples/client/petstore/typescript-aurelia/default/UserApi.ts b/samples/client/petstore/typescript-aurelia/default/UserApi.ts index c4ff06bea101..66fe8d100db2 100644 --- a/samples/client/petstore/typescript-aurelia/default/UserApi.ts +++ b/samples/client/petstore/typescript-aurelia/default/UserApi.ts @@ -22,21 +22,21 @@ import { * createUser - parameters interface */ export interface ICreateUserParams { - body: User; + user: User; } /** * createUsersWithArrayInput - parameters interface */ export interface ICreateUsersWithArrayInputParams { - body: Array; + user: Array; } /** * createUsersWithListInput - parameters interface */ export interface ICreateUsersWithListInputParams { - body: Array; + user: Array; } /** @@ -72,7 +72,7 @@ export interface ILogoutUserParams { */ export interface IUpdateUserParams { username: string; - body: User; + user: User; } /** @@ -94,11 +94,11 @@ export class UserApi extends Api { /** * Create user * This can only be done by the logged in user. - * @param params.body Created user object + * @param params.user Created user object */ async createUser(params: ICreateUserParams): Promise { // Verify required parameters are set - this.ensureParamIsSet('createUser', params, 'body'); + this.ensureParamIsSet('createUser', params, 'user'); // Create URL to call const url = `${this.basePath}/user`; @@ -108,8 +108,9 @@ export class UserApi extends Api { .asPost() // Encode body parameter .withHeader('content-type', 'application/json') - .withContent(JSON.stringify(params['body'] || {})) + .withContent(JSON.stringify(params['user'] || {})) + // Authentication 'auth_cookie' required // Send the request .send(); @@ -123,11 +124,11 @@ export class UserApi extends Api { /** * Creates list of users with given input array - * @param params.body List of user object + * @param params.user List of user object */ async createUsersWithArrayInput(params: ICreateUsersWithArrayInputParams): Promise { // Verify required parameters are set - this.ensureParamIsSet('createUsersWithArrayInput', params, 'body'); + this.ensureParamIsSet('createUsersWithArrayInput', params, 'user'); // Create URL to call const url = `${this.basePath}/user/createWithArray`; @@ -137,8 +138,9 @@ export class UserApi extends Api { .asPost() // Encode body parameter .withHeader('content-type', 'application/json') - .withContent(JSON.stringify(params['body'] || {})) + .withContent(JSON.stringify(params['user'] || {})) + // Authentication 'auth_cookie' required // Send the request .send(); @@ -152,11 +154,11 @@ export class UserApi extends Api { /** * Creates list of users with given input array - * @param params.body List of user object + * @param params.user List of user object */ async createUsersWithListInput(params: ICreateUsersWithListInputParams): Promise { // Verify required parameters are set - this.ensureParamIsSet('createUsersWithListInput', params, 'body'); + this.ensureParamIsSet('createUsersWithListInput', params, 'user'); // Create URL to call const url = `${this.basePath}/user/createWithList`; @@ -166,8 +168,9 @@ export class UserApi extends Api { .asPost() // Encode body parameter .withHeader('content-type', 'application/json') - .withContent(JSON.stringify(params['body'] || {})) + .withContent(JSON.stringify(params['user'] || {})) + // Authentication 'auth_cookie' required // Send the request .send(); @@ -196,6 +199,7 @@ export class UserApi extends Api { // Set HTTP method .asDelete() + // Authentication 'auth_cookie' required // Send the request .send(); @@ -280,6 +284,7 @@ export class UserApi extends Api { // Set HTTP method .asGet() + // Authentication 'auth_cookie' required // Send the request .send(); @@ -295,12 +300,12 @@ export class UserApi extends Api { * Updated user * This can only be done by the logged in user. * @param params.username name that need to be deleted - * @param params.body Updated user object + * @param params.user Updated user object */ async updateUser(params: IUpdateUserParams): Promise { // Verify required parameters are set this.ensureParamIsSet('updateUser', params, 'username'); - this.ensureParamIsSet('updateUser', params, 'body'); + this.ensureParamIsSet('updateUser', params, 'user'); // Create URL to call const url = `${this.basePath}/user/{username}` @@ -311,8 +316,9 @@ export class UserApi extends Api { .asPut() // Encode body parameter .withHeader('content-type', 'application/json') - .withContent(JSON.stringify(params['body'] || {})) + .withContent(JSON.stringify(params['user'] || {})) + // Authentication 'auth_cookie' required // Send the request .send(); diff --git a/samples/client/petstore/typescript-aurelia/default/index.ts b/samples/client/petstore/typescript-aurelia/default/index.ts index 389401150991..3e7aa388f0e6 100644 --- a/samples/client/petstore/typescript-aurelia/default/index.ts +++ b/samples/client/petstore/typescript-aurelia/default/index.ts @@ -18,6 +18,8 @@ export { UserApi } from './UserApi'; export { ApiResponse, Category, + InlineObject, + InlineObject1, Order, Pet, Tag, diff --git a/samples/client/petstore/typescript-aurelia/default/models.ts b/samples/client/petstore/typescript-aurelia/default/models.ts index 80d73eab8fd2..93fb3e547506 100644 --- a/samples/client/petstore/typescript-aurelia/default/models.ts +++ b/samples/client/petstore/typescript-aurelia/default/models.ts @@ -30,6 +30,30 @@ export interface Category { } +export interface InlineObject { + /** + * Updated name of the pet + */ + name?: string; + /** + * Updated status of the pet + */ + status?: string; +} + + +export interface InlineObject1 { + /** + * Additional data to pass to server + */ + additionalMetadata?: string; + /** + * file to upload + */ + file?: any; +} + + /** * An order for a pets from the pet store */ diff --git a/samples/client/petstore/typescript-fetch/builds/default/apis/PetApi.ts b/samples/client/petstore/typescript-fetch/builds/default/apis/PetApi.ts index e43896cc2929..04ce6e771879 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/apis/PetApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/default/apis/PetApi.ts @@ -23,7 +23,7 @@ import { } from '../models'; export interface AddPetRequest { - body: Pet; + pet: Pet; } export interface DeletePetRequest { @@ -37,6 +37,7 @@ export interface FindPetsByStatusRequest { export interface FindPetsByTagsRequest { tags: Array; + maxCount?: number; } export interface GetPetByIdRequest { @@ -44,7 +45,7 @@ export interface GetPetByIdRequest { } export interface UpdatePetRequest { - body: Pet; + pet: Pet; } export interface UpdatePetWithFormRequest { @@ -68,8 +69,8 @@ export class PetApi extends runtime.BaseAPI { * Add a new pet to the store */ async addPetRaw(requestParameters: AddPetRequest): Promise> { - if (requestParameters.body === null || requestParameters.body === undefined) { - throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling addPet.'); + if (requestParameters.pet === null || requestParameters.pet === undefined) { + throw new runtime.RequiredError('pet','Required parameter requestParameters.pet was null or undefined when calling addPet.'); } const queryParameters: runtime.HTTPQuery = {}; @@ -92,7 +93,7 @@ export class PetApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: PetToJSON(requestParameters.body), + body: PetToJSON(requestParameters.pet), }); return new runtime.VoidApiResponse(response); @@ -167,7 +168,7 @@ export class PetApi extends runtime.BaseAPI { if (this.configuration && this.configuration.accessToken) { // oauth required if (typeof this.configuration.accessToken === 'function') { - headerParameters["Authorization"] = this.configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]); + headerParameters["Authorization"] = this.configuration.accessToken("petstore_auth", ["read:pets"]); } else { headerParameters["Authorization"] = this.configuration.accessToken; } @@ -207,12 +208,16 @@ export class PetApi extends runtime.BaseAPI { queryParameters['tags'] = requestParameters.tags.join(runtime.COLLECTION_FORMATS["csv"]); } + if (requestParameters.maxCount !== undefined) { + queryParameters['maxCount'] = requestParameters.maxCount; + } + const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.accessToken) { // oauth required if (typeof this.configuration.accessToken === 'function') { - headerParameters["Authorization"] = this.configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]); + headerParameters["Authorization"] = this.configuration.accessToken("petstore_auth", ["read:pets"]); } else { headerParameters["Authorization"] = this.configuration.accessToken; } @@ -277,8 +282,8 @@ export class PetApi extends runtime.BaseAPI { * Update an existing pet */ async updatePetRaw(requestParameters: UpdatePetRequest): Promise> { - if (requestParameters.body === null || requestParameters.body === undefined) { - throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling updatePet.'); + if (requestParameters.pet === null || requestParameters.pet === undefined) { + throw new runtime.RequiredError('pet','Required parameter requestParameters.pet was null or undefined when calling updatePet.'); } const queryParameters: runtime.HTTPQuery = {}; @@ -301,7 +306,7 @@ export class PetApi extends runtime.BaseAPI { method: 'PUT', headers: headerParameters, query: queryParameters, - body: PetToJSON(requestParameters.body), + body: PetToJSON(requestParameters.pet), }); return new runtime.VoidApiResponse(response); diff --git a/samples/client/petstore/typescript-fetch/builds/default/apis/StoreApi.ts b/samples/client/petstore/typescript-fetch/builds/default/apis/StoreApi.ts index 916660981657..a8db149fec26 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/apis/StoreApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/default/apis/StoreApi.ts @@ -28,7 +28,7 @@ export interface GetOrderByIdRequest { } export interface PlaceOrderRequest { - body: Order; + order: Order; } /** @@ -135,8 +135,8 @@ export class StoreApi extends runtime.BaseAPI { * Place an order for a pet */ async placeOrderRaw(requestParameters: PlaceOrderRequest): Promise> { - if (requestParameters.body === null || requestParameters.body === undefined) { - throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling placeOrder.'); + if (requestParameters.order === null || requestParameters.order === undefined) { + throw new runtime.RequiredError('order','Required parameter requestParameters.order was null or undefined when calling placeOrder.'); } const queryParameters: runtime.HTTPQuery = {}; @@ -150,7 +150,7 @@ export class StoreApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: OrderToJSON(requestParameters.body), + body: OrderToJSON(requestParameters.order), }); return new runtime.JSONApiResponse(response, (jsonValue) => OrderFromJSON(jsonValue)); diff --git a/samples/client/petstore/typescript-fetch/builds/default/apis/UserApi.ts b/samples/client/petstore/typescript-fetch/builds/default/apis/UserApi.ts index 1696b600f57f..63659380995e 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/apis/UserApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/default/apis/UserApi.ts @@ -20,15 +20,15 @@ import { } from '../models'; export interface CreateUserRequest { - body: User; + user: User; } export interface CreateUsersWithArrayInputRequest { - body: Array; + user: Array; } export interface CreateUsersWithListInputRequest { - body: Array; + user: Array; } export interface DeleteUserRequest { @@ -46,7 +46,7 @@ export interface LoginUserRequest { export interface UpdateUserRequest { username: string; - body: User; + user: User; } /** @@ -59,8 +59,8 @@ export class UserApi extends runtime.BaseAPI { * Create user */ async createUserRaw(requestParameters: CreateUserRequest): Promise> { - if (requestParameters.body === null || requestParameters.body === undefined) { - throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling createUser.'); + if (requestParameters.user === null || requestParameters.user === undefined) { + throw new runtime.RequiredError('user','Required parameter requestParameters.user was null or undefined when calling createUser.'); } const queryParameters: runtime.HTTPQuery = {}; @@ -74,7 +74,7 @@ export class UserApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: UserToJSON(requestParameters.body), + body: UserToJSON(requestParameters.user), }); return new runtime.VoidApiResponse(response); @@ -92,8 +92,8 @@ export class UserApi extends runtime.BaseAPI { * Creates list of users with given input array */ async createUsersWithArrayInputRaw(requestParameters: CreateUsersWithArrayInputRequest): Promise> { - if (requestParameters.body === null || requestParameters.body === undefined) { - throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling createUsersWithArrayInput.'); + if (requestParameters.user === null || requestParameters.user === undefined) { + throw new runtime.RequiredError('user','Required parameter requestParameters.user was null or undefined when calling createUsersWithArrayInput.'); } const queryParameters: runtime.HTTPQuery = {}; @@ -107,7 +107,7 @@ export class UserApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: requestParameters.body.map(UserToJSON), + body: requestParameters.user.map(UserToJSON), }); return new runtime.VoidApiResponse(response); @@ -124,8 +124,8 @@ export class UserApi extends runtime.BaseAPI { * Creates list of users with given input array */ async createUsersWithListInputRaw(requestParameters: CreateUsersWithListInputRequest): Promise> { - if (requestParameters.body === null || requestParameters.body === undefined) { - throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling createUsersWithListInput.'); + if (requestParameters.user === null || requestParameters.user === undefined) { + throw new runtime.RequiredError('user','Required parameter requestParameters.user was null or undefined when calling createUsersWithListInput.'); } const queryParameters: runtime.HTTPQuery = {}; @@ -139,7 +139,7 @@ export class UserApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: requestParameters.body.map(UserToJSON), + body: requestParameters.user.map(UserToJSON), }); return new runtime.VoidApiResponse(response); @@ -289,8 +289,8 @@ export class UserApi extends runtime.BaseAPI { throw new runtime.RequiredError('username','Required parameter requestParameters.username was null or undefined when calling updateUser.'); } - if (requestParameters.body === null || requestParameters.body === undefined) { - throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling updateUser.'); + if (requestParameters.user === null || requestParameters.user === undefined) { + throw new runtime.RequiredError('user','Required parameter requestParameters.user was null or undefined when calling updateUser.'); } const queryParameters: runtime.HTTPQuery = {}; @@ -304,7 +304,7 @@ export class UserApi extends runtime.BaseAPI { method: 'PUT', headers: headerParameters, query: queryParameters, - body: UserToJSON(requestParameters.body), + body: UserToJSON(requestParameters.user), }); return new runtime.VoidApiResponse(response); diff --git a/samples/client/petstore/typescript-fetch/builds/default/models/InlineObject.ts b/samples/client/petstore/typescript-fetch/builds/default/models/InlineObject.ts new file mode 100644 index 000000000000..2998b1463ce5 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default/models/InlineObject.ts @@ -0,0 +1,52 @@ +// tslint:disable +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface InlineObject + */ +export interface InlineObject { + /** + * Updated name of the pet + * @type {string} + * @memberof InlineObject + */ + name?: string; + /** + * Updated status of the pet + * @type {string} + * @memberof InlineObject + */ + status?: string; +} + +export function InlineObjectFromJSON(json: any): InlineObject { + return { + 'name': !exists(json, 'name') ? undefined : json['name'], + 'status': !exists(json, 'status') ? undefined : json['status'], + }; +} + +export function InlineObjectToJSON(value?: InlineObject): any { + if (value === undefined) { + return undefined; + } + return { + 'name': value.name, + 'status': value.status, + }; +} + + diff --git a/samples/client/petstore/typescript-fetch/builds/default/models/InlineObject1.ts b/samples/client/petstore/typescript-fetch/builds/default/models/InlineObject1.ts new file mode 100644 index 000000000000..4cd90b137959 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default/models/InlineObject1.ts @@ -0,0 +1,52 @@ +// tslint:disable +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface InlineObject1 + */ +export interface InlineObject1 { + /** + * Additional data to pass to server + * @type {string} + * @memberof InlineObject1 + */ + additionalMetadata?: string; + /** + * file to upload + * @type {Blob} + * @memberof InlineObject1 + */ + file?: Blob; +} + +export function InlineObject1FromJSON(json: any): InlineObject1 { + return { + 'additionalMetadata': !exists(json, 'additionalMetadata') ? undefined : json['additionalMetadata'], + 'file': !exists(json, 'file') ? undefined : json['file'], + }; +} + +export function InlineObject1ToJSON(value?: InlineObject1): any { + if (value === undefined) { + return undefined; + } + return { + 'additionalMetadata': value.additionalMetadata, + 'file': value.file, + }; +} + + diff --git a/samples/client/petstore/typescript-fetch/builds/default/models/index.ts b/samples/client/petstore/typescript-fetch/builds/default/models/index.ts index b07ddc8446a0..5eefa748f29f 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/models/index.ts +++ b/samples/client/petstore/typescript-fetch/builds/default/models/index.ts @@ -1,4 +1,6 @@ export * from './Category'; +export * from './InlineObject'; +export * from './InlineObject1'; export * from './ModelApiResponse'; export * from './Order'; export * from './Pet'; diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/apis/PetApi.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/apis/PetApi.ts index e43896cc2929..04ce6e771879 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/apis/PetApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/apis/PetApi.ts @@ -23,7 +23,7 @@ import { } from '../models'; export interface AddPetRequest { - body: Pet; + pet: Pet; } export interface DeletePetRequest { @@ -37,6 +37,7 @@ export interface FindPetsByStatusRequest { export interface FindPetsByTagsRequest { tags: Array; + maxCount?: number; } export interface GetPetByIdRequest { @@ -44,7 +45,7 @@ export interface GetPetByIdRequest { } export interface UpdatePetRequest { - body: Pet; + pet: Pet; } export interface UpdatePetWithFormRequest { @@ -68,8 +69,8 @@ export class PetApi extends runtime.BaseAPI { * Add a new pet to the store */ async addPetRaw(requestParameters: AddPetRequest): Promise> { - if (requestParameters.body === null || requestParameters.body === undefined) { - throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling addPet.'); + if (requestParameters.pet === null || requestParameters.pet === undefined) { + throw new runtime.RequiredError('pet','Required parameter requestParameters.pet was null or undefined when calling addPet.'); } const queryParameters: runtime.HTTPQuery = {}; @@ -92,7 +93,7 @@ export class PetApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: PetToJSON(requestParameters.body), + body: PetToJSON(requestParameters.pet), }); return new runtime.VoidApiResponse(response); @@ -167,7 +168,7 @@ export class PetApi extends runtime.BaseAPI { if (this.configuration && this.configuration.accessToken) { // oauth required if (typeof this.configuration.accessToken === 'function') { - headerParameters["Authorization"] = this.configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]); + headerParameters["Authorization"] = this.configuration.accessToken("petstore_auth", ["read:pets"]); } else { headerParameters["Authorization"] = this.configuration.accessToken; } @@ -207,12 +208,16 @@ export class PetApi extends runtime.BaseAPI { queryParameters['tags'] = requestParameters.tags.join(runtime.COLLECTION_FORMATS["csv"]); } + if (requestParameters.maxCount !== undefined) { + queryParameters['maxCount'] = requestParameters.maxCount; + } + const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.accessToken) { // oauth required if (typeof this.configuration.accessToken === 'function') { - headerParameters["Authorization"] = this.configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]); + headerParameters["Authorization"] = this.configuration.accessToken("petstore_auth", ["read:pets"]); } else { headerParameters["Authorization"] = this.configuration.accessToken; } @@ -277,8 +282,8 @@ export class PetApi extends runtime.BaseAPI { * Update an existing pet */ async updatePetRaw(requestParameters: UpdatePetRequest): Promise> { - if (requestParameters.body === null || requestParameters.body === undefined) { - throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling updatePet.'); + if (requestParameters.pet === null || requestParameters.pet === undefined) { + throw new runtime.RequiredError('pet','Required parameter requestParameters.pet was null or undefined when calling updatePet.'); } const queryParameters: runtime.HTTPQuery = {}; @@ -301,7 +306,7 @@ export class PetApi extends runtime.BaseAPI { method: 'PUT', headers: headerParameters, query: queryParameters, - body: PetToJSON(requestParameters.body), + body: PetToJSON(requestParameters.pet), }); return new runtime.VoidApiResponse(response); diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/apis/StoreApi.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/apis/StoreApi.ts index 916660981657..a8db149fec26 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/apis/StoreApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/apis/StoreApi.ts @@ -28,7 +28,7 @@ export interface GetOrderByIdRequest { } export interface PlaceOrderRequest { - body: Order; + order: Order; } /** @@ -135,8 +135,8 @@ export class StoreApi extends runtime.BaseAPI { * Place an order for a pet */ async placeOrderRaw(requestParameters: PlaceOrderRequest): Promise> { - if (requestParameters.body === null || requestParameters.body === undefined) { - throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling placeOrder.'); + if (requestParameters.order === null || requestParameters.order === undefined) { + throw new runtime.RequiredError('order','Required parameter requestParameters.order was null or undefined when calling placeOrder.'); } const queryParameters: runtime.HTTPQuery = {}; @@ -150,7 +150,7 @@ export class StoreApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: OrderToJSON(requestParameters.body), + body: OrderToJSON(requestParameters.order), }); return new runtime.JSONApiResponse(response, (jsonValue) => OrderFromJSON(jsonValue)); diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/apis/UserApi.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/apis/UserApi.ts index 1696b600f57f..63659380995e 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/apis/UserApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/apis/UserApi.ts @@ -20,15 +20,15 @@ import { } from '../models'; export interface CreateUserRequest { - body: User; + user: User; } export interface CreateUsersWithArrayInputRequest { - body: Array; + user: Array; } export interface CreateUsersWithListInputRequest { - body: Array; + user: Array; } export interface DeleteUserRequest { @@ -46,7 +46,7 @@ export interface LoginUserRequest { export interface UpdateUserRequest { username: string; - body: User; + user: User; } /** @@ -59,8 +59,8 @@ export class UserApi extends runtime.BaseAPI { * Create user */ async createUserRaw(requestParameters: CreateUserRequest): Promise> { - if (requestParameters.body === null || requestParameters.body === undefined) { - throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling createUser.'); + if (requestParameters.user === null || requestParameters.user === undefined) { + throw new runtime.RequiredError('user','Required parameter requestParameters.user was null or undefined when calling createUser.'); } const queryParameters: runtime.HTTPQuery = {}; @@ -74,7 +74,7 @@ export class UserApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: UserToJSON(requestParameters.body), + body: UserToJSON(requestParameters.user), }); return new runtime.VoidApiResponse(response); @@ -92,8 +92,8 @@ export class UserApi extends runtime.BaseAPI { * Creates list of users with given input array */ async createUsersWithArrayInputRaw(requestParameters: CreateUsersWithArrayInputRequest): Promise> { - if (requestParameters.body === null || requestParameters.body === undefined) { - throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling createUsersWithArrayInput.'); + if (requestParameters.user === null || requestParameters.user === undefined) { + throw new runtime.RequiredError('user','Required parameter requestParameters.user was null or undefined when calling createUsersWithArrayInput.'); } const queryParameters: runtime.HTTPQuery = {}; @@ -107,7 +107,7 @@ export class UserApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: requestParameters.body.map(UserToJSON), + body: requestParameters.user.map(UserToJSON), }); return new runtime.VoidApiResponse(response); @@ -124,8 +124,8 @@ export class UserApi extends runtime.BaseAPI { * Creates list of users with given input array */ async createUsersWithListInputRaw(requestParameters: CreateUsersWithListInputRequest): Promise> { - if (requestParameters.body === null || requestParameters.body === undefined) { - throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling createUsersWithListInput.'); + if (requestParameters.user === null || requestParameters.user === undefined) { + throw new runtime.RequiredError('user','Required parameter requestParameters.user was null or undefined when calling createUsersWithListInput.'); } const queryParameters: runtime.HTTPQuery = {}; @@ -139,7 +139,7 @@ export class UserApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: requestParameters.body.map(UserToJSON), + body: requestParameters.user.map(UserToJSON), }); return new runtime.VoidApiResponse(response); @@ -289,8 +289,8 @@ export class UserApi extends runtime.BaseAPI { throw new runtime.RequiredError('username','Required parameter requestParameters.username was null or undefined when calling updateUser.'); } - if (requestParameters.body === null || requestParameters.body === undefined) { - throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling updateUser.'); + if (requestParameters.user === null || requestParameters.user === undefined) { + throw new runtime.RequiredError('user','Required parameter requestParameters.user was null or undefined when calling updateUser.'); } const queryParameters: runtime.HTTPQuery = {}; @@ -304,7 +304,7 @@ export class UserApi extends runtime.BaseAPI { method: 'PUT', headers: headerParameters, query: queryParameters, - body: UserToJSON(requestParameters.body), + body: UserToJSON(requestParameters.user), }); return new runtime.VoidApiResponse(response); diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/models/InlineObject.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/models/InlineObject.ts new file mode 100644 index 000000000000..2998b1463ce5 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/models/InlineObject.ts @@ -0,0 +1,52 @@ +// tslint:disable +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface InlineObject + */ +export interface InlineObject { + /** + * Updated name of the pet + * @type {string} + * @memberof InlineObject + */ + name?: string; + /** + * Updated status of the pet + * @type {string} + * @memberof InlineObject + */ + status?: string; +} + +export function InlineObjectFromJSON(json: any): InlineObject { + return { + 'name': !exists(json, 'name') ? undefined : json['name'], + 'status': !exists(json, 'status') ? undefined : json['status'], + }; +} + +export function InlineObjectToJSON(value?: InlineObject): any { + if (value === undefined) { + return undefined; + } + return { + 'name': value.name, + 'status': value.status, + }; +} + + diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/models/InlineObject1.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/models/InlineObject1.ts new file mode 100644 index 000000000000..4cd90b137959 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/models/InlineObject1.ts @@ -0,0 +1,52 @@ +// tslint:disable +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface InlineObject1 + */ +export interface InlineObject1 { + /** + * Additional data to pass to server + * @type {string} + * @memberof InlineObject1 + */ + additionalMetadata?: string; + /** + * file to upload + * @type {Blob} + * @memberof InlineObject1 + */ + file?: Blob; +} + +export function InlineObject1FromJSON(json: any): InlineObject1 { + return { + 'additionalMetadata': !exists(json, 'additionalMetadata') ? undefined : json['additionalMetadata'], + 'file': !exists(json, 'file') ? undefined : json['file'], + }; +} + +export function InlineObject1ToJSON(value?: InlineObject1): any { + if (value === undefined) { + return undefined; + } + return { + 'additionalMetadata': value.additionalMetadata, + 'file': value.file, + }; +} + + diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/models/index.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/models/index.ts index b07ddc8446a0..5eefa748f29f 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/models/index.ts +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/models/index.ts @@ -1,4 +1,6 @@ export * from './Category'; +export * from './InlineObject'; +export * from './InlineObject1'; export * from './ModelApiResponse'; export * from './Order'; export * from './Pet'; diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/PetApi.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/PetApi.ts index e43896cc2929..04ce6e771879 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/PetApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/PetApi.ts @@ -23,7 +23,7 @@ import { } from '../models'; export interface AddPetRequest { - body: Pet; + pet: Pet; } export interface DeletePetRequest { @@ -37,6 +37,7 @@ export interface FindPetsByStatusRequest { export interface FindPetsByTagsRequest { tags: Array; + maxCount?: number; } export interface GetPetByIdRequest { @@ -44,7 +45,7 @@ export interface GetPetByIdRequest { } export interface UpdatePetRequest { - body: Pet; + pet: Pet; } export interface UpdatePetWithFormRequest { @@ -68,8 +69,8 @@ export class PetApi extends runtime.BaseAPI { * Add a new pet to the store */ async addPetRaw(requestParameters: AddPetRequest): Promise> { - if (requestParameters.body === null || requestParameters.body === undefined) { - throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling addPet.'); + if (requestParameters.pet === null || requestParameters.pet === undefined) { + throw new runtime.RequiredError('pet','Required parameter requestParameters.pet was null or undefined when calling addPet.'); } const queryParameters: runtime.HTTPQuery = {}; @@ -92,7 +93,7 @@ export class PetApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: PetToJSON(requestParameters.body), + body: PetToJSON(requestParameters.pet), }); return new runtime.VoidApiResponse(response); @@ -167,7 +168,7 @@ export class PetApi extends runtime.BaseAPI { if (this.configuration && this.configuration.accessToken) { // oauth required if (typeof this.configuration.accessToken === 'function') { - headerParameters["Authorization"] = this.configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]); + headerParameters["Authorization"] = this.configuration.accessToken("petstore_auth", ["read:pets"]); } else { headerParameters["Authorization"] = this.configuration.accessToken; } @@ -207,12 +208,16 @@ export class PetApi extends runtime.BaseAPI { queryParameters['tags'] = requestParameters.tags.join(runtime.COLLECTION_FORMATS["csv"]); } + if (requestParameters.maxCount !== undefined) { + queryParameters['maxCount'] = requestParameters.maxCount; + } + const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.accessToken) { // oauth required if (typeof this.configuration.accessToken === 'function') { - headerParameters["Authorization"] = this.configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]); + headerParameters["Authorization"] = this.configuration.accessToken("petstore_auth", ["read:pets"]); } else { headerParameters["Authorization"] = this.configuration.accessToken; } @@ -277,8 +282,8 @@ export class PetApi extends runtime.BaseAPI { * Update an existing pet */ async updatePetRaw(requestParameters: UpdatePetRequest): Promise> { - if (requestParameters.body === null || requestParameters.body === undefined) { - throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling updatePet.'); + if (requestParameters.pet === null || requestParameters.pet === undefined) { + throw new runtime.RequiredError('pet','Required parameter requestParameters.pet was null or undefined when calling updatePet.'); } const queryParameters: runtime.HTTPQuery = {}; @@ -301,7 +306,7 @@ export class PetApi extends runtime.BaseAPI { method: 'PUT', headers: headerParameters, query: queryParameters, - body: PetToJSON(requestParameters.body), + body: PetToJSON(requestParameters.pet), }); return new runtime.VoidApiResponse(response); diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/StoreApi.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/StoreApi.ts index 916660981657..a8db149fec26 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/StoreApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/StoreApi.ts @@ -28,7 +28,7 @@ export interface GetOrderByIdRequest { } export interface PlaceOrderRequest { - body: Order; + order: Order; } /** @@ -135,8 +135,8 @@ export class StoreApi extends runtime.BaseAPI { * Place an order for a pet */ async placeOrderRaw(requestParameters: PlaceOrderRequest): Promise> { - if (requestParameters.body === null || requestParameters.body === undefined) { - throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling placeOrder.'); + if (requestParameters.order === null || requestParameters.order === undefined) { + throw new runtime.RequiredError('order','Required parameter requestParameters.order was null or undefined when calling placeOrder.'); } const queryParameters: runtime.HTTPQuery = {}; @@ -150,7 +150,7 @@ export class StoreApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: OrderToJSON(requestParameters.body), + body: OrderToJSON(requestParameters.order), }); return new runtime.JSONApiResponse(response, (jsonValue) => OrderFromJSON(jsonValue)); diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/UserApi.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/UserApi.ts index 1696b600f57f..63659380995e 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/UserApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/UserApi.ts @@ -20,15 +20,15 @@ import { } from '../models'; export interface CreateUserRequest { - body: User; + user: User; } export interface CreateUsersWithArrayInputRequest { - body: Array; + user: Array; } export interface CreateUsersWithListInputRequest { - body: Array; + user: Array; } export interface DeleteUserRequest { @@ -46,7 +46,7 @@ export interface LoginUserRequest { export interface UpdateUserRequest { username: string; - body: User; + user: User; } /** @@ -59,8 +59,8 @@ export class UserApi extends runtime.BaseAPI { * Create user */ async createUserRaw(requestParameters: CreateUserRequest): Promise> { - if (requestParameters.body === null || requestParameters.body === undefined) { - throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling createUser.'); + if (requestParameters.user === null || requestParameters.user === undefined) { + throw new runtime.RequiredError('user','Required parameter requestParameters.user was null or undefined when calling createUser.'); } const queryParameters: runtime.HTTPQuery = {}; @@ -74,7 +74,7 @@ export class UserApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: UserToJSON(requestParameters.body), + body: UserToJSON(requestParameters.user), }); return new runtime.VoidApiResponse(response); @@ -92,8 +92,8 @@ export class UserApi extends runtime.BaseAPI { * Creates list of users with given input array */ async createUsersWithArrayInputRaw(requestParameters: CreateUsersWithArrayInputRequest): Promise> { - if (requestParameters.body === null || requestParameters.body === undefined) { - throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling createUsersWithArrayInput.'); + if (requestParameters.user === null || requestParameters.user === undefined) { + throw new runtime.RequiredError('user','Required parameter requestParameters.user was null or undefined when calling createUsersWithArrayInput.'); } const queryParameters: runtime.HTTPQuery = {}; @@ -107,7 +107,7 @@ export class UserApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: requestParameters.body.map(UserToJSON), + body: requestParameters.user.map(UserToJSON), }); return new runtime.VoidApiResponse(response); @@ -124,8 +124,8 @@ export class UserApi extends runtime.BaseAPI { * Creates list of users with given input array */ async createUsersWithListInputRaw(requestParameters: CreateUsersWithListInputRequest): Promise> { - if (requestParameters.body === null || requestParameters.body === undefined) { - throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling createUsersWithListInput.'); + if (requestParameters.user === null || requestParameters.user === undefined) { + throw new runtime.RequiredError('user','Required parameter requestParameters.user was null or undefined when calling createUsersWithListInput.'); } const queryParameters: runtime.HTTPQuery = {}; @@ -139,7 +139,7 @@ export class UserApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: requestParameters.body.map(UserToJSON), + body: requestParameters.user.map(UserToJSON), }); return new runtime.VoidApiResponse(response); @@ -289,8 +289,8 @@ export class UserApi extends runtime.BaseAPI { throw new runtime.RequiredError('username','Required parameter requestParameters.username was null or undefined when calling updateUser.'); } - if (requestParameters.body === null || requestParameters.body === undefined) { - throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling updateUser.'); + if (requestParameters.user === null || requestParameters.user === undefined) { + throw new runtime.RequiredError('user','Required parameter requestParameters.user was null or undefined when calling updateUser.'); } const queryParameters: runtime.HTTPQuery = {}; @@ -304,7 +304,7 @@ export class UserApi extends runtime.BaseAPI { method: 'PUT', headers: headerParameters, query: queryParameters, - body: UserToJSON(requestParameters.body), + body: UserToJSON(requestParameters.user), }); return new runtime.VoidApiResponse(response); diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/InlineObject.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/InlineObject.ts new file mode 100644 index 000000000000..2998b1463ce5 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/InlineObject.ts @@ -0,0 +1,52 @@ +// tslint:disable +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface InlineObject + */ +export interface InlineObject { + /** + * Updated name of the pet + * @type {string} + * @memberof InlineObject + */ + name?: string; + /** + * Updated status of the pet + * @type {string} + * @memberof InlineObject + */ + status?: string; +} + +export function InlineObjectFromJSON(json: any): InlineObject { + return { + 'name': !exists(json, 'name') ? undefined : json['name'], + 'status': !exists(json, 'status') ? undefined : json['status'], + }; +} + +export function InlineObjectToJSON(value?: InlineObject): any { + if (value === undefined) { + return undefined; + } + return { + 'name': value.name, + 'status': value.status, + }; +} + + diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/InlineObject1.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/InlineObject1.ts new file mode 100644 index 000000000000..4cd90b137959 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/InlineObject1.ts @@ -0,0 +1,52 @@ +// tslint:disable +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface InlineObject1 + */ +export interface InlineObject1 { + /** + * Additional data to pass to server + * @type {string} + * @memberof InlineObject1 + */ + additionalMetadata?: string; + /** + * file to upload + * @type {Blob} + * @memberof InlineObject1 + */ + file?: Blob; +} + +export function InlineObject1FromJSON(json: any): InlineObject1 { + return { + 'additionalMetadata': !exists(json, 'additionalMetadata') ? undefined : json['additionalMetadata'], + 'file': !exists(json, 'file') ? undefined : json['file'], + }; +} + +export function InlineObject1ToJSON(value?: InlineObject1): any { + if (value === undefined) { + return undefined; + } + return { + 'additionalMetadata': value.additionalMetadata, + 'file': value.file, + }; +} + + diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/index.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/index.ts index b07ddc8446a0..5eefa748f29f 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/index.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/index.ts @@ -1,4 +1,6 @@ export * from './Category'; +export * from './InlineObject'; +export * from './InlineObject1'; export * from './ModelApiResponse'; export * from './Order'; export * from './Pet'; diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/apis/PetApi.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/apis/PetApi.ts index e43896cc2929..04ce6e771879 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/apis/PetApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/apis/PetApi.ts @@ -23,7 +23,7 @@ import { } from '../models'; export interface AddPetRequest { - body: Pet; + pet: Pet; } export interface DeletePetRequest { @@ -37,6 +37,7 @@ export interface FindPetsByStatusRequest { export interface FindPetsByTagsRequest { tags: Array; + maxCount?: number; } export interface GetPetByIdRequest { @@ -44,7 +45,7 @@ export interface GetPetByIdRequest { } export interface UpdatePetRequest { - body: Pet; + pet: Pet; } export interface UpdatePetWithFormRequest { @@ -68,8 +69,8 @@ export class PetApi extends runtime.BaseAPI { * Add a new pet to the store */ async addPetRaw(requestParameters: AddPetRequest): Promise> { - if (requestParameters.body === null || requestParameters.body === undefined) { - throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling addPet.'); + if (requestParameters.pet === null || requestParameters.pet === undefined) { + throw new runtime.RequiredError('pet','Required parameter requestParameters.pet was null or undefined when calling addPet.'); } const queryParameters: runtime.HTTPQuery = {}; @@ -92,7 +93,7 @@ export class PetApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: PetToJSON(requestParameters.body), + body: PetToJSON(requestParameters.pet), }); return new runtime.VoidApiResponse(response); @@ -167,7 +168,7 @@ export class PetApi extends runtime.BaseAPI { if (this.configuration && this.configuration.accessToken) { // oauth required if (typeof this.configuration.accessToken === 'function') { - headerParameters["Authorization"] = this.configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]); + headerParameters["Authorization"] = this.configuration.accessToken("petstore_auth", ["read:pets"]); } else { headerParameters["Authorization"] = this.configuration.accessToken; } @@ -207,12 +208,16 @@ export class PetApi extends runtime.BaseAPI { queryParameters['tags'] = requestParameters.tags.join(runtime.COLLECTION_FORMATS["csv"]); } + if (requestParameters.maxCount !== undefined) { + queryParameters['maxCount'] = requestParameters.maxCount; + } + const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.accessToken) { // oauth required if (typeof this.configuration.accessToken === 'function') { - headerParameters["Authorization"] = this.configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]); + headerParameters["Authorization"] = this.configuration.accessToken("petstore_auth", ["read:pets"]); } else { headerParameters["Authorization"] = this.configuration.accessToken; } @@ -277,8 +282,8 @@ export class PetApi extends runtime.BaseAPI { * Update an existing pet */ async updatePetRaw(requestParameters: UpdatePetRequest): Promise> { - if (requestParameters.body === null || requestParameters.body === undefined) { - throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling updatePet.'); + if (requestParameters.pet === null || requestParameters.pet === undefined) { + throw new runtime.RequiredError('pet','Required parameter requestParameters.pet was null or undefined when calling updatePet.'); } const queryParameters: runtime.HTTPQuery = {}; @@ -301,7 +306,7 @@ export class PetApi extends runtime.BaseAPI { method: 'PUT', headers: headerParameters, query: queryParameters, - body: PetToJSON(requestParameters.body), + body: PetToJSON(requestParameters.pet), }); return new runtime.VoidApiResponse(response); diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/apis/StoreApi.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/apis/StoreApi.ts index 916660981657..a8db149fec26 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/apis/StoreApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/apis/StoreApi.ts @@ -28,7 +28,7 @@ export interface GetOrderByIdRequest { } export interface PlaceOrderRequest { - body: Order; + order: Order; } /** @@ -135,8 +135,8 @@ export class StoreApi extends runtime.BaseAPI { * Place an order for a pet */ async placeOrderRaw(requestParameters: PlaceOrderRequest): Promise> { - if (requestParameters.body === null || requestParameters.body === undefined) { - throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling placeOrder.'); + if (requestParameters.order === null || requestParameters.order === undefined) { + throw new runtime.RequiredError('order','Required parameter requestParameters.order was null or undefined when calling placeOrder.'); } const queryParameters: runtime.HTTPQuery = {}; @@ -150,7 +150,7 @@ export class StoreApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: OrderToJSON(requestParameters.body), + body: OrderToJSON(requestParameters.order), }); return new runtime.JSONApiResponse(response, (jsonValue) => OrderFromJSON(jsonValue)); diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/apis/UserApi.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/apis/UserApi.ts index 1696b600f57f..63659380995e 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/apis/UserApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/apis/UserApi.ts @@ -20,15 +20,15 @@ import { } from '../models'; export interface CreateUserRequest { - body: User; + user: User; } export interface CreateUsersWithArrayInputRequest { - body: Array; + user: Array; } export interface CreateUsersWithListInputRequest { - body: Array; + user: Array; } export interface DeleteUserRequest { @@ -46,7 +46,7 @@ export interface LoginUserRequest { export interface UpdateUserRequest { username: string; - body: User; + user: User; } /** @@ -59,8 +59,8 @@ export class UserApi extends runtime.BaseAPI { * Create user */ async createUserRaw(requestParameters: CreateUserRequest): Promise> { - if (requestParameters.body === null || requestParameters.body === undefined) { - throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling createUser.'); + if (requestParameters.user === null || requestParameters.user === undefined) { + throw new runtime.RequiredError('user','Required parameter requestParameters.user was null or undefined when calling createUser.'); } const queryParameters: runtime.HTTPQuery = {}; @@ -74,7 +74,7 @@ export class UserApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: UserToJSON(requestParameters.body), + body: UserToJSON(requestParameters.user), }); return new runtime.VoidApiResponse(response); @@ -92,8 +92,8 @@ export class UserApi extends runtime.BaseAPI { * Creates list of users with given input array */ async createUsersWithArrayInputRaw(requestParameters: CreateUsersWithArrayInputRequest): Promise> { - if (requestParameters.body === null || requestParameters.body === undefined) { - throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling createUsersWithArrayInput.'); + if (requestParameters.user === null || requestParameters.user === undefined) { + throw new runtime.RequiredError('user','Required parameter requestParameters.user was null or undefined when calling createUsersWithArrayInput.'); } const queryParameters: runtime.HTTPQuery = {}; @@ -107,7 +107,7 @@ export class UserApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: requestParameters.body.map(UserToJSON), + body: requestParameters.user.map(UserToJSON), }); return new runtime.VoidApiResponse(response); @@ -124,8 +124,8 @@ export class UserApi extends runtime.BaseAPI { * Creates list of users with given input array */ async createUsersWithListInputRaw(requestParameters: CreateUsersWithListInputRequest): Promise> { - if (requestParameters.body === null || requestParameters.body === undefined) { - throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling createUsersWithListInput.'); + if (requestParameters.user === null || requestParameters.user === undefined) { + throw new runtime.RequiredError('user','Required parameter requestParameters.user was null or undefined when calling createUsersWithListInput.'); } const queryParameters: runtime.HTTPQuery = {}; @@ -139,7 +139,7 @@ export class UserApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: requestParameters.body.map(UserToJSON), + body: requestParameters.user.map(UserToJSON), }); return new runtime.VoidApiResponse(response); @@ -289,8 +289,8 @@ export class UserApi extends runtime.BaseAPI { throw new runtime.RequiredError('username','Required parameter requestParameters.username was null or undefined when calling updateUser.'); } - if (requestParameters.body === null || requestParameters.body === undefined) { - throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling updateUser.'); + if (requestParameters.user === null || requestParameters.user === undefined) { + throw new runtime.RequiredError('user','Required parameter requestParameters.user was null or undefined when calling updateUser.'); } const queryParameters: runtime.HTTPQuery = {}; @@ -304,7 +304,7 @@ export class UserApi extends runtime.BaseAPI { method: 'PUT', headers: headerParameters, query: queryParameters, - body: UserToJSON(requestParameters.body), + body: UserToJSON(requestParameters.user), }); return new runtime.VoidApiResponse(response); diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/models/InlineObject.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/models/InlineObject.ts new file mode 100644 index 000000000000..2998b1463ce5 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/models/InlineObject.ts @@ -0,0 +1,52 @@ +// tslint:disable +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface InlineObject + */ +export interface InlineObject { + /** + * Updated name of the pet + * @type {string} + * @memberof InlineObject + */ + name?: string; + /** + * Updated status of the pet + * @type {string} + * @memberof InlineObject + */ + status?: string; +} + +export function InlineObjectFromJSON(json: any): InlineObject { + return { + 'name': !exists(json, 'name') ? undefined : json['name'], + 'status': !exists(json, 'status') ? undefined : json['status'], + }; +} + +export function InlineObjectToJSON(value?: InlineObject): any { + if (value === undefined) { + return undefined; + } + return { + 'name': value.name, + 'status': value.status, + }; +} + + diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/models/InlineObject1.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/models/InlineObject1.ts new file mode 100644 index 000000000000..4cd90b137959 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/models/InlineObject1.ts @@ -0,0 +1,52 @@ +// tslint:disable +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface InlineObject1 + */ +export interface InlineObject1 { + /** + * Additional data to pass to server + * @type {string} + * @memberof InlineObject1 + */ + additionalMetadata?: string; + /** + * file to upload + * @type {Blob} + * @memberof InlineObject1 + */ + file?: Blob; +} + +export function InlineObject1FromJSON(json: any): InlineObject1 { + return { + 'additionalMetadata': !exists(json, 'additionalMetadata') ? undefined : json['additionalMetadata'], + 'file': !exists(json, 'file') ? undefined : json['file'], + }; +} + +export function InlineObject1ToJSON(value?: InlineObject1): any { + if (value === undefined) { + return undefined; + } + return { + 'additionalMetadata': value.additionalMetadata, + 'file': value.file, + }; +} + + diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/models/index.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/models/index.ts index b07ddc8446a0..5eefa748f29f 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/models/index.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/models/index.ts @@ -1,4 +1,6 @@ export * from './Category'; +export * from './InlineObject'; +export * from './InlineObject1'; export * from './ModelApiResponse'; export * from './Order'; export * from './Pet'; diff --git a/samples/client/petstore/typescript-inversify/api/pet.service.ts b/samples/client/petstore/typescript-inversify/api/pet.service.ts index 06dbd62cdf39..21445abc7322 100644 --- a/samples/client/petstore/typescript-inversify/api/pet.service.ts +++ b/samples/client/petstore/typescript-inversify/api/pet.service.ts @@ -40,14 +40,14 @@ export class PetService { /** * Add a new pet to the store * - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store */ - public addPet(body: Pet, observe?: 'body', headers?: Headers): Observable; - public addPet(body: Pet, observe?: 'response', headers?: Headers): Observable>; - public addPet(body: Pet, observe: any = 'body', headers: Headers = {}): Observable { - if (!body){ - throw new Error('Required parameter body was null or undefined when calling addPet.'); + public addPet(pet: Pet, observe?: 'body', headers?: Headers): Observable; + public addPet(pet: Pet, observe?: 'response', headers?: Headers): Observable>; + public addPet(pet: Pet, observe: any = 'body', headers: Headers = {}): Observable { + if (!pet){ + throw new Error('Required parameter pet was null or undefined when calling addPet.'); } // authentication (petstore_auth) required @@ -60,7 +60,7 @@ export class PetService { headers['Accept'] = 'application/json'; headers['Content-Type'] = 'application/json'; - const response: Observable> = this.httpClient.post(`${this.basePath}/pet`, body , headers); + const response: Observable> = this.httpClient.post(`${this.basePath}/pet`, pet , headers); if (observe == 'body') { return response.pipe( map(httpResponse => (httpResponse.response)) @@ -148,11 +148,12 @@ export class PetService { * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by + * @param maxCount Maximum number of items to return */ - public findPetsByTags(tags: Array, observe?: 'body', headers?: Headers): Observable>; - public findPetsByTags(tags: Array, observe?: 'response', headers?: Headers): Observable>>; - public findPetsByTags(tags: Array, observe: any = 'body', headers: Headers = {}): Observable { + public findPetsByTags(tags: Array, maxCount?: number, observe?: 'body', headers?: Headers): Observable>; + public findPetsByTags(tags: Array, maxCount?: number, observe?: 'response', headers?: Headers): Observable>>; + public findPetsByTags(tags: Array, maxCount?: number, observe: any = 'body', headers: Headers = {}): Observable { if (!tags){ throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); } @@ -161,6 +162,9 @@ export class PetService { if (tags) { queryParameters.push("tags="+encodeURIComponent(tags.join(COLLECTION_FORMATS['csv']))); } + if (maxCount !== undefined) { + queryParameters.push("maxCount="+encodeURIComponent(String(maxCount))); + } // authentication (petstore_auth) required if (this.APIConfiguration.accessToken) { @@ -213,14 +217,14 @@ export class PetService { /** * Update an existing pet * - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store */ - public updatePet(body: Pet, observe?: 'body', headers?: Headers): Observable; - public updatePet(body: Pet, observe?: 'response', headers?: Headers): Observable>; - public updatePet(body: Pet, observe: any = 'body', headers: Headers = {}): Observable { - if (!body){ - throw new Error('Required parameter body was null or undefined when calling updatePet.'); + public updatePet(pet: Pet, observe?: 'body', headers?: Headers): Observable; + public updatePet(pet: Pet, observe?: 'response', headers?: Headers): Observable>; + public updatePet(pet: Pet, observe: any = 'body', headers: Headers = {}): Observable { + if (!pet){ + throw new Error('Required parameter pet was null or undefined when calling updatePet.'); } // authentication (petstore_auth) required @@ -233,7 +237,7 @@ export class PetService { headers['Accept'] = 'application/json'; headers['Content-Type'] = 'application/json'; - const response: Observable> = this.httpClient.put(`${this.basePath}/pet`, body , headers); + const response: Observable> = this.httpClient.put(`${this.basePath}/pet`, pet , headers); if (observe == 'body') { return response.pipe( map(httpResponse => (httpResponse.response)) diff --git a/samples/client/petstore/typescript-inversify/api/store.service.ts b/samples/client/petstore/typescript-inversify/api/store.service.ts index 778e00e5c3ae..88463db97b7a 100644 --- a/samples/client/petstore/typescript-inversify/api/store.service.ts +++ b/samples/client/petstore/typescript-inversify/api/store.service.ts @@ -113,20 +113,20 @@ export class StoreService { /** * Place an order for a pet * - * @param body order placed for purchasing the pet + * @param order order placed for purchasing the pet */ - public placeOrder(body: Order, observe?: 'body', headers?: Headers): Observable; - public placeOrder(body: Order, observe?: 'response', headers?: Headers): Observable>; - public placeOrder(body: Order, observe: any = 'body', headers: Headers = {}): Observable { - if (!body){ - throw new Error('Required parameter body was null or undefined when calling placeOrder.'); + public placeOrder(order: Order, observe?: 'body', headers?: Headers): Observable; + public placeOrder(order: Order, observe?: 'response', headers?: Headers): Observable>; + public placeOrder(order: Order, observe: any = 'body', headers: Headers = {}): Observable { + if (!order){ + throw new Error('Required parameter order was null or undefined when calling placeOrder.'); } headers['Accept'] = 'application/xml'; headers['Content-Type'] = 'application/json'; - const response: Observable> = this.httpClient.post(`${this.basePath}/store/order`, body , headers); + const response: Observable> = this.httpClient.post(`${this.basePath}/store/order`, order , headers); if (observe == 'body') { return response.pipe( map(httpResponse => (httpResponse.response)) diff --git a/samples/client/petstore/typescript-inversify/api/user.service.ts b/samples/client/petstore/typescript-inversify/api/user.service.ts index f2e8b83c4ab6..9f1b52689abc 100644 --- a/samples/client/petstore/typescript-inversify/api/user.service.ts +++ b/samples/client/petstore/typescript-inversify/api/user.service.ts @@ -39,20 +39,21 @@ export class UserService { /** * Create user * This can only be done by the logged in user. - * @param body Created user object + * @param user Created user object */ - public createUser(body: User, observe?: 'body', headers?: Headers): Observable; - public createUser(body: User, observe?: 'response', headers?: Headers): Observable>; - public createUser(body: User, observe: any = 'body', headers: Headers = {}): Observable { - if (!body){ - throw new Error('Required parameter body was null or undefined when calling createUser.'); + public createUser(user: User, observe?: 'body', headers?: Headers): Observable; + public createUser(user: User, observe?: 'response', headers?: Headers): Observable>; + public createUser(user: User, observe: any = 'body', headers: Headers = {}): Observable { + if (!user){ + throw new Error('Required parameter user was null or undefined when calling createUser.'); } + // authentication (auth_cookie) required headers['Accept'] = 'application/json'; headers['Content-Type'] = 'application/json'; - const response: Observable> = this.httpClient.post(`${this.basePath}/user`, body , headers); + const response: Observable> = this.httpClient.post(`${this.basePath}/user`, user , headers); if (observe == 'body') { return response.pipe( map(httpResponse => (httpResponse.response)) @@ -65,20 +66,21 @@ export class UserService { /** * Creates list of users with given input array * - * @param body List of user object + * @param user List of user object */ - public createUsersWithArrayInput(body: Array, observe?: 'body', headers?: Headers): Observable; - public createUsersWithArrayInput(body: Array, observe?: 'response', headers?: Headers): Observable>; - public createUsersWithArrayInput(body: Array, observe: any = 'body', headers: Headers = {}): Observable { - if (!body){ - throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.'); + public createUsersWithArrayInput(user: Array, observe?: 'body', headers?: Headers): Observable; + public createUsersWithArrayInput(user: Array, observe?: 'response', headers?: Headers): Observable>; + public createUsersWithArrayInput(user: Array, observe: any = 'body', headers: Headers = {}): Observable { + if (!user){ + throw new Error('Required parameter user was null or undefined when calling createUsersWithArrayInput.'); } + // authentication (auth_cookie) required headers['Accept'] = 'application/json'; headers['Content-Type'] = 'application/json'; - const response: Observable> = this.httpClient.post(`${this.basePath}/user/createWithArray`, body , headers); + const response: Observable> = this.httpClient.post(`${this.basePath}/user/createWithArray`, user , headers); if (observe == 'body') { return response.pipe( map(httpResponse => (httpResponse.response)) @@ -91,20 +93,21 @@ export class UserService { /** * Creates list of users with given input array * - * @param body List of user object + * @param user List of user object */ - public createUsersWithListInput(body: Array, observe?: 'body', headers?: Headers): Observable; - public createUsersWithListInput(body: Array, observe?: 'response', headers?: Headers): Observable>; - public createUsersWithListInput(body: Array, observe: any = 'body', headers: Headers = {}): Observable { - if (!body){ - throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.'); + public createUsersWithListInput(user: Array, observe?: 'body', headers?: Headers): Observable; + public createUsersWithListInput(user: Array, observe?: 'response', headers?: Headers): Observable>; + public createUsersWithListInput(user: Array, observe: any = 'body', headers: Headers = {}): Observable { + if (!user){ + throw new Error('Required parameter user was null or undefined when calling createUsersWithListInput.'); } + // authentication (auth_cookie) required headers['Accept'] = 'application/json'; headers['Content-Type'] = 'application/json'; - const response: Observable> = this.httpClient.post(`${this.basePath}/user/createWithList`, body , headers); + const response: Observable> = this.httpClient.post(`${this.basePath}/user/createWithList`, user , headers); if (observe == 'body') { return response.pipe( map(httpResponse => (httpResponse.response)) @@ -127,6 +130,7 @@ export class UserService { throw new Error('Required parameter username was null or undefined when calling deleteUser.'); } + // authentication (auth_cookie) required headers['Accept'] = 'application/json'; const response: Observable> = this.httpClient.delete(`${this.basePath}/user/${encodeURIComponent(String(username))}`, headers); @@ -210,6 +214,7 @@ export class UserService { public logoutUser(observe?: 'body', headers?: Headers): Observable; public logoutUser(observe?: 'response', headers?: Headers): Observable>; public logoutUser(observe: any = 'body', headers: Headers = {}): Observable { + // authentication (auth_cookie) required headers['Accept'] = 'application/json'; const response: Observable> = this.httpClient.get(`${this.basePath}/user/logout`, headers); @@ -226,24 +231,25 @@ export class UserService { * Updated user * This can only be done by the logged in user. * @param username name that need to be deleted - * @param body Updated user object + * @param user Updated user object */ - public updateUser(username: string, body: User, observe?: 'body', headers?: Headers): Observable; - public updateUser(username: string, body: User, observe?: 'response', headers?: Headers): Observable>; - public updateUser(username: string, body: User, observe: any = 'body', headers: Headers = {}): Observable { + public updateUser(username: string, user: User, observe?: 'body', headers?: Headers): Observable; + public updateUser(username: string, user: User, observe?: 'response', headers?: Headers): Observable>; + public updateUser(username: string, user: User, observe: any = 'body', headers: Headers = {}): Observable { if (!username){ throw new Error('Required parameter username was null or undefined when calling updateUser.'); } - if (!body){ - throw new Error('Required parameter body was null or undefined when calling updateUser.'); + if (!user){ + throw new Error('Required parameter user was null or undefined when calling updateUser.'); } + // authentication (auth_cookie) required headers['Accept'] = 'application/json'; headers['Content-Type'] = 'application/json'; - const response: Observable> = this.httpClient.put(`${this.basePath}/user/${encodeURIComponent(String(username))}`, body , headers); + const response: Observable> = this.httpClient.put(`${this.basePath}/user/${encodeURIComponent(String(username))}`, user , headers); if (observe == 'body') { return response.pipe( map(httpResponse => (httpResponse.response)) diff --git a/samples/client/petstore/typescript-inversify/model/inlineObject.ts b/samples/client/petstore/typescript-inversify/model/inlineObject.ts index 7ebc2ff49162..0b51164ddb6e 100644 --- a/samples/client/petstore/typescript-inversify/model/inlineObject.ts +++ b/samples/client/petstore/typescript-inversify/model/inlineObject.ts @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/typescript-inversify/model/inlineObject1.ts b/samples/client/petstore/typescript-inversify/model/inlineObject1.ts index 3f35ccedd9be..de83a67ccc31 100644 --- a/samples/client/petstore/typescript-inversify/model/inlineObject1.ts +++ b/samples/client/petstore/typescript-inversify/model/inlineObject1.ts @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/typescript-jquery/default/api/PetApi.ts b/samples/client/petstore/typescript-jquery/default/api/PetApi.ts index 7da20e6acdbd..4ef8355c4c08 100644 --- a/samples/client/petstore/typescript-jquery/default/api/PetApi.ts +++ b/samples/client/petstore/typescript-jquery/default/api/PetApi.ts @@ -49,9 +49,9 @@ export class PetApi { /** * * @summary Add a new pet to the store - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store */ - public addPet(body: models.Pet, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< + public addPet(pet: models.Pet, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< { response: JQueryXHR; body?: any; }, { response: JQueryXHR; errorThrown: string } > { @@ -59,9 +59,9 @@ export class PetApi { let queryParameters: any = {}; let headerParams: any = {}; - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling addPet.'); + // verify required parameter 'pet' is not null or undefined + if (pet === null || pet === undefined) { + throw new Error('Required parameter pet was null or undefined when calling addPet.'); } @@ -95,7 +95,7 @@ export class PetApi { processData: false }; - requestOptions.data = JSON.stringify(body); + requestOptions.data = JSON.stringify(pet); if (headerParams['Content-Type']) { requestOptions.contentType = headerParams['Content-Type']; } @@ -273,8 +273,9 @@ export class PetApi { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @summary Finds Pets by tags * @param tags Tags to filter by + * @param maxCount Maximum number of items to return */ - public findPetsByTags(tags: Array, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< + public findPetsByTags(tags: Array, maxCount?: number, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< { response: JQueryXHR; body: Array; }, { response: JQueryXHR; errorThrown: string } > { @@ -290,6 +291,9 @@ export class PetApi { if (tags) { queryParameters['tags'] = tags.join(COLLECTION_FORMATS['csv']); } + if (maxCount !== null && maxCount !== undefined) { + queryParameters['maxCount'] = maxCount; + } localVarPath = localVarPath + "?" + $.param(queryParameters); // to determine the Content-Type header @@ -415,9 +419,9 @@ export class PetApi { /** * * @summary Update an existing pet - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store */ - public updatePet(body: models.Pet, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< + public updatePet(pet: models.Pet, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< { response: JQueryXHR; body?: any; }, { response: JQueryXHR; errorThrown: string } > { @@ -425,9 +429,9 @@ export class PetApi { let queryParameters: any = {}; let headerParams: any = {}; - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling updatePet.'); + // verify required parameter 'pet' is not null or undefined + if (pet === null || pet === undefined) { + throw new Error('Required parameter pet was null or undefined when calling updatePet.'); } @@ -461,7 +465,7 @@ export class PetApi { processData: false }; - requestOptions.data = JSON.stringify(body); + requestOptions.data = JSON.stringify(pet); if (headerParams['Content-Type']) { requestOptions.contentType = headerParams['Content-Type']; } diff --git a/samples/client/petstore/typescript-jquery/default/api/StoreApi.ts b/samples/client/petstore/typescript-jquery/default/api/StoreApi.ts index d1c0a00432a8..4fa7f6b201c6 100644 --- a/samples/client/petstore/typescript-jquery/default/api/StoreApi.ts +++ b/samples/client/petstore/typescript-jquery/default/api/StoreApi.ts @@ -234,9 +234,9 @@ export class StoreApi { /** * * @summary Place an order for a pet - * @param body order placed for purchasing the pet + * @param order order placed for purchasing the pet */ - public placeOrder(body: models.Order, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< + public placeOrder(order: models.Order, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< { response: JQueryXHR; body: models.Order; }, { response: JQueryXHR; errorThrown: string } > { @@ -244,15 +244,16 @@ export class StoreApi { let queryParameters: any = {}; let headerParams: any = {}; - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling placeOrder.'); + // verify required parameter 'order' is not null or undefined + if (order === null || order === undefined) { + throw new Error('Required parameter order was null or undefined when calling placeOrder.'); } localVarPath = localVarPath + "?" + $.param(queryParameters); // to determine the Content-Type header let consumes: string[] = [ + 'application/json' ]; // to determine the Accept header @@ -271,7 +272,7 @@ export class StoreApi { processData: false }; - requestOptions.data = JSON.stringify(body); + requestOptions.data = JSON.stringify(order); if (headerParams['Content-Type']) { requestOptions.contentType = headerParams['Content-Type']; } diff --git a/samples/client/petstore/typescript-jquery/default/api/UserApi.ts b/samples/client/petstore/typescript-jquery/default/api/UserApi.ts index bbe42be94b40..a63e23e3274d 100644 --- a/samples/client/petstore/typescript-jquery/default/api/UserApi.ts +++ b/samples/client/petstore/typescript-jquery/default/api/UserApi.ts @@ -49,9 +49,9 @@ export class UserApi { /** * This can only be done by the logged in user. * @summary Create user - * @param body Created user object + * @param user Created user object */ - public createUser(body: models.User, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< + public createUser(user: models.User, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< { response: JQueryXHR; body?: any; }, { response: JQueryXHR; errorThrown: string } > { @@ -59,21 +59,23 @@ export class UserApi { let queryParameters: any = {}; let headerParams: any = {}; - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling createUser.'); + // verify required parameter 'user' is not null or undefined + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling createUser.'); } localVarPath = localVarPath + "?" + $.param(queryParameters); // to determine the Content-Type header let consumes: string[] = [ + 'application/json' ]; // to determine the Accept header let produces: string[] = [ ]; + // authentication (auth_cookie) required headerParams['Content-Type'] = 'application/json'; @@ -84,7 +86,7 @@ export class UserApi { processData: false }; - requestOptions.data = JSON.stringify(body); + requestOptions.data = JSON.stringify(user); if (headerParams['Content-Type']) { requestOptions.contentType = headerParams['Content-Type']; } @@ -113,9 +115,9 @@ export class UserApi { /** * * @summary Creates list of users with given input array - * @param body List of user object + * @param modelsUser List of user object */ - public createUsersWithArrayInput(body: Array, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< + public createUsersWithArrayInput(modelsUser: Array, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< { response: JQueryXHR; body?: any; }, { response: JQueryXHR; errorThrown: string } > { @@ -123,21 +125,23 @@ export class UserApi { let queryParameters: any = {}; let headerParams: any = {}; - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.'); + // verify required parameter 'modelsUser' is not null or undefined + if (modelsUser === null || modelsUser === undefined) { + throw new Error('Required parameter modelsUser was null or undefined when calling createUsersWithArrayInput.'); } localVarPath = localVarPath + "?" + $.param(queryParameters); // to determine the Content-Type header let consumes: string[] = [ + 'application/json' ]; // to determine the Accept header let produces: string[] = [ ]; + // authentication (auth_cookie) required headerParams['Content-Type'] = 'application/json'; @@ -148,7 +152,7 @@ export class UserApi { processData: false }; - requestOptions.data = JSON.stringify(body); + requestOptions.data = JSON.stringify(modelsUser); if (headerParams['Content-Type']) { requestOptions.contentType = headerParams['Content-Type']; } @@ -177,9 +181,9 @@ export class UserApi { /** * * @summary Creates list of users with given input array - * @param body List of user object + * @param modelsUser List of user object */ - public createUsersWithListInput(body: Array, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< + public createUsersWithListInput(modelsUser: Array, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< { response: JQueryXHR; body?: any; }, { response: JQueryXHR; errorThrown: string } > { @@ -187,21 +191,23 @@ export class UserApi { let queryParameters: any = {}; let headerParams: any = {}; - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.'); + // verify required parameter 'modelsUser' is not null or undefined + if (modelsUser === null || modelsUser === undefined) { + throw new Error('Required parameter modelsUser was null or undefined when calling createUsersWithListInput.'); } localVarPath = localVarPath + "?" + $.param(queryParameters); // to determine the Content-Type header let consumes: string[] = [ + 'application/json' ]; // to determine the Accept header let produces: string[] = [ ]; + // authentication (auth_cookie) required headerParams['Content-Type'] = 'application/json'; @@ -212,7 +218,7 @@ export class UserApi { processData: false }; - requestOptions.data = JSON.stringify(body); + requestOptions.data = JSON.stringify(modelsUser); if (headerParams['Content-Type']) { requestOptions.contentType = headerParams['Content-Type']; } @@ -266,6 +272,7 @@ export class UserApi { let produces: string[] = [ ]; + // authentication (auth_cookie) required let requestOptions: JQueryAjaxSettings = { url: localVarPath, @@ -459,6 +466,7 @@ export class UserApi { let produces: string[] = [ ]; + // authentication (auth_cookie) required let requestOptions: JQueryAjaxSettings = { url: localVarPath, @@ -496,9 +504,9 @@ export class UserApi { * This can only be done by the logged in user. * @summary Updated user * @param username name that need to be deleted - * @param body Updated user object + * @param user Updated user object */ - public updateUser(username: string, body: models.User, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< + public updateUser(username: string, user: models.User, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< { response: JQueryXHR; body?: any; }, { response: JQueryXHR; errorThrown: string } > { @@ -511,21 +519,23 @@ export class UserApi { throw new Error('Required parameter username was null or undefined when calling updateUser.'); } - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling updateUser.'); + // verify required parameter 'user' is not null or undefined + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling updateUser.'); } localVarPath = localVarPath + "?" + $.param(queryParameters); // to determine the Content-Type header let consumes: string[] = [ + 'application/json' ]; // to determine the Accept header let produces: string[] = [ ]; + // authentication (auth_cookie) required headerParams['Content-Type'] = 'application/json'; @@ -536,7 +546,7 @@ export class UserApi { processData: false }; - requestOptions.data = JSON.stringify(body); + requestOptions.data = JSON.stringify(user); if (headerParams['Content-Type']) { requestOptions.contentType = headerParams['Content-Type']; } diff --git a/samples/client/petstore/typescript-jquery/default/model/InlineObject.ts b/samples/client/petstore/typescript-jquery/default/model/InlineObject.ts new file mode 100644 index 000000000000..2a20a92f781a --- /dev/null +++ b/samples/client/petstore/typescript-jquery/default/model/InlineObject.ts @@ -0,0 +1,26 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import * as models from './models'; + +export interface InlineObject { + /** + * Updated name of the pet + */ + name?: string; + + /** + * Updated status of the pet + */ + status?: string; + +} diff --git a/samples/client/petstore/typescript-jquery/default/model/InlineObject1.ts b/samples/client/petstore/typescript-jquery/default/model/InlineObject1.ts new file mode 100644 index 000000000000..fde4955e71bf --- /dev/null +++ b/samples/client/petstore/typescript-jquery/default/model/InlineObject1.ts @@ -0,0 +1,26 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import * as models from './models'; + +export interface InlineObject1 { + /** + * Additional data to pass to server + */ + additionalMetadata?: string; + + /** + * file to upload + */ + file?: any; + +} diff --git a/samples/client/petstore/typescript-jquery/default/model/models.ts b/samples/client/petstore/typescript-jquery/default/model/models.ts index f53c1dd42bdd..7f39cae301b7 100644 --- a/samples/client/petstore/typescript-jquery/default/model/models.ts +++ b/samples/client/petstore/typescript-jquery/default/model/models.ts @@ -1,5 +1,7 @@ export * from './ApiResponse'; export * from './Category'; +export * from './InlineObject'; +export * from './InlineObject1'; export * from './Order'; export * from './Pet'; export * from './Tag'; diff --git a/samples/client/petstore/typescript-jquery/npm/api/PetApi.ts b/samples/client/petstore/typescript-jquery/npm/api/PetApi.ts index 7da20e6acdbd..4ef8355c4c08 100644 --- a/samples/client/petstore/typescript-jquery/npm/api/PetApi.ts +++ b/samples/client/petstore/typescript-jquery/npm/api/PetApi.ts @@ -49,9 +49,9 @@ export class PetApi { /** * * @summary Add a new pet to the store - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store */ - public addPet(body: models.Pet, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< + public addPet(pet: models.Pet, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< { response: JQueryXHR; body?: any; }, { response: JQueryXHR; errorThrown: string } > { @@ -59,9 +59,9 @@ export class PetApi { let queryParameters: any = {}; let headerParams: any = {}; - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling addPet.'); + // verify required parameter 'pet' is not null or undefined + if (pet === null || pet === undefined) { + throw new Error('Required parameter pet was null or undefined when calling addPet.'); } @@ -95,7 +95,7 @@ export class PetApi { processData: false }; - requestOptions.data = JSON.stringify(body); + requestOptions.data = JSON.stringify(pet); if (headerParams['Content-Type']) { requestOptions.contentType = headerParams['Content-Type']; } @@ -273,8 +273,9 @@ export class PetApi { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @summary Finds Pets by tags * @param tags Tags to filter by + * @param maxCount Maximum number of items to return */ - public findPetsByTags(tags: Array, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< + public findPetsByTags(tags: Array, maxCount?: number, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< { response: JQueryXHR; body: Array; }, { response: JQueryXHR; errorThrown: string } > { @@ -290,6 +291,9 @@ export class PetApi { if (tags) { queryParameters['tags'] = tags.join(COLLECTION_FORMATS['csv']); } + if (maxCount !== null && maxCount !== undefined) { + queryParameters['maxCount'] = maxCount; + } localVarPath = localVarPath + "?" + $.param(queryParameters); // to determine the Content-Type header @@ -415,9 +419,9 @@ export class PetApi { /** * * @summary Update an existing pet - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store */ - public updatePet(body: models.Pet, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< + public updatePet(pet: models.Pet, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< { response: JQueryXHR; body?: any; }, { response: JQueryXHR; errorThrown: string } > { @@ -425,9 +429,9 @@ export class PetApi { let queryParameters: any = {}; let headerParams: any = {}; - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling updatePet.'); + // verify required parameter 'pet' is not null or undefined + if (pet === null || pet === undefined) { + throw new Error('Required parameter pet was null or undefined when calling updatePet.'); } @@ -461,7 +465,7 @@ export class PetApi { processData: false }; - requestOptions.data = JSON.stringify(body); + requestOptions.data = JSON.stringify(pet); if (headerParams['Content-Type']) { requestOptions.contentType = headerParams['Content-Type']; } diff --git a/samples/client/petstore/typescript-jquery/npm/api/StoreApi.ts b/samples/client/petstore/typescript-jquery/npm/api/StoreApi.ts index d1c0a00432a8..4fa7f6b201c6 100644 --- a/samples/client/petstore/typescript-jquery/npm/api/StoreApi.ts +++ b/samples/client/petstore/typescript-jquery/npm/api/StoreApi.ts @@ -234,9 +234,9 @@ export class StoreApi { /** * * @summary Place an order for a pet - * @param body order placed for purchasing the pet + * @param order order placed for purchasing the pet */ - public placeOrder(body: models.Order, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< + public placeOrder(order: models.Order, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< { response: JQueryXHR; body: models.Order; }, { response: JQueryXHR; errorThrown: string } > { @@ -244,15 +244,16 @@ export class StoreApi { let queryParameters: any = {}; let headerParams: any = {}; - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling placeOrder.'); + // verify required parameter 'order' is not null or undefined + if (order === null || order === undefined) { + throw new Error('Required parameter order was null or undefined when calling placeOrder.'); } localVarPath = localVarPath + "?" + $.param(queryParameters); // to determine the Content-Type header let consumes: string[] = [ + 'application/json' ]; // to determine the Accept header @@ -271,7 +272,7 @@ export class StoreApi { processData: false }; - requestOptions.data = JSON.stringify(body); + requestOptions.data = JSON.stringify(order); if (headerParams['Content-Type']) { requestOptions.contentType = headerParams['Content-Type']; } diff --git a/samples/client/petstore/typescript-jquery/npm/api/UserApi.ts b/samples/client/petstore/typescript-jquery/npm/api/UserApi.ts index bbe42be94b40..a63e23e3274d 100644 --- a/samples/client/petstore/typescript-jquery/npm/api/UserApi.ts +++ b/samples/client/petstore/typescript-jquery/npm/api/UserApi.ts @@ -49,9 +49,9 @@ export class UserApi { /** * This can only be done by the logged in user. * @summary Create user - * @param body Created user object + * @param user Created user object */ - public createUser(body: models.User, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< + public createUser(user: models.User, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< { response: JQueryXHR; body?: any; }, { response: JQueryXHR; errorThrown: string } > { @@ -59,21 +59,23 @@ export class UserApi { let queryParameters: any = {}; let headerParams: any = {}; - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling createUser.'); + // verify required parameter 'user' is not null or undefined + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling createUser.'); } localVarPath = localVarPath + "?" + $.param(queryParameters); // to determine the Content-Type header let consumes: string[] = [ + 'application/json' ]; // to determine the Accept header let produces: string[] = [ ]; + // authentication (auth_cookie) required headerParams['Content-Type'] = 'application/json'; @@ -84,7 +86,7 @@ export class UserApi { processData: false }; - requestOptions.data = JSON.stringify(body); + requestOptions.data = JSON.stringify(user); if (headerParams['Content-Type']) { requestOptions.contentType = headerParams['Content-Type']; } @@ -113,9 +115,9 @@ export class UserApi { /** * * @summary Creates list of users with given input array - * @param body List of user object + * @param modelsUser List of user object */ - public createUsersWithArrayInput(body: Array, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< + public createUsersWithArrayInput(modelsUser: Array, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< { response: JQueryXHR; body?: any; }, { response: JQueryXHR; errorThrown: string } > { @@ -123,21 +125,23 @@ export class UserApi { let queryParameters: any = {}; let headerParams: any = {}; - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.'); + // verify required parameter 'modelsUser' is not null or undefined + if (modelsUser === null || modelsUser === undefined) { + throw new Error('Required parameter modelsUser was null or undefined when calling createUsersWithArrayInput.'); } localVarPath = localVarPath + "?" + $.param(queryParameters); // to determine the Content-Type header let consumes: string[] = [ + 'application/json' ]; // to determine the Accept header let produces: string[] = [ ]; + // authentication (auth_cookie) required headerParams['Content-Type'] = 'application/json'; @@ -148,7 +152,7 @@ export class UserApi { processData: false }; - requestOptions.data = JSON.stringify(body); + requestOptions.data = JSON.stringify(modelsUser); if (headerParams['Content-Type']) { requestOptions.contentType = headerParams['Content-Type']; } @@ -177,9 +181,9 @@ export class UserApi { /** * * @summary Creates list of users with given input array - * @param body List of user object + * @param modelsUser List of user object */ - public createUsersWithListInput(body: Array, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< + public createUsersWithListInput(modelsUser: Array, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< { response: JQueryXHR; body?: any; }, { response: JQueryXHR; errorThrown: string } > { @@ -187,21 +191,23 @@ export class UserApi { let queryParameters: any = {}; let headerParams: any = {}; - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.'); + // verify required parameter 'modelsUser' is not null or undefined + if (modelsUser === null || modelsUser === undefined) { + throw new Error('Required parameter modelsUser was null or undefined when calling createUsersWithListInput.'); } localVarPath = localVarPath + "?" + $.param(queryParameters); // to determine the Content-Type header let consumes: string[] = [ + 'application/json' ]; // to determine the Accept header let produces: string[] = [ ]; + // authentication (auth_cookie) required headerParams['Content-Type'] = 'application/json'; @@ -212,7 +218,7 @@ export class UserApi { processData: false }; - requestOptions.data = JSON.stringify(body); + requestOptions.data = JSON.stringify(modelsUser); if (headerParams['Content-Type']) { requestOptions.contentType = headerParams['Content-Type']; } @@ -266,6 +272,7 @@ export class UserApi { let produces: string[] = [ ]; + // authentication (auth_cookie) required let requestOptions: JQueryAjaxSettings = { url: localVarPath, @@ -459,6 +466,7 @@ export class UserApi { let produces: string[] = [ ]; + // authentication (auth_cookie) required let requestOptions: JQueryAjaxSettings = { url: localVarPath, @@ -496,9 +504,9 @@ export class UserApi { * This can only be done by the logged in user. * @summary Updated user * @param username name that need to be deleted - * @param body Updated user object + * @param user Updated user object */ - public updateUser(username: string, body: models.User, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< + public updateUser(username: string, user: models.User, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< { response: JQueryXHR; body?: any; }, { response: JQueryXHR; errorThrown: string } > { @@ -511,21 +519,23 @@ export class UserApi { throw new Error('Required parameter username was null or undefined when calling updateUser.'); } - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling updateUser.'); + // verify required parameter 'user' is not null or undefined + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling updateUser.'); } localVarPath = localVarPath + "?" + $.param(queryParameters); // to determine the Content-Type header let consumes: string[] = [ + 'application/json' ]; // to determine the Accept header let produces: string[] = [ ]; + // authentication (auth_cookie) required headerParams['Content-Type'] = 'application/json'; @@ -536,7 +546,7 @@ export class UserApi { processData: false }; - requestOptions.data = JSON.stringify(body); + requestOptions.data = JSON.stringify(user); if (headerParams['Content-Type']) { requestOptions.contentType = headerParams['Content-Type']; } diff --git a/samples/client/petstore/typescript-jquery/npm/model/InlineObject.ts b/samples/client/petstore/typescript-jquery/npm/model/InlineObject.ts new file mode 100644 index 000000000000..2a20a92f781a --- /dev/null +++ b/samples/client/petstore/typescript-jquery/npm/model/InlineObject.ts @@ -0,0 +1,26 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import * as models from './models'; + +export interface InlineObject { + /** + * Updated name of the pet + */ + name?: string; + + /** + * Updated status of the pet + */ + status?: string; + +} diff --git a/samples/client/petstore/typescript-jquery/npm/model/InlineObject1.ts b/samples/client/petstore/typescript-jquery/npm/model/InlineObject1.ts new file mode 100644 index 000000000000..fde4955e71bf --- /dev/null +++ b/samples/client/petstore/typescript-jquery/npm/model/InlineObject1.ts @@ -0,0 +1,26 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import * as models from './models'; + +export interface InlineObject1 { + /** + * Additional data to pass to server + */ + additionalMetadata?: string; + + /** + * file to upload + */ + file?: any; + +} diff --git a/samples/client/petstore/typescript-jquery/npm/model/models.ts b/samples/client/petstore/typescript-jquery/npm/model/models.ts index f53c1dd42bdd..7f39cae301b7 100644 --- a/samples/client/petstore/typescript-jquery/npm/model/models.ts +++ b/samples/client/petstore/typescript-jquery/npm/model/models.ts @@ -1,5 +1,7 @@ export * from './ApiResponse'; export * from './Category'; +export * from './InlineObject'; +export * from './InlineObject1'; export * from './Order'; export * from './Pet'; export * from './Tag'; diff --git a/samples/client/petstore/typescript-node/default/api/petApi.ts b/samples/client/petstore/typescript-node/default/api/petApi.ts index 2566d2b93533..0f691f2e8a86 100644 --- a/samples/client/petstore/typescript-node/default/api/petApi.ts +++ b/samples/client/petstore/typescript-node/default/api/petApi.ts @@ -82,17 +82,17 @@ export class PetApi { /** * * @summary Add a new pet to the store - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store */ - public async addPet (body: Pet, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body?: any; }> { + public async addPet (pet: Pet, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body?: any; }> { const localVarPath = this.basePath + '/pet'; let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); let localVarFormParams: any = {}; - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling addPet.'); + // verify required parameter 'pet' is not null or undefined + if (pet === null || pet === undefined) { + throw new Error('Required parameter pet was null or undefined when calling addPet.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -106,7 +106,7 @@ export class PetApi { uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(body, "Pet") + body: ObjectSerializer.serialize(pet, "Pet") }; let authenticationPromise = Promise.resolve(); @@ -260,8 +260,9 @@ export class PetApi { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @summary Finds Pets by tags * @param tags Tags to filter by + * @param maxCount Maximum number of items to return */ - public async findPetsByTags (tags: Array, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: Array; }> { + public async findPetsByTags (tags: Array, maxCount?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: Array; }> { const localVarPath = this.basePath + '/pet/findByTags'; let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); @@ -276,6 +277,10 @@ export class PetApi { localVarQueryParameters['tags'] = ObjectSerializer.serialize(tags, "Array"); } + if (maxCount !== undefined) { + localVarQueryParameters['maxCount'] = ObjectSerializer.serialize(maxCount, "number"); + } + (Object).assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; @@ -378,17 +383,17 @@ export class PetApi { /** * * @summary Update an existing pet - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store */ - public async updatePet (body: Pet, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body?: any; }> { + public async updatePet (pet: Pet, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body?: any; }> { const localVarPath = this.basePath + '/pet'; let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); let localVarFormParams: any = {}; - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling updatePet.'); + // verify required parameter 'pet' is not null or undefined + if (pet === null || pet === undefined) { + throw new Error('Required parameter pet was null or undefined when calling updatePet.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -402,7 +407,7 @@ export class PetApi { uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(body, "Pet") + body: ObjectSerializer.serialize(pet, "Pet") }; let authenticationPromise = Promise.resolve(); diff --git a/samples/client/petstore/typescript-node/default/api/storeApi.ts b/samples/client/petstore/typescript-node/default/api/storeApi.ts index cf3b545a3d04..ec8c4cc6fc13 100644 --- a/samples/client/petstore/typescript-node/default/api/storeApi.ts +++ b/samples/client/petstore/typescript-node/default/api/storeApi.ts @@ -237,17 +237,17 @@ export class StoreApi { /** * * @summary Place an order for a pet - * @param body order placed for purchasing the pet + * @param order order placed for purchasing the pet */ - public async placeOrder (body: Order, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: Order; }> { + public async placeOrder (order: Order, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: Order; }> { const localVarPath = this.basePath + '/store/order'; let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); let localVarFormParams: any = {}; - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling placeOrder.'); + // verify required parameter 'order' is not null or undefined + if (order === null || order === undefined) { + throw new Error('Required parameter order was null or undefined when calling placeOrder.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -261,7 +261,7 @@ export class StoreApi { uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(body, "Order") + body: ObjectSerializer.serialize(order, "Order") }; let authenticationPromise = Promise.resolve(); diff --git a/samples/client/petstore/typescript-node/default/api/userApi.ts b/samples/client/petstore/typescript-node/default/api/userApi.ts index 374daf1f1bdf..78fb21d23414 100644 --- a/samples/client/petstore/typescript-node/default/api/userApi.ts +++ b/samples/client/petstore/typescript-node/default/api/userApi.ts @@ -17,6 +17,7 @@ import http = require('http'); import { User } from '../model/user'; import { ObjectSerializer, Authentication, VoidAuth } from '../model/models'; +import { ApiKeyAuth } from '../model/models'; let defaultBasePath = 'http://petstore.swagger.io/v2'; @@ -25,6 +26,7 @@ let defaultBasePath = 'http://petstore.swagger.io/v2'; // =============================================== export enum UserApiApiKeys { + auth_cookie, } export class UserApi { @@ -34,6 +36,7 @@ export class UserApi { protected authentications = { 'default': new VoidAuth(), + 'auth_cookie': new ApiKeyAuth('query', 'AUTH_KEY'), } constructor(basePath?: string); @@ -72,17 +75,17 @@ export class UserApi { /** * This can only be done by the logged in user. * @summary Create user - * @param body Created user object + * @param user Created user object */ - public async createUser (body: User, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body?: any; }> { + public async createUser (user: User, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body?: any; }> { const localVarPath = this.basePath + '/user'; let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); let localVarFormParams: any = {}; - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling createUser.'); + // verify required parameter 'user' is not null or undefined + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling createUser.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -96,10 +99,12 @@ export class UserApi { uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(body, "User") + body: ObjectSerializer.serialize(user, "User") }; let authenticationPromise = Promise.resolve(); + authenticationPromise = authenticationPromise.then(() => this.authentications.auth_cookie.applyToRequest(localVarRequestOptions)); + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); return authenticationPromise.then(() => { if (Object.keys(localVarFormParams).length) { @@ -127,17 +132,17 @@ export class UserApi { /** * * @summary Creates list of users with given input array - * @param body List of user object + * @param user List of user object */ - public async createUsersWithArrayInput (body: Array, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body?: any; }> { + public async createUsersWithArrayInput (user: Array, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body?: any; }> { const localVarPath = this.basePath + '/user/createWithArray'; let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); let localVarFormParams: any = {}; - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.'); + // verify required parameter 'user' is not null or undefined + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling createUsersWithArrayInput.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -151,10 +156,12 @@ export class UserApi { uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(body, "Array") + body: ObjectSerializer.serialize(user, "Array") }; let authenticationPromise = Promise.resolve(); + authenticationPromise = authenticationPromise.then(() => this.authentications.auth_cookie.applyToRequest(localVarRequestOptions)); + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); return authenticationPromise.then(() => { if (Object.keys(localVarFormParams).length) { @@ -182,17 +189,17 @@ export class UserApi { /** * * @summary Creates list of users with given input array - * @param body List of user object + * @param user List of user object */ - public async createUsersWithListInput (body: Array, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body?: any; }> { + public async createUsersWithListInput (user: Array, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body?: any; }> { const localVarPath = this.basePath + '/user/createWithList'; let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); let localVarFormParams: any = {}; - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.'); + // verify required parameter 'user' is not null or undefined + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling createUsersWithListInput.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -206,10 +213,12 @@ export class UserApi { uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(body, "Array") + body: ObjectSerializer.serialize(user, "Array") }; let authenticationPromise = Promise.resolve(); + authenticationPromise = authenticationPromise.then(() => this.authentications.auth_cookie.applyToRequest(localVarRequestOptions)); + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); return authenticationPromise.then(() => { if (Object.keys(localVarFormParams).length) { @@ -265,6 +274,8 @@ export class UserApi { }; let authenticationPromise = Promise.resolve(); + authenticationPromise = authenticationPromise.then(() => this.authentications.auth_cookie.applyToRequest(localVarRequestOptions)); + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); return authenticationPromise.then(() => { if (Object.keys(localVarFormParams).length) { @@ -438,6 +449,8 @@ export class UserApi { }; let authenticationPromise = Promise.resolve(); + authenticationPromise = authenticationPromise.then(() => this.authentications.auth_cookie.applyToRequest(localVarRequestOptions)); + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); return authenticationPromise.then(() => { if (Object.keys(localVarFormParams).length) { @@ -466,9 +479,9 @@ export class UserApi { * This can only be done by the logged in user. * @summary Updated user * @param username name that need to be deleted - * @param body Updated user object + * @param user Updated user object */ - public async updateUser (username: string, body: User, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body?: any; }> { + public async updateUser (username: string, user: User, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body?: any; }> { const localVarPath = this.basePath + '/user/{username}' .replace('{' + 'username' + '}', encodeURIComponent(String(username))); let localVarQueryParameters: any = {}; @@ -480,9 +493,9 @@ export class UserApi { throw new Error('Required parameter username was null or undefined when calling updateUser.'); } - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling updateUser.'); + // verify required parameter 'user' is not null or undefined + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling updateUser.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -496,10 +509,12 @@ export class UserApi { uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(body, "User") + body: ObjectSerializer.serialize(user, "User") }; let authenticationPromise = Promise.resolve(); + authenticationPromise = authenticationPromise.then(() => this.authentications.auth_cookie.applyToRequest(localVarRequestOptions)); + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); return authenticationPromise.then(() => { if (Object.keys(localVarFormParams).length) { diff --git a/samples/client/petstore/typescript-node/default/model/inlineObject.ts b/samples/client/petstore/typescript-node/default/model/inlineObject.ts index ceaabe7df489..b9396dae34fa 100644 --- a/samples/client/petstore/typescript-node/default/model/inlineObject.ts +++ b/samples/client/petstore/typescript-node/default/model/inlineObject.ts @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/typescript-node/default/model/inlineObject1.ts b/samples/client/petstore/typescript-node/default/model/inlineObject1.ts index b3e23fb84381..a9c57cdab63e 100644 --- a/samples/client/petstore/typescript-node/default/model/inlineObject1.ts +++ b/samples/client/petstore/typescript-node/default/model/inlineObject1.ts @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/typescript-node/default/model/models.ts b/samples/client/petstore/typescript-node/default/model/models.ts index 73d5122442a0..1e062be3d279 100644 --- a/samples/client/petstore/typescript-node/default/model/models.ts +++ b/samples/client/petstore/typescript-node/default/model/models.ts @@ -1,5 +1,7 @@ export * from './apiResponse'; export * from './category'; +export * from './inlineObject'; +export * from './inlineObject1'; export * from './order'; export * from './pet'; export * from './tag'; @@ -9,6 +11,8 @@ import localVarRequest = require('request'); import { ApiResponse } from './apiResponse'; import { Category } from './category'; +import { InlineObject } from './inlineObject'; +import { InlineObject1 } from './inlineObject1'; import { Order } from './order'; import { Pet } from './pet'; import { Tag } from './tag'; @@ -34,6 +38,8 @@ let enumsMap: {[index: string]: any} = { let typeMap: {[index: string]: any} = { "ApiResponse": ApiResponse, "Category": Category, + "InlineObject": InlineObject, + "InlineObject1": InlineObject1, "Order": Order, "Pet": Pet, "Tag": Tag, diff --git a/samples/client/petstore/typescript-node/npm/api/petApi.ts b/samples/client/petstore/typescript-node/npm/api/petApi.ts index 2566d2b93533..0f691f2e8a86 100644 --- a/samples/client/petstore/typescript-node/npm/api/petApi.ts +++ b/samples/client/petstore/typescript-node/npm/api/petApi.ts @@ -82,17 +82,17 @@ export class PetApi { /** * * @summary Add a new pet to the store - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store */ - public async addPet (body: Pet, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body?: any; }> { + public async addPet (pet: Pet, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body?: any; }> { const localVarPath = this.basePath + '/pet'; let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); let localVarFormParams: any = {}; - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling addPet.'); + // verify required parameter 'pet' is not null or undefined + if (pet === null || pet === undefined) { + throw new Error('Required parameter pet was null or undefined when calling addPet.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -106,7 +106,7 @@ export class PetApi { uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(body, "Pet") + body: ObjectSerializer.serialize(pet, "Pet") }; let authenticationPromise = Promise.resolve(); @@ -260,8 +260,9 @@ export class PetApi { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @summary Finds Pets by tags * @param tags Tags to filter by + * @param maxCount Maximum number of items to return */ - public async findPetsByTags (tags: Array, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: Array; }> { + public async findPetsByTags (tags: Array, maxCount?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: Array; }> { const localVarPath = this.basePath + '/pet/findByTags'; let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); @@ -276,6 +277,10 @@ export class PetApi { localVarQueryParameters['tags'] = ObjectSerializer.serialize(tags, "Array"); } + if (maxCount !== undefined) { + localVarQueryParameters['maxCount'] = ObjectSerializer.serialize(maxCount, "number"); + } + (Object).assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; @@ -378,17 +383,17 @@ export class PetApi { /** * * @summary Update an existing pet - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store */ - public async updatePet (body: Pet, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body?: any; }> { + public async updatePet (pet: Pet, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body?: any; }> { const localVarPath = this.basePath + '/pet'; let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); let localVarFormParams: any = {}; - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling updatePet.'); + // verify required parameter 'pet' is not null or undefined + if (pet === null || pet === undefined) { + throw new Error('Required parameter pet was null or undefined when calling updatePet.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -402,7 +407,7 @@ export class PetApi { uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(body, "Pet") + body: ObjectSerializer.serialize(pet, "Pet") }; let authenticationPromise = Promise.resolve(); diff --git a/samples/client/petstore/typescript-node/npm/api/storeApi.ts b/samples/client/petstore/typescript-node/npm/api/storeApi.ts index cf3b545a3d04..ec8c4cc6fc13 100644 --- a/samples/client/petstore/typescript-node/npm/api/storeApi.ts +++ b/samples/client/petstore/typescript-node/npm/api/storeApi.ts @@ -237,17 +237,17 @@ export class StoreApi { /** * * @summary Place an order for a pet - * @param body order placed for purchasing the pet + * @param order order placed for purchasing the pet */ - public async placeOrder (body: Order, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: Order; }> { + public async placeOrder (order: Order, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: Order; }> { const localVarPath = this.basePath + '/store/order'; let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); let localVarFormParams: any = {}; - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling placeOrder.'); + // verify required parameter 'order' is not null or undefined + if (order === null || order === undefined) { + throw new Error('Required parameter order was null or undefined when calling placeOrder.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -261,7 +261,7 @@ export class StoreApi { uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(body, "Order") + body: ObjectSerializer.serialize(order, "Order") }; let authenticationPromise = Promise.resolve(); diff --git a/samples/client/petstore/typescript-node/npm/api/userApi.ts b/samples/client/petstore/typescript-node/npm/api/userApi.ts index 374daf1f1bdf..78fb21d23414 100644 --- a/samples/client/petstore/typescript-node/npm/api/userApi.ts +++ b/samples/client/petstore/typescript-node/npm/api/userApi.ts @@ -17,6 +17,7 @@ import http = require('http'); import { User } from '../model/user'; import { ObjectSerializer, Authentication, VoidAuth } from '../model/models'; +import { ApiKeyAuth } from '../model/models'; let defaultBasePath = 'http://petstore.swagger.io/v2'; @@ -25,6 +26,7 @@ let defaultBasePath = 'http://petstore.swagger.io/v2'; // =============================================== export enum UserApiApiKeys { + auth_cookie, } export class UserApi { @@ -34,6 +36,7 @@ export class UserApi { protected authentications = { 'default': new VoidAuth(), + 'auth_cookie': new ApiKeyAuth('query', 'AUTH_KEY'), } constructor(basePath?: string); @@ -72,17 +75,17 @@ export class UserApi { /** * This can only be done by the logged in user. * @summary Create user - * @param body Created user object + * @param user Created user object */ - public async createUser (body: User, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body?: any; }> { + public async createUser (user: User, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body?: any; }> { const localVarPath = this.basePath + '/user'; let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); let localVarFormParams: any = {}; - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling createUser.'); + // verify required parameter 'user' is not null or undefined + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling createUser.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -96,10 +99,12 @@ export class UserApi { uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(body, "User") + body: ObjectSerializer.serialize(user, "User") }; let authenticationPromise = Promise.resolve(); + authenticationPromise = authenticationPromise.then(() => this.authentications.auth_cookie.applyToRequest(localVarRequestOptions)); + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); return authenticationPromise.then(() => { if (Object.keys(localVarFormParams).length) { @@ -127,17 +132,17 @@ export class UserApi { /** * * @summary Creates list of users with given input array - * @param body List of user object + * @param user List of user object */ - public async createUsersWithArrayInput (body: Array, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body?: any; }> { + public async createUsersWithArrayInput (user: Array, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body?: any; }> { const localVarPath = this.basePath + '/user/createWithArray'; let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); let localVarFormParams: any = {}; - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.'); + // verify required parameter 'user' is not null or undefined + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling createUsersWithArrayInput.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -151,10 +156,12 @@ export class UserApi { uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(body, "Array") + body: ObjectSerializer.serialize(user, "Array") }; let authenticationPromise = Promise.resolve(); + authenticationPromise = authenticationPromise.then(() => this.authentications.auth_cookie.applyToRequest(localVarRequestOptions)); + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); return authenticationPromise.then(() => { if (Object.keys(localVarFormParams).length) { @@ -182,17 +189,17 @@ export class UserApi { /** * * @summary Creates list of users with given input array - * @param body List of user object + * @param user List of user object */ - public async createUsersWithListInput (body: Array, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body?: any; }> { + public async createUsersWithListInput (user: Array, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body?: any; }> { const localVarPath = this.basePath + '/user/createWithList'; let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); let localVarFormParams: any = {}; - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.'); + // verify required parameter 'user' is not null or undefined + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling createUsersWithListInput.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -206,10 +213,12 @@ export class UserApi { uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(body, "Array") + body: ObjectSerializer.serialize(user, "Array") }; let authenticationPromise = Promise.resolve(); + authenticationPromise = authenticationPromise.then(() => this.authentications.auth_cookie.applyToRequest(localVarRequestOptions)); + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); return authenticationPromise.then(() => { if (Object.keys(localVarFormParams).length) { @@ -265,6 +274,8 @@ export class UserApi { }; let authenticationPromise = Promise.resolve(); + authenticationPromise = authenticationPromise.then(() => this.authentications.auth_cookie.applyToRequest(localVarRequestOptions)); + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); return authenticationPromise.then(() => { if (Object.keys(localVarFormParams).length) { @@ -438,6 +449,8 @@ export class UserApi { }; let authenticationPromise = Promise.resolve(); + authenticationPromise = authenticationPromise.then(() => this.authentications.auth_cookie.applyToRequest(localVarRequestOptions)); + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); return authenticationPromise.then(() => { if (Object.keys(localVarFormParams).length) { @@ -466,9 +479,9 @@ export class UserApi { * This can only be done by the logged in user. * @summary Updated user * @param username name that need to be deleted - * @param body Updated user object + * @param user Updated user object */ - public async updateUser (username: string, body: User, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body?: any; }> { + public async updateUser (username: string, user: User, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body?: any; }> { const localVarPath = this.basePath + '/user/{username}' .replace('{' + 'username' + '}', encodeURIComponent(String(username))); let localVarQueryParameters: any = {}; @@ -480,9 +493,9 @@ export class UserApi { throw new Error('Required parameter username was null or undefined when calling updateUser.'); } - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling updateUser.'); + // verify required parameter 'user' is not null or undefined + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling updateUser.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -496,10 +509,12 @@ export class UserApi { uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(body, "User") + body: ObjectSerializer.serialize(user, "User") }; let authenticationPromise = Promise.resolve(); + authenticationPromise = authenticationPromise.then(() => this.authentications.auth_cookie.applyToRequest(localVarRequestOptions)); + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); return authenticationPromise.then(() => { if (Object.keys(localVarFormParams).length) { diff --git a/samples/client/petstore/typescript-node/npm/model/inlineObject.ts b/samples/client/petstore/typescript-node/npm/model/inlineObject.ts new file mode 100644 index 000000000000..b9396dae34fa --- /dev/null +++ b/samples/client/petstore/typescript-node/npm/model/inlineObject.ts @@ -0,0 +1,42 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export class InlineObject { + /** + * Updated name of the pet + */ + 'name'?: string; + /** + * Updated status of the pet + */ + 'status'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "name", + "baseName": "name", + "type": "string" + }, + { + "name": "status", + "baseName": "status", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return InlineObject.attributeTypeMap; + } +} + diff --git a/samples/client/petstore/typescript-node/npm/model/inlineObject1.ts b/samples/client/petstore/typescript-node/npm/model/inlineObject1.ts new file mode 100644 index 000000000000..a9c57cdab63e --- /dev/null +++ b/samples/client/petstore/typescript-node/npm/model/inlineObject1.ts @@ -0,0 +1,42 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export class InlineObject1 { + /** + * Additional data to pass to server + */ + 'additionalMetadata'?: string; + /** + * file to upload + */ + 'file'?: Buffer; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "additionalMetadata", + "baseName": "additionalMetadata", + "type": "string" + }, + { + "name": "file", + "baseName": "file", + "type": "Buffer" + } ]; + + static getAttributeTypeMap() { + return InlineObject1.attributeTypeMap; + } +} + diff --git a/samples/client/petstore/typescript-node/npm/model/models.ts b/samples/client/petstore/typescript-node/npm/model/models.ts index 73d5122442a0..1e062be3d279 100644 --- a/samples/client/petstore/typescript-node/npm/model/models.ts +++ b/samples/client/petstore/typescript-node/npm/model/models.ts @@ -1,5 +1,7 @@ export * from './apiResponse'; export * from './category'; +export * from './inlineObject'; +export * from './inlineObject1'; export * from './order'; export * from './pet'; export * from './tag'; @@ -9,6 +11,8 @@ import localVarRequest = require('request'); import { ApiResponse } from './apiResponse'; import { Category } from './category'; +import { InlineObject } from './inlineObject'; +import { InlineObject1 } from './inlineObject1'; import { Order } from './order'; import { Pet } from './pet'; import { Tag } from './tag'; @@ -34,6 +38,8 @@ let enumsMap: {[index: string]: any} = { let typeMap: {[index: string]: any} = { "ApiResponse": ApiResponse, "Category": Category, + "InlineObject": InlineObject, + "InlineObject1": InlineObject1, "Order": Order, "Pet": Pet, "Tag": Tag, diff --git a/samples/client/petstore/typescript-node/npm/package.json b/samples/client/petstore/typescript-node/npm/package.json index 0ff014f766ae..7215fa2b8f52 100644 --- a/samples/client/petstore/typescript-node/npm/package.json +++ b/samples/client/petstore/typescript-node/npm/package.json @@ -1,7 +1,7 @@ { - "name": "@openapitools/node-typescript-petstore", + "name": "@openapitools/angular2-typescript-petstore", "version": "0.0.1", - "description": "NodeJS client for @openapitools/node-typescript-petstore", + "description": "NodeJS client for @openapitools/angular2-typescript-petstore", "repository": "GIT_USER_ID/GIT_REPO_ID", "main": "dist/api.js", "types": "dist/api.d.ts", diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/APIHelper.swift index 75dea2439575..d94614b34fc7 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/APIHelper.swift @@ -7,7 +7,7 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { + public static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { let destination = source.reduce(into: [String: Any]()) { (result, item) in if let value = item.value { result[item.key] = value @@ -20,17 +20,17 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { + public static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { return source.reduce(into: [String: String]()) { (result, item) in if let collection = item.value as? Array { - result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") + result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } } } - public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { + public static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { guard let source = source else { return nil } @@ -52,7 +52,7 @@ public struct APIHelper { return source } - public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { + public static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in if let collection = item.value as? Array { let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") @@ -68,3 +68,4 @@ public struct APIHelper { return destination } } + diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/APIs.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/APIs.swift index e60b6154004e..88a72b1c672b 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/APIs.swift @@ -9,22 +9,22 @@ import Foundation open class TestClientAPI { public static var basePath = "http://api.example.com/basePath" public static var credential: URLCredential? - public static var customHeaders: [String: String] = [:] + public static var customHeaders: [String:String] = [:] public static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() } open class RequestBuilder { var credential: URLCredential? - var headers: [String: String] - public let parameters: [String: Any]? + var headers: [String:String] + public let parameters: [String:Any]? public let isBody: Bool public let method: String public let URLString: String /// Optional block to obtain a reference to the request's progress instance when available. - public var onProgressReady: ((Progress) -> Void)? + public var onProgressReady: ((Progress) -> ())? - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters @@ -34,7 +34,7 @@ open class RequestBuilder { addHeaders(TestClientAPI.customHeaders) } - open func addHeaders(_ aHeaders: [String: String]) { + open func addHeaders(_ aHeaders:[String:String]) { for (header, value) in aHeaders { headers[header] = value } @@ -57,5 +57,5 @@ open class RequestBuilder { public protocol RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/APIs/Swift4TestAPI.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/APIs/Swift4TestAPI.swift index a775c2aaaac2..a0b90ee6a879 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/APIs/Swift4TestAPI.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/APIs/Swift4TestAPI.swift @@ -8,6 +8,8 @@ import Foundation import Alamofire + + open class Swift4TestAPI { /** Get all of the models @@ -15,7 +17,7 @@ open class Swift4TestAPI { - parameter clientId: (query) id that represent the Api client - parameter completion: completion handler to receive the data and the error objects */ - open class func getAllModels(clientId: String, completion: @escaping ((_ data: GetAllModelsResult?, _ error: Error?) -> Void)) { + open class func getAllModels(clientId: String, completion: @escaping ((_ data: GetAllModelsResult?,_ error: Error?) -> Void)) { getAllModelsWithRequestBuilder(clientId: clientId).execute { (response, error) -> Void in completion(response?.body, error) } @@ -31,8 +33,8 @@ open class Swift4TestAPI { open class func getAllModelsWithRequestBuilder(clientId: String) -> RequestBuilder { let path = "/allModels" let URLString = TestClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "client_id": clientId diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/AlamofireImplementations.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/AlamofireImplementations.swift index 04ad02a5ce88..dac40e9a31cf 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/AlamofireImplementations.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/AlamofireImplementations.swift @@ -12,7 +12,7 @@ class AlamofireRequestBuilderFactory: RequestBuilderFactory { return AlamofireRequestBuilder.self } - func getBuilder() -> RequestBuilder.Type { + func getBuilder() -> RequestBuilder.Type { return AlamofireDecodableRequestBuilder.self } } @@ -50,7 +50,7 @@ private struct SynchronizedDictionary { private var managerStore = SynchronizedDictionary() open class AlamofireRequestBuilder: RequestBuilder { - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } @@ -88,17 +88,17 @@ open class AlamofireRequestBuilder: RequestBuilder { May be overridden by a subclass if you want to control the request configuration (e.g. to override the cache policy). */ - open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) -> DataRequest { + open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) -> DataRequest { return manager.request(URLString, method: method, parameters: parameters, encoding: encoding, headers: headers) } override open func execute(_ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { - let managerId: String = UUID().uuidString + let managerId:String = UUID().uuidString // Create a new manager for each request to customize its request header let manager = createSessionManager() managerStore[managerId] = manager - let encoding: ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() + let encoding:ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() let xMethod = Alamofire.HTTPMethod(rawValue: method) let fileKeys = parameters == nil ? [] : parameters!.filter { $1 is NSURL } @@ -111,7 +111,8 @@ open class AlamofireRequestBuilder: RequestBuilder { case let fileURL as URL: if let mimeType = self.contentTypeForFormPart(fileURL: fileURL) { mpForm.append(fileURL, withName: k, fileName: fileURL.lastPathComponent, mimeType: mimeType) - } else { + } + else { mpForm.append(fileURL, withName: k) } case let string as String: @@ -275,7 +276,7 @@ open class AlamofireRequestBuilder: RequestBuilder { return httpHeaders } - fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { + fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { guard let contentDisposition = contentDisposition else { return nil @@ -283,7 +284,7 @@ open class AlamofireRequestBuilder: RequestBuilder { let items = contentDisposition.components(separatedBy: ";") - var filename: String? = nil + var filename : String? = nil for contentItem in items { @@ -303,7 +304,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } - fileprivate func getPath(from url: URL) throws -> String { + fileprivate func getPath(from url : URL) throws -> String { guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { throw DownloadException.requestMissingPath @@ -317,7 +318,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } - fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { + fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { guard let url = urlRequest.url else { throw DownloadException.requestMissingURL @@ -328,7 +329,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } -private enum DownloadException: Error { +fileprivate enum DownloadException : Error { case responseDataMissing case responseFailed case requestMissing @@ -343,7 +344,7 @@ public enum AlamofireDecodableRequestBuilderError: Error { case generalError(Error) } -open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { +open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { override fileprivate func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { if let credential = self.credential { diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/CodableHelper.swift index 111d5a3a8cbe..584de8c3d57a 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/CodableHelper.swift @@ -13,7 +13,7 @@ open class CodableHelper { public static var dateformatter: DateFormatter? - open class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T: Decodable { + open class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T : Decodable { var returnedDecodable: T? = nil var returnedError: Error? = nil @@ -39,7 +39,7 @@ open class CodableHelper { return (returnedDecodable, returnedError) } - open class func encode(_ value: T, prettyPrint: Bool = false) -> EncodeResult where T: Encodable { + open class func encode(_ value: T, prettyPrint: Bool = false) -> EncodeResult where T : Encodable { var returnedData: Data? var returnedError: Error? = nil diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Configuration.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Configuration.swift index e1ecb39726e7..516590da5d9e 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Configuration.swift @@ -7,9 +7,9 @@ import Foundation open class Configuration { - + // This value is used to configure the date formatter that is used to serialize dates into JSON format. // You must set it prior to encoding any dates, and it will only be read once. public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} + +} \ No newline at end of file diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Extensions.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Extensions.swift index 24c128daadef..8bf1829ba806 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Extensions.swift @@ -112,24 +112,24 @@ extension String: CodingKey { extension KeyedEncodingContainerProtocol { - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { var arrayContainer = nestedUnkeyedContainer(forKey: key) try arrayContainer.encode(contentsOf: values) } - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { if let values = values { try encodeArray(values, forKey: key) } } - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { for (key, value) in pairs { try encode(value, forKey: key) } } - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { if let pairs = pairs { try encodeMap(pairs) } @@ -139,7 +139,7 @@ extension KeyedEncodingContainerProtocol { extension KeyedDecodingContainerProtocol { - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { var tmpArray = [T]() var nestedContainer = try nestedUnkeyedContainer(forKey: key) @@ -151,7 +151,7 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { var tmpArray: [T]? = nil if contains(key) { @@ -161,8 +161,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { - var map: [Self.Key: T] = [:] + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { + var map: [Self.Key : T] = [:] for key in allKeys { if !excludedKeys.contains(key) { @@ -175,3 +175,5 @@ extension KeyedDecodingContainerProtocol { } } + + diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/JSONEncodingHelper.swift index 3e68bb5d4a9b..70449515842d 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -10,7 +10,7 @@ import Alamofire open class JSONEncodingHelper { - open class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { + open class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { var params: Parameters? = nil // Encode the Encodable object @@ -39,5 +39,5 @@ open class JSONEncodingHelper { return params } - + } diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models.swift index e87ce399c7c8..408563890359 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models.swift @@ -10,7 +10,7 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -public enum ErrorResponse: Error { +public enum ErrorResponse : Error { case error(Int, Data?, Error) } diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/AllPrimitives.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/AllPrimitives.swift index 0087792f2062..3ce27fcd98f5 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/AllPrimitives.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/AllPrimitives.swift @@ -7,6 +7,7 @@ import Foundation + /** Object which contains lots of different primitive Swagger types */ public struct AllPrimitives: Codable { @@ -70,4 +71,6 @@ public struct AllPrimitives: Codable { self.myInlineStringEnum = myInlineStringEnum } + } + diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/BaseCard.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/BaseCard.swift index 51055d85739e..7e4bb2c0cd5a 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/BaseCard.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/BaseCard.swift @@ -7,6 +7,7 @@ import Foundation + /** This is a base card object which uses a 'cardType' discriminator. */ public struct BaseCard: Codable { @@ -17,4 +18,6 @@ public struct BaseCard: Codable { self.cardType = cardType } + } + diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ErrorInfo.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ErrorInfo.swift index a603717abe68..ae5327eda329 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ErrorInfo.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ErrorInfo.swift @@ -7,6 +7,7 @@ import Foundation + /** Example Error object */ public struct ErrorInfo: Codable { @@ -21,4 +22,6 @@ public struct ErrorInfo: Codable { self.details = details } + } + diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/GetAllModelsResult.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/GetAllModelsResult.swift index cc3992e748af..286c5a7a35be 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/GetAllModelsResult.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/GetAllModelsResult.swift @@ -7,6 +7,7 @@ import Foundation + /** Response object containing AllPrimitives object */ public struct GetAllModelsResult: Codable { @@ -21,4 +22,6 @@ public struct GetAllModelsResult: Codable { self.myVariableNameTest = myVariableNameTest } + } + diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ModelWithPropertiesAndAdditionalProperties.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ModelWithPropertiesAndAdditionalProperties.swift index c00da2ea9fe2..d7f2ca152623 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ModelWithPropertiesAndAdditionalProperties.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ModelWithPropertiesAndAdditionalProperties.swift @@ -7,6 +7,7 @@ import Foundation + /** This is an empty model with no properties and only additionalProperties of type int32 */ public struct ModelWithPropertiesAndAdditionalProperties: Codable { @@ -30,7 +31,7 @@ public struct ModelWithPropertiesAndAdditionalProperties: Codable { self.myPrimitiveArrayReq = myPrimitiveArrayReq self.myPrimitiveArrayOpt = myPrimitiveArrayOpt } - public var additionalProperties: [String: String] = [:] + public var additionalProperties: [String:String] = [:] public subscript(key: String) -> String? { get { @@ -87,4 +88,7 @@ public struct ModelWithPropertiesAndAdditionalProperties: Codable { additionalProperties = try container.decodeMap(String.self, excludedKeys: nonAdditionalPropertyKeys) } + + } + diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PersonCard.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PersonCard.swift index 0f6036276583..9ce70e0b95e6 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PersonCard.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PersonCard.swift @@ -7,6 +7,7 @@ import Foundation + /** This is a card object for a Person derived from BaseCard. */ public struct PersonCard: Codable { @@ -21,4 +22,6 @@ public struct PersonCard: Codable { self.lastName = lastName } + } + diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PersonCardAllOf.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PersonCardAllOf.swift index e11d38985a2e..347da1187e01 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PersonCardAllOf.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PersonCardAllOf.swift @@ -7,6 +7,8 @@ import Foundation + + public struct PersonCardAllOf: Codable { public var firstName: String? @@ -17,4 +19,6 @@ public struct PersonCardAllOf: Codable { self.lastName = lastName } + } + diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PlaceCard.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PlaceCard.swift index d29263604039..905b80ae5241 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PlaceCard.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PlaceCard.swift @@ -7,6 +7,7 @@ import Foundation + /** This is a card object for a Person derived from BaseCard. */ public struct PlaceCard: Codable { @@ -21,4 +22,6 @@ public struct PlaceCard: Codable { self.placeAddress = placeAddress } + } + diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PlaceCardAllOf.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PlaceCardAllOf.swift index c5e89a15e00f..b9642dfdeb76 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PlaceCardAllOf.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PlaceCardAllOf.swift @@ -7,6 +7,8 @@ import Foundation + + public struct PlaceCardAllOf: Codable { public var placeName: String? @@ -17,4 +19,6 @@ public struct PlaceCardAllOf: Codable { self.placeAddress = placeAddress } + } + diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/SampleBase.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/SampleBase.swift index 42b32eee4397..77f8897cdf3f 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/SampleBase.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/SampleBase.swift @@ -7,6 +7,7 @@ import Foundation + /** This is a base class object from which other classes will derive. */ public struct SampleBase: Codable { @@ -19,4 +20,6 @@ public struct SampleBase: Codable { self.baseClassIntegerProp = baseClassIntegerProp } + } + diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/SampleSubClass.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/SampleSubClass.swift index a33ee92f2261..9ce5ac431bed 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/SampleSubClass.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/SampleSubClass.swift @@ -7,11 +7,15 @@ import Foundation + /** This is a subclass defived from the SampleBase class. */ public struct SampleSubClass: Codable { + public init() { } + } + diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/SampleSubClassAllOf.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/SampleSubClassAllOf.swift index 7f52bb9fef4c..d96f84566803 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/SampleSubClassAllOf.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/SampleSubClassAllOf.swift @@ -7,6 +7,8 @@ import Foundation + + public struct SampleSubClassAllOf: Codable { public var subClassStringProp: String? @@ -17,4 +19,6 @@ public struct SampleSubClassAllOf: Codable { self.subClassIntegerProp = subClassIntegerProp } + } + diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/StringEnum.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/StringEnum.swift index 67c1c22deda7..d4cce19e6d6d 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/StringEnum.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/StringEnum.swift @@ -7,6 +7,7 @@ import Foundation + public enum StringEnum: String, Codable { case stringenumvalue1 = "stringEnumValue1" case stringenumvalue2 = "stringEnumValue2" diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/VariableNameTest.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/VariableNameTest.swift index 6592d3f1eefd..1248e645c609 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/VariableNameTest.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/VariableNameTest.swift @@ -7,6 +7,7 @@ import Foundation + /** This object contains property names which we know will be different from their variable name. Examples of this include snake case property names and property names which are Swift 4 reserved words. */ public struct VariableNameTest: Codable { @@ -24,10 +25,12 @@ public struct VariableNameTest: Codable { self.normalName = normalName } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case exampleName = "example_name" case _for = "for" case normalName } + } + diff --git a/samples/config/petstore/apache2/.openapi-generator/VERSION b/samples/config/petstore/apache2/.openapi-generator/VERSION index 7fea99011a6f..83a328a9227e 100644 --- a/samples/config/petstore/apache2/.openapi-generator/VERSION +++ b/samples/config/petstore/apache2/.openapi-generator/VERSION @@ -1 +1 @@ -2.2.3-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/config/petstore/apache2/PetApi.conf b/samples/config/petstore/apache2/PetApi.conf index c92843e2610f..2d28dcdaa61b 100644 --- a/samples/config/petstore/apache2/PetApi.conf +++ b/samples/config/petstore/apache2/PetApi.conf @@ -1,4 +1,4 @@ - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" @@ -16,7 +16,7 @@ Require group read:pets - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" @@ -34,7 +34,7 @@ Require group read:pets - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" @@ -48,7 +48,7 @@ Require group read:pets - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" @@ -62,7 +62,7 @@ Require group read:pets - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" diff --git a/samples/config/petstore/apache2/StoreApi.conf b/samples/config/petstore/apache2/StoreApi.conf index f0fb742f55ac..b223a8816ba6 100644 --- a/samples/config/petstore/apache2/StoreApi.conf +++ b/samples/config/petstore/apache2/StoreApi.conf @@ -1,4 +1,4 @@ - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" @@ -14,7 +14,7 @@ Require valid-user - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" @@ -24,7 +24,7 @@ Require valid-user - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" diff --git a/samples/config/petstore/apache2/UserApi.conf b/samples/config/petstore/apache2/UserApi.conf index b01bb509728a..699b2b72c16c 100644 --- a/samples/config/petstore/apache2/UserApi.conf +++ b/samples/config/petstore/apache2/UserApi.conf @@ -1,4 +1,4 @@ - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" @@ -11,7 +11,7 @@ Require valid-user - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" @@ -24,7 +24,7 @@ Require valid-user - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" @@ -37,7 +37,7 @@ Require valid-user - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" @@ -56,7 +56,7 @@ Require valid-user - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" @@ -69,7 +69,7 @@ Require valid-user - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" diff --git a/samples/config/petstore/graphql-schema/.openapi-generator/VERSION b/samples/config/petstore/graphql-schema/.openapi-generator/VERSION index afa636560641..83a328a9227e 100644 --- a/samples/config/petstore/graphql-schema/.openapi-generator/VERSION +++ b/samples/config/petstore/graphql-schema/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/config/petstore/graphql-schema/petstore/api/pet_api.graphql b/samples/config/petstore/graphql-schema/petstore/api/pet_api.graphql index 07bdf0c0adb4..865b0eb73190 100644 --- a/samples/config/petstore/graphql-schema/petstore/api/pet_api.graphql +++ b/samples/config/petstore/graphql-schema/petstore/api/pet_api.graphql @@ -1,6 +1,6 @@ # OpenAPI Petstore # This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -# OpenAPI spec version: 1.0.0 +# The version of the OpenAPI document: 1.0.0 # Generated by OpenAPI Generator: https://openapi-generator.tech # diff --git a/samples/config/petstore/graphql-schema/petstore/api/store_api.graphql b/samples/config/petstore/graphql-schema/petstore/api/store_api.graphql index 30e2a034f20a..8c4137a4a4a4 100644 --- a/samples/config/petstore/graphql-schema/petstore/api/store_api.graphql +++ b/samples/config/petstore/graphql-schema/petstore/api/store_api.graphql @@ -1,6 +1,6 @@ # OpenAPI Petstore # This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -# OpenAPI spec version: 1.0.0 +# The version of the OpenAPI document: 1.0.0 # Generated by OpenAPI Generator: https://openapi-generator.tech # diff --git a/samples/config/petstore/graphql-schema/petstore/api/user_api.graphql b/samples/config/petstore/graphql-schema/petstore/api/user_api.graphql index 12335c2207e5..e873f153b58d 100644 --- a/samples/config/petstore/graphql-schema/petstore/api/user_api.graphql +++ b/samples/config/petstore/graphql-schema/petstore/api/user_api.graphql @@ -1,6 +1,6 @@ # OpenAPI Petstore # This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -# OpenAPI spec version: 1.0.0 +# The version of the OpenAPI document: 1.0.0 # Generated by OpenAPI Generator: https://openapi-generator.tech # diff --git a/samples/config/petstore/graphql-schema/petstore/model/api_response.graphql b/samples/config/petstore/graphql-schema/petstore/model/api_response.graphql index 2f8221d6f776..9db63eae5b9d 100644 --- a/samples/config/petstore/graphql-schema/petstore/model/api_response.graphql +++ b/samples/config/petstore/graphql-schema/petstore/model/api_response.graphql @@ -1,6 +1,6 @@ # OpenAPI Petstore # This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -# OpenAPI spec version: 1.0.0 +# The version of the OpenAPI document: 1.0.0 # Generated by OpenAPI Generator: https://openapi-generator.tech # diff --git a/samples/config/petstore/graphql-schema/petstore/model/category.graphql b/samples/config/petstore/graphql-schema/petstore/model/category.graphql index eeeef5998ae4..b75961d86df7 100644 --- a/samples/config/petstore/graphql-schema/petstore/model/category.graphql +++ b/samples/config/petstore/graphql-schema/petstore/model/category.graphql @@ -1,6 +1,6 @@ # OpenAPI Petstore # This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -# OpenAPI spec version: 1.0.0 +# The version of the OpenAPI document: 1.0.0 # Generated by OpenAPI Generator: https://openapi-generator.tech # diff --git a/samples/config/petstore/graphql-schema/petstore/model/order.graphql b/samples/config/petstore/graphql-schema/petstore/model/order.graphql index a76301107ac2..af6f699f8a95 100644 --- a/samples/config/petstore/graphql-schema/petstore/model/order.graphql +++ b/samples/config/petstore/graphql-schema/petstore/model/order.graphql @@ -1,6 +1,6 @@ # OpenAPI Petstore # This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -# OpenAPI spec version: 1.0.0 +# The version of the OpenAPI document: 1.0.0 # Generated by OpenAPI Generator: https://openapi-generator.tech # diff --git a/samples/config/petstore/graphql-schema/petstore/model/pet.graphql b/samples/config/petstore/graphql-schema/petstore/model/pet.graphql index e8ce58e93da3..c346af193587 100644 --- a/samples/config/petstore/graphql-schema/petstore/model/pet.graphql +++ b/samples/config/petstore/graphql-schema/petstore/model/pet.graphql @@ -1,6 +1,6 @@ # OpenAPI Petstore # This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -# OpenAPI spec version: 1.0.0 +# The version of the OpenAPI document: 1.0.0 # Generated by OpenAPI Generator: https://openapi-generator.tech # diff --git a/samples/config/petstore/graphql-schema/petstore/model/tag.graphql b/samples/config/petstore/graphql-schema/petstore/model/tag.graphql index 9fc620141a8c..a5002f44c9c1 100644 --- a/samples/config/petstore/graphql-schema/petstore/model/tag.graphql +++ b/samples/config/petstore/graphql-schema/petstore/model/tag.graphql @@ -1,6 +1,6 @@ # OpenAPI Petstore # This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -# OpenAPI spec version: 1.0.0 +# The version of the OpenAPI document: 1.0.0 # Generated by OpenAPI Generator: https://openapi-generator.tech # diff --git a/samples/config/petstore/graphql-schema/petstore/model/user.graphql b/samples/config/petstore/graphql-schema/petstore/model/user.graphql index da66c49fb83e..2f678c28ea7b 100644 --- a/samples/config/petstore/graphql-schema/petstore/model/user.graphql +++ b/samples/config/petstore/graphql-schema/petstore/model/user.graphql @@ -1,6 +1,6 @@ # OpenAPI Petstore # This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -# OpenAPI spec version: 1.0.0 +# The version of the OpenAPI document: 1.0.0 # Generated by OpenAPI Generator: https://openapi-generator.tech # diff --git a/samples/documentation/cwiki/.openapi-generator/VERSION b/samples/documentation/cwiki/.openapi-generator/VERSION index d077ffb477a4..83a328a9227e 100644 --- a/samples/documentation/cwiki/.openapi-generator/VERSION +++ b/samples/documentation/cwiki/.openapi-generator/VERSION @@ -1 +1 @@ -3.3.4-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/documentation/cwiki/confluence-markup.txt b/samples/documentation/cwiki/confluence-markup.txt index f790908e8f14..ba0cb5427027 100644 --- a/samples/documentation/cwiki/confluence-markup.txt +++ b/samples/documentation/cwiki/confluence-markup.txt @@ -21,7 +21,7 @@ h2. Endpoints h5. Body Parameter ||Name||Description||Required||Default||Pattern|| - |pet |Pet object that needs to be added to the store |(/) | | | + |body |Pet object that needs to be added to the store |(/) | | | @@ -325,7 +325,7 @@ Pet h5. Body Parameter ||Name||Description||Required||Default||Pattern|| - |pet |Pet object that needs to be added to the store |(/) | | | + |body |Pet object that needs to be added to the store |(/) | | | @@ -657,7 +657,7 @@ Order h5. Body Parameter ||Name||Description||Required||Default||Pattern|| - |order |order placed for purchasing the pet |(/) | | | + |body |order placed for purchasing the pet |(/) | | | @@ -722,7 +722,7 @@ Order h5. Body Parameter ||Name||Description||Required||Default||Pattern|| - |user |Created user object |(/) | | | + |body |Created user object |(/) | | | @@ -761,7 +761,7 @@ Order h5. Body Parameter ||Name||Description||Required||Default||Pattern|| - |user |List of user object |(/) | | | + |body |List of user object |(/) | | | @@ -800,7 +800,7 @@ Order h5. Body Parameter ||Name||Description||Required||Default||Pattern|| - |user |List of user object |(/) | | | + |body |List of user object |(/) | | | @@ -1095,7 +1095,7 @@ String h5. Body Parameter ||Name||Description||Required||Default||Pattern|| - |user |Updated user object |(/) | | | + |body |Updated user object |(/) | | | diff --git a/samples/documentation/dynamic-html/.openapi-generator/VERSION b/samples/documentation/dynamic-html/.openapi-generator/VERSION index 14900cee60e8..83a328a9227e 100644 --- a/samples/documentation/dynamic-html/.openapi-generator/VERSION +++ b/samples/documentation/dynamic-html/.openapi-generator/VERSION @@ -1 +1 @@ -3.2.1-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/documentation/dynamic-html/docs/operations/PetApi.html b/samples/documentation/dynamic-html/docs/operations/PetApi.html index 75a5fda414f8..3253976d7385 100644 --- a/samples/documentation/dynamic-html/docs/operations/PetApi.html +++ b/samples/documentation/dynamic-html/docs/operations/PetApi.html @@ -20,7 +20,7 @@

Parameters

Body: - Pet + body Pet(Pet)

Pet object that needs to be added to the store

@@ -151,7 +151,7 @@

Parameters

Body: - Pet + body Pet(Pet)

Pet object that needs to be added to the store

diff --git a/samples/documentation/dynamic-html/docs/operations/StoreApi.html b/samples/documentation/dynamic-html/docs/operations/StoreApi.html index cb880712d31a..f0bbff63e859 100644 --- a/samples/documentation/dynamic-html/docs/operations/StoreApi.html +++ b/samples/documentation/dynamic-html/docs/operations/StoreApi.html @@ -81,7 +81,7 @@

Parameters

Body: - Order + body Order(Order)

order placed for purchasing the pet

diff --git a/samples/documentation/dynamic-html/docs/operations/UserApi.html b/samples/documentation/dynamic-html/docs/operations/UserApi.html index f3940e0f4bde..ecc44e43656a 100644 --- a/samples/documentation/dynamic-html/docs/operations/UserApi.html +++ b/samples/documentation/dynamic-html/docs/operations/UserApi.html @@ -20,7 +20,7 @@

Parameters

Body: - User + body User(User)

Created user object

@@ -44,8 +44,8 @@

Parameters

Body: - User - List(array) + body + List(User)

List of user object

@@ -68,8 +68,8 @@

Parameters

Body: - User - List(array) + body + List(User)

List of user object

@@ -199,7 +199,7 @@

Parameters

Body: - User + body User(User)

Updated user object

diff --git a/samples/documentation/html.md/.openapi-generator/VERSION b/samples/documentation/html.md/.openapi-generator/VERSION index 096bf47efe31..83a328a9227e 100644 --- a/samples/documentation/html.md/.openapi-generator/VERSION +++ b/samples/documentation/html.md/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.0-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/documentation/html.md/index.html b/samples/documentation/html.md/index.html index 7545df2e3190..63ef7f704b0c 100644 --- a/samples/documentation/html.md/index.html +++ b/samples/documentation/html.md/index.html @@ -189,8 +189,8 @@

An API with more Markdown in summary, description,
  • in schema (model) member descriptions
  • -
    More information: https://helloreverb.com
    -
    Contact Info: hello@helloreverb.com
    + +
    Contact Info: team@openapitools.org
    Version: 0.1.0
    BasePath:/v1
    All rights reserved
    @@ -226,7 +226,7 @@

    Query parameters

    seed (required)
    -
    Query Parameter — A random number seed.
    +
    Query Parameter — A random number seed. default: null
    @@ -242,8 +242,8 @@

    Example data

    Content-Type: */*
    {
       "sequence" : 1,
    -  "seed" : 6.02745618307040320615897144307382404804229736328125,
    -  "value" : 0.80082819046101150206595775671303272247314453125
    +  "seed" : 6.027456183070403,
    +  "value" : 0.8008281904610115
     }

    Produces

    diff --git a/samples/documentation/html/.openapi-generator/VERSION b/samples/documentation/html/.openapi-generator/VERSION index d077ffb477a4..83a328a9227e 100644 --- a/samples/documentation/html/.openapi-generator/VERSION +++ b/samples/documentation/html/.openapi-generator/VERSION @@ -1 +1 @@ -3.3.4-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/documentation/html/index.html b/samples/documentation/html/index.html index 543b4acfc78e..15ed1f3c6a7f 100644 --- a/samples/documentation/html/index.html +++ b/samples/documentation/html/index.html @@ -246,7 +246,7 @@

    Consumes

    Request body

    -
    Pet Pet (required)
    +
    body Pet (required)
    Body Parameter
    @@ -551,7 +551,7 @@

    Consumes

    Request body

    -
    Pet Pet (required)
    +
    body Pet (required)
    Body Parameter
    @@ -829,7 +829,7 @@

    404

    Request body

    -
    Order Order (required)
    +
    body Order (required)
    Body Parameter
    @@ -896,7 +896,7 @@

    User

    Request body

    -
    User User (required)
    +
    body User (required)
    Body Parameter
    @@ -927,7 +927,7 @@

    default

    Request body

    -
    User array (required)
    +
    body User (required)
    Body Parameter
    @@ -958,7 +958,7 @@

    default

    Request body

    -
    User array (required)
    +
    body User (required)
    Body Parameter
    @@ -1171,7 +1171,7 @@

    Path parameters

    Request body

    -
    User User (required)
    +
    body User (required)
    Body Parameter
    diff --git a/samples/documentation/html2/.openapi-generator/VERSION b/samples/documentation/html2/.openapi-generator/VERSION index 14900cee60e8..83a328a9227e 100644 --- a/samples/documentation/html2/.openapi-generator/VERSION +++ b/samples/documentation/html2/.openapi-generator/VERSION @@ -1 +1 @@ -3.2.1-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/documentation/html2/index.html b/samples/documentation/html2/index.html index 5b9ce2fe173c..59b4a0283eea 100644 --- a/samples/documentation/html2/index.html +++ b/samples/documentation/html2/index.html @@ -1144,9 +1144,9 @@

    Usage and SDK Samples

    petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); - Pet pet = ; // Pet | + Pet body = ; // Pet | try { - apiInstance.addPet(pet); + apiInstance.addPet(body); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); e.printStackTrace(); @@ -1162,9 +1162,9 @@

    Usage and SDK Samples

    public static void main(String[] args) { PetApi apiInstance = new PetApi(); - Pet pet = ; // Pet | + Pet body = ; // Pet | try { - apiInstance.addPet(pet); + apiInstance.addPet(body); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); e.printStackTrace(); @@ -1182,12 +1182,12 @@

    Usage and SDK Samples

    // Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; -Pet *pet = ; // +Pet *body = ; // PetApi *apiInstance = [[PetApi alloc] init]; // Add a new pet to the store -[apiInstance addPetWith:pet +[apiInstance addPetWith:body completionHandler: ^(NSError* error) { if (error) { NSLog(@"Error: %@", error); @@ -1205,7 +1205,7 @@

    Usage and SDK Samples

    petstore_auth.accessToken = "YOUR ACCESS TOKEN" var api = new OpenApiPetstore.PetApi() -var pet = ; // {Pet} +var body = ; // {Pet} var callback = function(error, data, response) { if (error) { @@ -1214,7 +1214,7 @@

    Usage and SDK Samples

    console.log('API called successfully.'); } }; -api.addPet(pet, callback); +api.addPet(body, callback);
    @@ -1239,12 +1239,12 @@

    Usage and SDK Samples

    Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(); - var pet = new Pet(); // Pet | + var body = new Pet(); // Pet | try { // Add a new pet to the store - apiInstance.addPet(pet); + apiInstance.addPet(body); } catch (Exception e) { @@ -1264,10 +1264,10 @@

    Usage and SDK Samples

    OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $api_instance = new OpenAPITools\Client\Api\PetApi(); -$pet = ; // Pet | +$body = ; // Pet | try { - $api_instance->addPet($pet); + $api_instance->addPet($body); } catch (Exception $e) { echo 'Exception when calling PetApi->addPet: ', $e->getMessage(), PHP_EOL; } @@ -1283,10 +1283,10 @@

    Usage and SDK Samples

    $WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN'; my $api_instance = WWW::OPenAPIClient::PetApi->new(); -my $pet = WWW::OPenAPIClient::Object::Pet->new(); # Pet | +my $body = WWW::OPenAPIClient::Object::Pet->new(); # Pet | eval { - $api_instance->addPet(pet => $pet); + $api_instance->addPet(body => $body); }; if ($@) { warn "Exception when calling PetApi->addPet: $@\n"; @@ -1305,11 +1305,11 @@

    Usage and SDK Samples

    # create an instance of the API class api_instance = openapi_client.PetApi() -pet = # Pet | +body = # Pet | try: # Add a new pet to the store - api_instance.add_pet(pet) + api_instance.add_pet(body) except ApiException as e: print("Exception when calling PetApi->addPet: %s\n" % e)
    @@ -1318,10 +1318,10 @@

    Usage and SDK Samples

    extern crate PetApi;
     
     pub fn main() {
    -    let pet = ; // Pet
    +    let body = ; // Pet
     
         let mut context = PetApi::Context::default();
    -    let result = client.addPet(pet, &context).wait();
    +    let result = client.addPet(body, &context).wait();
         println!("{:?}", result);
     
     }
    @@ -1354,7 +1354,7 @@ 

    Parameters

    Name Description - pet * + body *

    Pet object that needs to be added to the store

    -
    +
    @@ -1504,8 +1504,8 @@

    Usage and SDK Samples

    // Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; -Long *petId = 789; // Pet id to delete -String *apiKey = apiKey_example; // (optional) +Long *petId = 789; // Pet id to delete (default to null) +String *apiKey = apiKey_example; // (optional) (default to null) PetApi *apiInstance = [[PetApi alloc] init]; @@ -1566,8 +1566,8 @@

    Usage and SDK Samples

    Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(); - var petId = 789; // Long | Pet id to delete - var apiKey = apiKey_example; // String | (optional) + var petId = 789; // Long | Pet id to delete (default to null) + var apiKey = apiKey_example; // String | (optional) (default to null) try { @@ -1635,8 +1635,8 @@

    Usage and SDK Samples

    # create an instance of the API class api_instance = openapi_client.PetApi() -petId = 789 # Long | Pet id to delete -apiKey = apiKey_example # String | (optional) +petId = 789 # Long | Pet id to delete (default to null) +apiKey = apiKey_example # String | (optional) (default to null) try: # Deletes a pet @@ -1860,7 +1860,7 @@

    Usage and SDK Samples

    // Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; -array[String] *status = ; // Status values that need to be considered for filter +array[String] *status = ; // Status values that need to be considered for filter (default to null) PetApi *apiInstance = [[PetApi alloc] init]; @@ -1920,7 +1920,7 @@

    Usage and SDK Samples

    Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(); - var status = new array[String](); // array[String] | Status values that need to be considered for filter + var status = new array[String](); // array[String] | Status values that need to be considered for filter (default to null) try { @@ -1989,7 +1989,7 @@

    Usage and SDK Samples

    # create an instance of the API class api_instance = openapi_client.PetApi() -status = # array[String] | Status values that need to be considered for filter +status = # array[String] | Status values that need to be considered for filter (default to null) try: # Finds Pets by status @@ -2258,7 +2258,7 @@

    Usage and SDK Samples

    // Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; -array[String] *tags = ; // Tags to filter by +array[String] *tags = ; // Tags to filter by (default to null) PetApi *apiInstance = [[PetApi alloc] init]; @@ -2318,7 +2318,7 @@

    Usage and SDK Samples

    Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(); - var tags = new array[String](); // array[String] | Tags to filter by + var tags = new array[String](); // array[String] | Tags to filter by (default to null) try { @@ -2387,7 +2387,7 @@

    Usage and SDK Samples

    # create an instance of the API class api_instance = openapi_client.PetApi() -tags = # array[String] | Tags to filter by +tags = # array[String] | Tags to filter by (default to null) try: # Finds Pets by tags @@ -2660,7 +2660,7 @@

    Usage and SDK Samples

    // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed //[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"api_key"]; -Long *petId = 789; // ID of pet to return +Long *petId = 789; // ID of pet to return (default to null) PetApi *apiInstance = [[PetApi alloc] init]; @@ -2724,7 +2724,7 @@

    Usage and SDK Samples

    // Configuration.Default.ApiKeyPrefix.Add("api_key", "Bearer"); var apiInstance = new PetApi(); - var petId = 789; // Long | ID of pet to return + var petId = 789; // Long | ID of pet to return (default to null) try { @@ -2799,7 +2799,7 @@

    Usage and SDK Samples

    # create an instance of the API class api_instance = openapi_client.PetApi() -petId = 789 # Long | ID of pet to return +petId = 789 # Long | ID of pet to return (default to null) try: # Find pet by ID @@ -3037,9 +3037,9 @@

    Usage and SDK Samples

    petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); - Pet pet = ; // Pet | + Pet body = ; // Pet | try { - apiInstance.updatePet(pet); + apiInstance.updatePet(body); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePet"); e.printStackTrace(); @@ -3055,9 +3055,9 @@

    Usage and SDK Samples

    public static void main(String[] args) { PetApi apiInstance = new PetApi(); - Pet pet = ; // Pet | + Pet body = ; // Pet | try { - apiInstance.updatePet(pet); + apiInstance.updatePet(body); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePet"); e.printStackTrace(); @@ -3075,12 +3075,12 @@

    Usage and SDK Samples

    // Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; -Pet *pet = ; // +Pet *body = ; // PetApi *apiInstance = [[PetApi alloc] init]; // Update an existing pet -[apiInstance updatePetWith:pet +[apiInstance updatePetWith:body completionHandler: ^(NSError* error) { if (error) { NSLog(@"Error: %@", error); @@ -3098,7 +3098,7 @@

    Usage and SDK Samples

    petstore_auth.accessToken = "YOUR ACCESS TOKEN" var api = new OpenApiPetstore.PetApi() -var pet = ; // {Pet} +var body = ; // {Pet} var callback = function(error, data, response) { if (error) { @@ -3107,7 +3107,7 @@

    Usage and SDK Samples

    console.log('API called successfully.'); } }; -api.updatePet(pet, callback); +api.updatePet(body, callback);
    @@ -3132,12 +3132,12 @@

    Usage and SDK Samples

    Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(); - var pet = new Pet(); // Pet | + var body = new Pet(); // Pet | try { // Update an existing pet - apiInstance.updatePet(pet); + apiInstance.updatePet(body); } catch (Exception e) { @@ -3157,10 +3157,10 @@

    Usage and SDK Samples

    OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $api_instance = new OpenAPITools\Client\Api\PetApi(); -$pet = ; // Pet | +$body = ; // Pet | try { - $api_instance->updatePet($pet); + $api_instance->updatePet($body); } catch (Exception $e) { echo 'Exception when calling PetApi->updatePet: ', $e->getMessage(), PHP_EOL; } @@ -3176,10 +3176,10 @@

    Usage and SDK Samples

    $WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN'; my $api_instance = WWW::OPenAPIClient::PetApi->new(); -my $pet = WWW::OPenAPIClient::Object::Pet->new(); # Pet | +my $body = WWW::OPenAPIClient::Object::Pet->new(); # Pet | eval { - $api_instance->updatePet(pet => $pet); + $api_instance->updatePet(body => $body); }; if ($@) { warn "Exception when calling PetApi->updatePet: $@\n"; @@ -3198,11 +3198,11 @@

    Usage and SDK Samples

    # create an instance of the API class api_instance = openapi_client.PetApi() -pet = # Pet | +body = # Pet | try: # Update an existing pet - api_instance.update_pet(pet) + api_instance.update_pet(body) except ApiException as e: print("Exception when calling PetApi->updatePet: %s\n" % e)
    @@ -3211,10 +3211,10 @@

    Usage and SDK Samples

    extern crate PetApi;
     
     pub fn main() {
    -    let pet = ; // Pet
    +    let body = ; // Pet
     
         let mut context = PetApi::Context::default();
    -    let result = client.updatePet(pet, &context).wait();
    +    let result = client.updatePet(body, &context).wait();
         println!("{:?}", result);
     
     }
    @@ -3247,7 +3247,7 @@ 

    Parameters

    Name Description - pet * + body *

    Pet object that needs to be added to the store

    -
    +
    @@ -3443,7 +3443,7 @@

    Usage and SDK Samples

    // Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; -Long *petId = 789; // ID of pet that needs to be updated +Long *petId = 789; // ID of pet that needs to be updated (default to null) String *name = name_example; // Updated name of the pet (optional) (default to null) String *status = status_example; // Updated status of the pet (optional) (default to null) @@ -3508,7 +3508,7 @@

    Usage and SDK Samples

    Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(); - var petId = 789; // Long | ID of pet that needs to be updated + var petId = 789; // Long | ID of pet that needs to be updated (default to null) var name = name_example; // String | Updated name of the pet (optional) (default to null) var status = status_example; // String | Updated status of the pet (optional) (default to null) @@ -3580,7 +3580,7 @@

    Usage and SDK Samples

    # create an instance of the API class api_instance = openapi_client.PetApi() -petId = 789 # Long | ID of pet that needs to be updated +petId = 789 # Long | ID of pet that needs to be updated (default to null) name = name_example # String | Updated name of the pet (optional) (default to null) status = status_example # String | Updated status of the pet (optional) (default to null) @@ -3834,7 +3834,7 @@

    Usage and SDK Samples

    // Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; -Long *petId = 789; // ID of pet to update +Long *petId = 789; // ID of pet to update (default to null) String *additionalMetadata = additionalMetadata_example; // Additional data to pass to server (optional) (default to null) File *file = BINARY_DATA_HERE; // file to upload (optional) (default to null) @@ -3902,7 +3902,7 @@

    Usage and SDK Samples

    Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(); - var petId = 789; // Long | ID of pet to update + var petId = 789; // Long | ID of pet to update (default to null) var additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server (optional) (default to null) var file = BINARY_DATA_HERE; // File | file to upload (optional) (default to null) @@ -3977,7 +3977,7 @@

    Usage and SDK Samples

    # create an instance of the API class api_instance = openapi_client.PetApi() -petId = 789 # Long | ID of pet to update +petId = 789 # Long | ID of pet to update (default to null) additionalMetadata = additionalMetadata_example # String | Additional data to pass to server (optional) (default to null) file = BINARY_DATA_HERE # File | file to upload (optional) (default to null) @@ -4261,7 +4261,7 @@

    Usage and SDK Samples

    Coming Soon!
    -->
    -
    String *orderId = orderId_example; // ID of the order that needs to be deleted
    +                              
    String *orderId = orderId_example; // ID of the order that needs to be deleted (default to null)
     
     StoreApi *apiInstance = [[StoreApi alloc] init];
     
    @@ -4310,7 +4310,7 @@ 

    Usage and SDK Samples

    { var apiInstance = new StoreApi(); - var orderId = orderId_example; // String | ID of the order that needs to be deleted + var orderId = orderId_example; // String | ID of the order that needs to be deleted (default to null) try { @@ -4367,7 +4367,7 @@

    Usage and SDK Samples

    # create an instance of the API class api_instance = openapi_client.StoreApi() -orderId = orderId_example # String | ID of the order that needs to be deleted +orderId = orderId_example # String | ID of the order that needs to be deleted (default to null) try: # Delete purchase order by ID @@ -4898,7 +4898,7 @@

    Usage and SDK Samples

    Coming Soon!
    -->
    -
    Long *orderId = 789; // ID of pet that needs to be fetched
    +                              
    Long *orderId = 789; // ID of pet that needs to be fetched (default to null)
     
     StoreApi *apiInstance = [[StoreApi alloc] init];
     
    @@ -4950,7 +4950,7 @@ 

    Usage and SDK Samples

    { var apiInstance = new StoreApi(); - var orderId = 789; // Long | ID of pet that needs to be fetched + var orderId = 789; // Long | ID of pet that needs to be fetched (default to null) try { @@ -5010,7 +5010,7 @@

    Usage and SDK Samples

    # create an instance of the API class api_instance = openapi_client.StoreApi() -orderId = 789 # Long | ID of pet that needs to be fetched +orderId = 789 # Long | ID of pet that needs to be fetched (default to null) try: # Find purchase order by ID @@ -5243,9 +5243,9 @@

    Usage and SDK Samples

    public static void main(String[] args) { StoreApi apiInstance = new StoreApi(); - Order order = ; // Order | + Order body = ; // Order | try { - Order result = apiInstance.placeOrder(order); + Order result = apiInstance.placeOrder(body); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling StoreApi#placeOrder"); @@ -5262,9 +5262,9 @@

    Usage and SDK Samples

    public static void main(String[] args) { StoreApi apiInstance = new StoreApi(); - Order order = ; // Order | + Order body = ; // Order | try { - Order result = apiInstance.placeOrder(order); + Order result = apiInstance.placeOrder(body); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling StoreApi#placeOrder"); @@ -5278,12 +5278,12 @@

    Usage and SDK Samples

    Coming Soon!
    -->
    -
    Order *order = ; // 
    +                              
    Order *body = ; // 
     
     StoreApi *apiInstance = [[StoreApi alloc] init];
     
     // Place an order for a pet
    -[apiInstance placeOrderWith:order
    +[apiInstance placeOrderWith:body
                   completionHandler: ^(Order output, NSError* error) {
                                 if (output) {
                                     NSLog(@"%@", output);
    @@ -5299,7 +5299,7 @@ 

    Usage and SDK Samples

    var OpenApiPetstore = require('open_api_petstore');
     
     var api = new OpenApiPetstore.StoreApi()
    -var order = ; // {Order} 
    +var body = ; // {Order} 
     
     var callback = function(error, data, response) {
       if (error) {
    @@ -5308,7 +5308,7 @@ 

    Usage and SDK Samples

    console.log('API called successfully. Returned data: ' + data); } }; -api.placeOrder(order, callback); +api.placeOrder(body, callback);
    @@ -5330,12 +5330,12 @@

    Usage and SDK Samples

    { var apiInstance = new StoreApi(); - var order = new Order(); // Order | + var body = new Order(); // Order | try { // Place an order for a pet - Order result = apiInstance.placeOrder(order); + Order result = apiInstance.placeOrder(body); Debug.WriteLine(result); } catch (Exception e) @@ -5353,10 +5353,10 @@

    Usage and SDK Samples

    require_once(__DIR__ . '/vendor/autoload.php'); $api_instance = new OpenAPITools\Client\Api\StoreApi(); -$order = ; // Order | +$body = ; // Order | try { - $result = $api_instance->placeOrder($order); + $result = $api_instance->placeOrder($body); print_r($result); } catch (Exception $e) { echo 'Exception when calling StoreApi->placeOrder: ', $e->getMessage(), PHP_EOL; @@ -5370,10 +5370,10 @@

    Usage and SDK Samples

    use WWW::OPenAPIClient::StoreApi; my $api_instance = WWW::OPenAPIClient::StoreApi->new(); -my $order = WWW::OPenAPIClient::Object::Order->new(); # Order | +my $body = WWW::OPenAPIClient::Object::Order->new(); # Order | eval { - my $result = $api_instance->placeOrder(order => $order); + my $result = $api_instance->placeOrder(body => $body); print Dumper($result); }; if ($@) { @@ -5390,11 +5390,11 @@

    Usage and SDK Samples

    # create an instance of the API class api_instance = openapi_client.StoreApi() -order = # Order | +body = # Order | try: # Place an order for a pet - api_response = api_instance.place_order(order) + api_response = api_instance.place_order(body) pprint(api_response) except ApiException as e: print("Exception when calling StoreApi->placeOrder: %s\n" % e)
    @@ -5404,10 +5404,10 @@

    Usage and SDK Samples

    extern crate StoreApi;
     
     pub fn main() {
    -    let order = ; // Order
    +    let body = ; // Order
     
         let mut context = StoreApi::Context::default();
    -    let result = client.placeOrder(order, &context).wait();
    +    let result = client.placeOrder(body, &context).wait();
         println!("{:?}", result);
     
     }
    @@ -5430,7 +5430,7 @@ 

    Parameters

    Name Description - order * + body *

    order placed for purchasing the pet

    -
    +
    @@ -5604,9 +5604,9 @@

    Usage and SDK Samples

    public static void main(String[] args) { UserApi apiInstance = new UserApi(); - User user = ; // User | + User body = ; // User | try { - apiInstance.createUser(user); + apiInstance.createUser(body); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUser"); e.printStackTrace(); @@ -5622,9 +5622,9 @@

    Usage and SDK Samples

    public static void main(String[] args) { UserApi apiInstance = new UserApi(); - User user = ; // User | + User body = ; // User | try { - apiInstance.createUser(user); + apiInstance.createUser(body); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUser"); e.printStackTrace(); @@ -5637,12 +5637,12 @@

    Usage and SDK Samples

    Coming Soon!
    -->
    -
    User *user = ; // 
    +                              
    User *body = ; // 
     
     UserApi *apiInstance = [[UserApi alloc] init];
     
     // Create user
    -[apiInstance createUserWith:user
    +[apiInstance createUserWith:body
                   completionHandler: ^(NSError* error) {
                                 if (error) {
                                     NSLog(@"Error: %@", error);
    @@ -5655,7 +5655,7 @@ 

    Usage and SDK Samples

    var OpenApiPetstore = require('open_api_petstore');
     
     var api = new OpenApiPetstore.UserApi()
    -var user = ; // {User} 
    +var body = ; // {User} 
     
     var callback = function(error, data, response) {
       if (error) {
    @@ -5664,7 +5664,7 @@ 

    Usage and SDK Samples

    console.log('API called successfully.'); } }; -api.createUser(user, callback); +api.createUser(body, callback);
    @@ -5686,12 +5686,12 @@

    Usage and SDK Samples

    { var apiInstance = new UserApi(); - var user = new User(); // User | + var body = new User(); // User | try { // Create user - apiInstance.createUser(user); + apiInstance.createUser(body); } catch (Exception e) { @@ -5708,10 +5708,10 @@

    Usage and SDK Samples

    require_once(__DIR__ . '/vendor/autoload.php'); $api_instance = new OpenAPITools\Client\Api\UserApi(); -$user = ; // User | +$body = ; // User | try { - $api_instance->createUser($user); + $api_instance->createUser($body); } catch (Exception $e) { echo 'Exception when calling UserApi->createUser: ', $e->getMessage(), PHP_EOL; } @@ -5724,10 +5724,10 @@

    Usage and SDK Samples

    use WWW::OPenAPIClient::UserApi; my $api_instance = WWW::OPenAPIClient::UserApi->new(); -my $user = WWW::OPenAPIClient::Object::User->new(); # User | +my $body = WWW::OPenAPIClient::Object::User->new(); # User | eval { - $api_instance->createUser(user => $user); + $api_instance->createUser(body => $body); }; if ($@) { warn "Exception when calling UserApi->createUser: $@\n"; @@ -5743,11 +5743,11 @@

    Usage and SDK Samples

    # create an instance of the API class api_instance = openapi_client.UserApi() -user = # User | +body = # User | try: # Create user - api_instance.create_user(user) + api_instance.create_user(body) except ApiException as e: print("Exception when calling UserApi->createUser: %s\n" % e)
    @@ -5756,10 +5756,10 @@

    Usage and SDK Samples

    extern crate UserApi;
     
     pub fn main() {
    -    let user = ; // User
    +    let body = ; // User
     
         let mut context = UserApi::Context::default();
    -    let result = client.createUser(user, &context).wait();
    +    let result = client.createUser(body, &context).wait();
         println!("{:?}", result);
     
     }
    @@ -5782,7 +5782,7 @@ 

    Parameters

    Name Description - user * + body *

    Created user object

    -
    +
    @@ -5887,9 +5887,9 @@

    Usage and SDK Samples

    public static void main(String[] args) { UserApi apiInstance = new UserApi(); - array[User] user = ; // array[User] | + array[User] body = ; // array[User] | try { - apiInstance.createUsersWithArrayInput(user); + apiInstance.createUsersWithArrayInput(body); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); e.printStackTrace(); @@ -5905,9 +5905,9 @@

    Usage and SDK Samples

    public static void main(String[] args) { UserApi apiInstance = new UserApi(); - array[User] user = ; // array[User] | + array[User] body = ; // array[User] | try { - apiInstance.createUsersWithArrayInput(user); + apiInstance.createUsersWithArrayInput(body); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); e.printStackTrace(); @@ -5920,12 +5920,12 @@

    Usage and SDK Samples

    Coming Soon!
    -->
    -
    array[User] *user = ; // 
    +                              
    array[User] *body = ; // 
     
     UserApi *apiInstance = [[UserApi alloc] init];
     
     // Creates list of users with given input array
    -[apiInstance createUsersWithArrayInputWith:user
    +[apiInstance createUsersWithArrayInputWith:body
                   completionHandler: ^(NSError* error) {
                                 if (error) {
                                     NSLog(@"Error: %@", error);
    @@ -5938,7 +5938,7 @@ 

    Usage and SDK Samples

    var OpenApiPetstore = require('open_api_petstore');
     
     var api = new OpenApiPetstore.UserApi()
    -var user = ; // {array[User]} 
    +var body = ; // {array[User]} 
     
     var callback = function(error, data, response) {
       if (error) {
    @@ -5947,7 +5947,7 @@ 

    Usage and SDK Samples

    console.log('API called successfully.'); } }; -api.createUsersWithArrayInput(user, callback); +api.createUsersWithArrayInput(body, callback);
    @@ -5969,12 +5969,12 @@

    Usage and SDK Samples

    { var apiInstance = new UserApi(); - var user = new array[User](); // array[User] | + var body = new array[User](); // array[User] | try { // Creates list of users with given input array - apiInstance.createUsersWithArrayInput(user); + apiInstance.createUsersWithArrayInput(body); } catch (Exception e) { @@ -5991,10 +5991,10 @@

    Usage and SDK Samples

    require_once(__DIR__ . '/vendor/autoload.php'); $api_instance = new OpenAPITools\Client\Api\UserApi(); -$user = ; // array[User] | +$body = ; // array[User] | try { - $api_instance->createUsersWithArrayInput($user); + $api_instance->createUsersWithArrayInput($body); } catch (Exception $e) { echo 'Exception when calling UserApi->createUsersWithArrayInput: ', $e->getMessage(), PHP_EOL; } @@ -6007,10 +6007,10 @@

    Usage and SDK Samples

    use WWW::OPenAPIClient::UserApi; my $api_instance = WWW::OPenAPIClient::UserApi->new(); -my $user = [WWW::OPenAPIClient::Object::array[User]->new()]; # array[User] | +my $body = [WWW::OPenAPIClient::Object::array[User]->new()]; # array[User] | eval { - $api_instance->createUsersWithArrayInput(user => $user); + $api_instance->createUsersWithArrayInput(body => $body); }; if ($@) { warn "Exception when calling UserApi->createUsersWithArrayInput: $@\n"; @@ -6026,11 +6026,11 @@

    Usage and SDK Samples

    # create an instance of the API class api_instance = openapi_client.UserApi() -user = # array[User] | +body = # array[User] | try: # Creates list of users with given input array - api_instance.create_users_with_array_input(user) + api_instance.create_users_with_array_input(body) except ApiException as e: print("Exception when calling UserApi->createUsersWithArrayInput: %s\n" % e)
    @@ -6039,10 +6039,10 @@

    Usage and SDK Samples

    extern crate UserApi;
     
     pub fn main() {
    -    let user = ; // array[User]
    +    let body = ; // array[User]
     
         let mut context = UserApi::Context::default();
    -    let result = client.createUsersWithArrayInput(user, &context).wait();
    +    let result = client.createUsersWithArrayInput(body, &context).wait();
         println!("{:?}", result);
     
     }
    @@ -6065,7 +6065,7 @@ 

    Parameters

    Name Description - user * + body *

    List of user object

    -
    +
    @@ -6170,9 +6170,9 @@

    Usage and SDK Samples

    public static void main(String[] args) { UserApi apiInstance = new UserApi(); - array[User] user = ; // array[User] | + array[User] body = ; // array[User] | try { - apiInstance.createUsersWithListInput(user); + apiInstance.createUsersWithListInput(body); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithListInput"); e.printStackTrace(); @@ -6188,9 +6188,9 @@

    Usage and SDK Samples

    public static void main(String[] args) { UserApi apiInstance = new UserApi(); - array[User] user = ; // array[User] | + array[User] body = ; // array[User] | try { - apiInstance.createUsersWithListInput(user); + apiInstance.createUsersWithListInput(body); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithListInput"); e.printStackTrace(); @@ -6203,12 +6203,12 @@

    Usage and SDK Samples

    Coming Soon!
    -->
    -
    array[User] *user = ; // 
    +                              
    array[User] *body = ; // 
     
     UserApi *apiInstance = [[UserApi alloc] init];
     
     // Creates list of users with given input array
    -[apiInstance createUsersWithListInputWith:user
    +[apiInstance createUsersWithListInputWith:body
                   completionHandler: ^(NSError* error) {
                                 if (error) {
                                     NSLog(@"Error: %@", error);
    @@ -6221,7 +6221,7 @@ 

    Usage and SDK Samples

    var OpenApiPetstore = require('open_api_petstore');
     
     var api = new OpenApiPetstore.UserApi()
    -var user = ; // {array[User]} 
    +var body = ; // {array[User]} 
     
     var callback = function(error, data, response) {
       if (error) {
    @@ -6230,7 +6230,7 @@ 

    Usage and SDK Samples

    console.log('API called successfully.'); } }; -api.createUsersWithListInput(user, callback); +api.createUsersWithListInput(body, callback);
    @@ -6252,12 +6252,12 @@

    Usage and SDK Samples

    { var apiInstance = new UserApi(); - var user = new array[User](); // array[User] | + var body = new array[User](); // array[User] | try { // Creates list of users with given input array - apiInstance.createUsersWithListInput(user); + apiInstance.createUsersWithListInput(body); } catch (Exception e) { @@ -6274,10 +6274,10 @@

    Usage and SDK Samples

    require_once(__DIR__ . '/vendor/autoload.php'); $api_instance = new OpenAPITools\Client\Api\UserApi(); -$user = ; // array[User] | +$body = ; // array[User] | try { - $api_instance->createUsersWithListInput($user); + $api_instance->createUsersWithListInput($body); } catch (Exception $e) { echo 'Exception when calling UserApi->createUsersWithListInput: ', $e->getMessage(), PHP_EOL; } @@ -6290,10 +6290,10 @@

    Usage and SDK Samples

    use WWW::OPenAPIClient::UserApi; my $api_instance = WWW::OPenAPIClient::UserApi->new(); -my $user = [WWW::OPenAPIClient::Object::array[User]->new()]; # array[User] | +my $body = [WWW::OPenAPIClient::Object::array[User]->new()]; # array[User] | eval { - $api_instance->createUsersWithListInput(user => $user); + $api_instance->createUsersWithListInput(body => $body); }; if ($@) { warn "Exception when calling UserApi->createUsersWithListInput: $@\n"; @@ -6309,11 +6309,11 @@

    Usage and SDK Samples

    # create an instance of the API class api_instance = openapi_client.UserApi() -user = # array[User] | +body = # array[User] | try: # Creates list of users with given input array - api_instance.create_users_with_list_input(user) + api_instance.create_users_with_list_input(body) except ApiException as e: print("Exception when calling UserApi->createUsersWithListInput: %s\n" % e)
    @@ -6322,10 +6322,10 @@

    Usage and SDK Samples

    extern crate UserApi;
     
     pub fn main() {
    -    let user = ; // array[User]
    +    let body = ; // array[User]
     
         let mut context = UserApi::Context::default();
    -    let result = client.createUsersWithListInput(user, &context).wait();
    +    let result = client.createUsersWithListInput(body, &context).wait();
         println!("{:?}", result);
     
     }
    @@ -6348,7 +6348,7 @@ 

    Parameters

    Name Description - user * + body *

    List of user object

    -
    +
    @@ -6486,7 +6486,7 @@

    Usage and SDK Samples

    Coming Soon!
    -->
    -
    String *username = username_example; // The name that needs to be deleted
    +                              
    String *username = username_example; // The name that needs to be deleted (default to null)
     
     UserApi *apiInstance = [[UserApi alloc] init];
     
    @@ -6535,7 +6535,7 @@ 

    Usage and SDK Samples

    { var apiInstance = new UserApi(); - var username = username_example; // String | The name that needs to be deleted + var username = username_example; // String | The name that needs to be deleted (default to null) try { @@ -6592,7 +6592,7 @@

    Usage and SDK Samples

    # create an instance of the API class api_instance = openapi_client.UserApi() -username = username_example # String | The name that needs to be deleted +username = username_example # String | The name that needs to be deleted (default to null) try: # Delete user @@ -6790,7 +6790,7 @@

    Usage and SDK Samples

    Coming Soon!
    -->
    -
    String *username = username_example; // The name that needs to be fetched. Use user1 for testing.
    +                              
    String *username = username_example; // The name that needs to be fetched. Use user1 for testing. (default to null)
     
     UserApi *apiInstance = [[UserApi alloc] init];
     
    @@ -6842,7 +6842,7 @@ 

    Usage and SDK Samples

    { var apiInstance = new UserApi(); - var username = username_example; // String | The name that needs to be fetched. Use user1 for testing. + var username = username_example; // String | The name that needs to be fetched. Use user1 for testing. (default to null) try { @@ -6902,7 +6902,7 @@

    Usage and SDK Samples

    # create an instance of the API class api_instance = openapi_client.UserApi() -username = username_example # String | The name that needs to be fetched. Use user1 for testing. +username = username_example # String | The name that needs to be fetched. Use user1 for testing. (default to null) try: # Get user by user name @@ -7169,8 +7169,8 @@

    Usage and SDK Samples

    Coming Soon!
    -->
    -
    String *username = username_example; // The user name for login
    -String *password = password_example; // The password for login in clear text
    +                              
    String *username = username_example; // The user name for login (default to null)
    +String *password = password_example; // The password for login in clear text (default to null)
     
     UserApi *apiInstance = [[UserApi alloc] init];
     
    @@ -7224,8 +7224,8 @@ 

    Usage and SDK Samples

    { var apiInstance = new UserApi(); - var username = username_example; // String | The user name for login - var password = password_example; // String | The password for login in clear text + var username = username_example; // String | The user name for login (default to null) + var password = password_example; // String | The password for login in clear text (default to null) try { @@ -7287,8 +7287,8 @@

    Usage and SDK Samples

    # create an instance of the API class api_instance = openapi_client.UserApi() -username = username_example # String | The user name for login -password = password_example # String | The password for login in clear text +username = username_example # String | The user name for login (default to null) +password = password_example # String | The password for login in clear text (default to null) try: # Logs user into the system @@ -7802,9 +7802,9 @@

    Usage and SDK Samples

    UserApi apiInstance = new UserApi(); String username = username_example; // String | name that need to be deleted - User user = ; // User | + User body = ; // User | try { - apiInstance.updateUser(username, user); + apiInstance.updateUser(username, body); } catch (ApiException e) { System.err.println("Exception when calling UserApi#updateUser"); e.printStackTrace(); @@ -7821,9 +7821,9 @@

    Usage and SDK Samples

    public static void main(String[] args) { UserApi apiInstance = new UserApi(); String username = username_example; // String | name that need to be deleted - User user = ; // User | + User body = ; // User | try { - apiInstance.updateUser(username, user); + apiInstance.updateUser(username, body); } catch (ApiException e) { System.err.println("Exception when calling UserApi#updateUser"); e.printStackTrace(); @@ -7836,14 +7836,14 @@

    Usage and SDK Samples

    Coming Soon!
    -->
    -
    String *username = username_example; // name that need to be deleted
    -User *user = ; // 
    +                              
    String *username = username_example; // name that need to be deleted (default to null)
    +User *body = ; // 
     
     UserApi *apiInstance = [[UserApi alloc] init];
     
     // Updated user
     [apiInstance updateUserWith:username
    -    user:user
    +    body:body
                   completionHandler: ^(NSError* error) {
                                 if (error) {
                                     NSLog(@"Error: %@", error);
    @@ -7857,7 +7857,7 @@ 

    Usage and SDK Samples

    var api = new OpenApiPetstore.UserApi() var username = username_example; // {String} name that need to be deleted -var user = ; // {User} +var body = ; // {User} var callback = function(error, data, response) { if (error) { @@ -7866,7 +7866,7 @@

    Usage and SDK Samples

    console.log('API called successfully.'); } }; -api.updateUser(username, user, callback); +api.updateUser(username, body, callback);
    @@ -7888,13 +7888,13 @@

    Usage and SDK Samples

    { var apiInstance = new UserApi(); - var username = username_example; // String | name that need to be deleted - var user = new User(); // User | + var username = username_example; // String | name that need to be deleted (default to null) + var body = new User(); // User | try { // Updated user - apiInstance.updateUser(username, user); + apiInstance.updateUser(username, body); } catch (Exception e) { @@ -7912,10 +7912,10 @@

    Usage and SDK Samples

    $api_instance = new OpenAPITools\Client\Api\UserApi(); $username = username_example; // String | name that need to be deleted -$user = ; // User | +$body = ; // User | try { - $api_instance->updateUser($username, $user); + $api_instance->updateUser($username, $body); } catch (Exception $e) { echo 'Exception when calling UserApi->updateUser: ', $e->getMessage(), PHP_EOL; } @@ -7929,10 +7929,10 @@

    Usage and SDK Samples

    my $api_instance = WWW::OPenAPIClient::UserApi->new(); my $username = username_example; # String | name that need to be deleted -my $user = WWW::OPenAPIClient::Object::User->new(); # User | +my $body = WWW::OPenAPIClient::Object::User->new(); # User | eval { - $api_instance->updateUser(username => $username, user => $user); + $api_instance->updateUser(username => $username, body => $body); }; if ($@) { warn "Exception when calling UserApi->updateUser: $@\n"; @@ -7948,12 +7948,12 @@

    Usage and SDK Samples

    # create an instance of the API class api_instance = openapi_client.UserApi() -username = username_example # String | name that need to be deleted -user = # User | +username = username_example # String | name that need to be deleted (default to null) +body = # User | try: # Updated user - api_instance.update_user(username, user) + api_instance.update_user(username, body) except ApiException as e: print("Exception when calling UserApi->updateUser: %s\n" % e)
    @@ -7963,10 +7963,10 @@

    Usage and SDK Samples

    pub fn main() { let username = username_example; // String - let user = ; // User + let body = ; // User let mut context = UserApi::Context::default(); - let result = client.updateUser(username, user, &context).wait(); + let result = client.updateUser(username, body, &context).wait(); println!("{:?}", result); } @@ -8019,7 +8019,7 @@

    Parameters

    Name Description - user * + body *

    Updated user object

    -
    +
    diff --git a/samples/dynamic-html/.openapi-generator-ignore b/samples/dynamic-html/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/dynamic-html/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/dynamic-html/.openapi-generator/VERSION b/samples/dynamic-html/.openapi-generator/VERSION new file mode 100644 index 000000000000..83a328a9227e --- /dev/null +++ b/samples/dynamic-html/.openapi-generator/VERSION @@ -0,0 +1 @@ +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/dynamic-html/docs/assets/css/bootstrap-responsive.css b/samples/dynamic-html/docs/assets/css/bootstrap-responsive.css new file mode 100644 index 000000000000..a3352d774ce8 --- /dev/null +++ b/samples/dynamic-html/docs/assets/css/bootstrap-responsive.css @@ -0,0 +1,1092 @@ +/*! + * Bootstrap Responsive v2.2.2 + * + * Copyright 2012 Twitter, Inc + * Licensed under the Apache License v2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Designed and built with all the love in the world @twitter by @mdo and @fat. + */ + +@-ms-viewport { + width: device-width; +} + +.clearfix { + *zoom: 1; +} + +.clearfix:before, +.clearfix:after { + display: table; + line-height: 0; + content: ""; +} + +.clearfix:after { + clear: both; +} + +.hide-text { + font: 0/0 a; + color: transparent; + text-shadow: none; + background-color: transparent; + border: 0; +} + +.input-block-level { + display: block; + width: 100%; + min-height: 30px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +.hidden { + display: none; + visibility: hidden; +} + +.visible-phone { + display: none !important; +} + +.visible-tablet { + display: none !important; +} + +.hidden-desktop { + display: none !important; +} + +.visible-desktop { + display: inherit !important; +} + +@media (min-width: 768px) and (max-width: 979px) { + .hidden-desktop { + display: inherit !important; + } + .visible-desktop { + display: none !important ; + } + .visible-tablet { + display: inherit !important; + } + .hidden-tablet { + display: none !important; + } +} + +@media (max-width: 767px) { + .hidden-desktop { + display: inherit !important; + } + .visible-desktop { + display: none !important; + } + .visible-phone { + display: inherit !important; + } + .hidden-phone { + display: none !important; + } +} + +@media (min-width: 1200px) { + .row { + margin-left: -30px; + *zoom: 1; + } + .row:before, + .row:after { + display: table; + line-height: 0; + content: ""; + } + .row:after { + clear: both; + } + [class*="span"] { + float: left; + min-height: 1px; + margin-left: 30px; + } + .container, + .navbar-static-top .container, + .navbar-fixed-top .container, + .navbar-fixed-bottom .container { + width: 1170px; + } + .span12 { + width: 1170px; + } + .span11 { + width: 1070px; + } + .span10 { + width: 970px; + } + .span9 { + width: 870px; + } + .span8 { + width: 770px; + } + .span7 { + width: 670px; + } + .span6 { + width: 570px; + } + .span5 { + width: 470px; + } + .span4 { + width: 370px; + } + .span3 { + width: 270px; + } + .span2 { + width: 170px; + } + .span1 { + width: 70px; + } + .offset12 { + margin-left: 1230px; + } + .offset11 { + margin-left: 1130px; + } + .offset10 { + margin-left: 1030px; + } + .offset9 { + margin-left: 930px; + } + .offset8 { + margin-left: 830px; + } + .offset7 { + margin-left: 730px; + } + .offset6 { + margin-left: 630px; + } + .offset5 { + margin-left: 530px; + } + .offset4 { + margin-left: 430px; + } + .offset3 { + margin-left: 330px; + } + .offset2 { + margin-left: 230px; + } + .offset1 { + margin-left: 130px; + } + .row-fluid { + width: 100%; + *zoom: 1; + } + .row-fluid:before, + .row-fluid:after { + display: table; + line-height: 0; + content: ""; + } + .row-fluid:after { + clear: both; + } + .row-fluid [class*="span"] { + display: block; + float: left; + width: 100%; + min-height: 30px; + margin-left: 2.564102564102564%; + *margin-left: 2.5109110747408616%; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + } + .row-fluid [class*="span"]:first-child { + margin-left: 0; + } + .row-fluid .controls-row [class*="span"] + [class*="span"] { + margin-left: 2.564102564102564%; + } + .row-fluid .span12 { + width: 100%; + *width: 99.94680851063829%; + } + .row-fluid .span11 { + width: 91.45299145299145%; + *width: 91.39979996362975%; + } + .row-fluid .span10 { + width: 82.90598290598291%; + *width: 82.8527914166212%; + } + .row-fluid .span9 { + width: 74.35897435897436%; + *width: 74.30578286961266%; + } + .row-fluid .span8 { + width: 65.81196581196582%; + *width: 65.75877432260411%; + } + .row-fluid .span7 { + width: 57.26495726495726%; + *width: 57.21176577559556%; + } + .row-fluid .span6 { + width: 48.717948717948715%; + *width: 48.664757228587014%; + } + .row-fluid .span5 { + width: 40.17094017094017%; + *width: 40.11774868157847%; + } + .row-fluid .span4 { + width: 31.623931623931625%; + *width: 31.570740134569924%; + } + .row-fluid .span3 { + width: 23.076923076923077%; + *width: 23.023731587561375%; + } + .row-fluid .span2 { + width: 14.52991452991453%; + *width: 14.476723040552828%; + } + .row-fluid .span1 { + width: 5.982905982905983%; + *width: 5.929714493544281%; + } + .row-fluid .offset12 { + margin-left: 105.12820512820512%; + *margin-left: 105.02182214948171%; + } + .row-fluid .offset12:first-child { + margin-left: 102.56410256410257%; + *margin-left: 102.45771958537915%; + } + .row-fluid .offset11 { + margin-left: 96.58119658119658%; + *margin-left: 96.47481360247316%; + } + .row-fluid .offset11:first-child { + margin-left: 94.01709401709402%; + *margin-left: 93.91071103837061%; + } + .row-fluid .offset10 { + margin-left: 88.03418803418803%; + *margin-left: 87.92780505546462%; + } + .row-fluid .offset10:first-child { + margin-left: 85.47008547008548%; + *margin-left: 85.36370249136206%; + } + .row-fluid .offset9 { + margin-left: 79.48717948717949%; + *margin-left: 79.38079650845607%; + } + .row-fluid .offset9:first-child { + margin-left: 76.92307692307693%; + *margin-left: 76.81669394435352%; + } + .row-fluid .offset8 { + margin-left: 70.94017094017094%; + *margin-left: 70.83378796144753%; + } + .row-fluid .offset8:first-child { + margin-left: 68.37606837606839%; + *margin-left: 68.26968539734497%; + } + .row-fluid .offset7 { + margin-left: 62.393162393162385%; + *margin-left: 62.28677941443899%; + } + .row-fluid .offset7:first-child { + margin-left: 59.82905982905982%; + *margin-left: 59.72267685033642%; + } + .row-fluid .offset6 { + margin-left: 53.84615384615384%; + *margin-left: 53.739770867430444%; + } + .row-fluid .offset6:first-child { + margin-left: 51.28205128205128%; + *margin-left: 51.175668303327875%; + } + .row-fluid .offset5 { + margin-left: 45.299145299145295%; + *margin-left: 45.1927623204219%; + } + .row-fluid .offset5:first-child { + margin-left: 42.73504273504273%; + *margin-left: 42.62865975631933%; + } + .row-fluid .offset4 { + margin-left: 36.75213675213675%; + *margin-left: 36.645753773413354%; + } + .row-fluid .offset4:first-child { + margin-left: 34.18803418803419%; + *margin-left: 34.081651209310785%; + } + .row-fluid .offset3 { + margin-left: 28.205128205128204%; + *margin-left: 28.0987452264048%; + } + .row-fluid .offset3:first-child { + margin-left: 25.641025641025642%; + *margin-left: 25.53464266230224%; + } + .row-fluid .offset2 { + margin-left: 19.65811965811966%; + *margin-left: 19.551736679396257%; + } + .row-fluid .offset2:first-child { + margin-left: 17.094017094017094%; + *margin-left: 16.98763411529369%; + } + .row-fluid .offset1 { + margin-left: 11.11111111111111%; + *margin-left: 11.004728132387708%; + } + .row-fluid .offset1:first-child { + margin-left: 8.547008547008547%; + *margin-left: 8.440625568285142%; + } + input, + textarea, + .uneditable-input { + margin-left: 0; + } + .controls-row [class*="span"] + [class*="span"] { + margin-left: 30px; + } + input.span12, + textarea.span12, + .uneditable-input.span12 { + width: 1156px; + } + input.span11, + textarea.span11, + .uneditable-input.span11 { + width: 1056px; + } + input.span10, + textarea.span10, + .uneditable-input.span10 { + width: 956px; + } + input.span9, + textarea.span9, + .uneditable-input.span9 { + width: 856px; + } + input.span8, + textarea.span8, + .uneditable-input.span8 { + width: 756px; + } + input.span7, + textarea.span7, + .uneditable-input.span7 { + width: 656px; + } + input.span6, + textarea.span6, + .uneditable-input.span6 { + width: 556px; + } + input.span5, + textarea.span5, + .uneditable-input.span5 { + width: 456px; + } + input.span4, + textarea.span4, + .uneditable-input.span4 { + width: 356px; + } + input.span3, + textarea.span3, + .uneditable-input.span3 { + width: 256px; + } + input.span2, + textarea.span2, + .uneditable-input.span2 { + width: 156px; + } + input.span1, + textarea.span1, + .uneditable-input.span1 { + width: 56px; + } + .thumbnails { + margin-left: -30px; + } + .thumbnails > li { + margin-left: 30px; + } + .row-fluid .thumbnails { + margin-left: 0; + } +} + +@media (min-width: 768px) and (max-width: 979px) { + .row { + margin-left: -20px; + *zoom: 1; + } + .row:before, + .row:after { + display: table; + line-height: 0; + content: ""; + } + .row:after { + clear: both; + } + [class*="span"] { + float: left; + min-height: 1px; + margin-left: 20px; + } + .container, + .navbar-static-top .container, + .navbar-fixed-top .container, + .navbar-fixed-bottom .container { + width: 724px; + } + .span12 { + width: 724px; + } + .span11 { + width: 662px; + } + .span10 { + width: 600px; + } + .span9 { + width: 538px; + } + .span8 { + width: 476px; + } + .span7 { + width: 414px; + } + .span6 { + width: 352px; + } + .span5 { + width: 290px; + } + .span4 { + width: 228px; + } + .span3 { + width: 166px; + } + .span2 { + width: 104px; + } + .span1 { + width: 42px; + } + .offset12 { + margin-left: 764px; + } + .offset11 { + margin-left: 702px; + } + .offset10 { + margin-left: 640px; + } + .offset9 { + margin-left: 578px; + } + .offset8 { + margin-left: 516px; + } + .offset7 { + margin-left: 454px; + } + .offset6 { + margin-left: 392px; + } + .offset5 { + margin-left: 330px; + } + .offset4 { + margin-left: 268px; + } + .offset3 { + margin-left: 206px; + } + .offset2 { + margin-left: 144px; + } + .offset1 { + margin-left: 82px; + } + .row-fluid { + width: 100%; + *zoom: 1; + } + .row-fluid:before, + .row-fluid:after { + display: table; + line-height: 0; + content: ""; + } + .row-fluid:after { + clear: both; + } + .row-fluid [class*="span"] { + display: block; + float: left; + width: 100%; + min-height: 30px; + margin-left: 2.7624309392265194%; + *margin-left: 2.709239449864817%; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + } + .row-fluid [class*="span"]:first-child { + margin-left: 0; + } + .row-fluid .controls-row [class*="span"] + [class*="span"] { + margin-left: 2.7624309392265194%; + } + .row-fluid .span12 { + width: 100%; + *width: 99.94680851063829%; + } + .row-fluid .span11 { + width: 91.43646408839778%; + *width: 91.38327259903608%; + } + .row-fluid .span10 { + width: 82.87292817679558%; + *width: 82.81973668743387%; + } + .row-fluid .span9 { + width: 74.30939226519337%; + *width: 74.25620077583166%; + } + .row-fluid .span8 { + width: 65.74585635359117%; + *width: 65.69266486422946%; + } + .row-fluid .span7 { + width: 57.18232044198895%; + *width: 57.12912895262725%; + } + .row-fluid .span6 { + width: 48.61878453038674%; + *width: 48.56559304102504%; + } + .row-fluid .span5 { + width: 40.05524861878453%; + *width: 40.00205712942283%; + } + .row-fluid .span4 { + width: 31.491712707182323%; + *width: 31.43852121782062%; + } + .row-fluid .span3 { + width: 22.92817679558011%; + *width: 22.87498530621841%; + } + .row-fluid .span2 { + width: 14.3646408839779%; + *width: 14.311449394616199%; + } + .row-fluid .span1 { + width: 5.801104972375691%; + *width: 5.747913483013988%; + } + .row-fluid .offset12 { + margin-left: 105.52486187845304%; + *margin-left: 105.41847889972962%; + } + .row-fluid .offset12:first-child { + margin-left: 102.76243093922652%; + *margin-left: 102.6560479605031%; + } + .row-fluid .offset11 { + margin-left: 96.96132596685082%; + *margin-left: 96.8549429881274%; + } + .row-fluid .offset11:first-child { + margin-left: 94.1988950276243%; + *margin-left: 94.09251204890089%; + } + .row-fluid .offset10 { + margin-left: 88.39779005524862%; + *margin-left: 88.2914070765252%; + } + .row-fluid .offset10:first-child { + margin-left: 85.6353591160221%; + *margin-left: 85.52897613729868%; + } + .row-fluid .offset9 { + margin-left: 79.8342541436464%; + *margin-left: 79.72787116492299%; + } + .row-fluid .offset9:first-child { + margin-left: 77.07182320441989%; + *margin-left: 76.96544022569647%; + } + .row-fluid .offset8 { + margin-left: 71.2707182320442%; + *margin-left: 71.16433525332079%; + } + .row-fluid .offset8:first-child { + margin-left: 68.50828729281768%; + *margin-left: 68.40190431409427%; + } + .row-fluid .offset7 { + margin-left: 62.70718232044199%; + *margin-left: 62.600799341718584%; + } + .row-fluid .offset7:first-child { + margin-left: 59.94475138121547%; + *margin-left: 59.838368402492065%; + } + .row-fluid .offset6 { + margin-left: 54.14364640883978%; + *margin-left: 54.037263430116376%; + } + .row-fluid .offset6:first-child { + margin-left: 51.38121546961326%; + *margin-left: 51.27483249088986%; + } + .row-fluid .offset5 { + margin-left: 45.58011049723757%; + *margin-left: 45.47372751851417%; + } + .row-fluid .offset5:first-child { + margin-left: 42.81767955801105%; + *margin-left: 42.71129657928765%; + } + .row-fluid .offset4 { + margin-left: 37.01657458563536%; + *margin-left: 36.91019160691196%; + } + .row-fluid .offset4:first-child { + margin-left: 34.25414364640884%; + *margin-left: 34.14776066768544%; + } + .row-fluid .offset3 { + margin-left: 28.45303867403315%; + *margin-left: 28.346655695309746%; + } + .row-fluid .offset3:first-child { + margin-left: 25.69060773480663%; + *margin-left: 25.584224756083227%; + } + .row-fluid .offset2 { + margin-left: 19.88950276243094%; + *margin-left: 19.783119783707537%; + } + .row-fluid .offset2:first-child { + margin-left: 17.12707182320442%; + *margin-left: 17.02068884448102%; + } + .row-fluid .offset1 { + margin-left: 11.32596685082873%; + *margin-left: 11.219583872105325%; + } + .row-fluid .offset1:first-child { + margin-left: 8.56353591160221%; + *margin-left: 8.457152932878806%; + } + input, + textarea, + .uneditable-input { + margin-left: 0; + } + .controls-row [class*="span"] + [class*="span"] { + margin-left: 20px; + } + input.span12, + textarea.span12, + .uneditable-input.span12 { + width: 710px; + } + input.span11, + textarea.span11, + .uneditable-input.span11 { + width: 648px; + } + input.span10, + textarea.span10, + .uneditable-input.span10 { + width: 586px; + } + input.span9, + textarea.span9, + .uneditable-input.span9 { + width: 524px; + } + input.span8, + textarea.span8, + .uneditable-input.span8 { + width: 462px; + } + input.span7, + textarea.span7, + .uneditable-input.span7 { + width: 400px; + } + input.span6, + textarea.span6, + .uneditable-input.span6 { + width: 338px; + } + input.span5, + textarea.span5, + .uneditable-input.span5 { + width: 276px; + } + input.span4, + textarea.span4, + .uneditable-input.span4 { + width: 214px; + } + input.span3, + textarea.span3, + .uneditable-input.span3 { + width: 152px; + } + input.span2, + textarea.span2, + .uneditable-input.span2 { + width: 90px; + } + input.span1, + textarea.span1, + .uneditable-input.span1 { + width: 28px; + } +} + +@media (max-width: 767px) { + body { + padding-right: 20px; + padding-left: 20px; + } + .navbar-fixed-top, + .navbar-fixed-bottom, + .navbar-static-top { + margin-right: -20px; + margin-left: -20px; + } + .container-fluid { + padding: 0; + } + .dl-horizontal dt { + float: none; + width: auto; + clear: none; + text-align: left; + } + .dl-horizontal dd { + margin-left: 0; + } + .container { + width: auto; + } + .row-fluid { + width: 100%; + } + .row, + .thumbnails { + margin-left: 0; + } + .thumbnails > li { + float: none; + margin-left: 0; + } + [class*="span"], + .uneditable-input[class*="span"], + .row-fluid [class*="span"] { + display: block; + float: none; + width: 100%; + margin-left: 0; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + } + .span12, + .row-fluid .span12 { + width: 100%; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + } + .row-fluid [class*="offset"]:first-child { + margin-left: 0; + } + .input-large, + .input-xlarge, + .input-xxlarge, + input[class*="span"], + select[class*="span"], + textarea[class*="span"], + .uneditable-input { + display: block; + width: 100%; + min-height: 30px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + } + .input-prepend input, + .input-append input, + .input-prepend input[class*="span"], + .input-append input[class*="span"] { + display: inline-block; + width: auto; + } + .controls-row [class*="span"] + [class*="span"] { + margin-left: 0; + } + .modal { + position: fixed; + top: 20px; + right: 20px; + left: 20px; + width: auto; + margin: 0; + } + .modal.fade { + top: -100px; + } + .modal.fade.in { + top: 20px; + } +} + +@media (max-width: 480px) { + .nav-collapse { + -webkit-transform: translate3d(0, 0, 0); + } + .page-header h1 small { + display: block; + line-height: 20px; + } + input[type="checkbox"], + input[type="radio"] { + border: 1px solid #ccc; + } + .form-horizontal .control-label { + float: none; + width: auto; + padding-top: 0; + text-align: left; + } + .form-horizontal .controls { + margin-left: 0; + } + .form-horizontal .control-list { + padding-top: 0; + } + .form-horizontal .form-actions { + padding-right: 10px; + padding-left: 10px; + } + .media .pull-left, + .media .pull-right { + display: block; + float: none; + margin-bottom: 10px; + } + .media-object { + margin-right: 0; + margin-left: 0; + } + .modal { + top: 10px; + right: 10px; + left: 10px; + } + .modal-header .close { + padding: 10px; + margin: -10px; + } + .carousel-caption { + position: static; + } +} + +@media (max-width: 979px) { + body { + padding-top: 0; + } + .navbar-fixed-top, + .navbar-fixed-bottom { + position: static; + } + .navbar-fixed-top { + margin-bottom: 20px; + } + .navbar-fixed-bottom { + margin-top: 20px; + } + .navbar-fixed-top .navbar-inner, + .navbar-fixed-bottom .navbar-inner { + padding: 5px; + } + .navbar .container { + width: auto; + padding: 0; + } + .navbar .brand { + padding-right: 10px; + padding-left: 10px; + margin: 0 0 0 -5px; + } + .nav-collapse { + clear: both; + } + .nav-collapse .nav { + float: none; + margin: 0 0 10px; + } + .nav-collapse .nav > li { + float: none; + } + .nav-collapse .nav > li > a { + margin-bottom: 2px; + } + .nav-collapse .nav > .divider-vertical { + display: none; + } + .nav-collapse .nav .nav-header { + color: #777777; + text-shadow: none; + } + .nav-collapse .nav > li > a, + .nav-collapse .dropdown-menu a { + padding: 9px 15px; + font-weight: bold; + color: #777777; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + } + .nav-collapse .btn { + padding: 4px 10px 4px; + font-weight: normal; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + } + .nav-collapse .dropdown-menu li + li a { + margin-bottom: 2px; + } + .nav-collapse .nav > li > a:hover, + .nav-collapse .dropdown-menu a:hover { + background-color: #f2f2f2; + } + .navbar-inverse .nav-collapse .nav > li > a, + .navbar-inverse .nav-collapse .dropdown-menu a { + color: #999999; + } + .navbar-inverse .nav-collapse .nav > li > a:hover, + .navbar-inverse .nav-collapse .dropdown-menu a:hover { + background-color: #111111; + } + .nav-collapse.in .btn-group { + padding: 0; + margin-top: 5px; + } + .nav-collapse .dropdown-menu { + position: static; + top: auto; + left: auto; + display: none; + float: none; + max-width: none; + padding: 0; + margin: 0 15px; + background-color: transparent; + border: none; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; + } + .nav-collapse .open > .dropdown-menu { + display: block; + } + .nav-collapse .dropdown-menu:before, + .nav-collapse .dropdown-menu:after { + display: none; + } + .nav-collapse .dropdown-menu .divider { + display: none; + } + .nav-collapse .nav > li > .dropdown-menu:before, + .nav-collapse .nav > li > .dropdown-menu:after { + display: none; + } + .nav-collapse .navbar-form, + .nav-collapse .navbar-search { + float: none; + padding: 10px 15px; + margin: 10px 0; + border-top: 1px solid #f2f2f2; + border-bottom: 1px solid #f2f2f2; + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); + -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); + } + .navbar-inverse .nav-collapse .navbar-form, + .navbar-inverse .nav-collapse .navbar-search { + border-top-color: #111111; + border-bottom-color: #111111; + } + .navbar .nav-collapse .nav.pull-right { + float: none; + margin-left: 0; + } + .nav-collapse, + .nav-collapse.collapse { + height: 0; + overflow: hidden; + } + .navbar .btn-navbar { + display: block; + } + .navbar-static .navbar-inner { + padding-right: 10px; + padding-left: 10px; + } +} + +@media (min-width: 980px) { + .nav-collapse.collapse { + height: auto !important; + overflow: visible !important; + } +} diff --git a/samples/dynamic-html/docs/assets/css/bootstrap.css b/samples/dynamic-html/docs/assets/css/bootstrap.css new file mode 100644 index 000000000000..db3b3bfd6a0c --- /dev/null +++ b/samples/dynamic-html/docs/assets/css/bootstrap.css @@ -0,0 +1,6057 @@ +/*! + * Bootstrap v2.2.2 + * + * Copyright 2012 Twitter, Inc + * Licensed under the Apache License v2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Designed and built with all the love in the world @twitter by @mdo and @fat. + */ + +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +nav, +section { + display: block; +} + +audio, +canvas, +video { + display: inline-block; + *display: inline; + *zoom: 1; +} + +audio:not([controls]) { + display: none; +} + +html { + font-size: 100%; + -webkit-text-size-adjust: 100%; + -ms-text-size-adjust: 100%; +} + +a:focus { + outline: thin dotted #333; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} + +a:hover, +a:active { + outline: 0; +} + +sub, +sup { + position: relative; + font-size: 75%; + line-height: 0; + vertical-align: baseline; +} + +sup { + top: -0.5em; +} + +sub { + bottom: -0.25em; +} + +img { + width: auto\9; + height: auto; + max-width: 100%; + vertical-align: middle; + border: 0; + -ms-interpolation-mode: bicubic; +} + +#map_canvas img, +.google-maps img { + max-width: none; +} + +button, +input, +select, +textarea { + margin: 0; + font-size: 100%; + vertical-align: middle; +} + +button, +input { + *overflow: visible; + line-height: normal; +} + +button::-moz-focus-inner, +input::-moz-focus-inner { + padding: 0; + border: 0; +} + +button, +html input[type="button"], +input[type="reset"], +input[type="submit"] { + cursor: pointer; + -webkit-appearance: button; +} + +label, +select, +button, +input[type="button"], +input[type="reset"], +input[type="submit"], +input[type="radio"], +input[type="checkbox"] { + cursor: pointer; +} + +input[type="search"] { + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; + -webkit-appearance: textfield; +} + +input[type="search"]::-webkit-search-decoration, +input[type="search"]::-webkit-search-cancel-button { + -webkit-appearance: none; +} + +textarea { + overflow: auto; + vertical-align: top; +} + +@media print { + * { + color: #000 !important; + text-shadow: none !important; + background: transparent !important; + box-shadow: none !important; + } + a, + a:visited { + text-decoration: underline; + } + a[href]:after { + content: " (" attr(href) ")"; + } + abbr[title]:after { + content: " (" attr(title) ")"; + } + .ir a:after, + a[href^="javascript:"]:after, + a[href^="#"]:after { + content: ""; + } + pre, + blockquote { + border: 1px solid #999; + page-break-inside: avoid; + } + thead { + display: table-header-group; + } + tr, + img { + page-break-inside: avoid; + } + img { + max-width: 100% !important; + } + @page { + margin: 0.5cm; + } + p, + h2, + h3 { + orphans: 3; + widows: 3; + } + h2, + h3 { + page-break-after: avoid; + } +} + +.clearfix { + *zoom: 1; +} + +.clearfix:before, +.clearfix:after { + display: table; + line-height: 0; + content: ""; +} + +.clearfix:after { + clear: both; +} + +.hide-text { + font: 0/0 a; + color: transparent; + text-shadow: none; + background-color: transparent; + border: 0; +} + +.input-block-level { + display: block; + width: 100%; + min-height: 30px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +body { + margin: 0; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; + line-height: 20px; + color: #333333; + background-color: #ffffff; +} + +a { + color: #0088cc; + text-decoration: none; +} + +a:hover { + color: #005580; + text-decoration: underline; +} + +.img-rounded { + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; +} + +.img-polaroid { + padding: 4px; + background-color: #fff; + border: 1px solid #ccc; + border: 1px solid rgba(0, 0, 0, 0.2); + -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); + -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); +} + +.img-circle { + -webkit-border-radius: 500px; + -moz-border-radius: 500px; + border-radius: 500px; +} + +.row { + margin-left: -20px; + *zoom: 1; +} + +.row:before, +.row:after { + display: table; + line-height: 0; + content: ""; +} + +.row:after { + clear: both; +} + +[class*="span"] { + float: left; + min-height: 1px; + margin-left: 20px; +} + +.container, +.navbar-static-top .container, +.navbar-fixed-top .container, +.navbar-fixed-bottom .container { + width: 940px; +} + +.span12 { + width: 940px; +} + +.span11 { + width: 860px; +} + +.span10 { + width: 780px; +} + +.span9 { + width: 700px; +} + +.span8 { + width: 620px; +} + +.span7 { + width: 540px; +} + +.span6 { + width: 460px; +} + +.span5 { + width: 380px; +} + +.span4 { + width: 300px; +} + +.span3 { + width: 220px; +} + +.span2 { + width: 140px; +} + +.span1 { + width: 60px; +} + +.offset12 { + margin-left: 980px; +} + +.offset11 { + margin-left: 900px; +} + +.offset10 { + margin-left: 820px; +} + +.offset9 { + margin-left: 740px; +} + +.offset8 { + margin-left: 660px; +} + +.offset7 { + margin-left: 580px; +} + +.offset6 { + margin-left: 500px; +} + +.offset5 { + margin-left: 420px; +} + +.offset4 { + margin-left: 340px; +} + +.offset3 { + margin-left: 260px; +} + +.offset2 { + margin-left: 180px; +} + +.offset1 { + margin-left: 100px; +} + +.row-fluid { + width: 100%; + *zoom: 1; +} + +.row-fluid:before, +.row-fluid:after { + display: table; + line-height: 0; + content: ""; +} + +.row-fluid:after { + clear: both; +} + +.row-fluid [class*="span"] { + display: block; + float: left; + width: 100%; + min-height: 30px; + margin-left: 2.127659574468085%; + *margin-left: 2.074468085106383%; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +.row-fluid [class*="span"]:first-child { + margin-left: 0; +} + +.row-fluid .controls-row [class*="span"] + [class*="span"] { + margin-left: 2.127659574468085%; +} + +.row-fluid .span12 { + width: 100%; + *width: 99.94680851063829%; +} + +.row-fluid .span11 { + width: 91.48936170212765%; + *width: 91.43617021276594%; +} + +.row-fluid .span10 { + width: 82.97872340425532%; + *width: 82.92553191489361%; +} + +.row-fluid .span9 { + width: 74.46808510638297%; + *width: 74.41489361702126%; +} + +.row-fluid .span8 { + width: 65.95744680851064%; + *width: 65.90425531914893%; +} + +.row-fluid .span7 { + width: 57.44680851063829%; + *width: 57.39361702127659%; +} + +.row-fluid .span6 { + width: 48.93617021276595%; + *width: 48.88297872340425%; +} + +.row-fluid .span5 { + width: 40.42553191489362%; + *width: 40.37234042553192%; +} + +.row-fluid .span4 { + width: 31.914893617021278%; + *width: 31.861702127659576%; +} + +.row-fluid .span3 { + width: 23.404255319148934%; + *width: 23.351063829787233%; +} + +.row-fluid .span2 { + width: 14.893617021276595%; + *width: 14.840425531914894%; +} + +.row-fluid .span1 { + width: 6.382978723404255%; + *width: 6.329787234042553%; +} + +.row-fluid .offset12 { + margin-left: 104.25531914893617%; + *margin-left: 104.14893617021275%; +} + +.row-fluid .offset12:first-child { + margin-left: 102.12765957446808%; + *margin-left: 102.02127659574467%; +} + +.row-fluid .offset11 { + margin-left: 95.74468085106382%; + *margin-left: 95.6382978723404%; +} + +.row-fluid .offset11:first-child { + margin-left: 93.61702127659574%; + *margin-left: 93.51063829787232%; +} + +.row-fluid .offset10 { + margin-left: 87.23404255319149%; + *margin-left: 87.12765957446807%; +} + +.row-fluid .offset10:first-child { + margin-left: 85.1063829787234%; + *margin-left: 84.99999999999999%; +} + +.row-fluid .offset9 { + margin-left: 78.72340425531914%; + *margin-left: 78.61702127659572%; +} + +.row-fluid .offset9:first-child { + margin-left: 76.59574468085106%; + *margin-left: 76.48936170212764%; +} + +.row-fluid .offset8 { + margin-left: 70.2127659574468%; + *margin-left: 70.10638297872339%; +} + +.row-fluid .offset8:first-child { + margin-left: 68.08510638297872%; + *margin-left: 67.9787234042553%; +} + +.row-fluid .offset7 { + margin-left: 61.70212765957446%; + *margin-left: 61.59574468085106%; +} + +.row-fluid .offset7:first-child { + margin-left: 59.574468085106375%; + *margin-left: 59.46808510638297%; +} + +.row-fluid .offset6 { + margin-left: 53.191489361702125%; + *margin-left: 53.085106382978715%; +} + +.row-fluid .offset6:first-child { + margin-left: 51.063829787234035%; + *margin-left: 50.95744680851063%; +} + +.row-fluid .offset5 { + margin-left: 44.68085106382979%; + *margin-left: 44.57446808510638%; +} + +.row-fluid .offset5:first-child { + margin-left: 42.5531914893617%; + *margin-left: 42.4468085106383%; +} + +.row-fluid .offset4 { + margin-left: 36.170212765957444%; + *margin-left: 36.06382978723405%; +} + +.row-fluid .offset4:first-child { + margin-left: 34.04255319148936%; + *margin-left: 33.93617021276596%; +} + +.row-fluid .offset3 { + margin-left: 27.659574468085104%; + *margin-left: 27.5531914893617%; +} + +.row-fluid .offset3:first-child { + margin-left: 25.53191489361702%; + *margin-left: 25.425531914893618%; +} + +.row-fluid .offset2 { + margin-left: 19.148936170212764%; + *margin-left: 19.04255319148936%; +} + +.row-fluid .offset2:first-child { + margin-left: 17.02127659574468%; + *margin-left: 16.914893617021278%; +} + +.row-fluid .offset1 { + margin-left: 10.638297872340425%; + *margin-left: 10.53191489361702%; +} + +.row-fluid .offset1:first-child { + margin-left: 8.51063829787234%; + *margin-left: 8.404255319148938%; +} + +[class*="span"].hide, +.row-fluid [class*="span"].hide { + display: none; +} + +[class*="span"].pull-right, +.row-fluid [class*="span"].pull-right { + float: right; +} + +.container { + margin-right: auto; + margin-left: auto; + *zoom: 1; +} + +.container:before, +.container:after { + display: table; + line-height: 0; + content: ""; +} + +.container:after { + clear: both; +} + +.container-fluid { + padding-right: 20px; + padding-left: 20px; + *zoom: 1; +} + +.container-fluid:before, +.container-fluid:after { + display: table; + line-height: 0; + content: ""; +} + +.container-fluid:after { + clear: both; +} + +p { + margin: 0 0 10px; +} + +.lead { + margin-bottom: 20px; + font-size: 21px; + font-weight: 200; + line-height: 30px; +} + +small { + font-size: 85%; +} + +strong { + font-weight: bold; +} + +em { + font-style: italic; +} + +cite { + font-style: normal; +} + +.muted { + color: #999999; +} + +a.muted:hover { + color: #808080; +} + +.text-warning { + color: #c09853; +} + +a.text-warning:hover { + color: #a47e3c; +} + +.text-error { + color: #b94a48; +} + +a.text-error:hover { + color: #953b39; +} + +.text-info { + color: #3a87ad; +} + +a.text-info:hover { + color: #2d6987; +} + +.text-success { + color: #468847; +} + +a.text-success:hover { + color: #356635; +} + +h1, +h2, +h3, +h4, +h5, +h6 { + margin: 10px 0; + font-family: inherit; + font-weight: bold; + line-height: 20px; + color: inherit; + text-rendering: optimizelegibility; +} + +h1 small, +h2 small, +h3 small, +h4 small, +h5 small, +h6 small { + font-weight: normal; + line-height: 1; + color: #999999; +} + +h1, +h2, +h3 { + line-height: 40px; +} + +h1 { + font-size: 38.5px; +} + +h2 { + font-size: 31.5px; +} + +h3 { + font-size: 24.5px; +} + +h4 { + font-size: 17.5px; +} + +h5 { + font-size: 14px; +} + +h6 { + font-size: 11.9px; +} + +h1 small { + font-size: 24.5px; +} + +h2 small { + font-size: 17.5px; +} + +h3 small { + font-size: 14px; +} + +h4 small { + font-size: 14px; +} + +.page-header { + padding-bottom: 9px; + margin: 20px 0 30px; + border-bottom: 1px solid #eeeeee; +} + +ul, +ol { + padding: 0; + margin: 0 0 10px 25px; +} + +ul ul, +ul ol, +ol ol, +ol ul { + margin-bottom: 0; +} + +li { + line-height: 20px; +} + +ul.unstyled, +ol.unstyled { + margin-left: 0; + list-style: none; +} + +ul.inline, +ol.inline { + margin-left: 0; + list-style: none; +} + +ul.inline > li, +ol.inline > li { + display: inline-block; + padding-right: 5px; + padding-left: 5px; +} + +dl { + margin-bottom: 20px; +} + +dt, +dd { + line-height: 20px; +} + +dt { + font-weight: bold; +} + +dd { + margin-left: 10px; +} + +.dl-horizontal { + *zoom: 1; +} + +.dl-horizontal:before, +.dl-horizontal:after { + display: table; + line-height: 0; + content: ""; +} + +.dl-horizontal:after { + clear: both; +} + +.dl-horizontal dt { + float: left; + width: 160px; + overflow: hidden; + clear: left; + text-align: right; + text-overflow: ellipsis; + white-space: nowrap; +} + +.dl-horizontal dd { + margin-left: 180px; +} + +hr { + margin: 20px 0; + border: 0; + border-top: 1px solid #eeeeee; + border-bottom: 1px solid #ffffff; +} + +abbr[title], +abbr[data-original-title] { + cursor: help; + border-bottom: 1px dotted #999999; +} + +abbr.initialism { + font-size: 90%; + text-transform: uppercase; +} + +blockquote { + padding: 0 0 0 15px; + margin: 0 0 20px; + border-left: 5px solid #eeeeee; +} + +blockquote p { + margin-bottom: 0; + font-size: 16px; + font-weight: 300; + line-height: 25px; +} + +blockquote small { + display: block; + line-height: 20px; + color: #999999; +} + +blockquote small:before { + content: '\2014 \00A0'; +} + +blockquote.pull-right { + float: right; + padding-right: 15px; + padding-left: 0; + border-right: 5px solid #eeeeee; + border-left: 0; +} + +blockquote.pull-right p, +blockquote.pull-right small { + text-align: right; +} + +blockquote.pull-right small:before { + content: ''; +} + +blockquote.pull-right small:after { + content: '\00A0 \2014'; +} + +q:before, +q:after, +blockquote:before, +blockquote:after { + content: ""; +} + +address { + display: block; + margin-bottom: 20px; + font-style: normal; + line-height: 20px; +} + +code, +pre { + padding: 0 3px 2px; + font-family: Monaco, Menlo, Consolas, "Courier New", monospace; + font-size: 12px; + color: #333333; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} + +code { + padding: 2px 4px; + color: #d14; + white-space: nowrap; + background-color: #f7f7f9; + border: 1px solid #e1e1e8; +} + +pre { + display: block; + padding: 9.5px; + margin: 0 0 10px; + font-size: 13px; + line-height: 20px; + word-break: break-all; + word-wrap: break-word; + white-space: pre; + white-space: pre-wrap; + background-color: #f5f5f5; + border: 1px solid #ccc; + border: 1px solid rgba(0, 0, 0, 0.15); + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} + +pre.prettyprint { + margin-bottom: 20px; +} + +pre code { + padding: 0; + color: inherit; + white-space: pre; + white-space: pre-wrap; + background-color: transparent; + border: 0; +} + +.pre-scrollable { + max-height: 340px; + overflow-y: scroll; +} + +form { + margin: 0 0 20px; +} + +fieldset { + padding: 0; + margin: 0; + border: 0; +} + +legend { + display: block; + width: 100%; + padding: 0; + margin-bottom: 20px; + font-size: 21px; + line-height: 40px; + color: #333333; + border: 0; + border-bottom: 1px solid #e5e5e5; +} + +legend small { + font-size: 15px; + color: #999999; +} + +label, +input, +button, +select, +textarea { + font-size: 14px; + font-weight: normal; + line-height: 20px; +} + +input, +button, +select, +textarea { + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; +} + +label { + display: block; + margin-bottom: 5px; +} + +select, +textarea, +input[type="text"], +input[type="password"], +input[type="datetime"], +input[type="datetime-local"], +input[type="date"], +input[type="month"], +input[type="time"], +input[type="week"], +input[type="number"], +input[type="email"], +input[type="url"], +input[type="search"], +input[type="tel"], +input[type="color"], +.uneditable-input { + display: inline-block; + height: 20px; + padding: 4px 6px; + margin-bottom: 10px; + font-size: 14px; + line-height: 20px; + color: #555555; + vertical-align: middle; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} + +input, +textarea, +.uneditable-input { + width: 206px; +} + +textarea { + height: auto; +} + +textarea, +input[type="text"], +input[type="password"], +input[type="datetime"], +input[type="datetime-local"], +input[type="date"], +input[type="month"], +input[type="time"], +input[type="week"], +input[type="number"], +input[type="email"], +input[type="url"], +input[type="search"], +input[type="tel"], +input[type="color"], +.uneditable-input { + background-color: #ffffff; + border: 1px solid #cccccc; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -webkit-transition: border linear 0.2s, box-shadow linear 0.2s; + -moz-transition: border linear 0.2s, box-shadow linear 0.2s; + -o-transition: border linear 0.2s, box-shadow linear 0.2s; + transition: border linear 0.2s, box-shadow linear 0.2s; +} + +textarea:focus, +input[type="text"]:focus, +input[type="password"]:focus, +input[type="datetime"]:focus, +input[type="datetime-local"]:focus, +input[type="date"]:focus, +input[type="month"]:focus, +input[type="time"]:focus, +input[type="week"]:focus, +input[type="number"]:focus, +input[type="email"]:focus, +input[type="url"]:focus, +input[type="search"]:focus, +input[type="tel"]:focus, +input[type="color"]:focus, +.uneditable-input:focus { + border-color: rgba(82, 168, 236, 0.8); + outline: 0; + outline: thin dotted \9; + /* IE6-9 */ + + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6); + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6); +} + +input[type="radio"], +input[type="checkbox"] { + margin: 4px 0 0; + margin-top: 1px \9; + *margin-top: 0; + line-height: normal; +} + +input[type="file"], +input[type="image"], +input[type="submit"], +input[type="reset"], +input[type="button"], +input[type="radio"], +input[type="checkbox"] { + width: auto; +} + +select, +input[type="file"] { + height: 30px; + /* In IE7, the height of the select element cannot be changed by height, only font-size */ + + *margin-top: 4px; + /* For IE7, add top margin to align select with labels */ + + line-height: 30px; +} + +select { + width: 220px; + background-color: #ffffff; + border: 1px solid #cccccc; +} + +select[multiple], +select[size] { + height: auto; +} + +select:focus, +input[type="file"]:focus, +input[type="radio"]:focus, +input[type="checkbox"]:focus { + outline: thin dotted #333; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} + +.uneditable-input, +.uneditable-textarea { + color: #999999; + cursor: not-allowed; + background-color: #fcfcfc; + border-color: #cccccc; + -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025); + -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025); +} + +.uneditable-input { + overflow: hidden; + white-space: nowrap; +} + +.uneditable-textarea { + width: auto; + height: auto; +} + +input:-moz-placeholder, +textarea:-moz-placeholder { + color: #999999; +} + +input:-ms-input-placeholder, +textarea:-ms-input-placeholder { + color: #999999; +} + +input::-webkit-input-placeholder, +textarea::-webkit-input-placeholder { + color: #999999; +} + +.radio, +.checkbox { + min-height: 20px; + padding-left: 20px; +} + +.radio input[type="radio"], +.checkbox input[type="checkbox"] { + float: left; + margin-left: -20px; +} + +.controls > .radio:first-child, +.controls > .checkbox:first-child { + padding-top: 5px; +} + +.radio.inline, +.checkbox.inline { + display: inline-block; + padding-top: 5px; + margin-bottom: 0; + vertical-align: middle; +} + +.radio.inline + .radio.inline, +.checkbox.inline + .checkbox.inline { + margin-left: 10px; +} + +.input-mini { + width: 60px; +} + +.input-small { + width: 90px; +} + +.input-medium { + width: 150px; +} + +.input-large { + width: 210px; +} + +.input-xlarge { + width: 270px; +} + +.input-xxlarge { + width: 530px; +} + +input[class*="span"], +select[class*="span"], +textarea[class*="span"], +.uneditable-input[class*="span"], +.row-fluid input[class*="span"], +.row-fluid select[class*="span"], +.row-fluid textarea[class*="span"], +.row-fluid .uneditable-input[class*="span"] { + float: none; + margin-left: 0; +} + +.input-append input[class*="span"], +.input-append .uneditable-input[class*="span"], +.input-prepend input[class*="span"], +.input-prepend .uneditable-input[class*="span"], +.row-fluid input[class*="span"], +.row-fluid select[class*="span"], +.row-fluid textarea[class*="span"], +.row-fluid .uneditable-input[class*="span"], +.row-fluid .input-prepend [class*="span"], +.row-fluid .input-append [class*="span"] { + display: inline-block; +} + +input, +textarea, +.uneditable-input { + margin-left: 0; +} + +.controls-row [class*="span"] + [class*="span"] { + margin-left: 20px; +} + +input.span12, +textarea.span12, +.uneditable-input.span12 { + width: 926px; +} + +input.span11, +textarea.span11, +.uneditable-input.span11 { + width: 846px; +} + +input.span10, +textarea.span10, +.uneditable-input.span10 { + width: 766px; +} + +input.span9, +textarea.span9, +.uneditable-input.span9 { + width: 686px; +} + +input.span8, +textarea.span8, +.uneditable-input.span8 { + width: 606px; +} + +input.span7, +textarea.span7, +.uneditable-input.span7 { + width: 526px; +} + +input.span6, +textarea.span6, +.uneditable-input.span6 { + width: 446px; +} + +input.span5, +textarea.span5, +.uneditable-input.span5 { + width: 366px; +} + +input.span4, +textarea.span4, +.uneditable-input.span4 { + width: 286px; +} + +input.span3, +textarea.span3, +.uneditable-input.span3 { + width: 206px; +} + +input.span2, +textarea.span2, +.uneditable-input.span2 { + width: 126px; +} + +input.span1, +textarea.span1, +.uneditable-input.span1 { + width: 46px; +} + +.controls-row { + *zoom: 1; +} + +.controls-row:before, +.controls-row:after { + display: table; + line-height: 0; + content: ""; +} + +.controls-row:after { + clear: both; +} + +.controls-row [class*="span"], +.row-fluid .controls-row [class*="span"] { + float: left; +} + +.controls-row .checkbox[class*="span"], +.controls-row .radio[class*="span"] { + padding-top: 5px; +} + +input[disabled], +select[disabled], +textarea[disabled], +input[readonly], +select[readonly], +textarea[readonly] { + cursor: not-allowed; + background-color: #eeeeee; +} + +input[type="radio"][disabled], +input[type="checkbox"][disabled], +input[type="radio"][readonly], +input[type="checkbox"][readonly] { + background-color: transparent; +} + +.control-group.warning .control-label, +.control-group.warning .help-block, +.control-group.warning .help-inline { + color: #c09853; +} + +.control-group.warning .checkbox, +.control-group.warning .radio, +.control-group.warning input, +.control-group.warning select, +.control-group.warning textarea { + color: #c09853; +} + +.control-group.warning input, +.control-group.warning select, +.control-group.warning textarea { + border-color: #c09853; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); +} + +.control-group.warning input:focus, +.control-group.warning select:focus, +.control-group.warning textarea:focus { + border-color: #a47e3c; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e; + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e; +} + +.control-group.warning .input-prepend .add-on, +.control-group.warning .input-append .add-on { + color: #c09853; + background-color: #fcf8e3; + border-color: #c09853; +} + +.control-group.error .control-label, +.control-group.error .help-block, +.control-group.error .help-inline { + color: #b94a48; +} + +.control-group.error .checkbox, +.control-group.error .radio, +.control-group.error input, +.control-group.error select, +.control-group.error textarea { + color: #b94a48; +} + +.control-group.error input, +.control-group.error select, +.control-group.error textarea { + border-color: #b94a48; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); +} + +.control-group.error input:focus, +.control-group.error select:focus, +.control-group.error textarea:focus { + border-color: #953b39; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392; + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392; +} + +.control-group.error .input-prepend .add-on, +.control-group.error .input-append .add-on { + color: #b94a48; + background-color: #f2dede; + border-color: #b94a48; +} + +.control-group.success .control-label, +.control-group.success .help-block, +.control-group.success .help-inline { + color: #468847; +} + +.control-group.success .checkbox, +.control-group.success .radio, +.control-group.success input, +.control-group.success select, +.control-group.success textarea { + color: #468847; +} + +.control-group.success input, +.control-group.success select, +.control-group.success textarea { + border-color: #468847; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); +} + +.control-group.success input:focus, +.control-group.success select:focus, +.control-group.success textarea:focus { + border-color: #356635; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b; + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b; +} + +.control-group.success .input-prepend .add-on, +.control-group.success .input-append .add-on { + color: #468847; + background-color: #dff0d8; + border-color: #468847; +} + +.control-group.info .control-label, +.control-group.info .help-block, +.control-group.info .help-inline { + color: #3a87ad; +} + +.control-group.info .checkbox, +.control-group.info .radio, +.control-group.info input, +.control-group.info select, +.control-group.info textarea { + color: #3a87ad; +} + +.control-group.info input, +.control-group.info select, +.control-group.info textarea { + border-color: #3a87ad; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); +} + +.control-group.info input:focus, +.control-group.info select:focus, +.control-group.info textarea:focus { + border-color: #2d6987; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7ab5d3; + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7ab5d3; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7ab5d3; +} + +.control-group.info .input-prepend .add-on, +.control-group.info .input-append .add-on { + color: #3a87ad; + background-color: #d9edf7; + border-color: #3a87ad; +} + +input:focus:invalid, +textarea:focus:invalid, +select:focus:invalid { + color: #b94a48; + border-color: #ee5f5b; +} + +input:focus:invalid:focus, +textarea:focus:invalid:focus, +select:focus:invalid:focus { + border-color: #e9322d; + -webkit-box-shadow: 0 0 6px #f8b9b7; + -moz-box-shadow: 0 0 6px #f8b9b7; + box-shadow: 0 0 6px #f8b9b7; +} + +.form-actions { + padding: 19px 20px 20px; + margin-top: 20px; + margin-bottom: 20px; + background-color: #f5f5f5; + border-top: 1px solid #e5e5e5; + *zoom: 1; +} + +.form-actions:before, +.form-actions:after { + display: table; + line-height: 0; + content: ""; +} + +.form-actions:after { + clear: both; +} + +.help-block, +.help-inline { + color: #595959; +} + +.help-block { + display: block; + margin-bottom: 10px; +} + +.help-inline { + display: inline-block; + *display: inline; + padding-left: 5px; + vertical-align: middle; + *zoom: 1; +} + +.input-append, +.input-prepend { + margin-bottom: 5px; + font-size: 0; + white-space: nowrap; +} + +.input-append input, +.input-prepend input, +.input-append select, +.input-prepend select, +.input-append .uneditable-input, +.input-prepend .uneditable-input, +.input-append .dropdown-menu, +.input-prepend .dropdown-menu { + font-size: 14px; +} + +.input-append input, +.input-prepend input, +.input-append select, +.input-prepend select, +.input-append .uneditable-input, +.input-prepend .uneditable-input { + position: relative; + margin-bottom: 0; + *margin-left: 0; + vertical-align: top; + -webkit-border-radius: 0 4px 4px 0; + -moz-border-radius: 0 4px 4px 0; + border-radius: 0 4px 4px 0; +} + +.input-append input:focus, +.input-prepend input:focus, +.input-append select:focus, +.input-prepend select:focus, +.input-append .uneditable-input:focus, +.input-prepend .uneditable-input:focus { + z-index: 2; +} + +.input-append .add-on, +.input-prepend .add-on { + display: inline-block; + width: auto; + height: 20px; + min-width: 16px; + padding: 4px 5px; + font-size: 14px; + font-weight: normal; + line-height: 20px; + text-align: center; + text-shadow: 0 1px 0 #ffffff; + background-color: #eeeeee; + border: 1px solid #ccc; +} + +.input-append .add-on, +.input-prepend .add-on, +.input-append .btn, +.input-prepend .btn, +.input-append .btn-group > .dropdown-toggle, +.input-prepend .btn-group > .dropdown-toggle { + vertical-align: top; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; +} + +.input-append .active, +.input-prepend .active { + background-color: #a9dba9; + border-color: #46a546; +} + +.input-prepend .add-on, +.input-prepend .btn { + margin-right: -1px; +} + +.input-prepend .add-on:first-child, +.input-prepend .btn:first-child { + -webkit-border-radius: 4px 0 0 4px; + -moz-border-radius: 4px 0 0 4px; + border-radius: 4px 0 0 4px; +} + +.input-append input, +.input-append select, +.input-append .uneditable-input { + -webkit-border-radius: 4px 0 0 4px; + -moz-border-radius: 4px 0 0 4px; + border-radius: 4px 0 0 4px; +} + +.input-append input + .btn-group .btn:last-child, +.input-append select + .btn-group .btn:last-child, +.input-append .uneditable-input + .btn-group .btn:last-child { + -webkit-border-radius: 0 4px 4px 0; + -moz-border-radius: 0 4px 4px 0; + border-radius: 0 4px 4px 0; +} + +.input-append .add-on, +.input-append .btn, +.input-append .btn-group { + margin-left: -1px; +} + +.input-append .add-on:last-child, +.input-append .btn:last-child, +.input-append .btn-group:last-child > .dropdown-toggle { + -webkit-border-radius: 0 4px 4px 0; + -moz-border-radius: 0 4px 4px 0; + border-radius: 0 4px 4px 0; +} + +.input-prepend.input-append input, +.input-prepend.input-append select, +.input-prepend.input-append .uneditable-input { + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; +} + +.input-prepend.input-append input + .btn-group .btn, +.input-prepend.input-append select + .btn-group .btn, +.input-prepend.input-append .uneditable-input + .btn-group .btn { + -webkit-border-radius: 0 4px 4px 0; + -moz-border-radius: 0 4px 4px 0; + border-radius: 0 4px 4px 0; +} + +.input-prepend.input-append .add-on:first-child, +.input-prepend.input-append .btn:first-child { + margin-right: -1px; + -webkit-border-radius: 4px 0 0 4px; + -moz-border-radius: 4px 0 0 4px; + border-radius: 4px 0 0 4px; +} + +.input-prepend.input-append .add-on:last-child, +.input-prepend.input-append .btn:last-child { + margin-left: -1px; + -webkit-border-radius: 0 4px 4px 0; + -moz-border-radius: 0 4px 4px 0; + border-radius: 0 4px 4px 0; +} + +.input-prepend.input-append .btn-group:first-child { + margin-left: 0; +} + +input.search-query { + padding-right: 14px; + padding-right: 4px \9; + padding-left: 14px; + padding-left: 4px \9; + /* IE7-8 doesn't have border-radius, so don't indent the padding */ + + margin-bottom: 0; + -webkit-border-radius: 15px; + -moz-border-radius: 15px; + border-radius: 15px; +} + +/* Allow for input prepend/append in search forms */ + +.form-search .input-append .search-query, +.form-search .input-prepend .search-query { + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; +} + +.form-search .input-append .search-query { + -webkit-border-radius: 14px 0 0 14px; + -moz-border-radius: 14px 0 0 14px; + border-radius: 14px 0 0 14px; +} + +.form-search .input-append .btn { + -webkit-border-radius: 0 14px 14px 0; + -moz-border-radius: 0 14px 14px 0; + border-radius: 0 14px 14px 0; +} + +.form-search .input-prepend .search-query { + -webkit-border-radius: 0 14px 14px 0; + -moz-border-radius: 0 14px 14px 0; + border-radius: 0 14px 14px 0; +} + +.form-search .input-prepend .btn { + -webkit-border-radius: 14px 0 0 14px; + -moz-border-radius: 14px 0 0 14px; + border-radius: 14px 0 0 14px; +} + +.form-search input, +.form-inline input, +.form-horizontal input, +.form-search textarea, +.form-inline textarea, +.form-horizontal textarea, +.form-search select, +.form-inline select, +.form-horizontal select, +.form-search .help-inline, +.form-inline .help-inline, +.form-horizontal .help-inline, +.form-search .uneditable-input, +.form-inline .uneditable-input, +.form-horizontal .uneditable-input, +.form-search .input-prepend, +.form-inline .input-prepend, +.form-horizontal .input-prepend, +.form-search .input-append, +.form-inline .input-append, +.form-horizontal .input-append { + display: inline-block; + *display: inline; + margin-bottom: 0; + vertical-align: middle; + *zoom: 1; +} + +.form-search .hide, +.form-inline .hide, +.form-horizontal .hide { + display: none; +} + +.form-search label, +.form-inline label, +.form-search .btn-group, +.form-inline .btn-group { + display: inline-block; +} + +.form-search .input-append, +.form-inline .input-append, +.form-search .input-prepend, +.form-inline .input-prepend { + margin-bottom: 0; +} + +.form-search .radio, +.form-search .checkbox, +.form-inline .radio, +.form-inline .checkbox { + padding-left: 0; + margin-bottom: 0; + vertical-align: middle; +} + +.form-search .radio input[type="radio"], +.form-search .checkbox input[type="checkbox"], +.form-inline .radio input[type="radio"], +.form-inline .checkbox input[type="checkbox"] { + float: left; + margin-right: 3px; + margin-left: 0; +} + +.control-group { + margin-bottom: 10px; +} + +legend + .control-group { + margin-top: 20px; + -webkit-margin-top-collapse: separate; +} + +.form-horizontal .control-group { + margin-bottom: 20px; + *zoom: 1; +} + +.form-horizontal .control-group:before, +.form-horizontal .control-group:after { + display: table; + line-height: 0; + content: ""; +} + +.form-horizontal .control-group:after { + clear: both; +} + +.form-horizontal .control-label { + float: left; + width: 160px; + padding-top: 5px; + text-align: right; +} + +.form-horizontal .controls { + *display: inline-block; + *padding-left: 20px; + margin-left: 180px; + *margin-left: 0; +} + +.form-horizontal .controls:first-child { + *padding-left: 180px; +} + +.form-horizontal .help-block { + margin-bottom: 0; +} + +.form-horizontal input + .help-block, +.form-horizontal select + .help-block, +.form-horizontal textarea + .help-block, +.form-horizontal .uneditable-input + .help-block, +.form-horizontal .input-prepend + .help-block, +.form-horizontal .input-append + .help-block { + margin-top: 10px; +} + +.form-horizontal .form-actions { + padding-left: 180px; +} + +table { + max-width: 100%; + background-color: transparent; + border-collapse: collapse; + border-spacing: 0; +} + +.table, table { + width: 100%; + margin-bottom: 20px; +} + +.table th, +table th, +.table td, +table td { + padding: 8px; + line-height: 20px; + text-align: left; + vertical-align: top; + border-top: 1px solid #dddddd; +} + +.table th, +table th { + font-weight: bold; +} + +.table thead th, +table thead th { + vertical-align: bottom; +} + +.table caption + thead tr:first-child th, +.table caption + thead tr:first-child td, +.table colgroup + thead tr:first-child th, +.table colgroup + thead tr:first-child td, +.table thead:first-child tr:first-child th, +.table thead:first-child tr:first-child td, +table caption + thead tr:first-child th, +table caption + thead tr:first-child td, +table colgroup + thead tr:first-child th, +table colgroup + thead tr:first-child td, +table thead:first-child tr:first-child th, +table thead:first-child tr:first-child td { + border-top: 0; +} + +.table tbody + tbody, +table tbody + tbody { + border-top: 2px solid #dddddd; +} + +.table .table, +table table { + background-color: #ffffff; +} + +.table-condensed th, +.table-condensed td { + padding: 4px 5px; +} + +.table-bordered { + border: 1px solid #dddddd; + border-collapse: separate; + *border-collapse: collapse; + border-left: 0; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} + +.table-bordered th, +.table-bordered td { + border-left: 1px solid #dddddd; +} + +.table-bordered caption + thead tr:first-child th, +.table-bordered caption + tbody tr:first-child th, +.table-bordered caption + tbody tr:first-child td, +.table-bordered colgroup + thead tr:first-child th, +.table-bordered colgroup + tbody tr:first-child th, +.table-bordered colgroup + tbody tr:first-child td, +.table-bordered thead:first-child tr:first-child th, +.table-bordered tbody:first-child tr:first-child th, +.table-bordered tbody:first-child tr:first-child td { + border-top: 0; +} + +.table-bordered thead:first-child tr:first-child > th:first-child, +.table-bordered tbody:first-child tr:first-child > td:first-child { + -webkit-border-top-left-radius: 4px; + border-top-left-radius: 4px; + -moz-border-radius-topleft: 4px; +} + +.table-bordered thead:first-child tr:first-child > th:last-child, +.table-bordered tbody:first-child tr:first-child > td:last-child { + -webkit-border-top-right-radius: 4px; + border-top-right-radius: 4px; + -moz-border-radius-topright: 4px; +} + +.table-bordered thead:last-child tr:last-child > th:first-child, +.table-bordered tbody:last-child tr:last-child > td:first-child, +.table-bordered tfoot:last-child tr:last-child > td:first-child { + -webkit-border-bottom-left-radius: 4px; + border-bottom-left-radius: 4px; + -moz-border-radius-bottomleft: 4px; +} + +.table-bordered thead:last-child tr:last-child > th:last-child, +.table-bordered tbody:last-child tr:last-child > td:last-child, +.table-bordered tfoot:last-child tr:last-child > td:last-child { + -webkit-border-bottom-right-radius: 4px; + border-bottom-right-radius: 4px; + -moz-border-radius-bottomright: 4px; +} + +.table-bordered tfoot + tbody:last-child tr:last-child td:first-child { + -webkit-border-bottom-left-radius: 0; + border-bottom-left-radius: 0; + -moz-border-radius-bottomleft: 0; +} + +.table-bordered tfoot + tbody:last-child tr:last-child td:last-child { + -webkit-border-bottom-right-radius: 0; + border-bottom-right-radius: 0; + -moz-border-radius-bottomright: 0; +} + +.table-bordered caption + thead tr:first-child th:first-child, +.table-bordered caption + tbody tr:first-child td:first-child, +.table-bordered colgroup + thead tr:first-child th:first-child, +.table-bordered colgroup + tbody tr:first-child td:first-child { + -webkit-border-top-left-radius: 4px; + border-top-left-radius: 4px; + -moz-border-radius-topleft: 4px; +} + +.table-bordered caption + thead tr:first-child th:last-child, +.table-bordered caption + tbody tr:first-child td:last-child, +.table-bordered colgroup + thead tr:first-child th:last-child, +.table-bordered colgroup + tbody tr:first-child td:last-child { + -webkit-border-top-right-radius: 4px; + border-top-right-radius: 4px; + -moz-border-radius-topright: 4px; +} + +.table-striped tbody > tr:nth-child(odd) > td, +.table-striped tbody > tr:nth-child(odd) > th, +table tbody > tr:nth-child(odd) > td, +table tbody > tr:nth-child(odd) > th { + background-color: #f9f9f9; +} + +.table-hover tbody tr:hover td, +.table-hover tbody tr:hover th { + background-color: #f5f5f5; +} + +table td[class*="span"], +table th[class*="span"], +.row-fluid table td[class*="span"], +.row-fluid table th[class*="span"] { + display: table-cell; + float: none; + margin-left: 0; +} + +.table td.span1, +.table th.span1 { + float: none; + width: 44px; + margin-left: 0; +} + +.table td.span2, +.table th.span2 { + float: none; + width: 124px; + margin-left: 0; +} + +.table td.span3, +.table th.span3 { + float: none; + width: 204px; + margin-left: 0; +} + +.table td.span4, +.table th.span4 { + float: none; + width: 284px; + margin-left: 0; +} + +.table td.span5, +.table th.span5 { + float: none; + width: 364px; + margin-left: 0; +} + +.table td.span6, +.table th.span6 { + float: none; + width: 444px; + margin-left: 0; +} + +.table td.span7, +.table th.span7 { + float: none; + width: 524px; + margin-left: 0; +} + +.table td.span8, +.table th.span8 { + float: none; + width: 604px; + margin-left: 0; +} + +.table td.span9, +.table th.span9 { + float: none; + width: 684px; + margin-left: 0; +} + +.table td.span10, +.table th.span10 { + float: none; + width: 764px; + margin-left: 0; +} + +.table td.span11, +.table th.span11 { + float: none; + width: 844px; + margin-left: 0; +} + +.table td.span12, +.table th.span12 { + float: none; + width: 924px; + margin-left: 0; +} + +.table tbody tr.success td, +table tbody tr.success td { + background-color: #dff0d8; +} + +.table tbody tr.error td, +table tbody tr.error td { + background-color: #f2dede; +} + +.table tbody tr.warning td, +table tbody tr.warning td { + background-color: #fcf8e3; +} + +.table tbody tr.info td, +table tbody tr.info td { + background-color: #d9edf7; +} + +.table-hover tbody tr.success:hover td { + background-color: #d0e9c6; +} + +.table-hover tbody tr.error:hover td { + background-color: #ebcccc; +} + +.table-hover tbody tr.warning:hover td { + background-color: #faf2cc; +} + +.table-hover tbody tr.info:hover td { + background-color: #c4e3f3; +} + +[class^="icon-"], +[class*=" icon-"] { + display: inline-block; + width: 14px; + height: 14px; + margin-top: 1px; + *margin-right: .3em; + line-height: 14px; + vertical-align: text-top; + background-image: url("../img/glyphicons-halflings.png"); + background-position: 14px 14px; + background-repeat: no-repeat; +} + +/* White icons with optional class, or on hover/active states of certain elements */ + +.icon-white, +.nav-pills > .active > a > [class^="icon-"], +.nav-pills > .active > a > [class*=" icon-"], +.nav-list > .active > a > [class^="icon-"], +.nav-list > .active > a > [class*=" icon-"], +.navbar-inverse .nav > .active > a > [class^="icon-"], +.navbar-inverse .nav > .active > a > [class*=" icon-"], +.dropdown-menu > li > a:hover > [class^="icon-"], +.dropdown-menu > li > a:hover > [class*=" icon-"], +.dropdown-menu > .active > a > [class^="icon-"], +.dropdown-menu > .active > a > [class*=" icon-"], +.dropdown-submenu:hover > a > [class^="icon-"], +.dropdown-submenu:hover > a > [class*=" icon-"] { + background-image: url("../img/glyphicons-halflings-white.png"); +} + +.icon-glass { + background-position: 0 0; +} + +.icon-music { + background-position: -24px 0; +} + +.icon-search { + background-position: -48px 0; +} + +.icon-envelope { + background-position: -72px 0; +} + +.icon-heart { + background-position: -96px 0; +} + +.icon-star { + background-position: -120px 0; +} + +.icon-star-empty { + background-position: -144px 0; +} + +.icon-user { + background-position: -168px 0; +} + +.icon-film { + background-position: -192px 0; +} + +.icon-th-large { + background-position: -216px 0; +} + +.icon-th { + background-position: -240px 0; +} + +.icon-th-list { + background-position: -264px 0; +} + +.icon-ok { + background-position: -288px 0; +} + +.icon-remove { + background-position: -312px 0; +} + +.icon-zoom-in { + background-position: -336px 0; +} + +.icon-zoom-out { + background-position: -360px 0; +} + +.icon-off { + background-position: -384px 0; +} + +.icon-signal { + background-position: -408px 0; +} + +.icon-cog { + background-position: -432px 0; +} + +.icon-trash { + background-position: -456px 0; +} + +.icon-home { + background-position: 0 -24px; +} + +.icon-file { + background-position: -24px -24px; +} + +.icon-time { + background-position: -48px -24px; +} + +.icon-road { + background-position: -72px -24px; +} + +.icon-download-alt { + background-position: -96px -24px; +} + +.icon-download { + background-position: -120px -24px; +} + +.icon-upload { + background-position: -144px -24px; +} + +.icon-inbox { + background-position: -168px -24px; +} + +.icon-play-circle { + background-position: -192px -24px; +} + +.icon-repeat { + background-position: -216px -24px; +} + +.icon-refresh { + background-position: -240px -24px; +} + +.icon-list-alt { + background-position: -264px -24px; +} + +.icon-lock { + background-position: -287px -24px; +} + +.icon-flag { + background-position: -312px -24px; +} + +.icon-headphones { + background-position: -336px -24px; +} + +.icon-volume-off { + background-position: -360px -24px; +} + +.icon-volume-down { + background-position: -384px -24px; +} + +.icon-volume-up { + background-position: -408px -24px; +} + +.icon-qrcode { + background-position: -432px -24px; +} + +.icon-barcode { + background-position: -456px -24px; +} + +.icon-tag { + background-position: 0 -48px; +} + +.icon-tags { + background-position: -25px -48px; +} + +.icon-book { + background-position: -48px -48px; +} + +.icon-bookmark { + background-position: -72px -48px; +} + +.icon-print { + background-position: -96px -48px; +} + +.icon-camera { + background-position: -120px -48px; +} + +.icon-font { + background-position: -144px -48px; +} + +.icon-bold { + background-position: -167px -48px; +} + +.icon-italic { + background-position: -192px -48px; +} + +.icon-text-height { + background-position: -216px -48px; +} + +.icon-text-width { + background-position: -240px -48px; +} + +.icon-align-left { + background-position: -264px -48px; +} + +.icon-align-center { + background-position: -288px -48px; +} + +.icon-align-right { + background-position: -312px -48px; +} + +.icon-align-justify { + background-position: -336px -48px; +} + +.icon-list { + background-position: -360px -48px; +} + +.icon-indent-left { + background-position: -384px -48px; +} + +.icon-indent-right { + background-position: -408px -48px; +} + +.icon-facetime-video { + background-position: -432px -48px; +} + +.icon-picture { + background-position: -456px -48px; +} + +.icon-pencil { + background-position: 0 -72px; +} + +.icon-map-marker { + background-position: -24px -72px; +} + +.icon-adjust { + background-position: -48px -72px; +} + +.icon-tint { + background-position: -72px -72px; +} + +.icon-edit { + background-position: -96px -72px; +} + +.icon-share { + background-position: -120px -72px; +} + +.icon-check { + background-position: -144px -72px; +} + +.icon-move { + background-position: -168px -72px; +} + +.icon-step-backward { + background-position: -192px -72px; +} + +.icon-fast-backward { + background-position: -216px -72px; +} + +.icon-backward { + background-position: -240px -72px; +} + +.icon-play { + background-position: -264px -72px; +} + +.icon-pause { + background-position: -288px -72px; +} + +.icon-stop { + background-position: -312px -72px; +} + +.icon-forward { + background-position: -336px -72px; +} + +.icon-fast-forward { + background-position: -360px -72px; +} + +.icon-step-forward { + background-position: -384px -72px; +} + +.icon-eject { + background-position: -408px -72px; +} + +.icon-chevron-left { + background-position: -432px -72px; +} + +.icon-chevron-right { + background-position: -456px -72px; +} + +.icon-plus-sign { + background-position: 0 -96px; +} + +.icon-minus-sign { + background-position: -24px -96px; +} + +.icon-remove-sign { + background-position: -48px -96px; +} + +.icon-ok-sign { + background-position: -72px -96px; +} + +.icon-question-sign { + background-position: -96px -96px; +} + +.icon-info-sign { + background-position: -120px -96px; +} + +.icon-screenshot { + background-position: -144px -96px; +} + +.icon-remove-circle { + background-position: -168px -96px; +} + +.icon-ok-circle { + background-position: -192px -96px; +} + +.icon-ban-circle { + background-position: -216px -96px; +} + +.icon-arrow-left { + background-position: -240px -96px; +} + +.icon-arrow-right { + background-position: -264px -96px; +} + +.icon-arrow-up { + background-position: -289px -96px; +} + +.icon-arrow-down { + background-position: -312px -96px; +} + +.icon-share-alt { + background-position: -336px -96px; +} + +.icon-resize-full { + background-position: -360px -96px; +} + +.icon-resize-small { + background-position: -384px -96px; +} + +.icon-plus { + background-position: -408px -96px; +} + +.icon-minus { + background-position: -433px -96px; +} + +.icon-asterisk { + background-position: -456px -96px; +} + +.icon-exclamation-sign { + background-position: 0 -120px; +} + +.icon-gift { + background-position: -24px -120px; +} + +.icon-leaf { + background-position: -48px -120px; +} + +.icon-fire { + background-position: -72px -120px; +} + +.icon-eye-open { + background-position: -96px -120px; +} + +.icon-eye-close { + background-position: -120px -120px; +} + +.icon-warning-sign { + background-position: -144px -120px; +} + +.icon-plane { + background-position: -168px -120px; +} + +.icon-calendar { + background-position: -192px -120px; +} + +.icon-random { + width: 16px; + background-position: -216px -120px; +} + +.icon-comment { + background-position: -240px -120px; +} + +.icon-magnet { + background-position: -264px -120px; +} + +.icon-chevron-up { + background-position: -288px -120px; +} + +.icon-chevron-down { + background-position: -313px -119px; +} + +.icon-retweet { + background-position: -336px -120px; +} + +.icon-shopping-cart { + background-position: -360px -120px; +} + +.icon-folder-close { + background-position: -384px -120px; +} + +.icon-folder-open { + width: 16px; + background-position: -408px -120px; +} + +.icon-resize-vertical { + background-position: -432px -119px; +} + +.icon-resize-horizontal { + background-position: -456px -118px; +} + +.icon-hdd { + background-position: 0 -144px; +} + +.icon-bullhorn { + background-position: -24px -144px; +} + +.icon-bell { + background-position: -48px -144px; +} + +.icon-certificate { + background-position: -72px -144px; +} + +.icon-thumbs-up { + background-position: -96px -144px; +} + +.icon-thumbs-down { + background-position: -120px -144px; +} + +.icon-hand-right { + background-position: -144px -144px; +} + +.icon-hand-left { + background-position: -168px -144px; +} + +.icon-hand-up { + background-position: -192px -144px; +} + +.icon-hand-down { + background-position: -216px -144px; +} + +.icon-circle-arrow-right { + background-position: -240px -144px; +} + +.icon-circle-arrow-left { + background-position: -264px -144px; +} + +.icon-circle-arrow-up { + background-position: -288px -144px; +} + +.icon-circle-arrow-down { + background-position: -312px -144px; +} + +.icon-globe { + background-position: -336px -144px; +} + +.icon-wrench { + background-position: -360px -144px; +} + +.icon-tasks { + background-position: -384px -144px; +} + +.icon-filter { + background-position: -408px -144px; +} + +.icon-briefcase { + background-position: -432px -144px; +} + +.icon-fullscreen { + background-position: -456px -144px; +} + +.dropup, +.dropdown { + position: relative; +} + +.dropdown-toggle { + *margin-bottom: -3px; +} + +.dropdown-toggle:active, +.open .dropdown-toggle { + outline: 0; +} + +.caret { + display: inline-block; + width: 0; + height: 0; + vertical-align: top; + border-top: 4px solid #000000; + border-right: 4px solid transparent; + border-left: 4px solid transparent; + content: ""; +} + +.dropdown .caret { + margin-top: 8px; + margin-left: 2px; +} + +.dropdown-menu { + position: absolute; + top: 100%; + left: 0; + z-index: 1000; + display: none; + float: left; + min-width: 160px; + padding: 5px 0; + margin: 2px 0 0; + list-style: none; + background-color: #ffffff; + border: 1px solid #ccc; + border: 1px solid rgba(0, 0, 0, 0.2); + *border-right-width: 2px; + *border-bottom-width: 2px; + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; + -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + -webkit-background-clip: padding-box; + -moz-background-clip: padding; + background-clip: padding-box; +} + +.dropdown-menu.pull-right { + right: 0; + left: auto; +} + +.dropdown-menu .divider { + *width: 100%; + height: 1px; + margin: 9px 1px; + *margin: -5px 0 5px; + overflow: hidden; + background-color: #e5e5e5; + border-bottom: 1px solid #ffffff; +} + +.dropdown-menu li > a { + display: block; + padding: 3px 20px; + clear: both; + font-weight: normal; + line-height: 20px; + color: #333333; + white-space: nowrap; +} + +.dropdown-menu li > a:hover, +.dropdown-menu li > a:focus, +.dropdown-submenu:hover > a { + color: #ffffff; + text-decoration: none; + background-color: #0081c2; + background-image: -moz-linear-gradient(top, #0088cc, #0077b3); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0077b3)); + background-image: -webkit-linear-gradient(top, #0088cc, #0077b3); + background-image: -o-linear-gradient(top, #0088cc, #0077b3); + background-image: linear-gradient(to bottom, #0088cc, #0077b3); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0); +} + +.dropdown-menu .active > a, +.dropdown-menu .active > a:hover { + color: #ffffff; + text-decoration: none; + background-color: #0081c2; + background-image: -moz-linear-gradient(top, #0088cc, #0077b3); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0077b3)); + background-image: -webkit-linear-gradient(top, #0088cc, #0077b3); + background-image: -o-linear-gradient(top, #0088cc, #0077b3); + background-image: linear-gradient(to bottom, #0088cc, #0077b3); + background-repeat: repeat-x; + outline: 0; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0); +} + +.dropdown-menu .disabled > a, +.dropdown-menu .disabled > a:hover { + color: #999999; +} + +.dropdown-menu .disabled > a:hover { + text-decoration: none; + cursor: default; + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); +} + +.open { + *z-index: 1000; +} + +.open > .dropdown-menu { + display: block; +} + +.pull-right > .dropdown-menu { + right: 0; + left: auto; +} + +.dropup .caret, +.navbar-fixed-bottom .dropdown .caret { + border-top: 0; + border-bottom: 4px solid #000000; + content: ""; +} + +.dropup .dropdown-menu, +.navbar-fixed-bottom .dropdown .dropdown-menu { + top: auto; + bottom: 100%; + margin-bottom: 1px; +} + +.dropdown-submenu { + position: relative; +} + +.dropdown-submenu > .dropdown-menu { + top: 0; + left: 100%; + margin-top: -6px; + margin-left: -1px; + -webkit-border-radius: 0 6px 6px 6px; + -moz-border-radius: 0 6px 6px 6px; + border-radius: 0 6px 6px 6px; +} + +.dropdown-submenu:hover > .dropdown-menu { + display: block; +} + +.dropup .dropdown-submenu > .dropdown-menu { + top: auto; + bottom: 0; + margin-top: 0; + margin-bottom: -2px; + -webkit-border-radius: 5px 5px 5px 0; + -moz-border-radius: 5px 5px 5px 0; + border-radius: 5px 5px 5px 0; +} + +.dropdown-submenu > a:after { + display: block; + float: right; + width: 0; + height: 0; + margin-top: 5px; + margin-right: -10px; + border-color: transparent; + border-left-color: #cccccc; + border-style: solid; + border-width: 5px 0 5px 5px; + content: " "; +} + +.dropdown-submenu:hover > a:after { + border-left-color: #ffffff; +} + +.dropdown-submenu.pull-left { + float: none; +} + +.dropdown-submenu.pull-left > .dropdown-menu { + left: -100%; + margin-left: 10px; + -webkit-border-radius: 6px 0 6px 6px; + -moz-border-radius: 6px 0 6px 6px; + border-radius: 6px 0 6px 6px; +} + +.dropdown .dropdown-menu .nav-header { + padding-right: 20px; + padding-left: 20px; +} + +.typeahead { + z-index: 1051; + margin-top: 2px; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} + +.well { + min-height: 20px; + padding: 19px; + margin-bottom: 20px; + background-color: #f5f5f5; + border: 1px solid #e3e3e3; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); +} + +.well blockquote { + border-color: #ddd; + border-color: rgba(0, 0, 0, 0.15); +} + +.well-large { + padding: 24px; + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; +} + +.well-small { + padding: 9px; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} + +.fade { + opacity: 0; + -webkit-transition: opacity 0.15s linear; + -moz-transition: opacity 0.15s linear; + -o-transition: opacity 0.15s linear; + transition: opacity 0.15s linear; +} + +.fade.in { + opacity: 1; +} + +.collapse { + position: relative; + height: 0; + overflow: hidden; + -webkit-transition: height 0.35s ease; + -moz-transition: height 0.35s ease; + -o-transition: height 0.35s ease; + transition: height 0.35s ease; +} + +.collapse.in { + height: auto; +} + +.close { + float: right; + font-size: 20px; + font-weight: bold; + line-height: 20px; + color: #000000; + text-shadow: 0 1px 0 #ffffff; + opacity: 0.2; + filter: alpha(opacity=20); +} + +.close:hover { + color: #000000; + text-decoration: none; + cursor: pointer; + opacity: 0.4; + filter: alpha(opacity=40); +} + +button.close { + padding: 0; + cursor: pointer; + background: transparent; + border: 0; + -webkit-appearance: none; +} + +.btn { + display: inline-block; + *display: inline; + padding: 4px 12px; + margin-bottom: 0; + *margin-left: .3em; + font-size: 14px; + line-height: 20px; + color: #333333; + text-align: center; + text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75); + vertical-align: middle; + cursor: pointer; + background-color: #f5f5f5; + *background-color: #e6e6e6; + background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6)); + background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6); + background-image: -o-linear-gradient(top, #ffffff, #e6e6e6); + background-image: linear-gradient(to bottom, #ffffff, #e6e6e6); + background-repeat: repeat-x; + border: 1px solid #bbbbbb; + *border: 0; + border-color: #e6e6e6 #e6e6e6 #bfbfbf; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + border-bottom-color: #a2a2a2; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); + *zoom: 1; + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); +} + +.btn:hover, +.btn:active, +.btn.active, +.btn.disabled, +.btn[disabled] { + color: #333333; + background-color: #e6e6e6; + *background-color: #d9d9d9; +} + +.btn:active, +.btn.active { + background-color: #cccccc \9; +} + +.btn:first-child { + *margin-left: 0; +} + +.btn:hover { + color: #333333; + text-decoration: none; + background-position: 0 -15px; + -webkit-transition: background-position 0.1s linear; + -moz-transition: background-position 0.1s linear; + -o-transition: background-position 0.1s linear; + transition: background-position 0.1s linear; +} + +.btn:focus { + outline: thin dotted #333; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} + +.btn.active, +.btn:active { + background-image: none; + outline: 0; + -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); +} + +.btn.disabled, +.btn[disabled] { + cursor: default; + background-image: none; + opacity: 0.65; + filter: alpha(opacity=65); + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; +} + +.btn-large { + padding: 11px 19px; + font-size: 17.5px; + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; +} + +.btn-large [class^="icon-"], +.btn-large [class*=" icon-"] { + margin-top: 4px; +} + +.btn-small { + padding: 2px 10px; + font-size: 11.9px; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} + +.btn-small [class^="icon-"], +.btn-small [class*=" icon-"] { + margin-top: 0; +} + +.btn-mini [class^="icon-"], +.btn-mini [class*=" icon-"] { + margin-top: -1px; +} + +.btn-mini { + padding: 0 6px; + font-size: 10.5px; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} + +.btn-block { + display: block; + width: 100%; + padding-right: 0; + padding-left: 0; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +.btn-block + .btn-block { + margin-top: 5px; +} + +input[type="submit"].btn-block, +input[type="reset"].btn-block, +input[type="button"].btn-block { + width: 100%; +} + +.btn-primary.active, +.btn-warning.active, +.btn-danger.active, +.btn-success.active, +.btn-info.active, +.btn-inverse.active { + color: rgba(255, 255, 255, 0.75); +} + +.btn { + border-color: #c5c5c5; + border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25); +} + +.btn-primary { + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #006dcc; + *background-color: #0044cc; + background-image: -moz-linear-gradient(top, #0088cc, #0044cc); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc)); + background-image: -webkit-linear-gradient(top, #0088cc, #0044cc); + background-image: -o-linear-gradient(top, #0088cc, #0044cc); + background-image: linear-gradient(to bottom, #0088cc, #0044cc); + background-repeat: repeat-x; + border-color: #0044cc #0044cc #002a80; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0044cc', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); +} + +.btn-primary:hover, +.btn-primary:active, +.btn-primary.active, +.btn-primary.disabled, +.btn-primary[disabled] { + color: #ffffff; + background-color: #0044cc; + *background-color: #003bb3; +} + +.btn-primary:active, +.btn-primary.active { + background-color: #003399 \9; +} + +.btn-warning { + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #faa732; + *background-color: #f89406; + background-image: -moz-linear-gradient(top, #fbb450, #f89406); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406)); + background-image: -webkit-linear-gradient(top, #fbb450, #f89406); + background-image: -o-linear-gradient(top, #fbb450, #f89406); + background-image: linear-gradient(to bottom, #fbb450, #f89406); + background-repeat: repeat-x; + border-color: #f89406 #f89406 #ad6704; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450', endColorstr='#fff89406', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); +} + +.btn-warning:hover, +.btn-warning:active, +.btn-warning.active, +.btn-warning.disabled, +.btn-warning[disabled] { + color: #ffffff; + background-color: #f89406; + *background-color: #df8505; +} + +.btn-warning:active, +.btn-warning.active { + background-color: #c67605 \9; +} + +.btn-danger { + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #da4f49; + *background-color: #bd362f; + background-image: -moz-linear-gradient(top, #ee5f5b, #bd362f); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#bd362f)); + background-image: -webkit-linear-gradient(top, #ee5f5b, #bd362f); + background-image: -o-linear-gradient(top, #ee5f5b, #bd362f); + background-image: linear-gradient(to bottom, #ee5f5b, #bd362f); + background-repeat: repeat-x; + border-color: #bd362f #bd362f #802420; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b', endColorstr='#ffbd362f', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); +} + +.btn-danger:hover, +.btn-danger:active, +.btn-danger.active, +.btn-danger.disabled, +.btn-danger[disabled] { + color: #ffffff; + background-color: #bd362f; + *background-color: #a9302a; +} + +.btn-danger:active, +.btn-danger.active { + background-color: #942a25 \9; +} + +.btn-success { + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #5bb75b; + *background-color: #51a351; + background-image: -moz-linear-gradient(top, #62c462, #51a351); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#51a351)); + background-image: -webkit-linear-gradient(top, #62c462, #51a351); + background-image: -o-linear-gradient(top, #62c462, #51a351); + background-image: linear-gradient(to bottom, #62c462, #51a351); + background-repeat: repeat-x; + border-color: #51a351 #51a351 #387038; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462', endColorstr='#ff51a351', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); +} + +.btn-success:hover, +.btn-success:active, +.btn-success.active, +.btn-success.disabled, +.btn-success[disabled] { + color: #ffffff; + background-color: #51a351; + *background-color: #499249; +} + +.btn-success:active, +.btn-success.active { + background-color: #408140 \9; +} + +.btn-info { + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #49afcd; + *background-color: #2f96b4; + background-image: -moz-linear-gradient(top, #5bc0de, #2f96b4); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#2f96b4)); + background-image: -webkit-linear-gradient(top, #5bc0de, #2f96b4); + background-image: -o-linear-gradient(top, #5bc0de, #2f96b4); + background-image: linear-gradient(to bottom, #5bc0de, #2f96b4); + background-repeat: repeat-x; + border-color: #2f96b4 #2f96b4 #1f6377; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2f96b4', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); +} + +.btn-info:hover, +.btn-info:active, +.btn-info.active, +.btn-info.disabled, +.btn-info[disabled] { + color: #ffffff; + background-color: #2f96b4; + *background-color: #2a85a0; +} + +.btn-info:active, +.btn-info.active { + background-color: #24748c \9; +} + +.btn-inverse { + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #363636; + *background-color: #222222; + background-image: -moz-linear-gradient(top, #444444, #222222); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#444444), to(#222222)); + background-image: -webkit-linear-gradient(top, #444444, #222222); + background-image: -o-linear-gradient(top, #444444, #222222); + background-image: linear-gradient(to bottom, #444444, #222222); + background-repeat: repeat-x; + border-color: #222222 #222222 #000000; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff444444', endColorstr='#ff222222', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); +} + +.btn-inverse:hover, +.btn-inverse:active, +.btn-inverse.active, +.btn-inverse.disabled, +.btn-inverse[disabled] { + color: #ffffff; + background-color: #222222; + *background-color: #151515; +} + +.btn-inverse:active, +.btn-inverse.active { + background-color: #080808 \9; +} + +button.btn, +input[type="submit"].btn { + *padding-top: 3px; + *padding-bottom: 3px; +} + +button.btn::-moz-focus-inner, +input[type="submit"].btn::-moz-focus-inner { + padding: 0; + border: 0; +} + +button.btn.btn-large, +input[type="submit"].btn.btn-large { + *padding-top: 7px; + *padding-bottom: 7px; +} + +button.btn.btn-small, +input[type="submit"].btn.btn-small { + *padding-top: 3px; + *padding-bottom: 3px; +} + +button.btn.btn-mini, +input[type="submit"].btn.btn-mini { + *padding-top: 1px; + *padding-bottom: 1px; +} + +.btn-link, +.btn-link:active, +.btn-link[disabled] { + background-color: transparent; + background-image: none; + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; +} + +.btn-link { + color: #0088cc; + cursor: pointer; + border-color: transparent; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; +} + +.btn-link:hover { + color: #005580; + text-decoration: underline; + background-color: transparent; +} + +.btn-link[disabled]:hover { + color: #333333; + text-decoration: none; +} + +.btn-group { + position: relative; + display: inline-block; + *display: inline; + *margin-left: .3em; + font-size: 0; + white-space: nowrap; + vertical-align: middle; + *zoom: 1; +} + +.btn-group:first-child { + *margin-left: 0; +} + +.btn-group + .btn-group { + margin-left: 5px; +} + +.btn-toolbar { + margin-top: 10px; + margin-bottom: 10px; + font-size: 0; +} + +.btn-toolbar > .btn + .btn, +.btn-toolbar > .btn-group + .btn, +.btn-toolbar > .btn + .btn-group { + margin-left: 5px; +} + +.btn-group > .btn { + position: relative; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; +} + +.btn-group > .btn + .btn { + margin-left: -1px; +} + +.btn-group > .btn, +.btn-group > .dropdown-menu, +.btn-group > .popover { + font-size: 14px; +} + +.btn-group > .btn-mini { + font-size: 10.5px; +} + +.btn-group > .btn-small { + font-size: 11.9px; +} + +.btn-group > .btn-large { + font-size: 17.5px; +} + +.btn-group > .btn:first-child { + margin-left: 0; + -webkit-border-bottom-left-radius: 4px; + border-bottom-left-radius: 4px; + -webkit-border-top-left-radius: 4px; + border-top-left-radius: 4px; + -moz-border-radius-bottomleft: 4px; + -moz-border-radius-topleft: 4px; +} + +.btn-group > .btn:last-child, +.btn-group > .dropdown-toggle { + -webkit-border-top-right-radius: 4px; + border-top-right-radius: 4px; + -webkit-border-bottom-right-radius: 4px; + border-bottom-right-radius: 4px; + -moz-border-radius-topright: 4px; + -moz-border-radius-bottomright: 4px; +} + +.btn-group > .btn.large:first-child { + margin-left: 0; + -webkit-border-bottom-left-radius: 6px; + border-bottom-left-radius: 6px; + -webkit-border-top-left-radius: 6px; + border-top-left-radius: 6px; + -moz-border-radius-bottomleft: 6px; + -moz-border-radius-topleft: 6px; +} + +.btn-group > .btn.large:last-child, +.btn-group > .large.dropdown-toggle { + -webkit-border-top-right-radius: 6px; + border-top-right-radius: 6px; + -webkit-border-bottom-right-radius: 6px; + border-bottom-right-radius: 6px; + -moz-border-radius-topright: 6px; + -moz-border-radius-bottomright: 6px; +} + +.btn-group > .btn:hover, +.btn-group > .btn:focus, +.btn-group > .btn:active, +.btn-group > .btn.active { + z-index: 2; +} + +.btn-group .dropdown-toggle:active, +.btn-group.open .dropdown-toggle { + outline: 0; +} + +.btn-group > .btn + .dropdown-toggle { + *padding-top: 5px; + padding-right: 8px; + *padding-bottom: 5px; + padding-left: 8px; + -webkit-box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); +} + +.btn-group > .btn-mini + .dropdown-toggle { + *padding-top: 2px; + padding-right: 5px; + *padding-bottom: 2px; + padding-left: 5px; +} + +.btn-group > .btn-small + .dropdown-toggle { + *padding-top: 5px; + *padding-bottom: 4px; +} + +.btn-group > .btn-large + .dropdown-toggle { + *padding-top: 7px; + padding-right: 12px; + *padding-bottom: 7px; + padding-left: 12px; +} + +.btn-group.open .dropdown-toggle { + background-image: none; + -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); +} + +.btn-group.open .btn.dropdown-toggle { + background-color: #e6e6e6; +} + +.btn-group.open .btn-primary.dropdown-toggle { + background-color: #0044cc; +} + +.btn-group.open .btn-warning.dropdown-toggle { + background-color: #f89406; +} + +.btn-group.open .btn-danger.dropdown-toggle { + background-color: #bd362f; +} + +.btn-group.open .btn-success.dropdown-toggle { + background-color: #51a351; +} + +.btn-group.open .btn-info.dropdown-toggle { + background-color: #2f96b4; +} + +.btn-group.open .btn-inverse.dropdown-toggle { + background-color: #222222; +} + +.btn .caret { + margin-top: 8px; + margin-left: 0; +} + +.btn-mini .caret, +.btn-small .caret, +.btn-large .caret { + margin-top: 6px; +} + +.btn-large .caret { + border-top-width: 5px; + border-right-width: 5px; + border-left-width: 5px; +} + +.dropup .btn-large .caret { + border-bottom-width: 5px; +} + +.btn-primary .caret, +.btn-warning .caret, +.btn-danger .caret, +.btn-info .caret, +.btn-success .caret, +.btn-inverse .caret { + border-top-color: #ffffff; + border-bottom-color: #ffffff; +} + +.btn-group-vertical { + display: inline-block; + *display: inline; + /* IE7 inline-block hack */ + + *zoom: 1; +} + +.btn-group-vertical > .btn { + display: block; + float: none; + max-width: 100%; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; +} + +.btn-group-vertical > .btn + .btn { + margin-top: -1px; + margin-left: 0; +} + +.btn-group-vertical > .btn:first-child { + -webkit-border-radius: 4px 4px 0 0; + -moz-border-radius: 4px 4px 0 0; + border-radius: 4px 4px 0 0; +} + +.btn-group-vertical > .btn:last-child { + -webkit-border-radius: 0 0 4px 4px; + -moz-border-radius: 0 0 4px 4px; + border-radius: 0 0 4px 4px; +} + +.btn-group-vertical > .btn-large:first-child { + -webkit-border-radius: 6px 6px 0 0; + -moz-border-radius: 6px 6px 0 0; + border-radius: 6px 6px 0 0; +} + +.btn-group-vertical > .btn-large:last-child { + -webkit-border-radius: 0 0 6px 6px; + -moz-border-radius: 0 0 6px 6px; + border-radius: 0 0 6px 6px; +} + +.alert { + padding: 8px 35px 8px 14px; + margin-bottom: 20px; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); + background-color: #fcf8e3; + border: 1px solid #fbeed5; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} + +.alert, +.alert h4 { + color: #c09853; +} + +.alert h4 { + margin: 0; +} + +.alert .close { + position: relative; + top: -2px; + right: -21px; + line-height: 20px; +} + +.alert-success { + color: #468847; + background-color: #dff0d8; + border-color: #d6e9c6; +} + +.alert-success h4 { + color: #468847; +} + +.alert-danger, +.alert-error { + color: #b94a48; + background-color: #f2dede; + border-color: #eed3d7; +} + +.alert-danger h4, +.alert-error h4 { + color: #b94a48; +} + +.alert-info { + color: #3a87ad; + background-color: #d9edf7; + border-color: #bce8f1; +} + +.alert-info h4 { + color: #3a87ad; +} + +.alert-block { + padding-top: 14px; + padding-bottom: 14px; +} + +.alert-block > p, +.alert-block > ul { + margin-bottom: 0; +} + +.alert-block p + p { + margin-top: 5px; +} + +.nav { + margin-bottom: 20px; + margin-left: 0; + list-style: none; +} + +.nav > li > a { + display: block; +} + +.nav > li > a:hover { + text-decoration: none; + background-color: #eeeeee; +} + +.nav > li > a > img { + max-width: none; +} + +.nav > .pull-right { + float: right; +} + +.nav-header { + display: block; + padding: 3px 15px; + font-size: 11px; + font-weight: bold; + line-height: 20px; + color: #999999; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); + text-transform: uppercase; +} + +.nav li + .nav-header { + margin-top: 9px; +} + +.nav-list { + padding-right: 15px; + padding-left: 15px; + margin-bottom: 0; +} + +.nav-list > li > a, +.nav-list .nav-header { + margin-right: -15px; + margin-left: -15px; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); +} + +.nav-list > li > a { + padding: 3px 15px; +} + +.nav-list > .active > a, +.nav-list > .active > a:hover { + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2); + background-color: #0088cc; +} + +.nav-list [class^="icon-"], +.nav-list [class*=" icon-"] { + margin-right: 2px; +} + +.nav-list .divider { + *width: 100%; + height: 1px; + margin: 9px 1px; + *margin: -5px 0 5px; + overflow: hidden; + background-color: #e5e5e5; + border-bottom: 1px solid #ffffff; +} + +.nav-tabs, +.nav-pills { + *zoom: 1; +} + +.nav-tabs:before, +.nav-pills:before, +.nav-tabs:after, +.nav-pills:after { + display: table; + line-height: 0; + content: ""; +} + +.nav-tabs:after, +.nav-pills:after { + clear: both; +} + +.nav-tabs > li, +.nav-pills > li { + float: left; +} + +.nav-tabs > li > a, +.nav-pills > li > a { + padding-right: 12px; + padding-left: 12px; + margin-right: 2px; + line-height: 14px; +} + +.nav-tabs { + border-bottom: 1px solid #ddd; +} + +.nav-tabs > li { + margin-bottom: -1px; +} + +.nav-tabs > li > a { + padding-top: 8px; + padding-bottom: 8px; + line-height: 20px; + border: 1px solid transparent; + -webkit-border-radius: 4px 4px 0 0; + -moz-border-radius: 4px 4px 0 0; + border-radius: 4px 4px 0 0; +} + +.nav-tabs > li > a:hover { + border-color: #eeeeee #eeeeee #dddddd; +} + +.nav-tabs > .active > a, +.nav-tabs > .active > a:hover { + color: #555555; + cursor: default; + background-color: #ffffff; + border: 1px solid #ddd; + border-bottom-color: transparent; +} + +.nav-pills > li > a { + padding-top: 8px; + padding-bottom: 8px; + margin-top: 2px; + margin-bottom: 2px; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; +} + +.nav-pills > .active > a, +.nav-pills > .active > a:hover { + color: #ffffff; + background-color: #0088cc; +} + +.nav-stacked > li { + float: none; +} + +.nav-stacked > li > a { + margin-right: 0; +} + +.nav-tabs.nav-stacked { + border-bottom: 0; +} + +.nav-tabs.nav-stacked > li > a { + border: 1px solid #ddd; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; +} + +.nav-tabs.nav-stacked > li:first-child > a { + -webkit-border-top-right-radius: 4px; + border-top-right-radius: 4px; + -webkit-border-top-left-radius: 4px; + border-top-left-radius: 4px; + -moz-border-radius-topright: 4px; + -moz-border-radius-topleft: 4px; +} + +.nav-tabs.nav-stacked > li:last-child > a { + -webkit-border-bottom-right-radius: 4px; + border-bottom-right-radius: 4px; + -webkit-border-bottom-left-radius: 4px; + border-bottom-left-radius: 4px; + -moz-border-radius-bottomright: 4px; + -moz-border-radius-bottomleft: 4px; +} + +.nav-tabs.nav-stacked > li > a:hover { + z-index: 2; + border-color: #ddd; +} + +.nav-pills.nav-stacked > li > a { + margin-bottom: 3px; +} + +.nav-pills.nav-stacked > li:last-child > a { + margin-bottom: 1px; +} + +.nav-tabs .dropdown-menu { + -webkit-border-radius: 0 0 6px 6px; + -moz-border-radius: 0 0 6px 6px; + border-radius: 0 0 6px 6px; +} + +.nav-pills .dropdown-menu { + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; +} + +.nav .dropdown-toggle .caret { + margin-top: 6px; + border-top-color: #0088cc; + border-bottom-color: #0088cc; +} + +.nav .dropdown-toggle:hover .caret { + border-top-color: #005580; + border-bottom-color: #005580; +} + +/* move down carets for tabs */ + +.nav-tabs .dropdown-toggle .caret { + margin-top: 8px; +} + +.nav .active .dropdown-toggle .caret { + border-top-color: #fff; + border-bottom-color: #fff; +} + +.nav-tabs .active .dropdown-toggle .caret { + border-top-color: #555555; + border-bottom-color: #555555; +} + +.nav > .dropdown.active > a:hover { + cursor: pointer; +} + +.nav-tabs .open .dropdown-toggle, +.nav-pills .open .dropdown-toggle, +.nav > li.dropdown.open.active > a:hover { + color: #ffffff; + background-color: #999999; + border-color: #999999; +} + +.nav li.dropdown.open .caret, +.nav li.dropdown.open.active .caret, +.nav li.dropdown.open a:hover .caret { + border-top-color: #ffffff; + border-bottom-color: #ffffff; + opacity: 1; + filter: alpha(opacity=100); +} + +.tabs-stacked .open > a:hover { + border-color: #999999; +} + +.tabbable { + *zoom: 1; +} + +.tabbable:before, +.tabbable:after { + display: table; + line-height: 0; + content: ""; +} + +.tabbable:after { + clear: both; +} + +.tab-content { + overflow: auto; +} + +.tabs-below > .nav-tabs, +.tabs-right > .nav-tabs, +.tabs-left > .nav-tabs { + border-bottom: 0; +} + +.tab-content > .tab-pane, +.pill-content > .pill-pane { + display: none; +} + +.tab-content > .active, +.pill-content > .active { + display: block; +} + +.tabs-below > .nav-tabs { + border-top: 1px solid #ddd; +} + +.tabs-below > .nav-tabs > li { + margin-top: -1px; + margin-bottom: 0; +} + +.tabs-below > .nav-tabs > li > a { + -webkit-border-radius: 0 0 4px 4px; + -moz-border-radius: 0 0 4px 4px; + border-radius: 0 0 4px 4px; +} + +.tabs-below > .nav-tabs > li > a:hover { + border-top-color: #ddd; + border-bottom-color: transparent; +} + +.tabs-below > .nav-tabs > .active > a, +.tabs-below > .nav-tabs > .active > a:hover { + border-color: transparent #ddd #ddd #ddd; +} + +.tabs-left > .nav-tabs > li, +.tabs-right > .nav-tabs > li { + float: none; +} + +.tabs-left > .nav-tabs > li > a, +.tabs-right > .nav-tabs > li > a { + min-width: 74px; + margin-right: 0; + margin-bottom: 3px; +} + +.tabs-left > .nav-tabs { + float: left; + margin-right: 19px; + border-right: 1px solid #ddd; +} + +.tabs-left > .nav-tabs > li > a { + margin-right: -1px; + -webkit-border-radius: 4px 0 0 4px; + -moz-border-radius: 4px 0 0 4px; + border-radius: 4px 0 0 4px; +} + +.tabs-left > .nav-tabs > li > a:hover { + border-color: #eeeeee #dddddd #eeeeee #eeeeee; +} + +.tabs-left > .nav-tabs .active > a, +.tabs-left > .nav-tabs .active > a:hover { + border-color: #ddd transparent #ddd #ddd; + *border-right-color: #ffffff; +} + +.tabs-right > .nav-tabs { + float: right; + margin-left: 19px; + border-left: 1px solid #ddd; +} + +.tabs-right > .nav-tabs > li > a { + margin-left: -1px; + -webkit-border-radius: 0 4px 4px 0; + -moz-border-radius: 0 4px 4px 0; + border-radius: 0 4px 4px 0; +} + +.tabs-right > .nav-tabs > li > a:hover { + border-color: #eeeeee #eeeeee #eeeeee #dddddd; +} + +.tabs-right > .nav-tabs .active > a, +.tabs-right > .nav-tabs .active > a:hover { + border-color: #ddd #ddd #ddd transparent; + *border-left-color: #ffffff; +} + +.nav > .disabled > a { + color: #999999; +} + +.nav > .disabled > a:hover { + text-decoration: none; + cursor: default; + background-color: transparent; +} + +.navbar { + *position: relative; + *z-index: 2; + margin-bottom: 20px; + overflow: visible; +} + +.navbar-inner { + min-height: 40px; + padding-right: 20px; + padding-left: 20px; + background-color: #fafafa; + background-image: -moz-linear-gradient(top, #ffffff, #f2f2f2); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#f2f2f2)); + background-image: -webkit-linear-gradient(top, #ffffff, #f2f2f2); + background-image: -o-linear-gradient(top, #ffffff, #f2f2f2); + background-image: linear-gradient(to bottom, #ffffff, #f2f2f2); + background-repeat: repeat-x; + border: 1px solid #d4d4d4; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff2f2f2', GradientType=0); + *zoom: 1; + -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065); + -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065); + box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065); +} + +.navbar-inner:before, +.navbar-inner:after { + display: table; + line-height: 0; + content: ""; +} + +.navbar-inner:after { + clear: both; +} + +.navbar .container { + width: auto; +} + +.nav-collapse.collapse { + height: auto; + overflow: visible; +} + +.navbar .brand { + display: block; + float: left; + padding: 10px 20px 10px; + margin-left: -20px; + font-size: 20px; + font-weight: 200; + color: #777777; + text-shadow: 0 1px 0 #ffffff; +} + +.navbar .brand:hover { + text-decoration: none; +} + +.navbar-text { + margin-bottom: 0; + line-height: 40px; + color: #777777; +} + +.navbar-link { + color: #777777; +} + +.navbar-link:hover { + color: #333333; +} + +.navbar .divider-vertical { + height: 40px; + margin: 0 9px; + border-right: 1px solid #ffffff; + border-left: 1px solid #f2f2f2; +} + +.navbar .btn, +.navbar .btn-group { + margin-top: 5px; +} + +.navbar .btn-group .btn, +.navbar .input-prepend .btn, +.navbar .input-append .btn { + margin-top: 0; +} + +.navbar-form { + margin-bottom: 0; + *zoom: 1; +} + +.navbar-form:before, +.navbar-form:after { + display: table; + line-height: 0; + content: ""; +} + +.navbar-form:after { + clear: both; +} + +.navbar-form input, +.navbar-form select, +.navbar-form .radio, +.navbar-form .checkbox { + margin-top: 5px; +} + +.navbar-form input, +.navbar-form select, +.navbar-form .btn { + display: inline-block; + margin-bottom: 0; +} + +.navbar-form input[type="image"], +.navbar-form input[type="checkbox"], +.navbar-form input[type="radio"] { + margin-top: 3px; +} + +.navbar-form .input-append, +.navbar-form .input-prepend { + margin-top: 5px; + white-space: nowrap; +} + +.navbar-form .input-append input, +.navbar-form .input-prepend input { + margin-top: 0; +} + +.navbar-search { + position: relative; + float: left; + margin-top: 5px; + margin-bottom: 0; +} + +.navbar-search .search-query { + padding: 4px 14px; + margin-bottom: 0; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 13px; + font-weight: normal; + line-height: 1; + -webkit-border-radius: 15px; + -moz-border-radius: 15px; + border-radius: 15px; +} + +.navbar-static-top { + position: static; + margin-bottom: 0; +} + +.navbar-static-top .navbar-inner { + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; +} + +.navbar-fixed-top, +.navbar-fixed-bottom { + position: fixed; + right: 0; + left: 0; + z-index: 1030; + margin-bottom: 0; +} + +.navbar-fixed-top .navbar-inner, +.navbar-static-top .navbar-inner { + border-width: 0 0 1px; +} + +.navbar-fixed-bottom .navbar-inner { + border-width: 1px 0 0; +} + +.navbar-fixed-top .navbar-inner, +.navbar-fixed-bottom .navbar-inner { + padding-right: 0; + padding-left: 0; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; +} + +.navbar-static-top .container, +.navbar-fixed-top .container, +.navbar-fixed-bottom .container { + width: 940px; +} + +.navbar-fixed-top { + top: 0; +} + +.navbar-fixed-top .navbar-inner, +.navbar-static-top .navbar-inner { + -webkit-box-shadow: 0 1px 10px rgba(0, 0, 0, 0.1); + -moz-box-shadow: 0 1px 10px rgba(0, 0, 0, 0.1); + box-shadow: 0 1px 10px rgba(0, 0, 0, 0.1); +} + +.navbar-fixed-bottom { + bottom: 0; +} + +.navbar-fixed-bottom .navbar-inner { + -webkit-box-shadow: 0 -1px 10px rgba(0, 0, 0, 0.1); + -moz-box-shadow: 0 -1px 10px rgba(0, 0, 0, 0.1); + box-shadow: 0 -1px 10px rgba(0, 0, 0, 0.1); +} + +.navbar .nav { + position: relative; + left: 0; + display: block; + float: left; + margin: 0 10px 0 0; +} + +.navbar .nav.pull-right { + float: right; + margin-right: 0; +} + +.navbar .nav > li { + float: left; +} + +.navbar .nav > li > a { + float: none; + padding: 10px 15px 10px; + color: #777777; + text-decoration: none; + text-shadow: 0 1px 0 #ffffff; +} + +.navbar .nav .dropdown-toggle .caret { + margin-top: 8px; +} + +.navbar .nav > li > a:focus, +.navbar .nav > li > a:hover { + color: #333333; + text-decoration: none; + background-color: transparent; +} + +.navbar .nav > .active > a, +.navbar .nav > .active > a:hover, +.navbar .nav > .active > a:focus { + color: #555555; + text-decoration: none; + background-color: #e5e5e5; + -webkit-box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125); + -moz-box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125); + box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125); +} + +.navbar .btn-navbar { + display: none; + float: right; + padding: 7px 10px; + margin-right: 5px; + margin-left: 5px; + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #ededed; + *background-color: #e5e5e5; + background-image: -moz-linear-gradient(top, #f2f2f2, #e5e5e5); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f2f2f2), to(#e5e5e5)); + background-image: -webkit-linear-gradient(top, #f2f2f2, #e5e5e5); + background-image: -o-linear-gradient(top, #f2f2f2, #e5e5e5); + background-image: linear-gradient(to bottom, #f2f2f2, #e5e5e5); + background-repeat: repeat-x; + border-color: #e5e5e5 #e5e5e5 #bfbfbf; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2f2f2', endColorstr='#ffe5e5e5', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075); + -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075); +} + +.navbar .btn-navbar:hover, +.navbar .btn-navbar:active, +.navbar .btn-navbar.active, +.navbar .btn-navbar.disabled, +.navbar .btn-navbar[disabled] { + color: #ffffff; + background-color: #e5e5e5; + *background-color: #d9d9d9; +} + +.navbar .btn-navbar:active, +.navbar .btn-navbar.active { + background-color: #cccccc \9; +} + +.navbar .btn-navbar .icon-bar { + display: block; + width: 18px; + height: 2px; + background-color: #f5f5f5; + -webkit-border-radius: 1px; + -moz-border-radius: 1px; + border-radius: 1px; + -webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); + -moz-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); + box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); +} + +.btn-navbar .icon-bar + .icon-bar { + margin-top: 3px; +} + +.navbar .nav > li > .dropdown-menu:before { + position: absolute; + top: -7px; + left: 9px; + display: inline-block; + border-right: 7px solid transparent; + border-bottom: 7px solid #ccc; + border-left: 7px solid transparent; + border-bottom-color: rgba(0, 0, 0, 0.2); + content: ''; +} + +.navbar .nav > li > .dropdown-menu:after { + position: absolute; + top: -6px; + left: 10px; + display: inline-block; + border-right: 6px solid transparent; + border-bottom: 6px solid #ffffff; + border-left: 6px solid transparent; + content: ''; +} + +.navbar-fixed-bottom .nav > li > .dropdown-menu:before { + top: auto; + bottom: -7px; + border-top: 7px solid #ccc; + border-bottom: 0; + border-top-color: rgba(0, 0, 0, 0.2); +} + +.navbar-fixed-bottom .nav > li > .dropdown-menu:after { + top: auto; + bottom: -6px; + border-top: 6px solid #ffffff; + border-bottom: 0; +} + +.navbar .nav li.dropdown > a:hover .caret { + border-top-color: #555555; + border-bottom-color: #555555; +} + +.navbar .nav li.dropdown.open > .dropdown-toggle, +.navbar .nav li.dropdown.active > .dropdown-toggle, +.navbar .nav li.dropdown.open.active > .dropdown-toggle { + color: #555555; + background-color: #e5e5e5; +} + +.navbar .nav li.dropdown > .dropdown-toggle .caret { + border-top-color: #777777; + border-bottom-color: #777777; +} + +.navbar .nav li.dropdown.open > .dropdown-toggle .caret, +.navbar .nav li.dropdown.active > .dropdown-toggle .caret, +.navbar .nav li.dropdown.open.active > .dropdown-toggle .caret { + border-top-color: #555555; + border-bottom-color: #555555; +} + +.navbar .pull-right > li > .dropdown-menu, +.navbar .nav > li > .dropdown-menu.pull-right { + right: 0; + left: auto; +} + +.navbar .pull-right > li > .dropdown-menu:before, +.navbar .nav > li > .dropdown-menu.pull-right:before { + right: 12px; + left: auto; +} + +.navbar .pull-right > li > .dropdown-menu:after, +.navbar .nav > li > .dropdown-menu.pull-right:after { + right: 13px; + left: auto; +} + +.navbar .pull-right > li > .dropdown-menu .dropdown-menu, +.navbar .nav > li > .dropdown-menu.pull-right .dropdown-menu { + right: 100%; + left: auto; + margin-right: -1px; + margin-left: 0; + -webkit-border-radius: 6px 0 6px 6px; + -moz-border-radius: 6px 0 6px 6px; + border-radius: 6px 0 6px 6px; +} + +.navbar-inverse .navbar-inner { + background-color: #1b1b1b; + background-image: -moz-linear-gradient(top, #222222, #111111); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#222222), to(#111111)); + background-image: -webkit-linear-gradient(top, #222222, #111111); + background-image: -o-linear-gradient(top, #222222, #111111); + background-image: linear-gradient(to bottom, #222222, #111111); + background-repeat: repeat-x; + border-color: #252525; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff222222', endColorstr='#ff111111', GradientType=0); +} + +.navbar-inverse .brand, +.navbar-inverse .nav > li > a { + color: #999999; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); +} + +.navbar-inverse .brand:hover, +.navbar-inverse .nav > li > a:hover { + color: #ffffff; +} + +.navbar-inverse .brand { + color: #999999; +} + +.navbar-inverse .navbar-text { + color: #999999; +} + +.navbar-inverse .nav > li > a:focus, +.navbar-inverse .nav > li > a:hover { + color: #ffffff; + background-color: transparent; +} + +.navbar-inverse .nav .active > a, +.navbar-inverse .nav .active > a:hover, +.navbar-inverse .nav .active > a:focus { + color: #ffffff; + background-color: #111111; +} + +.navbar-inverse .navbar-link { + color: #999999; +} + +.navbar-inverse .navbar-link:hover { + color: #ffffff; +} + +.navbar-inverse .divider-vertical { + border-right-color: #222222; + border-left-color: #111111; +} + +.navbar-inverse .nav li.dropdown.open > .dropdown-toggle, +.navbar-inverse .nav li.dropdown.active > .dropdown-toggle, +.navbar-inverse .nav li.dropdown.open.active > .dropdown-toggle { + color: #ffffff; + background-color: #111111; +} + +.navbar-inverse .nav li.dropdown > a:hover .caret { + border-top-color: #ffffff; + border-bottom-color: #ffffff; +} + +.navbar-inverse .nav li.dropdown > .dropdown-toggle .caret { + border-top-color: #999999; + border-bottom-color: #999999; +} + +.navbar-inverse .nav li.dropdown.open > .dropdown-toggle .caret, +.navbar-inverse .nav li.dropdown.active > .dropdown-toggle .caret, +.navbar-inverse .nav li.dropdown.open.active > .dropdown-toggle .caret { + border-top-color: #ffffff; + border-bottom-color: #ffffff; +} + +.navbar-inverse .navbar-search .search-query { + color: #ffffff; + background-color: #515151; + border-color: #111111; + -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.15); + -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.15); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.15); + -webkit-transition: none; + -moz-transition: none; + -o-transition: none; + transition: none; +} + +.navbar-inverse .navbar-search .search-query:-moz-placeholder { + color: #cccccc; +} + +.navbar-inverse .navbar-search .search-query:-ms-input-placeholder { + color: #cccccc; +} + +.navbar-inverse .navbar-search .search-query::-webkit-input-placeholder { + color: #cccccc; +} + +.navbar-inverse .navbar-search .search-query:focus, +.navbar-inverse .navbar-search .search-query.focused { + padding: 5px 15px; + color: #333333; + text-shadow: 0 1px 0 #ffffff; + background-color: #ffffff; + border: 0; + outline: 0; + -webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.15); + -moz-box-shadow: 0 0 3px rgba(0, 0, 0, 0.15); + box-shadow: 0 0 3px rgba(0, 0, 0, 0.15); +} + +.navbar-inverse .btn-navbar { + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #0e0e0e; + *background-color: #040404; + background-image: -moz-linear-gradient(top, #151515, #040404); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#151515), to(#040404)); + background-image: -webkit-linear-gradient(top, #151515, #040404); + background-image: -o-linear-gradient(top, #151515, #040404); + background-image: linear-gradient(to bottom, #151515, #040404); + background-repeat: repeat-x; + border-color: #040404 #040404 #000000; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff151515', endColorstr='#ff040404', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); +} + +.navbar-inverse .btn-navbar:hover, +.navbar-inverse .btn-navbar:active, +.navbar-inverse .btn-navbar.active, +.navbar-inverse .btn-navbar.disabled, +.navbar-inverse .btn-navbar[disabled] { + color: #ffffff; + background-color: #040404; + *background-color: #000000; +} + +.navbar-inverse .btn-navbar:active, +.navbar-inverse .btn-navbar.active { + background-color: #000000 \9; +} + +.breadcrumb { + padding: 8px 15px; + margin: 0 0 20px; + list-style: none; + background-color: #f5f5f5; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} + +.breadcrumb > li { + display: inline-block; + *display: inline; + text-shadow: 0 1px 0 #ffffff; + *zoom: 1; +} + +.breadcrumb > li > .divider { + padding: 0 5px; + color: #ccc; +} + +.breadcrumb > .active { + color: #999999; +} + +.pagination { + margin: 20px 0; +} + +.pagination ul { + display: inline-block; + *display: inline; + margin-bottom: 0; + margin-left: 0; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + *zoom: 1; + -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); +} + +.pagination ul > li { + display: inline; +} + +.pagination ul > li > a, +.pagination ul > li > span { + float: left; + padding: 4px 12px; + line-height: 20px; + text-decoration: none; + background-color: #ffffff; + border: 1px solid #dddddd; + border-left-width: 0; +} + +.pagination ul > li > a:hover, +.pagination ul > .active > a, +.pagination ul > .active > span { + background-color: #f5f5f5; +} + +.pagination ul > .active > a, +.pagination ul > .active > span { + color: #999999; + cursor: default; +} + +.pagination ul > .disabled > span, +.pagination ul > .disabled > a, +.pagination ul > .disabled > a:hover { + color: #999999; + cursor: default; + background-color: transparent; +} + +.pagination ul > li:first-child > a, +.pagination ul > li:first-child > span { + border-left-width: 1px; + -webkit-border-bottom-left-radius: 4px; + border-bottom-left-radius: 4px; + -webkit-border-top-left-radius: 4px; + border-top-left-radius: 4px; + -moz-border-radius-bottomleft: 4px; + -moz-border-radius-topleft: 4px; +} + +.pagination ul > li:last-child > a, +.pagination ul > li:last-child > span { + -webkit-border-top-right-radius: 4px; + border-top-right-radius: 4px; + -webkit-border-bottom-right-radius: 4px; + border-bottom-right-radius: 4px; + -moz-border-radius-topright: 4px; + -moz-border-radius-bottomright: 4px; +} + +.pagination-centered { + text-align: center; +} + +.pagination-right { + text-align: right; +} + +.pagination-large ul > li > a, +.pagination-large ul > li > span { + padding: 11px 19px; + font-size: 17.5px; +} + +.pagination-large ul > li:first-child > a, +.pagination-large ul > li:first-child > span { + -webkit-border-bottom-left-radius: 6px; + border-bottom-left-radius: 6px; + -webkit-border-top-left-radius: 6px; + border-top-left-radius: 6px; + -moz-border-radius-bottomleft: 6px; + -moz-border-radius-topleft: 6px; +} + +.pagination-large ul > li:last-child > a, +.pagination-large ul > li:last-child > span { + -webkit-border-top-right-radius: 6px; + border-top-right-radius: 6px; + -webkit-border-bottom-right-radius: 6px; + border-bottom-right-radius: 6px; + -moz-border-radius-topright: 6px; + -moz-border-radius-bottomright: 6px; +} + +.pagination-mini ul > li:first-child > a, +.pagination-small ul > li:first-child > a, +.pagination-mini ul > li:first-child > span, +.pagination-small ul > li:first-child > span { + -webkit-border-bottom-left-radius: 3px; + border-bottom-left-radius: 3px; + -webkit-border-top-left-radius: 3px; + border-top-left-radius: 3px; + -moz-border-radius-bottomleft: 3px; + -moz-border-radius-topleft: 3px; +} + +.pagination-mini ul > li:last-child > a, +.pagination-small ul > li:last-child > a, +.pagination-mini ul > li:last-child > span, +.pagination-small ul > li:last-child > span { + -webkit-border-top-right-radius: 3px; + border-top-right-radius: 3px; + -webkit-border-bottom-right-radius: 3px; + border-bottom-right-radius: 3px; + -moz-border-radius-topright: 3px; + -moz-border-radius-bottomright: 3px; +} + +.pagination-small ul > li > a, +.pagination-small ul > li > span { + padding: 2px 10px; + font-size: 11.9px; +} + +.pagination-mini ul > li > a, +.pagination-mini ul > li > span { + padding: 0 6px; + font-size: 10.5px; +} + +.pager { + margin: 20px 0; + text-align: center; + list-style: none; + *zoom: 1; +} + +.pager:before, +.pager:after { + display: table; + line-height: 0; + content: ""; +} + +.pager:after { + clear: both; +} + +.pager li { + display: inline; +} + +.pager li > a, +.pager li > span { + display: inline-block; + padding: 5px 14px; + background-color: #fff; + border: 1px solid #ddd; + -webkit-border-radius: 15px; + -moz-border-radius: 15px; + border-radius: 15px; +} + +.pager li > a:hover { + text-decoration: none; + background-color: #f5f5f5; +} + +.pager .next > a, +.pager .next > span { + float: right; +} + +.pager .previous > a, +.pager .previous > span { + float: left; +} + +.pager .disabled > a, +.pager .disabled > a:hover, +.pager .disabled > span { + color: #999999; + cursor: default; + background-color: #fff; +} + +.modal-backdrop { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1040; + background-color: #000000; +} + +.modal-backdrop.fade { + opacity: 0; +} + +.modal-backdrop, +.modal-backdrop.fade.in { + opacity: 0.8; + filter: alpha(opacity=80); +} + +.modal { + position: fixed; + top: 10%; + left: 50%; + z-index: 1050; + width: 560px; + margin-left: -280px; + background-color: #ffffff; + border: 1px solid #999; + border: 1px solid rgba(0, 0, 0, 0.3); + *border: 1px solid #999; + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; + outline: none; + -webkit-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); + -moz-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); + box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); + -webkit-background-clip: padding-box; + -moz-background-clip: padding-box; + background-clip: padding-box; +} + +.modal.fade { + top: -25%; + -webkit-transition: opacity 0.3s linear, top 0.3s ease-out; + -moz-transition: opacity 0.3s linear, top 0.3s ease-out; + -o-transition: opacity 0.3s linear, top 0.3s ease-out; + transition: opacity 0.3s linear, top 0.3s ease-out; +} + +.modal.fade.in { + top: 10%; +} + +.modal-header { + padding: 9px 15px; + border-bottom: 1px solid #eee; +} + +.modal-header .close { + margin-top: 2px; +} + +.modal-header h3 { + margin: 0; + line-height: 30px; +} + +.modal-body { + position: relative; + max-height: 400px; + padding: 15px; + overflow-y: auto; +} + +.modal-form { + margin-bottom: 0; +} + +.modal-footer { + padding: 14px 15px 15px; + margin-bottom: 0; + text-align: right; + background-color: #f5f5f5; + border-top: 1px solid #ddd; + -webkit-border-radius: 0 0 6px 6px; + -moz-border-radius: 0 0 6px 6px; + border-radius: 0 0 6px 6px; + *zoom: 1; + -webkit-box-shadow: inset 0 1px 0 #ffffff; + -moz-box-shadow: inset 0 1px 0 #ffffff; + box-shadow: inset 0 1px 0 #ffffff; +} + +.modal-footer:before, +.modal-footer:after { + display: table; + line-height: 0; + content: ""; +} + +.modal-footer:after { + clear: both; +} + +.modal-footer .btn + .btn { + margin-bottom: 0; + margin-left: 5px; +} + +.modal-footer .btn-group .btn + .btn { + margin-left: -1px; +} + +.modal-footer .btn-block + .btn-block { + margin-left: 0; +} + +.tooltip { + position: absolute; + z-index: 1030; + display: block; + padding: 5px; + font-size: 11px; + opacity: 0; + filter: alpha(opacity=0); + visibility: visible; +} + +.tooltip.in { + opacity: 0.8; + filter: alpha(opacity=80); +} + +.tooltip.top { + margin-top: -3px; +} + +.tooltip.right { + margin-left: 3px; +} + +.tooltip.bottom { + margin-top: 3px; +} + +.tooltip.left { + margin-left: -3px; +} + +.tooltip-inner { + max-width: 200px; + padding: 3px 8px; + color: #ffffff; + text-align: center; + text-decoration: none; + background-color: #000000; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} + +.tooltip-arrow { + position: absolute; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; +} + +.tooltip.top .tooltip-arrow { + bottom: 0; + left: 50%; + margin-left: -5px; + border-top-color: #000000; + border-width: 5px 5px 0; +} + +.tooltip.right .tooltip-arrow { + top: 50%; + left: 0; + margin-top: -5px; + border-right-color: #000000; + border-width: 5px 5px 5px 0; +} + +.tooltip.left .tooltip-arrow { + top: 50%; + right: 0; + margin-top: -5px; + border-left-color: #000000; + border-width: 5px 0 5px 5px; +} + +.tooltip.bottom .tooltip-arrow { + top: 0; + left: 50%; + margin-left: -5px; + border-bottom-color: #000000; + border-width: 0 5px 5px; +} + +.popover { + position: absolute; + top: 0; + left: 0; + z-index: 1010; + display: none; + width: 236px; + padding: 1px; + text-align: left; + white-space: normal; + background-color: #ffffff; + border: 1px solid #ccc; + border: 1px solid rgba(0, 0, 0, 0.2); + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; + -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + -webkit-background-clip: padding-box; + -moz-background-clip: padding; + background-clip: padding-box; +} + +.popover.top { + margin-top: -10px; +} + +.popover.right { + margin-left: 10px; +} + +.popover.bottom { + margin-top: 10px; +} + +.popover.left { + margin-left: -10px; +} + +.popover-title { + padding: 8px 14px; + margin: 0; + font-size: 14px; + font-weight: normal; + line-height: 18px; + background-color: #f7f7f7; + border-bottom: 1px solid #ebebeb; + -webkit-border-radius: 5px 5px 0 0; + -moz-border-radius: 5px 5px 0 0; + border-radius: 5px 5px 0 0; +} + +.popover-content { + padding: 9px 14px; +} + +.popover .arrow, +.popover .arrow:after { + position: absolute; + display: block; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; +} + +.popover .arrow { + border-width: 11px; +} + +.popover .arrow:after { + border-width: 10px; + content: ""; +} + +.popover.top .arrow { + bottom: -11px; + left: 50%; + margin-left: -11px; + border-top-color: #999; + border-top-color: rgba(0, 0, 0, 0.25); + border-bottom-width: 0; +} + +.popover.top .arrow:after { + bottom: 1px; + margin-left: -10px; + border-top-color: #ffffff; + border-bottom-width: 0; +} + +.popover.right .arrow { + top: 50%; + left: -11px; + margin-top: -11px; + border-right-color: #999; + border-right-color: rgba(0, 0, 0, 0.25); + border-left-width: 0; +} + +.popover.right .arrow:after { + bottom: -10px; + left: 1px; + border-right-color: #ffffff; + border-left-width: 0; +} + +.popover.bottom .arrow { + top: -11px; + left: 50%; + margin-left: -11px; + border-bottom-color: #999; + border-bottom-color: rgba(0, 0, 0, 0.25); + border-top-width: 0; +} + +.popover.bottom .arrow:after { + top: 1px; + margin-left: -10px; + border-bottom-color: #ffffff; + border-top-width: 0; +} + +.popover.left .arrow { + top: 50%; + right: -11px; + margin-top: -11px; + border-left-color: #999; + border-left-color: rgba(0, 0, 0, 0.25); + border-right-width: 0; +} + +.popover.left .arrow:after { + right: 1px; + bottom: -10px; + border-left-color: #ffffff; + border-right-width: 0; +} + +.thumbnails { + margin-left: -20px; + list-style: none; + *zoom: 1; +} + +.thumbnails:before, +.thumbnails:after { + display: table; + line-height: 0; + content: ""; +} + +.thumbnails:after { + clear: both; +} + +.row-fluid .thumbnails { + margin-left: 0; +} + +.thumbnails > li { + float: left; + margin-bottom: 20px; + margin-left: 20px; +} + +.thumbnail { + display: block; + padding: 4px; + line-height: 20px; + border: 1px solid #ddd; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.055); + -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.055); + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.055); + -webkit-transition: all 0.2s ease-in-out; + -moz-transition: all 0.2s ease-in-out; + -o-transition: all 0.2s ease-in-out; + transition: all 0.2s ease-in-out; +} + +a.thumbnail:hover { + border-color: #0088cc; + -webkit-box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25); + -moz-box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25); + box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25); +} + +.thumbnail > img { + display: block; + max-width: 100%; + margin-right: auto; + margin-left: auto; +} + +.thumbnail .caption { + padding: 9px; + color: #555555; +} + +.media, +.media-body { + overflow: hidden; + *overflow: visible; + zoom: 1; +} + +.media, +.media .media { + margin-top: 15px; +} + +.media:first-child { + margin-top: 0; +} + +.media-object { + display: block; +} + +.media-heading { + margin: 0 0 5px; +} + +.media .pull-left { + margin-right: 10px; +} + +.media .pull-right { + margin-left: 10px; +} + +.media-list { + margin-left: 0; + list-style: none; +} + +.label, +.badge { + display: inline-block; + padding: 2px 4px; + font-size: 11.844px; + font-weight: bold; + line-height: 14px; + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + white-space: nowrap; + vertical-align: baseline; + background-color: #999999; +} + +.label { + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} + +.badge { + padding-right: 9px; + padding-left: 9px; + -webkit-border-radius: 9px; + -moz-border-radius: 9px; + border-radius: 9px; +} + +.label:empty, +.badge:empty { + display: none; +} + +a.label:hover, +a.badge:hover { + color: #ffffff; + text-decoration: none; + cursor: pointer; +} + +.label-important, +.badge-important { + background-color: #b94a48; +} + +.label-important[href], +.badge-important[href] { + background-color: #953b39; +} + +.label-warning, +.badge-warning { + background-color: #f89406; +} + +.label-warning[href], +.badge-warning[href] { + background-color: #c67605; +} + +.label-success, +.badge-success { + background-color: #468847; +} + +.label-success[href], +.badge-success[href] { + background-color: #356635; +} + +.label-info, +.badge-info { + background-color: #3a87ad; +} + +.label-info[href], +.badge-info[href] { + background-color: #2d6987; +} + +.label-inverse, +.badge-inverse { + background-color: #333333; +} + +.label-inverse[href], +.badge-inverse[href] { + background-color: #1a1a1a; +} + +.btn .label, +.btn .badge { + position: relative; + top: -1px; +} + +.btn-mini .label, +.btn-mini .badge { + top: 0; +} + +@-webkit-keyframes progress-bar-stripes { + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } +} + +@-moz-keyframes progress-bar-stripes { + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } +} + +@-ms-keyframes progress-bar-stripes { + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } +} + +@-o-keyframes progress-bar-stripes { + from { + background-position: 0 0; + } + to { + background-position: 40px 0; + } +} + +@keyframes progress-bar-stripes { + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } +} + +.progress { + height: 20px; + margin-bottom: 20px; + overflow: hidden; + background-color: #f7f7f7; + background-image: -moz-linear-gradient(top, #f5f5f5, #f9f9f9); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f5f5f5), to(#f9f9f9)); + background-image: -webkit-linear-gradient(top, #f5f5f5, #f9f9f9); + background-image: -o-linear-gradient(top, #f5f5f5, #f9f9f9); + background-image: linear-gradient(to bottom, #f5f5f5, #f9f9f9); + background-repeat: repeat-x; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#fff9f9f9', GradientType=0); + -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); + -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); +} + +.progress .bar { + float: left; + width: 0; + height: 100%; + font-size: 12px; + color: #ffffff; + text-align: center; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #0e90d2; + background-image: -moz-linear-gradient(top, #149bdf, #0480be); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#149bdf), to(#0480be)); + background-image: -webkit-linear-gradient(top, #149bdf, #0480be); + background-image: -o-linear-gradient(top, #149bdf, #0480be); + background-image: linear-gradient(to bottom, #149bdf, #0480be); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff149bdf', endColorstr='#ff0480be', GradientType=0); + -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); + -moz-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); + box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + -webkit-transition: width 0.6s ease; + -moz-transition: width 0.6s ease; + -o-transition: width 0.6s ease; + transition: width 0.6s ease; +} + +.progress .bar + .bar { + -webkit-box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.15), inset 0 -1px 0 rgba(0, 0, 0, 0.15); + -moz-box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.15), inset 0 -1px 0 rgba(0, 0, 0, 0.15); + box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.15), inset 0 -1px 0 rgba(0, 0, 0, 0.15); +} + +.progress-striped .bar { + background-color: #149bdf; + background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + -webkit-background-size: 40px 40px; + -moz-background-size: 40px 40px; + -o-background-size: 40px 40px; + background-size: 40px 40px; +} + +.progress.active .bar { + -webkit-animation: progress-bar-stripes 2s linear infinite; + -moz-animation: progress-bar-stripes 2s linear infinite; + -ms-animation: progress-bar-stripes 2s linear infinite; + -o-animation: progress-bar-stripes 2s linear infinite; + animation: progress-bar-stripes 2s linear infinite; +} + +.progress-danger .bar, +.progress .bar-danger { + background-color: #dd514c; + background-image: -moz-linear-gradient(top, #ee5f5b, #c43c35); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#c43c35)); + background-image: -webkit-linear-gradient(top, #ee5f5b, #c43c35); + background-image: -o-linear-gradient(top, #ee5f5b, #c43c35); + background-image: linear-gradient(to bottom, #ee5f5b, #c43c35); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b', endColorstr='#ffc43c35', GradientType=0); +} + +.progress-danger.progress-striped .bar, +.progress-striped .bar-danger { + background-color: #ee5f5b; + background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} + +.progress-success .bar, +.progress .bar-success { + background-color: #5eb95e; + background-image: -moz-linear-gradient(top, #62c462, #57a957); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#57a957)); + background-image: -webkit-linear-gradient(top, #62c462, #57a957); + background-image: -o-linear-gradient(top, #62c462, #57a957); + background-image: linear-gradient(to bottom, #62c462, #57a957); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462', endColorstr='#ff57a957', GradientType=0); +} + +.progress-success.progress-striped .bar, +.progress-striped .bar-success { + background-color: #62c462; + background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} + +.progress-info .bar, +.progress .bar-info { + background-color: #4bb1cf; + background-image: -moz-linear-gradient(top, #5bc0de, #339bb9); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#339bb9)); + background-image: -webkit-linear-gradient(top, #5bc0de, #339bb9); + background-image: -o-linear-gradient(top, #5bc0de, #339bb9); + background-image: linear-gradient(to bottom, #5bc0de, #339bb9); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff339bb9', GradientType=0); +} + +.progress-info.progress-striped .bar, +.progress-striped .bar-info { + background-color: #5bc0de; + background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} + +.progress-warning .bar, +.progress .bar-warning { + background-color: #faa732; + background-image: -moz-linear-gradient(top, #fbb450, #f89406); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406)); + background-image: -webkit-linear-gradient(top, #fbb450, #f89406); + background-image: -o-linear-gradient(top, #fbb450, #f89406); + background-image: linear-gradient(to bottom, #fbb450, #f89406); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450', endColorstr='#fff89406', GradientType=0); +} + +.progress-warning.progress-striped .bar, +.progress-striped .bar-warning { + background-color: #fbb450; + background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} + +.accordion { + margin-bottom: 20px; +} + +.accordion-group { + margin-bottom: 2px; + border: 1px solid #e5e5e5; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} + +.accordion-heading { + border-bottom: 0; +} + +.accordion-heading .accordion-toggle { + display: block; + padding: 8px 15px; +} + +.accordion-toggle { + cursor: pointer; +} + +.accordion-inner { + padding: 9px 15px; + border-top: 1px solid #e5e5e5; +} + +.carousel { + position: relative; + margin-bottom: 20px; + line-height: 1; +} + +.carousel-inner { + position: relative; + width: 100%; + overflow: hidden; +} + +.carousel-inner > .item { + position: relative; + display: none; + -webkit-transition: 0.6s ease-in-out left; + -moz-transition: 0.6s ease-in-out left; + -o-transition: 0.6s ease-in-out left; + transition: 0.6s ease-in-out left; +} + +.carousel-inner > .item > img { + display: block; + line-height: 1; +} + +.carousel-inner > .active, +.carousel-inner > .next, +.carousel-inner > .prev { + display: block; +} + +.carousel-inner > .active { + left: 0; +} + +.carousel-inner > .next, +.carousel-inner > .prev { + position: absolute; + top: 0; + width: 100%; +} + +.carousel-inner > .next { + left: 100%; +} + +.carousel-inner > .prev { + left: -100%; +} + +.carousel-inner > .next.left, +.carousel-inner > .prev.right { + left: 0; +} + +.carousel-inner > .active.left { + left: -100%; +} + +.carousel-inner > .active.right { + left: 100%; +} + +.carousel-control { + position: absolute; + top: 40%; + left: 15px; + width: 40px; + height: 40px; + margin-top: -20px; + font-size: 60px; + font-weight: 100; + line-height: 30px; + color: #ffffff; + text-align: center; + background: #222222; + border: 3px solid #ffffff; + -webkit-border-radius: 23px; + -moz-border-radius: 23px; + border-radius: 23px; + opacity: 0.5; + filter: alpha(opacity=50); +} + +.carousel-control.right { + right: 15px; + left: auto; +} + +.carousel-control:hover { + color: #ffffff; + text-decoration: none; + opacity: 0.9; + filter: alpha(opacity=90); +} + +.carousel-caption { + position: absolute; + right: 0; + bottom: 0; + left: 0; + padding: 15px; + background: #333333; + background: rgba(0, 0, 0, 0.75); +} + +.carousel-caption h4, +.carousel-caption p { + line-height: 20px; + color: #ffffff; +} + +.carousel-caption h4 { + margin: 0 0 5px; +} + +.carousel-caption p { + margin-bottom: 0; +} + +.hero-unit { + padding: 60px; + margin-bottom: 30px; + font-size: 18px; + font-weight: 200; + line-height: 30px; + color: inherit; + background-color: #eeeeee; + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; +} + +.hero-unit h1 { + margin-bottom: 0; + font-size: 60px; + line-height: 1; + letter-spacing: -1px; + color: inherit; +} + +.hero-unit li { + line-height: 30px; +} + +.pull-right { + float: right; +} + +.pull-left { + float: left; +} + +.hide { + display: none; +} + +.show { + display: block; +} + +.invisible { + visibility: hidden; +} + +.affix { + position: fixed; +} \ No newline at end of file diff --git a/samples/dynamic-html/docs/assets/css/style.css b/samples/dynamic-html/docs/assets/css/style.css new file mode 100644 index 000000000000..b596c11a535f --- /dev/null +++ b/samples/dynamic-html/docs/assets/css/style.css @@ -0,0 +1,312 @@ +.line-numbers { + margin-right: 1.0em; +} + +.content { + padding-bottom: 100px; +} + +.column_header_name { + width: 150px; +} + +.column_header_path { + width: 350px; +} + +.column_header_name .column_header_param_type .column_header_data_type .column_header_return_type { + width: 200px; +} + +.expandable { + display: none; +} + +.main_content { + margin-top: 80px; + margin-left: 25px; + margin-right: 25px; +} + +.model { + float: left; +} + +.model-container { + float: left; + width: 500px; + padding: 0px; +} + +.model-detail-container { + clear: left; + float: left; + width: 500px; + margin-left: 40px; +} + +.model-detail-popup { + box-shadow: rgba(0, 0, 0, 0.2) 0 2px 8px 5px; + border-style: solid; + border-width: 1px; + border-color: black; + padding-left: 10px; + padding-right: 10px; + padding-top: 10px; + padding-bottom: 10px; + background-color: white; + opacity: 0.99; + z-index: 1; + overflow: scroll; + width: 400px; +} + +.model-detail-popup .code { + background-color: #E4F5FF; + font-family: monospace; + white-space: pre; + margin: 10px; + overflow: auto; +} + +.model-detail-popup h2 { + margin-top: 0px; + padding-top: 0px; +} + +.model-detail-popup li { + padding-bottom: 5px; +} + +.model-detail-popup .param-reqiured-true { + font-family: monospace; + font-weight: bold; + clear: left; + display: block; + float: left; + width: 100%; +} + +.model-detail-popup .param-required-false { + font-family: monospace; + clear: left; + display: block; + float: left; + width: 100%; +} + +.model-detail-popup .param-description { + margin-left: 50px; + float: left; +} + +.param-enum { + margin-left: 20px; +} + +.section-header { + border-bottom: 2px; + font-weight: bold; + font-size: 15px; + padding: 6px 0; + color: rgb(57,57,57); +} + +.content { + padding-top: 100px; +} + +.content h1 { + font-size: 43px; + text-align: center; + margin-top: 40px; + margin-bottom: 40px; +} + +.sidebar { + box-sizing: border-box; + float: left; + display: block; + width: 240px; + overflow: scroll; + position: fixed; +} + +.section-box { + border-bottom-style: solid; + border-bottom: 10px; +} + +.section-box ul li { + list-style: none; + margin-left: 0px; +} + +.non-sidebar { + box-sizing: border-box; + display: block; + margin-left: 240px; + margin-right: 0px; + width: 638px; +} + +.non-sidebar h2 { + clear: left; + padding-top: 20px; +} + +li.parameter { + list-style: none; + display: block; + padding-left: 1em; +} + +.param{ + display: block; +} + +.param-name { + margin-left: 1em; +} + +.param-in { + font-weight: bold; + font-size: 1.1em; +} +.param-type { + margin-left: 1em; + font-style: italic; +} + +.param-description { + display: block; + font-family: 'Helvetica Neue', Arial, 'Liberation Sans', FreeSans, sans-serif; +} + +.param-optional-flag { + font-style: italic; +} + +.section { + font-weight: normal; + clear: left; +} + +.section a { + text-decoration: underline; +} + +.code { + background-color: #E4F5FF; + font-family: monospace; + white-space: pre; + margin: 10px; + overflow: auto; + width: 600px; +} + +.header { + position: fixed; + text-align: left; + background-color: black; + float: left; + top: 0; + width: 100%; + height: 70px auto; + padding-bottom: 20px; + box-shadow: rgba(0, 0, 0, 0.2) 0 2px 8px 5px; +} + +.top-bar h1 a { + width: auto; +} + +.top-bar h1#logo a { + width: auto; + display: block; + clear: none; + float: left; + background-position: left;; + color: white; + text-decoration: none; +} + +.top-bar ul li { + list-style: none; +} + +.top-bar h1#logo span { + display: block; + clear: none; + float: left; + padding-top: 10px; + padding-left: 10px; + margin: 0px; +} + +.top-bar h1#logo a span.light { + color: #ffc97a; + color: #666666; + padding-left: 0px; +} + +.top-bar ul#nav { + float: none; + clear: both; + overflow: hidden; + margin: 0; + padding: 0; + display: block; + float: right; + clear: none; +} + +.top-bar ul#nav li { + float: left; + clear: none; + margin: 0; + padding: 2px 10px; + border-right: 1px solid #dddddd; +} + +.top-bar ul#nav li:first-child, .top-bar ul#nav li.first { + padding-left: 0; +} + +.top-bar ul#nav li:last-child, .top-bar ul#nav li.last { + padding-right: 0; + border-right: none; +} + +.top-bar ul#nav li { + border: none; + padding: 0 5px; +} + +.top-bar ul#nav li a { + display: block; + padding: 8px 10px 8px 10px; + color: #999999; + text-decoration: none; +} + +.top-bar ul#nav li a.strong { + color: white; +} + +.top-bar ul#nav li a:active, .top-bar ul#nav li a.active, .top-bar ul#nav li a:hover { + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + -o-border-radius: 4px; + -ms-border-radius: 4px; + -khtml-border-radius: 4px; + border-radius: 4px; + background-image: -webkit-gradient(linear, 0% 100%, 0% 0%, color-stop(0%, #ff5401), color-stop(100%, #ffa014)); + background-image: -moz-linear-gradient(bottom, #ff5401 0%, #ffa014 100%); + background-image: linear-gradient(bottom, #ff5401 0%, #ffa014 100%); + color: white; +} + +.top-bar ul#nav:hover li { + border-color: #222222; +} diff --git a/samples/dynamic-html/docs/assets/images/logo.png b/samples/dynamic-html/docs/assets/images/logo.png new file mode 100644 index 000000000000..6b704e25f992 Binary files /dev/null and b/samples/dynamic-html/docs/assets/images/logo.png differ diff --git a/samples/dynamic-html/docs/assets/js/bootstrap.js b/samples/dynamic-html/docs/assets/js/bootstrap.js new file mode 100644 index 000000000000..6c15a5832964 --- /dev/null +++ b/samples/dynamic-html/docs/assets/js/bootstrap.js @@ -0,0 +1,2159 @@ +/* =================================================== + * bootstrap-transition.js v2.2.2 + * http://twitter.github.com/bootstrap/javascript.html#transitions + * =================================================== + * Copyright 2012 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ========================================================== */ + + +!function ($) { + + "use strict"; // jshint ;_; + + + /* CSS TRANSITION SUPPORT (http://www.modernizr.com/) + * ======================================================= */ + + $(function () { + + $.support.transition = (function () { + + var transitionEnd = (function () { + + var el = document.createElement('bootstrap') + , transEndEventNames = { + 'WebkitTransition' : 'webkitTransitionEnd' + , 'MozTransition' : 'transitionend' + , 'OTransition' : 'oTransitionEnd otransitionend' + , 'transition' : 'transitionend' + } + , name + + for (name in transEndEventNames){ + if (el.style[name] !== undefined) { + return transEndEventNames[name] + } + } + + }()) + + return transitionEnd && { + end: transitionEnd + } + + })() + + }) + +}(window.jQuery);/* ========================================================== + * bootstrap-alert.js v2.2.2 + * http://twitter.github.com/bootstrap/javascript.html#alerts + * ========================================================== + * Copyright 2012 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ========================================================== */ + + +!function ($) { + + "use strict"; // jshint ;_; + + + /* ALERT CLASS DEFINITION + * ====================== */ + + var dismiss = '[data-dismiss="alert"]' + , Alert = function (el) { + $(el).on('click', dismiss, this.close) + } + + Alert.prototype.close = function (e) { + var $this = $(this) + , selector = $this.attr('data-target') + , $parent + + if (!selector) { + selector = $this.attr('href') + selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 + } + + $parent = $(selector) + + e && e.preventDefault() + + $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent()) + + $parent.trigger(e = $.Event('close')) + + if (e.isDefaultPrevented()) return + + $parent.removeClass('in') + + function removeElement() { + $parent + .trigger('closed') + .remove() + } + + $.support.transition && $parent.hasClass('fade') ? + $parent.on($.support.transition.end, removeElement) : + removeElement() + } + + + /* ALERT PLUGIN DEFINITION + * ======================= */ + + var old = $.fn.alert + + $.fn.alert = function (option) { + return this.each(function () { + var $this = $(this) + , data = $this.data('alert') + if (!data) $this.data('alert', (data = new Alert(this))) + if (typeof option == 'string') data[option].call($this) + }) + } + + $.fn.alert.Constructor = Alert + + + /* ALERT NO CONFLICT + * ================= */ + + $.fn.alert.noConflict = function () { + $.fn.alert = old + return this + } + + + /* ALERT DATA-API + * ============== */ + + $(document).on('click.alert.data-api', dismiss, Alert.prototype.close) + +}(window.jQuery);/* ============================================================ + * bootstrap-button.js v2.2.2 + * http://twitter.github.com/bootstrap/javascript.html#buttons + * ============================================================ + * Copyright 2012 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================ */ + + +!function ($) { + + "use strict"; // jshint ;_; + + + /* BUTTON PUBLIC CLASS DEFINITION + * ============================== */ + + var Button = function (element, options) { + this.$element = $(element) + this.options = $.extend({}, $.fn.button.defaults, options) + } + + Button.prototype.setState = function (state) { + var d = 'disabled' + , $el = this.$element + , data = $el.data() + , val = $el.is('input') ? 'val' : 'html' + + state = state + 'Text' + data.resetText || $el.data('resetText', $el[val]()) + + $el[val](data[state] || this.options[state]) + + // push to event loop to allow forms to submit + setTimeout(function () { + state == 'loadingText' ? + $el.addClass(d).attr(d, d) : + $el.removeClass(d).removeAttr(d) + }, 0) + } + + Button.prototype.toggle = function () { + var $parent = this.$element.closest('[data-toggle="buttons-radio"]') + + $parent && $parent + .find('.active') + .removeClass('active') + + this.$element.toggleClass('active') + } + + + /* BUTTON PLUGIN DEFINITION + * ======================== */ + + var old = $.fn.button + + $.fn.button = function (option) { + return this.each(function () { + var $this = $(this) + , data = $this.data('button') + , options = typeof option == 'object' && option + if (!data) $this.data('button', (data = new Button(this, options))) + if (option == 'toggle') data.toggle() + else if (option) data.setState(option) + }) + } + + $.fn.button.defaults = { + loadingText: 'loading...' + } + + $.fn.button.Constructor = Button + + + /* BUTTON NO CONFLICT + * ================== */ + + $.fn.button.noConflict = function () { + $.fn.button = old + return this + } + + + /* BUTTON DATA-API + * =============== */ + + $(document).on('click.button.data-api', '[data-toggle^=button]', function (e) { + var $btn = $(e.target) + if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') + $btn.button('toggle') + }) + +}(window.jQuery);/* ========================================================== + * bootstrap-carousel.js v2.2.2 + * http://twitter.github.com/bootstrap/javascript.html#carousel + * ========================================================== + * Copyright 2012 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ========================================================== */ + + +!function ($) { + + "use strict"; // jshint ;_; + + + /* CAROUSEL CLASS DEFINITION + * ========================= */ + + var Carousel = function (element, options) { + this.$element = $(element) + this.options = options + this.options.pause == 'hover' && this.$element + .on('mouseenter', $.proxy(this.pause, this)) + .on('mouseleave', $.proxy(this.cycle, this)) + } + + Carousel.prototype = { + + cycle: function (e) { + if (!e) this.paused = false + this.options.interval + && !this.paused + && (this.interval = setInterval($.proxy(this.next, this), this.options.interval)) + return this + } + + , to: function (pos) { + var $active = this.$element.find('.item.active') + , children = $active.parent().children() + , activePos = children.index($active) + , that = this + + if (pos > (children.length - 1) || pos < 0) return + + if (this.sliding) { + return this.$element.one('slid', function () { + that.to(pos) + }) + } + + if (activePos == pos) { + return this.pause().cycle() + } + + return this.slide(pos > activePos ? 'next' : 'prev', $(children[pos])) + } + + , pause: function (e) { + if (!e) this.paused = true + if (this.$element.find('.next, .prev').length && $.support.transition.end) { + this.$element.trigger($.support.transition.end) + this.cycle() + } + clearInterval(this.interval) + this.interval = null + return this + } + + , next: function () { + if (this.sliding) return + return this.slide('next') + } + + , prev: function () { + if (this.sliding) return + return this.slide('prev') + } + + , slide: function (type, next) { + var $active = this.$element.find('.item.active') + , $next = next || $active[type]() + , isCycling = this.interval + , direction = type == 'next' ? 'left' : 'right' + , fallback = type == 'next' ? 'first' : 'last' + , that = this + , e + + this.sliding = true + + isCycling && this.pause() + + $next = $next.length ? $next : this.$element.find('.item')[fallback]() + + e = $.Event('slide', { + relatedTarget: $next[0] + }) + + if ($next.hasClass('active')) return + + if ($.support.transition && this.$element.hasClass('slide')) { + this.$element.trigger(e) + if (e.isDefaultPrevented()) return + $next.addClass(type) + $next[0].offsetWidth // force reflow + $active.addClass(direction) + $next.addClass(direction) + this.$element.one($.support.transition.end, function () { + $next.removeClass([type, direction].join(' ')).addClass('active') + $active.removeClass(['active', direction].join(' ')) + that.sliding = false + setTimeout(function () { that.$element.trigger('slid') }, 0) + }) + } else { + this.$element.trigger(e) + if (e.isDefaultPrevented()) return + $active.removeClass('active') + $next.addClass('active') + this.sliding = false + this.$element.trigger('slid') + } + + isCycling && this.cycle() + + return this + } + + } + + + /* CAROUSEL PLUGIN DEFINITION + * ========================== */ + + var old = $.fn.carousel + + $.fn.carousel = function (option) { + return this.each(function () { + var $this = $(this) + , data = $this.data('carousel') + , options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option) + , action = typeof option == 'string' ? option : options.slide + if (!data) $this.data('carousel', (data = new Carousel(this, options))) + if (typeof option == 'number') data.to(option) + else if (action) data[action]() + else if (options.interval) data.cycle() + }) + } + + $.fn.carousel.defaults = { + interval: 5000 + , pause: 'hover' + } + + $.fn.carousel.Constructor = Carousel + + + /* CAROUSEL NO CONFLICT + * ==================== */ + + $.fn.carousel.noConflict = function () { + $.fn.carousel = old + return this + } + + /* CAROUSEL DATA-API + * ================= */ + + $(document).on('click.carousel.data-api', '[data-slide]', function (e) { + var $this = $(this), href + , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 + , options = $.extend({}, $target.data(), $this.data()) + $target.carousel(options) + e.preventDefault() + }) + +}(window.jQuery);/* ============================================================= + * bootstrap-collapse.js v2.2.2 + * http://twitter.github.com/bootstrap/javascript.html#collapse + * ============================================================= + * Copyright 2012 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================ */ + + +!function ($) { + + "use strict"; // jshint ;_; + + + /* COLLAPSE PUBLIC CLASS DEFINITION + * ================================ */ + + var Collapse = function (element, options) { + this.$element = $(element) + this.options = $.extend({}, $.fn.collapse.defaults, options) + + if (this.options.parent) { + this.$parent = $(this.options.parent) + } + + this.options.toggle && this.toggle() + } + + Collapse.prototype = { + + constructor: Collapse + + , dimension: function () { + var hasWidth = this.$element.hasClass('width') + return hasWidth ? 'width' : 'height' + } + + , show: function () { + var dimension + , scroll + , actives + , hasData + + if (this.transitioning) return + + dimension = this.dimension() + scroll = $.camelCase(['scroll', dimension].join('-')) + actives = this.$parent && this.$parent.find('> .accordion-group > .in') + + if (actives && actives.length) { + hasData = actives.data('collapse') + if (hasData && hasData.transitioning) return + actives.collapse('hide') + hasData || actives.data('collapse', null) + } + + this.$element[dimension](0) + this.transition('addClass', $.Event('show'), 'shown') + $.support.transition && this.$element[dimension](this.$element[0][scroll]) + } + + , hide: function () { + var dimension + if (this.transitioning) return + dimension = this.dimension() + this.reset(this.$element[dimension]()) + this.transition('removeClass', $.Event('hide'), 'hidden') + this.$element[dimension](0) + } + + , reset: function (size) { + var dimension = this.dimension() + + this.$element + .removeClass('collapse') + [dimension](size || 'auto') + [0].offsetWidth + + this.$element[size !== null ? 'addClass' : 'removeClass']('collapse') + + return this + } + + , transition: function (method, startEvent, completeEvent) { + var that = this + , complete = function () { + if (startEvent.type == 'show') that.reset() + that.transitioning = 0 + that.$element.trigger(completeEvent) + } + + this.$element.trigger(startEvent) + + if (startEvent.isDefaultPrevented()) return + + this.transitioning = 1 + + this.$element[method]('in') + + $.support.transition && this.$element.hasClass('collapse') ? + this.$element.one($.support.transition.end, complete) : + complete() + } + + , toggle: function () { + this[this.$element.hasClass('in') ? 'hide' : 'show']() + } + + } + + + /* COLLAPSE PLUGIN DEFINITION + * ========================== */ + + var old = $.fn.collapse + + $.fn.collapse = function (option) { + return this.each(function () { + var $this = $(this) + , data = $this.data('collapse') + , options = typeof option == 'object' && option + if (!data) $this.data('collapse', (data = new Collapse(this, options))) + if (typeof option == 'string') data[option]() + }) + } + + $.fn.collapse.defaults = { + toggle: true + } + + $.fn.collapse.Constructor = Collapse + + + /* COLLAPSE NO CONFLICT + * ==================== */ + + $.fn.collapse.noConflict = function () { + $.fn.collapse = old + return this + } + + + /* COLLAPSE DATA-API + * ================= */ + + $(document).on('click.collapse.data-api', '[data-toggle=collapse]', function (e) { + var $this = $(this), href + , target = $this.attr('data-target') + || e.preventDefault() + || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7 + , option = $(target).data('collapse') ? 'toggle' : $this.data() + $this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed') + $(target).collapse(option) + }) + +}(window.jQuery);/* ============================================================ + * bootstrap-dropdown.js v2.2.2 + * http://twitter.github.com/bootstrap/javascript.html#dropdowns + * ============================================================ + * Copyright 2012 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================ */ + + +!function ($) { + + "use strict"; // jshint ;_; + + + /* DROPDOWN CLASS DEFINITION + * ========================= */ + + var toggle = '[data-toggle=dropdown]' + , Dropdown = function (element) { + var $el = $(element).on('click.dropdown.data-api', this.toggle) + $('html').on('click.dropdown.data-api', function () { + $el.parent().removeClass('open') + }) + } + + Dropdown.prototype = { + + constructor: Dropdown + + , toggle: function (e) { + var $this = $(this) + , $parent + , isActive + + if ($this.is('.disabled, :disabled')) return + + $parent = getParent($this) + + isActive = $parent.hasClass('open') + + clearMenus() + + if (!isActive) { + $parent.toggleClass('open') + } + + $this.focus() + + return false + } + + , keydown: function (e) { + var $this + , $items + , $active + , $parent + , isActive + , index + + if (!/(38|40|27)/.test(e.keyCode)) return + + $this = $(this) + + e.preventDefault() + e.stopPropagation() + + if ($this.is('.disabled, :disabled')) return + + $parent = getParent($this) + + isActive = $parent.hasClass('open') + + if (!isActive || (isActive && e.keyCode == 27)) return $this.click() + + $items = $('[role=menu] li:not(.divider):visible a', $parent) + + if (!$items.length) return + + index = $items.index($items.filter(':focus')) + + if (e.keyCode == 38 && index > 0) index-- // up + if (e.keyCode == 40 && index < $items.length - 1) index++ // down + if (!~index) index = 0 + + $items + .eq(index) + .focus() + } + + } + + function clearMenus() { + $(toggle).each(function () { + getParent($(this)).removeClass('open') + }) + } + + function getParent($this) { + var selector = $this.attr('data-target') + , $parent + + if (!selector) { + selector = $this.attr('href') + selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 + } + + $parent = $(selector) + $parent.length || ($parent = $this.parent()) + + return $parent + } + + + /* DROPDOWN PLUGIN DEFINITION + * ========================== */ + + var old = $.fn.dropdown + + $.fn.dropdown = function (option) { + return this.each(function () { + var $this = $(this) + , data = $this.data('dropdown') + if (!data) $this.data('dropdown', (data = new Dropdown(this))) + if (typeof option == 'string') data[option].call($this) + }) + } + + $.fn.dropdown.Constructor = Dropdown + + + /* DROPDOWN NO CONFLICT + * ==================== */ + + $.fn.dropdown.noConflict = function () { + $.fn.dropdown = old + return this + } + + + /* APPLY TO STANDARD DROPDOWN ELEMENTS + * =================================== */ + + $(document) + .on('click.dropdown.data-api touchstart.dropdown.data-api', clearMenus) + .on('click.dropdown touchstart.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() }) + .on('touchstart.dropdown.data-api', '.dropdown-menu', function (e) { e.stopPropagation() }) + .on('click.dropdown.data-api touchstart.dropdown.data-api' , toggle, Dropdown.prototype.toggle) + .on('keydown.dropdown.data-api touchstart.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown) + +}(window.jQuery);/* ========================================================= + * bootstrap-modal.js v2.2.2 + * http://twitter.github.com/bootstrap/javascript.html#modals + * ========================================================= + * Copyright 2012 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ========================================================= */ + + +!function ($) { + + "use strict"; // jshint ;_; + + + /* MODAL CLASS DEFINITION + * ====================== */ + + var Modal = function (element, options) { + this.options = options + this.$element = $(element) + .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this)) + this.options.remote && this.$element.find('.modal-body').load(this.options.remote) + } + + Modal.prototype = { + + constructor: Modal + + , toggle: function () { + return this[!this.isShown ? 'show' : 'hide']() + } + + , show: function () { + var that = this + , e = $.Event('show') + + this.$element.trigger(e) + + if (this.isShown || e.isDefaultPrevented()) return + + this.isShown = true + + this.escape() + + this.backdrop(function () { + var transition = $.support.transition && that.$element.hasClass('fade') + + if (!that.$element.parent().length) { + that.$element.appendTo(document.body) //don't move modals dom position + } + + that.$element + .show() + + if (transition) { + that.$element[0].offsetWidth // force reflow + } + + that.$element + .addClass('in') + .attr('aria-hidden', false) + + that.enforceFocus() + + transition ? + that.$element.one($.support.transition.end, function () { that.$element.focus().trigger('shown') }) : + that.$element.focus().trigger('shown') + + }) + } + + , hide: function (e) { + e && e.preventDefault() + + var that = this + + e = $.Event('hide') + + this.$element.trigger(e) + + if (!this.isShown || e.isDefaultPrevented()) return + + this.isShown = false + + this.escape() + + $(document).off('focusin.modal') + + this.$element + .removeClass('in') + .attr('aria-hidden', true) + + $.support.transition && this.$element.hasClass('fade') ? + this.hideWithTransition() : + this.hideModal() + } + + , enforceFocus: function () { + var that = this + $(document).on('focusin.modal', function (e) { + if (that.$element[0] !== e.target && !that.$element.has(e.target).length) { + that.$element.focus() + } + }) + } + + , escape: function () { + var that = this + if (this.isShown && this.options.keyboard) { + this.$element.on('keyup.dismiss.modal', function ( e ) { + e.which == 27 && that.hide() + }) + } else if (!this.isShown) { + this.$element.off('keyup.dismiss.modal') + } + } + + , hideWithTransition: function () { + var that = this + , timeout = setTimeout(function () { + that.$element.off($.support.transition.end) + that.hideModal() + }, 500) + + this.$element.one($.support.transition.end, function () { + clearTimeout(timeout) + that.hideModal() + }) + } + + , hideModal: function (that) { + this.$element + .hide() + .trigger('hidden') + + this.backdrop() + } + + , removeBackdrop: function () { + this.$backdrop.remove() + this.$backdrop = null + } + + , backdrop: function (callback) { + var that = this + , animate = this.$element.hasClass('fade') ? 'fade' : '' + + if (this.isShown && this.options.backdrop) { + var doAnimate = $.support.transition && animate + + this.$backdrop = $(' +
    +
    +
    +
    +

    deletePet

    +

    Deletes a pet

    +
    +
    +
    +

    +

    +

    +
    +
    /pet/{petId}
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X DELETE "http://petstore.swagger.io/v2/pet/{petId}"
    +
    +
    +
    import org.openapitools.client.*;
    +import org.openapitools.client.auth.*;
    +import org.openapitools.client.model.*;
    +import org.openapitools.client.api.PetApi;
    +
    +import java.io.File;
    +import java.util.*;
    +
    +public class PetApiExample {
    +
    +    public static void main(String[] args) {
    +        ApiClient defaultClient = Configuration.getDefaultApiClient();
    +        
    +        // Configure OAuth2 access token for authorization: petstore_auth
    +        OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
    +        petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
    +
    +        PetApi apiInstance = new PetApi();
    +        Long petId = 789; // Long | Pet id to delete
    +        String apiKey = apiKey_example; // String | 
    +        try {
    +            apiInstance.deletePet(petId, apiKey);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling PetApi#deletePet");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import org.openapitools.client.api.PetApi;
    +
    +public class PetApiExample {
    +
    +    public static void main(String[] args) {
    +        PetApi apiInstance = new PetApi();
    +        Long petId = 789; // Long | Pet id to delete
    +        String apiKey = apiKey_example; // String | 
    +        try {
    +            apiInstance.deletePet(petId, apiKey);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling PetApi#deletePet");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    Configuration *apiConfig = [Configuration sharedConfig];
    +
    +// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth)
    +[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
    +
    +Long *petId = 789; // Pet id to delete (default to null)
    +String *apiKey = apiKey_example; //  (optional) (default to null)
    +
    +PetApi *apiInstance = [[PetApi alloc] init];
    +
    +// Deletes a pet
    +[apiInstance deletePetWith:petId
    +    apiKey:apiKey
    +              completionHandler: ^(NSError* error) {
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var OpenApiPetstore = require('open_api_petstore');
    +var defaultClient = OpenApiPetstore.ApiClient.instance;
    +
    +// Configure OAuth2 access token for authorization: petstore_auth
    +var petstore_auth = defaultClient.authentications['petstore_auth'];
    +petstore_auth.accessToken = "YOUR ACCESS TOKEN"
    +
    +var api = new OpenApiPetstore.PetApi()
    +var petId = 789; // {Long} Pet id to delete
    +var opts = {
    +  'apiKey': apiKey_example // {String} 
    +};
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully.');
    +  }
    +};
    +api.deletePet(petId, opts, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using Org.OpenAPITools.Api;
    +using Org.OpenAPITools.Client;
    +using Org.OpenAPITools.Model;
    +
    +namespace Example
    +{
    +    public class deletePetExample
    +    {
    +        public void main()
    +        {
    +            
    +            // Configure OAuth2 access token for authorization: petstore_auth
    +            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
    +
    +            var apiInstance = new PetApi();
    +            var petId = 789;  // Long | Pet id to delete (default to null)
    +            var apiKey = apiKey_example;  // String |  (optional)  (default to null)
    +
    +            try
    +            {
    +                // Deletes a pet
    +                apiInstance.deletePet(petId, apiKey);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling PetApi.deletePet: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +// Configure OAuth2 access token for authorization: petstore_auth
    +OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
    +
    +$api_instance = new OpenAPITools\Client\Api\PetApi();
    +$petId = 789; // Long | Pet id to delete
    +$apiKey = apiKey_example; // String | 
    +
    +try {
    +    $api_instance->deletePet($petId, $apiKey);
    +} catch (Exception $e) {
    +    echo 'Exception when calling PetApi->deletePet: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use WWW::OPenAPIClient::Configuration;
    +use WWW::OPenAPIClient::PetApi;
    +
    +# Configure OAuth2 access token for authorization: petstore_auth
    +$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
    +
    +my $api_instance = WWW::OPenAPIClient::PetApi->new();
    +my $petId = 789; # Long | Pet id to delete
    +my $apiKey = apiKey_example; # String | 
    +
    +eval { 
    +    $api_instance->deletePet(petId => $petId, apiKey => $apiKey);
    +};
    +if ($@) {
    +    warn "Exception when calling PetApi->deletePet: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import openapi_client
    +from openapi_client.rest import ApiException
    +from pprint import pprint
    +
    +# Configure OAuth2 access token for authorization: petstore_auth
    +openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
    +
    +# create an instance of the API class
    +api_instance = openapi_client.PetApi()
    +petId = 789 # Long | Pet id to delete (default to null)
    +apiKey = apiKey_example # String |  (optional) (default to null)
    +
    +try: 
    +    # Deletes a pet
    +    api_instance.delete_pet(petId, apiKey=apiKey)
    +except ApiException as e:
    +    print("Exception when calling PetApi->deletePet: %s\n" % e)
    +
    + +
    +
    extern crate PetApi;
    +
    +pub fn main() {
    +    let petId = 789; // Long
    +    let apiKey = apiKey_example; // String
    +
    +    let mut context = PetApi::Context::default();
    +    let result = client.deletePet(petId, apiKey, &context).wait();
    +    println!("{:?}", result);
    +
    +}
    +
    +
    +
    + +

    Scopes

    + + + + + + + + + + + + +
    write:petsmodify pets in your account
    read:petsread your pets
    + +

    Parameters

    + +
    Path parameters
    + + + + + + + + + +
    NameDescription
    petId* + + +
    +
    +
    + + Long + + + (int64) + + +
    +Pet id to delete +
    +
    +
    + Required +
    +
    +
    +
    + +
    Header parameters
    + + + + + + + + + +
    NameDescription
    api_key + + +
    +
    +
    + + String + + +
    +
    +
    +
    + + + + +

    Responses

    +

    +

    + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    +

    findPetsByStatus

    +

    Finds Pets by status

    +
    +
    +
    +

    +

    Multiple status values can be provided with comma separated strings

    +

    +
    +
    /pet/findByStatus
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X GET "http://petstore.swagger.io/v2/pet/findByStatus?status="
    +
    +
    +
    import org.openapitools.client.*;
    +import org.openapitools.client.auth.*;
    +import org.openapitools.client.model.*;
    +import org.openapitools.client.api.PetApi;
    +
    +import java.io.File;
    +import java.util.*;
    +
    +public class PetApiExample {
    +
    +    public static void main(String[] args) {
    +        ApiClient defaultClient = Configuration.getDefaultApiClient();
    +        
    +        // Configure OAuth2 access token for authorization: petstore_auth
    +        OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
    +        petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
    +
    +        PetApi apiInstance = new PetApi();
    +        array[String] status = ; // array[String] | Status values that need to be considered for filter
    +        try {
    +            array[Pet] result = apiInstance.findPetsByStatus(status);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling PetApi#findPetsByStatus");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import org.openapitools.client.api.PetApi;
    +
    +public class PetApiExample {
    +
    +    public static void main(String[] args) {
    +        PetApi apiInstance = new PetApi();
    +        array[String] status = ; // array[String] | Status values that need to be considered for filter
    +        try {
    +            array[Pet] result = apiInstance.findPetsByStatus(status);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling PetApi#findPetsByStatus");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    Configuration *apiConfig = [Configuration sharedConfig];
    +
    +// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth)
    +[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
    +
    +array[String] *status = ; // Status values that need to be considered for filter (default to null)
    +
    +PetApi *apiInstance = [[PetApi alloc] init];
    +
    +// Finds Pets by status
    +[apiInstance findPetsByStatusWith:status
    +              completionHandler: ^(array[Pet] output, NSError* error) {
    +                            if (output) {
    +                                NSLog(@"%@", output);
    +                            }
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var OpenApiPetstore = require('open_api_petstore');
    +var defaultClient = OpenApiPetstore.ApiClient.instance;
    +
    +// Configure OAuth2 access token for authorization: petstore_auth
    +var petstore_auth = defaultClient.authentications['petstore_auth'];
    +petstore_auth.accessToken = "YOUR ACCESS TOKEN"
    +
    +var api = new OpenApiPetstore.PetApi()
    +var status = ; // {array[String]} Status values that need to be considered for filter
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully. Returned data: ' + data);
    +  }
    +};
    +api.findPetsByStatus(status, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using Org.OpenAPITools.Api;
    +using Org.OpenAPITools.Client;
    +using Org.OpenAPITools.Model;
    +
    +namespace Example
    +{
    +    public class findPetsByStatusExample
    +    {
    +        public void main()
    +        {
    +            
    +            // Configure OAuth2 access token for authorization: petstore_auth
    +            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
    +
    +            var apiInstance = new PetApi();
    +            var status = new array[String](); // array[String] | Status values that need to be considered for filter (default to null)
    +
    +            try
    +            {
    +                // Finds Pets by status
    +                array[Pet] result = apiInstance.findPetsByStatus(status);
    +                Debug.WriteLine(result);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling PetApi.findPetsByStatus: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +// Configure OAuth2 access token for authorization: petstore_auth
    +OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
    +
    +$api_instance = new OpenAPITools\Client\Api\PetApi();
    +$status = ; // array[String] | Status values that need to be considered for filter
    +
    +try {
    +    $result = $api_instance->findPetsByStatus($status);
    +    print_r($result);
    +} catch (Exception $e) {
    +    echo 'Exception when calling PetApi->findPetsByStatus: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use WWW::OPenAPIClient::Configuration;
    +use WWW::OPenAPIClient::PetApi;
    +
    +# Configure OAuth2 access token for authorization: petstore_auth
    +$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
    +
    +my $api_instance = WWW::OPenAPIClient::PetApi->new();
    +my $status = []; # array[String] | Status values that need to be considered for filter
    +
    +eval { 
    +    my $result = $api_instance->findPetsByStatus(status => $status);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling PetApi->findPetsByStatus: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import openapi_client
    +from openapi_client.rest import ApiException
    +from pprint import pprint
    +
    +# Configure OAuth2 access token for authorization: petstore_auth
    +openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
    +
    +# create an instance of the API class
    +api_instance = openapi_client.PetApi()
    +status =  # array[String] | Status values that need to be considered for filter (default to null)
    +
    +try: 
    +    # Finds Pets by status
    +    api_response = api_instance.find_pets_by_status(status)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling PetApi->findPetsByStatus: %s\n" % e)
    +
    + +
    +
    extern crate PetApi;
    +
    +pub fn main() {
    +    let status = ; // array[String]
    +
    +    let mut context = PetApi::Context::default();
    +    let result = client.findPetsByStatus(status, &context).wait();
    +    println!("{:?}", result);
    +
    +}
    +
    +
    +
    + +

    Scopes

    + + + + + + + +
    read:petsread your pets
    + +

    Parameters

    + + + + + +
    Query parameters
    + + + + + + + + + +
    NameDescription
    status* + + +
    +
    +
    + + array[String] + + +
    +Status values that need to be considered for filter +
    +
    +
    + Required +
    +
    +
    +
    + +

    Responses

    +

    +

    + + + + + + +
    +
    +
    + +
    + +
    +
    +

    +

    + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    +

    findPetsByTags

    +

    Finds Pets by tags

    +
    +
    +
    +

    +

    Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.

    +

    +
    +
    /pet/findByTags
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X GET "http://petstore.swagger.io/v2/pet/findByTags?tags=&maxCount="
    +
    +
    +
    import org.openapitools.client.*;
    +import org.openapitools.client.auth.*;
    +import org.openapitools.client.model.*;
    +import org.openapitools.client.api.PetApi;
    +
    +import java.io.File;
    +import java.util.*;
    +
    +public class PetApiExample {
    +
    +    public static void main(String[] args) {
    +        ApiClient defaultClient = Configuration.getDefaultApiClient();
    +        
    +        // Configure OAuth2 access token for authorization: petstore_auth
    +        OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
    +        petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
    +
    +        PetApi apiInstance = new PetApi();
    +        array[String] tags = ; // array[String] | Tags to filter by
    +        Integer maxCount = 56; // Integer | Maximum number of items to return
    +        try {
    +            array[Pet] result = apiInstance.findPetsByTags(tags, maxCount);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling PetApi#findPetsByTags");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import org.openapitools.client.api.PetApi;
    +
    +public class PetApiExample {
    +
    +    public static void main(String[] args) {
    +        PetApi apiInstance = new PetApi();
    +        array[String] tags = ; // array[String] | Tags to filter by
    +        Integer maxCount = 56; // Integer | Maximum number of items to return
    +        try {
    +            array[Pet] result = apiInstance.findPetsByTags(tags, maxCount);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling PetApi#findPetsByTags");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    Configuration *apiConfig = [Configuration sharedConfig];
    +
    +// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth)
    +[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
    +
    +array[String] *tags = ; // Tags to filter by (default to null)
    +Integer *maxCount = 56; // Maximum number of items to return (optional) (default to null)
    +
    +PetApi *apiInstance = [[PetApi alloc] init];
    +
    +// Finds Pets by tags
    +[apiInstance findPetsByTagsWith:tags
    +    maxCount:maxCount
    +              completionHandler: ^(array[Pet] output, NSError* error) {
    +                            if (output) {
    +                                NSLog(@"%@", output);
    +                            }
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var OpenApiPetstore = require('open_api_petstore');
    +var defaultClient = OpenApiPetstore.ApiClient.instance;
    +
    +// Configure OAuth2 access token for authorization: petstore_auth
    +var petstore_auth = defaultClient.authentications['petstore_auth'];
    +petstore_auth.accessToken = "YOUR ACCESS TOKEN"
    +
    +var api = new OpenApiPetstore.PetApi()
    +var tags = ; // {array[String]} Tags to filter by
    +var opts = {
    +  'maxCount': 56 // {Integer} Maximum number of items to return
    +};
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully. Returned data: ' + data);
    +  }
    +};
    +api.findPetsByTags(tags, opts, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using Org.OpenAPITools.Api;
    +using Org.OpenAPITools.Client;
    +using Org.OpenAPITools.Model;
    +
    +namespace Example
    +{
    +    public class findPetsByTagsExample
    +    {
    +        public void main()
    +        {
    +            
    +            // Configure OAuth2 access token for authorization: petstore_auth
    +            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
    +
    +            var apiInstance = new PetApi();
    +            var tags = new array[String](); // array[String] | Tags to filter by (default to null)
    +            var maxCount = 56;  // Integer | Maximum number of items to return (optional)  (default to null)
    +
    +            try
    +            {
    +                // Finds Pets by tags
    +                array[Pet] result = apiInstance.findPetsByTags(tags, maxCount);
    +                Debug.WriteLine(result);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling PetApi.findPetsByTags: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +// Configure OAuth2 access token for authorization: petstore_auth
    +OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
    +
    +$api_instance = new OpenAPITools\Client\Api\PetApi();
    +$tags = ; // array[String] | Tags to filter by
    +$maxCount = 56; // Integer | Maximum number of items to return
    +
    +try {
    +    $result = $api_instance->findPetsByTags($tags, $maxCount);
    +    print_r($result);
    +} catch (Exception $e) {
    +    echo 'Exception when calling PetApi->findPetsByTags: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use WWW::OPenAPIClient::Configuration;
    +use WWW::OPenAPIClient::PetApi;
    +
    +# Configure OAuth2 access token for authorization: petstore_auth
    +$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
    +
    +my $api_instance = WWW::OPenAPIClient::PetApi->new();
    +my $tags = []; # array[String] | Tags to filter by
    +my $maxCount = 56; # Integer | Maximum number of items to return
    +
    +eval { 
    +    my $result = $api_instance->findPetsByTags(tags => $tags, maxCount => $maxCount);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling PetApi->findPetsByTags: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import openapi_client
    +from openapi_client.rest import ApiException
    +from pprint import pprint
    +
    +# Configure OAuth2 access token for authorization: petstore_auth
    +openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
    +
    +# create an instance of the API class
    +api_instance = openapi_client.PetApi()
    +tags =  # array[String] | Tags to filter by (default to null)
    +maxCount = 56 # Integer | Maximum number of items to return (optional) (default to null)
    +
    +try: 
    +    # Finds Pets by tags
    +    api_response = api_instance.find_pets_by_tags(tags, maxCount=maxCount)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling PetApi->findPetsByTags: %s\n" % e)
    +
    + +
    +
    extern crate PetApi;
    +
    +pub fn main() {
    +    let tags = ; // array[String]
    +    let maxCount = 56; // Integer
    +
    +    let mut context = PetApi::Context::default();
    +    let result = client.findPetsByTags(tags, maxCount, &context).wait();
    +    println!("{:?}", result);
    +
    +}
    +
    +
    +
    + +

    Scopes

    + + + + + + + +
    read:petsread your pets
    + +

    Parameters

    + + + + + +
    Query parameters
    + + + + + + + + + + + + + +
    NameDescription
    tags* + + +
    +
    +
    + + array[String] + + +
    +Tags to filter by +
    +
    +
    + Required +
    +
    +
    +
    maxCount + + +
    +
    +
    + + Integer + + + (int32) + + +
    +Maximum number of items to return +
    +
    +
    +
    +
    + +

    Responses

    +

    +

    + + + + + + +
    +
    +
    + +
    + +
    +
    +

    +

    + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    +

    getPetById

    +

    Find pet by ID

    +
    +
    +
    +

    +

    Returns a single pet

    +

    +
    +
    /pet/{petId}
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X GET -H "api_key: [[apiKey]]" "http://petstore.swagger.io/v2/pet/{petId}"
    +
    +
    +
    import org.openapitools.client.*;
    +import org.openapitools.client.auth.*;
    +import org.openapitools.client.model.*;
    +import org.openapitools.client.api.PetApi;
    +
    +import java.io.File;
    +import java.util.*;
    +
    +public class PetApiExample {
    +
    +    public static void main(String[] args) {
    +        ApiClient defaultClient = Configuration.getDefaultApiClient();
    +        
    +        // Configure API key authorization: api_key
    +        ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
    +        api_key.setApiKey("YOUR API KEY");
    +        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    +        //api_key.setApiKeyPrefix("Token");
    +
    +        PetApi apiInstance = new PetApi();
    +        Long petId = 789; // Long | ID of pet to return
    +        try {
    +            Pet result = apiInstance.getPetById(petId);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling PetApi#getPetById");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import org.openapitools.client.api.PetApi;
    +
    +public class PetApiExample {
    +
    +    public static void main(String[] args) {
    +        PetApi apiInstance = new PetApi();
    +        Long petId = 789; // Long | ID of pet to return
    +        try {
    +            Pet result = apiInstance.getPetById(petId);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling PetApi#getPetById");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    Configuration *apiConfig = [Configuration sharedConfig];
    +
    +// Configure API key authorization: (authentication scheme: api_key)
    +[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"api_key"];
    +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    +//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"api_key"];
    +
    +Long *petId = 789; // ID of pet to return (default to null)
    +
    +PetApi *apiInstance = [[PetApi alloc] init];
    +
    +// Find pet by ID
    +[apiInstance getPetByIdWith:petId
    +              completionHandler: ^(Pet output, NSError* error) {
    +                            if (output) {
    +                                NSLog(@"%@", output);
    +                            }
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var OpenApiPetstore = require('open_api_petstore');
    +var defaultClient = OpenApiPetstore.ApiClient.instance;
    +
    +// Configure API key authorization: api_key
    +var api_key = defaultClient.authentications['api_key'];
    +api_key.apiKey = "YOUR API KEY"
    +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    +//api_key.apiKeyPrefix['api_key'] = "Token"
    +
    +var api = new OpenApiPetstore.PetApi()
    +var petId = 789; // {Long} ID of pet to return
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully. Returned data: ' + data);
    +  }
    +};
    +api.getPetById(petId, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using Org.OpenAPITools.Api;
    +using Org.OpenAPITools.Client;
    +using Org.OpenAPITools.Model;
    +
    +namespace Example
    +{
    +    public class getPetByIdExample
    +    {
    +        public void main()
    +        {
    +            
    +            // Configure API key authorization: api_key
    +            Configuration.Default.ApiKey.Add("api_key", "YOUR_API_KEY");
    +            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    +            // Configuration.Default.ApiKeyPrefix.Add("api_key", "Bearer");
    +
    +            var apiInstance = new PetApi();
    +            var petId = 789;  // Long | ID of pet to return (default to null)
    +
    +            try
    +            {
    +                // Find pet by ID
    +                Pet result = apiInstance.getPetById(petId);
    +                Debug.WriteLine(result);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling PetApi.getPetById: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +// Configure API key authorization: api_key
    +OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('api_key', 'YOUR_API_KEY');
    +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    +// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api_key', 'Bearer');
    +
    +$api_instance = new OpenAPITools\Client\Api\PetApi();
    +$petId = 789; // Long | ID of pet to return
    +
    +try {
    +    $result = $api_instance->getPetById($petId);
    +    print_r($result);
    +} catch (Exception $e) {
    +    echo 'Exception when calling PetApi->getPetById: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use WWW::OPenAPIClient::Configuration;
    +use WWW::OPenAPIClient::PetApi;
    +
    +# Configure API key authorization: api_key
    +$WWW::OPenAPIClient::Configuration::api_key->{'api_key'} = 'YOUR_API_KEY';
    +# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    +#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'api_key'} = "Bearer";
    +
    +my $api_instance = WWW::OPenAPIClient::PetApi->new();
    +my $petId = 789; # Long | ID of pet to return
    +
    +eval { 
    +    my $result = $api_instance->getPetById(petId => $petId);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling PetApi->getPetById: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import openapi_client
    +from openapi_client.rest import ApiException
    +from pprint import pprint
    +
    +# Configure API key authorization: api_key
    +openapi_client.configuration.api_key['api_key'] = 'YOUR_API_KEY'
    +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    +# openapi_client.configuration.api_key_prefix['api_key'] = 'Bearer'
    +
    +# create an instance of the API class
    +api_instance = openapi_client.PetApi()
    +petId = 789 # Long | ID of pet to return (default to null)
    +
    +try: 
    +    # Find pet by ID
    +    api_response = api_instance.get_pet_by_id(petId)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling PetApi->getPetById: %s\n" % e)
    +
    + +
    +
    extern crate PetApi;
    +
    +pub fn main() {
    +    let petId = 789; // Long
    +
    +    let mut context = PetApi::Context::default();
    +    let result = client.getPetById(petId, &context).wait();
    +    println!("{:?}", result);
    +
    +}
    +
    +
    +
    + +

    Scopes

    + + +
    + +

    Parameters

    + +
    Path parameters
    + + + + + + + + + +
    NameDescription
    petId* + + +
    +
    +
    + + Long + + + (int64) + + +
    +ID of pet to return +
    +
    +
    + Required +
    +
    +
    +
    + + + + + +

    Responses

    +

    +

    + + + + + + +
    +
    +
    + +
    + +
    +
    +

    +

    + + + + + + +
    +
    +

    +

    + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    +

    updatePet

    +

    Update an existing pet

    +
    +
    +
    +

    +

    +

    +
    +
    /pet
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X PUT "http://petstore.swagger.io/v2/pet"
    +
    +
    +
    import org.openapitools.client.*;
    +import org.openapitools.client.auth.*;
    +import org.openapitools.client.model.*;
    +import org.openapitools.client.api.PetApi;
    +
    +import java.io.File;
    +import java.util.*;
    +
    +public class PetApiExample {
    +
    +    public static void main(String[] args) {
    +        ApiClient defaultClient = Configuration.getDefaultApiClient();
    +        
    +        // Configure OAuth2 access token for authorization: petstore_auth
    +        OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
    +        petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
    +
    +        PetApi apiInstance = new PetApi();
    +        Pet pet = ; // Pet | 
    +        try {
    +            apiInstance.updatePet(pet);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling PetApi#updatePet");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import org.openapitools.client.api.PetApi;
    +
    +public class PetApiExample {
    +
    +    public static void main(String[] args) {
    +        PetApi apiInstance = new PetApi();
    +        Pet pet = ; // Pet | 
    +        try {
    +            apiInstance.updatePet(pet);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling PetApi#updatePet");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    Configuration *apiConfig = [Configuration sharedConfig];
    +
    +// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth)
    +[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
    +
    +Pet *pet = ; // 
    +
    +PetApi *apiInstance = [[PetApi alloc] init];
    +
    +// Update an existing pet
    +[apiInstance updatePetWith:pet
    +              completionHandler: ^(NSError* error) {
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var OpenApiPetstore = require('open_api_petstore');
    +var defaultClient = OpenApiPetstore.ApiClient.instance;
    +
    +// Configure OAuth2 access token for authorization: petstore_auth
    +var petstore_auth = defaultClient.authentications['petstore_auth'];
    +petstore_auth.accessToken = "YOUR ACCESS TOKEN"
    +
    +var api = new OpenApiPetstore.PetApi()
    +var pet = ; // {Pet} 
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully.');
    +  }
    +};
    +api.updatePet(pet, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using Org.OpenAPITools.Api;
    +using Org.OpenAPITools.Client;
    +using Org.OpenAPITools.Model;
    +
    +namespace Example
    +{
    +    public class updatePetExample
    +    {
    +        public void main()
    +        {
    +            
    +            // Configure OAuth2 access token for authorization: petstore_auth
    +            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
    +
    +            var apiInstance = new PetApi();
    +            var pet = new Pet(); // Pet | 
    +
    +            try
    +            {
    +                // Update an existing pet
    +                apiInstance.updatePet(pet);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling PetApi.updatePet: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +// Configure OAuth2 access token for authorization: petstore_auth
    +OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
    +
    +$api_instance = new OpenAPITools\Client\Api\PetApi();
    +$pet = ; // Pet | 
    +
    +try {
    +    $api_instance->updatePet($pet);
    +} catch (Exception $e) {
    +    echo 'Exception when calling PetApi->updatePet: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use WWW::OPenAPIClient::Configuration;
    +use WWW::OPenAPIClient::PetApi;
    +
    +# Configure OAuth2 access token for authorization: petstore_auth
    +$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
    +
    +my $api_instance = WWW::OPenAPIClient::PetApi->new();
    +my $pet = WWW::OPenAPIClient::Object::Pet->new(); # Pet | 
    +
    +eval { 
    +    $api_instance->updatePet(pet => $pet);
    +};
    +if ($@) {
    +    warn "Exception when calling PetApi->updatePet: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import openapi_client
    +from openapi_client.rest import ApiException
    +from pprint import pprint
    +
    +# Configure OAuth2 access token for authorization: petstore_auth
    +openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
    +
    +# create an instance of the API class
    +api_instance = openapi_client.PetApi()
    +pet =  # Pet | 
    +
    +try: 
    +    # Update an existing pet
    +    api_instance.update_pet(pet)
    +except ApiException as e:
    +    print("Exception when calling PetApi->updatePet: %s\n" % e)
    +
    + +
    +
    extern crate PetApi;
    +
    +pub fn main() {
    +    let pet = ; // Pet
    +
    +    let mut context = PetApi::Context::default();
    +    let result = client.updatePet(pet, &context).wait();
    +    println!("{:?}", result);
    +
    +}
    +
    +
    +
    + +

    Scopes

    + + + + + + + + + + + + +
    write:petsmodify pets in your account
    read:petsread your pets
    + +

    Parameters

    + + + +
    Body parameters
    + + + + + + + + + +
    NameDescription
    pet * +

    Pet object that needs to be added to the store

    + +
    +
    + + + +

    Responses

    +

    +

    + + + + + + +
    +
    +

    +

    + + + + + + +
    +
    +

    +

    + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    +

    updatePetWithForm

    +

    Updates a pet in the store with form data

    +
    +
    +
    +

    +

    +

    +
    +
    /pet/{petId}
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X POST "http://petstore.swagger.io/v2/pet/{petId}"
    +
    +
    +
    import org.openapitools.client.*;
    +import org.openapitools.client.auth.*;
    +import org.openapitools.client.model.*;
    +import org.openapitools.client.api.PetApi;
    +
    +import java.io.File;
    +import java.util.*;
    +
    +public class PetApiExample {
    +
    +    public static void main(String[] args) {
    +        ApiClient defaultClient = Configuration.getDefaultApiClient();
    +        
    +        // Configure OAuth2 access token for authorization: petstore_auth
    +        OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
    +        petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
    +
    +        PetApi apiInstance = new PetApi();
    +        Long petId = 789; // Long | ID of pet that needs to be updated
    +        String name = name_example; // String | Updated name of the pet
    +        String status = status_example; // String | Updated status of the pet
    +        try {
    +            apiInstance.updatePetWithForm(petId, name, status);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling PetApi#updatePetWithForm");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import org.openapitools.client.api.PetApi;
    +
    +public class PetApiExample {
    +
    +    public static void main(String[] args) {
    +        PetApi apiInstance = new PetApi();
    +        Long petId = 789; // Long | ID of pet that needs to be updated
    +        String name = name_example; // String | Updated name of the pet
    +        String status = status_example; // String | Updated status of the pet
    +        try {
    +            apiInstance.updatePetWithForm(petId, name, status);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling PetApi#updatePetWithForm");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    Configuration *apiConfig = [Configuration sharedConfig];
    +
    +// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth)
    +[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
    +
    +Long *petId = 789; // ID of pet that needs to be updated (default to null)
    +String *name = name_example; // Updated name of the pet (optional) (default to null)
    +String *status = status_example; // Updated status of the pet (optional) (default to null)
    +
    +PetApi *apiInstance = [[PetApi alloc] init];
    +
    +// Updates a pet in the store with form data
    +[apiInstance updatePetWithFormWith:petId
    +    name:name
    +    status:status
    +              completionHandler: ^(NSError* error) {
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var OpenApiPetstore = require('open_api_petstore');
    +var defaultClient = OpenApiPetstore.ApiClient.instance;
    +
    +// Configure OAuth2 access token for authorization: petstore_auth
    +var petstore_auth = defaultClient.authentications['petstore_auth'];
    +petstore_auth.accessToken = "YOUR ACCESS TOKEN"
    +
    +var api = new OpenApiPetstore.PetApi()
    +var petId = 789; // {Long} ID of pet that needs to be updated
    +var opts = {
    +  'name': name_example, // {String} Updated name of the pet
    +  'status': status_example // {String} Updated status of the pet
    +};
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully.');
    +  }
    +};
    +api.updatePetWithForm(petId, opts, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using Org.OpenAPITools.Api;
    +using Org.OpenAPITools.Client;
    +using Org.OpenAPITools.Model;
    +
    +namespace Example
    +{
    +    public class updatePetWithFormExample
    +    {
    +        public void main()
    +        {
    +            
    +            // Configure OAuth2 access token for authorization: petstore_auth
    +            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
    +
    +            var apiInstance = new PetApi();
    +            var petId = 789;  // Long | ID of pet that needs to be updated (default to null)
    +            var name = name_example;  // String | Updated name of the pet (optional)  (default to null)
    +            var status = status_example;  // String | Updated status of the pet (optional)  (default to null)
    +
    +            try
    +            {
    +                // Updates a pet in the store with form data
    +                apiInstance.updatePetWithForm(petId, name, status);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling PetApi.updatePetWithForm: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +// Configure OAuth2 access token for authorization: petstore_auth
    +OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
    +
    +$api_instance = new OpenAPITools\Client\Api\PetApi();
    +$petId = 789; // Long | ID of pet that needs to be updated
    +$name = name_example; // String | Updated name of the pet
    +$status = status_example; // String | Updated status of the pet
    +
    +try {
    +    $api_instance->updatePetWithForm($petId, $name, $status);
    +} catch (Exception $e) {
    +    echo 'Exception when calling PetApi->updatePetWithForm: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use WWW::OPenAPIClient::Configuration;
    +use WWW::OPenAPIClient::PetApi;
    +
    +# Configure OAuth2 access token for authorization: petstore_auth
    +$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
    +
    +my $api_instance = WWW::OPenAPIClient::PetApi->new();
    +my $petId = 789; # Long | ID of pet that needs to be updated
    +my $name = name_example; # String | Updated name of the pet
    +my $status = status_example; # String | Updated status of the pet
    +
    +eval { 
    +    $api_instance->updatePetWithForm(petId => $petId, name => $name, status => $status);
    +};
    +if ($@) {
    +    warn "Exception when calling PetApi->updatePetWithForm: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import openapi_client
    +from openapi_client.rest import ApiException
    +from pprint import pprint
    +
    +# Configure OAuth2 access token for authorization: petstore_auth
    +openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
    +
    +# create an instance of the API class
    +api_instance = openapi_client.PetApi()
    +petId = 789 # Long | ID of pet that needs to be updated (default to null)
    +name = name_example # String | Updated name of the pet (optional) (default to null)
    +status = status_example # String | Updated status of the pet (optional) (default to null)
    +
    +try: 
    +    # Updates a pet in the store with form data
    +    api_instance.update_pet_with_form(petId, name=name, status=status)
    +except ApiException as e:
    +    print("Exception when calling PetApi->updatePetWithForm: %s\n" % e)
    +
    + +
    +
    extern crate PetApi;
    +
    +pub fn main() {
    +    let petId = 789; // Long
    +    let name = name_example; // String
    +    let status = status_example; // String
    +
    +    let mut context = PetApi::Context::default();
    +    let result = client.updatePetWithForm(petId, name, status, &context).wait();
    +    println!("{:?}", result);
    +
    +}
    +
    +
    +
    + +

    Scopes

    + + + + + + + + + + + + +
    write:petsmodify pets in your account
    read:petsread your pets
    + +

    Parameters

    + +
    Path parameters
    + + + + + + + + + +
    NameDescription
    petId* + + +
    +
    +
    + + Long + + + (int64) + + +
    +ID of pet that needs to be updated +
    +
    +
    + Required +
    +
    +
    +
    + + + +
    Form parameters
    + + + + + + + + + + + + + +
    NameDescription
    name + + +
    +
    +
    + + String + + +
    +Updated name of the pet +
    +
    +
    +
    +
    status + + +
    +
    +
    + + String + + +
    +Updated status of the pet +
    +
    +
    +
    +
    + + +

    Responses

    +

    +

    + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    +

    uploadFile

    +

    uploads an image

    +
    +
    +
    +

    +

    +

    +
    +
    /pet/{petId}/uploadImage
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X POST "http://petstore.swagger.io/v2/pet/{petId}/uploadImage"
    +
    +
    +
    import org.openapitools.client.*;
    +import org.openapitools.client.auth.*;
    +import org.openapitools.client.model.*;
    +import org.openapitools.client.api.PetApi;
    +
    +import java.io.File;
    +import java.util.*;
    +
    +public class PetApiExample {
    +
    +    public static void main(String[] args) {
    +        ApiClient defaultClient = Configuration.getDefaultApiClient();
    +        
    +        // Configure OAuth2 access token for authorization: petstore_auth
    +        OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
    +        petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
    +
    +        PetApi apiInstance = new PetApi();
    +        Long petId = 789; // Long | ID of pet to update
    +        String additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server
    +        File file = BINARY_DATA_HERE; // File | file to upload
    +        try {
    +            ApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling PetApi#uploadFile");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import org.openapitools.client.api.PetApi;
    +
    +public class PetApiExample {
    +
    +    public static void main(String[] args) {
    +        PetApi apiInstance = new PetApi();
    +        Long petId = 789; // Long | ID of pet to update
    +        String additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server
    +        File file = BINARY_DATA_HERE; // File | file to upload
    +        try {
    +            ApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling PetApi#uploadFile");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    Configuration *apiConfig = [Configuration sharedConfig];
    +
    +// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth)
    +[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
    +
    +Long *petId = 789; // ID of pet to update (default to null)
    +String *additionalMetadata = additionalMetadata_example; // Additional data to pass to server (optional) (default to null)
    +File *file = BINARY_DATA_HERE; // file to upload (optional) (default to null)
    +
    +PetApi *apiInstance = [[PetApi alloc] init];
    +
    +// uploads an image
    +[apiInstance uploadFileWith:petId
    +    additionalMetadata:additionalMetadata
    +    file:file
    +              completionHandler: ^(ApiResponse output, NSError* error) {
    +                            if (output) {
    +                                NSLog(@"%@", output);
    +                            }
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var OpenApiPetstore = require('open_api_petstore');
    +var defaultClient = OpenApiPetstore.ApiClient.instance;
    +
    +// Configure OAuth2 access token for authorization: petstore_auth
    +var petstore_auth = defaultClient.authentications['petstore_auth'];
    +petstore_auth.accessToken = "YOUR ACCESS TOKEN"
    +
    +var api = new OpenApiPetstore.PetApi()
    +var petId = 789; // {Long} ID of pet to update
    +var opts = {
    +  'additionalMetadata': additionalMetadata_example, // {String} Additional data to pass to server
    +  'file': BINARY_DATA_HERE // {File} file to upload
    +};
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully. Returned data: ' + data);
    +  }
    +};
    +api.uploadFile(petId, opts, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using Org.OpenAPITools.Api;
    +using Org.OpenAPITools.Client;
    +using Org.OpenAPITools.Model;
    +
    +namespace Example
    +{
    +    public class uploadFileExample
    +    {
    +        public void main()
    +        {
    +            
    +            // Configure OAuth2 access token for authorization: petstore_auth
    +            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
    +
    +            var apiInstance = new PetApi();
    +            var petId = 789;  // Long | ID of pet to update (default to null)
    +            var additionalMetadata = additionalMetadata_example;  // String | Additional data to pass to server (optional)  (default to null)
    +            var file = BINARY_DATA_HERE;  // File | file to upload (optional)  (default to null)
    +
    +            try
    +            {
    +                // uploads an image
    +                ApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file);
    +                Debug.WriteLine(result);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling PetApi.uploadFile: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +// Configure OAuth2 access token for authorization: petstore_auth
    +OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
    +
    +$api_instance = new OpenAPITools\Client\Api\PetApi();
    +$petId = 789; // Long | ID of pet to update
    +$additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server
    +$file = BINARY_DATA_HERE; // File | file to upload
    +
    +try {
    +    $result = $api_instance->uploadFile($petId, $additionalMetadata, $file);
    +    print_r($result);
    +} catch (Exception $e) {
    +    echo 'Exception when calling PetApi->uploadFile: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use WWW::OPenAPIClient::Configuration;
    +use WWW::OPenAPIClient::PetApi;
    +
    +# Configure OAuth2 access token for authorization: petstore_auth
    +$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
    +
    +my $api_instance = WWW::OPenAPIClient::PetApi->new();
    +my $petId = 789; # Long | ID of pet to update
    +my $additionalMetadata = additionalMetadata_example; # String | Additional data to pass to server
    +my $file = BINARY_DATA_HERE; # File | file to upload
    +
    +eval { 
    +    my $result = $api_instance->uploadFile(petId => $petId, additionalMetadata => $additionalMetadata, file => $file);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling PetApi->uploadFile: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import openapi_client
    +from openapi_client.rest import ApiException
    +from pprint import pprint
    +
    +# Configure OAuth2 access token for authorization: petstore_auth
    +openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
    +
    +# create an instance of the API class
    +api_instance = openapi_client.PetApi()
    +petId = 789 # Long | ID of pet to update (default to null)
    +additionalMetadata = additionalMetadata_example # String | Additional data to pass to server (optional) (default to null)
    +file = BINARY_DATA_HERE # File | file to upload (optional) (default to null)
    +
    +try: 
    +    # uploads an image
    +    api_response = api_instance.upload_file(petId, additionalMetadata=additionalMetadata, file=file)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling PetApi->uploadFile: %s\n" % e)
    +
    + +
    +
    extern crate PetApi;
    +
    +pub fn main() {
    +    let petId = 789; // Long
    +    let additionalMetadata = additionalMetadata_example; // String
    +    let file = BINARY_DATA_HERE; // File
    +
    +    let mut context = PetApi::Context::default();
    +    let result = client.uploadFile(petId, additionalMetadata, file, &context).wait();
    +    println!("{:?}", result);
    +
    +}
    +
    +
    +
    + +

    Scopes

    + + + + + + + + + + + + +
    write:petsmodify pets in your account
    read:petsread your pets
    + +

    Parameters

    + +
    Path parameters
    + + + + + + + + + +
    NameDescription
    petId* + + +
    +
    +
    + + Long + + + (int64) + + +
    +ID of pet to update +
    +
    +
    + Required +
    +
    +
    +
    + + + +
    Form parameters
    + + + + + + + + + + + + + +
    NameDescription
    additionalMetadata + + +
    +
    +
    + + String + + +
    +Additional data to pass to server +
    +
    +
    +
    +
    file + + +
    +
    +
    + + File + + + (binary) + + +
    +file to upload +
    +
    +
    +
    +
    + + +

    Responses

    +

    +

    + + + + + + +
    +
    +
    + +
    + +
    +
    +
    +
    +
    + +
    +

    Store

    +
    +
    +
    +

    deleteOrder

    +

    Delete purchase order by ID

    +
    +
    +
    +

    +

    For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors

    +

    +
    +
    /store/order/{orderId}
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X DELETE "http://petstore.swagger.io/v2/store/order/{orderId}"
    +
    +
    +
    import org.openapitools.client.*;
    +import org.openapitools.client.auth.*;
    +import org.openapitools.client.model.*;
    +import org.openapitools.client.api.StoreApi;
    +
    +import java.io.File;
    +import java.util.*;
    +
    +public class StoreApiExample {
    +
    +    public static void main(String[] args) {
    +        
    +        StoreApi apiInstance = new StoreApi();
    +        String orderId = orderId_example; // String | ID of the order that needs to be deleted
    +        try {
    +            apiInstance.deleteOrder(orderId);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling StoreApi#deleteOrder");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import org.openapitools.client.api.StoreApi;
    +
    +public class StoreApiExample {
    +
    +    public static void main(String[] args) {
    +        StoreApi apiInstance = new StoreApi();
    +        String orderId = orderId_example; // String | ID of the order that needs to be deleted
    +        try {
    +            apiInstance.deleteOrder(orderId);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling StoreApi#deleteOrder");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    String *orderId = orderId_example; // ID of the order that needs to be deleted (default to null)
    +
    +StoreApi *apiInstance = [[StoreApi alloc] init];
    +
    +// Delete purchase order by ID
    +[apiInstance deleteOrderWith:orderId
    +              completionHandler: ^(NSError* error) {
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var OpenApiPetstore = require('open_api_petstore');
    +
    +var api = new OpenApiPetstore.StoreApi()
    +var orderId = orderId_example; // {String} ID of the order that needs to be deleted
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully.');
    +  }
    +};
    +api.deleteOrder(orderId, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using Org.OpenAPITools.Api;
    +using Org.OpenAPITools.Client;
    +using Org.OpenAPITools.Model;
    +
    +namespace Example
    +{
    +    public class deleteOrderExample
    +    {
    +        public void main()
    +        {
    +            
    +            var apiInstance = new StoreApi();
    +            var orderId = orderId_example;  // String | ID of the order that needs to be deleted (default to null)
    +
    +            try
    +            {
    +                // Delete purchase order by ID
    +                apiInstance.deleteOrder(orderId);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling StoreApi.deleteOrder: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +$api_instance = new OpenAPITools\Client\Api\StoreApi();
    +$orderId = orderId_example; // String | ID of the order that needs to be deleted
    +
    +try {
    +    $api_instance->deleteOrder($orderId);
    +} catch (Exception $e) {
    +    echo 'Exception when calling StoreApi->deleteOrder: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use WWW::OPenAPIClient::Configuration;
    +use WWW::OPenAPIClient::StoreApi;
    +
    +my $api_instance = WWW::OPenAPIClient::StoreApi->new();
    +my $orderId = orderId_example; # String | ID of the order that needs to be deleted
    +
    +eval { 
    +    $api_instance->deleteOrder(orderId => $orderId);
    +};
    +if ($@) {
    +    warn "Exception when calling StoreApi->deleteOrder: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import openapi_client
    +from openapi_client.rest import ApiException
    +from pprint import pprint
    +
    +# create an instance of the API class
    +api_instance = openapi_client.StoreApi()
    +orderId = orderId_example # String | ID of the order that needs to be deleted (default to null)
    +
    +try: 
    +    # Delete purchase order by ID
    +    api_instance.delete_order(orderId)
    +except ApiException as e:
    +    print("Exception when calling StoreApi->deleteOrder: %s\n" % e)
    +
    + +
    +
    extern crate StoreApi;
    +
    +pub fn main() {
    +    let orderId = orderId_example; // String
    +
    +    let mut context = StoreApi::Context::default();
    +    let result = client.deleteOrder(orderId, &context).wait();
    +    println!("{:?}", result);
    +
    +}
    +
    +
    +
    + +

    Scopes

    + + +
    + +

    Parameters

    + +
    Path parameters
    + + + + + + + + + +
    NameDescription
    orderId* + + +
    +
    +
    + + String + + +
    +ID of the order that needs to be deleted +
    +
    +
    + Required +
    +
    +
    +
    + + + + + +

    Responses

    +

    +

    + + + + + + +
    +
    +

    +

    + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    +

    getInventory

    +

    Returns pet inventories by status

    +
    +
    +
    +

    +

    Returns a map of status codes to quantities

    +

    +
    +
    /store/inventory
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X GET -H "api_key: [[apiKey]]" "http://petstore.swagger.io/v2/store/inventory"
    +
    +
    +
    import org.openapitools.client.*;
    +import org.openapitools.client.auth.*;
    +import org.openapitools.client.model.*;
    +import org.openapitools.client.api.StoreApi;
    +
    +import java.io.File;
    +import java.util.*;
    +
    +public class StoreApiExample {
    +
    +    public static void main(String[] args) {
    +        ApiClient defaultClient = Configuration.getDefaultApiClient();
    +        
    +        // Configure API key authorization: api_key
    +        ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
    +        api_key.setApiKey("YOUR API KEY");
    +        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    +        //api_key.setApiKeyPrefix("Token");
    +
    +        StoreApi apiInstance = new StoreApi();
    +        try {
    +            map['String', 'Integer'] result = apiInstance.getInventory();
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling StoreApi#getInventory");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import org.openapitools.client.api.StoreApi;
    +
    +public class StoreApiExample {
    +
    +    public static void main(String[] args) {
    +        StoreApi apiInstance = new StoreApi();
    +        try {
    +            map['String', 'Integer'] result = apiInstance.getInventory();
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling StoreApi#getInventory");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    Configuration *apiConfig = [Configuration sharedConfig];
    +
    +// Configure API key authorization: (authentication scheme: api_key)
    +[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"api_key"];
    +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    +//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"api_key"];
    +
    +
    +StoreApi *apiInstance = [[StoreApi alloc] init];
    +
    +// Returns pet inventories by status
    +[apiInstance getInventoryWithCompletionHandler: 
    +              ^(map['String', 'Integer'] output, NSError* error) {
    +                            if (output) {
    +                                NSLog(@"%@", output);
    +                            }
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var OpenApiPetstore = require('open_api_petstore');
    +var defaultClient = OpenApiPetstore.ApiClient.instance;
    +
    +// Configure API key authorization: api_key
    +var api_key = defaultClient.authentications['api_key'];
    +api_key.apiKey = "YOUR API KEY"
    +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    +//api_key.apiKeyPrefix['api_key'] = "Token"
    +
    +var api = new OpenApiPetstore.StoreApi()
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully. Returned data: ' + data);
    +  }
    +};
    +api.getInventory(callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using Org.OpenAPITools.Api;
    +using Org.OpenAPITools.Client;
    +using Org.OpenAPITools.Model;
    +
    +namespace Example
    +{
    +    public class getInventoryExample
    +    {
    +        public void main()
    +        {
    +            
    +            // Configure API key authorization: api_key
    +            Configuration.Default.ApiKey.Add("api_key", "YOUR_API_KEY");
    +            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    +            // Configuration.Default.ApiKeyPrefix.Add("api_key", "Bearer");
    +
    +            var apiInstance = new StoreApi();
    +
    +            try
    +            {
    +                // Returns pet inventories by status
    +                map['String', 'Integer'] result = apiInstance.getInventory();
    +                Debug.WriteLine(result);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling StoreApi.getInventory: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +// Configure API key authorization: api_key
    +OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('api_key', 'YOUR_API_KEY');
    +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    +// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api_key', 'Bearer');
    +
    +$api_instance = new OpenAPITools\Client\Api\StoreApi();
    +
    +try {
    +    $result = $api_instance->getInventory();
    +    print_r($result);
    +} catch (Exception $e) {
    +    echo 'Exception when calling StoreApi->getInventory: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use WWW::OPenAPIClient::Configuration;
    +use WWW::OPenAPIClient::StoreApi;
    +
    +# Configure API key authorization: api_key
    +$WWW::OPenAPIClient::Configuration::api_key->{'api_key'} = 'YOUR_API_KEY';
    +# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    +#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'api_key'} = "Bearer";
    +
    +my $api_instance = WWW::OPenAPIClient::StoreApi->new();
    +
    +eval { 
    +    my $result = $api_instance->getInventory();
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling StoreApi->getInventory: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import openapi_client
    +from openapi_client.rest import ApiException
    +from pprint import pprint
    +
    +# Configure API key authorization: api_key
    +openapi_client.configuration.api_key['api_key'] = 'YOUR_API_KEY'
    +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    +# openapi_client.configuration.api_key_prefix['api_key'] = 'Bearer'
    +
    +# create an instance of the API class
    +api_instance = openapi_client.StoreApi()
    +
    +try: 
    +    # Returns pet inventories by status
    +    api_response = api_instance.get_inventory()
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling StoreApi->getInventory: %s\n" % e)
    +
    + +
    +
    extern crate StoreApi;
    +
    +pub fn main() {
    +
    +    let mut context = StoreApi::Context::default();
    +    let result = client.getInventory(&context).wait();
    +    println!("{:?}", result);
    +
    +}
    +
    +
    +
    + +

    Scopes

    + + +
    + +

    Parameters

    + + + + + + +

    Responses

    +

    +

    + + + + + + +
    +
    +
    + +
    + +
    +
    +
    +
    +
    +
    +
    +
    +

    getOrderById

    +

    Find purchase order by ID

    +
    +
    +
    +

    +

    For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions

    +

    +
    +
    /store/order/{orderId}
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X GET "http://petstore.swagger.io/v2/store/order/{orderId}"
    +
    +
    +
    import org.openapitools.client.*;
    +import org.openapitools.client.auth.*;
    +import org.openapitools.client.model.*;
    +import org.openapitools.client.api.StoreApi;
    +
    +import java.io.File;
    +import java.util.*;
    +
    +public class StoreApiExample {
    +
    +    public static void main(String[] args) {
    +        
    +        StoreApi apiInstance = new StoreApi();
    +        Long orderId = 789; // Long | ID of pet that needs to be fetched
    +        try {
    +            Order result = apiInstance.getOrderById(orderId);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling StoreApi#getOrderById");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import org.openapitools.client.api.StoreApi;
    +
    +public class StoreApiExample {
    +
    +    public static void main(String[] args) {
    +        StoreApi apiInstance = new StoreApi();
    +        Long orderId = 789; // Long | ID of pet that needs to be fetched
    +        try {
    +            Order result = apiInstance.getOrderById(orderId);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling StoreApi#getOrderById");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    Long *orderId = 789; // ID of pet that needs to be fetched (default to null)
    +
    +StoreApi *apiInstance = [[StoreApi alloc] init];
    +
    +// Find purchase order by ID
    +[apiInstance getOrderByIdWith:orderId
    +              completionHandler: ^(Order output, NSError* error) {
    +                            if (output) {
    +                                NSLog(@"%@", output);
    +                            }
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var OpenApiPetstore = require('open_api_petstore');
    +
    +var api = new OpenApiPetstore.StoreApi()
    +var orderId = 789; // {Long} ID of pet that needs to be fetched
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully. Returned data: ' + data);
    +  }
    +};
    +api.getOrderById(orderId, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using Org.OpenAPITools.Api;
    +using Org.OpenAPITools.Client;
    +using Org.OpenAPITools.Model;
    +
    +namespace Example
    +{
    +    public class getOrderByIdExample
    +    {
    +        public void main()
    +        {
    +            
    +            var apiInstance = new StoreApi();
    +            var orderId = 789;  // Long | ID of pet that needs to be fetched (default to null)
    +
    +            try
    +            {
    +                // Find purchase order by ID
    +                Order result = apiInstance.getOrderById(orderId);
    +                Debug.WriteLine(result);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling StoreApi.getOrderById: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +$api_instance = new OpenAPITools\Client\Api\StoreApi();
    +$orderId = 789; // Long | ID of pet that needs to be fetched
    +
    +try {
    +    $result = $api_instance->getOrderById($orderId);
    +    print_r($result);
    +} catch (Exception $e) {
    +    echo 'Exception when calling StoreApi->getOrderById: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use WWW::OPenAPIClient::Configuration;
    +use WWW::OPenAPIClient::StoreApi;
    +
    +my $api_instance = WWW::OPenAPIClient::StoreApi->new();
    +my $orderId = 789; # Long | ID of pet that needs to be fetched
    +
    +eval { 
    +    my $result = $api_instance->getOrderById(orderId => $orderId);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling StoreApi->getOrderById: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import openapi_client
    +from openapi_client.rest import ApiException
    +from pprint import pprint
    +
    +# create an instance of the API class
    +api_instance = openapi_client.StoreApi()
    +orderId = 789 # Long | ID of pet that needs to be fetched (default to null)
    +
    +try: 
    +    # Find purchase order by ID
    +    api_response = api_instance.get_order_by_id(orderId)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling StoreApi->getOrderById: %s\n" % e)
    +
    + +
    +
    extern crate StoreApi;
    +
    +pub fn main() {
    +    let orderId = 789; // Long
    +
    +    let mut context = StoreApi::Context::default();
    +    let result = client.getOrderById(orderId, &context).wait();
    +    println!("{:?}", result);
    +
    +}
    +
    +
    +
    + +

    Scopes

    + + +
    + +

    Parameters

    + +
    Path parameters
    + + + + + + + + + +
    NameDescription
    orderId* + + +
    +
    +
    + + Long + + + (int64) + + +
    +ID of pet that needs to be fetched +
    +
    +
    + Required +
    +
    +
    +
    + + + + + +

    Responses

    +

    +

    + + + + + + +
    +
    +
    + +
    + +
    +
    +

    +

    + + + + + + +
    +
    +

    +

    + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    +

    placeOrder

    +

    Place an order for a pet

    +
    +
    +
    +

    +

    +

    +
    +
    /store/order
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X POST "http://petstore.swagger.io/v2/store/order"
    +
    +
    +
    import org.openapitools.client.*;
    +import org.openapitools.client.auth.*;
    +import org.openapitools.client.model.*;
    +import org.openapitools.client.api.StoreApi;
    +
    +import java.io.File;
    +import java.util.*;
    +
    +public class StoreApiExample {
    +
    +    public static void main(String[] args) {
    +        
    +        StoreApi apiInstance = new StoreApi();
    +        Order order = ; // Order | 
    +        try {
    +            Order result = apiInstance.placeOrder(order);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling StoreApi#placeOrder");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import org.openapitools.client.api.StoreApi;
    +
    +public class StoreApiExample {
    +
    +    public static void main(String[] args) {
    +        StoreApi apiInstance = new StoreApi();
    +        Order order = ; // Order | 
    +        try {
    +            Order result = apiInstance.placeOrder(order);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling StoreApi#placeOrder");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    Order *order = ; // 
    +
    +StoreApi *apiInstance = [[StoreApi alloc] init];
    +
    +// Place an order for a pet
    +[apiInstance placeOrderWith:order
    +              completionHandler: ^(Order output, NSError* error) {
    +                            if (output) {
    +                                NSLog(@"%@", output);
    +                            }
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var OpenApiPetstore = require('open_api_petstore');
    +
    +var api = new OpenApiPetstore.StoreApi()
    +var order = ; // {Order} 
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully. Returned data: ' + data);
    +  }
    +};
    +api.placeOrder(order, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using Org.OpenAPITools.Api;
    +using Org.OpenAPITools.Client;
    +using Org.OpenAPITools.Model;
    +
    +namespace Example
    +{
    +    public class placeOrderExample
    +    {
    +        public void main()
    +        {
    +            
    +            var apiInstance = new StoreApi();
    +            var order = new Order(); // Order | 
    +
    +            try
    +            {
    +                // Place an order for a pet
    +                Order result = apiInstance.placeOrder(order);
    +                Debug.WriteLine(result);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling StoreApi.placeOrder: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +$api_instance = new OpenAPITools\Client\Api\StoreApi();
    +$order = ; // Order | 
    +
    +try {
    +    $result = $api_instance->placeOrder($order);
    +    print_r($result);
    +} catch (Exception $e) {
    +    echo 'Exception when calling StoreApi->placeOrder: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use WWW::OPenAPIClient::Configuration;
    +use WWW::OPenAPIClient::StoreApi;
    +
    +my $api_instance = WWW::OPenAPIClient::StoreApi->new();
    +my $order = WWW::OPenAPIClient::Object::Order->new(); # Order | 
    +
    +eval { 
    +    my $result = $api_instance->placeOrder(order => $order);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling StoreApi->placeOrder: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import openapi_client
    +from openapi_client.rest import ApiException
    +from pprint import pprint
    +
    +# create an instance of the API class
    +api_instance = openapi_client.StoreApi()
    +order =  # Order | 
    +
    +try: 
    +    # Place an order for a pet
    +    api_response = api_instance.place_order(order)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling StoreApi->placeOrder: %s\n" % e)
    +
    + +
    +
    extern crate StoreApi;
    +
    +pub fn main() {
    +    let order = ; // Order
    +
    +    let mut context = StoreApi::Context::default();
    +    let result = client.placeOrder(order, &context).wait();
    +    println!("{:?}", result);
    +
    +}
    +
    +
    +
    + +

    Scopes

    + + +
    + +

    Parameters

    + + + +
    Body parameters
    + + + + + + + + + +
    NameDescription
    order * +

    order placed for purchasing the pet

    + +
    +
    + + + +

    Responses

    +

    +

    + + + + + + +
    +
    +
    + +
    + +
    +
    +

    +

    + + + + + + +
    +
    +
    +
    +
    +
    +
    +

    User

    +
    +
    +
    +

    createUser

    +

    Create user

    +
    +
    +
    +

    +

    This can only be done by the logged in user.

    +

    +
    +
    /user
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X POST "http://petstore.swagger.io/v2/user"
    +
    +
    +
    import org.openapitools.client.*;
    +import org.openapitools.client.auth.*;
    +import org.openapitools.client.model.*;
    +import org.openapitools.client.api.UserApi;
    +
    +import java.io.File;
    +import java.util.*;
    +
    +public class UserApiExample {
    +
    +    public static void main(String[] args) {
    +        ApiClient defaultClient = Configuration.getDefaultApiClient();
    +        
    +        // Configure API key authorization: auth_cookie
    +        ApiKeyAuth auth_cookie = (ApiKeyAuth) defaultClient.getAuthentication("auth_cookie");
    +        auth_cookie.setApiKey("YOUR API KEY");
    +        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    +        //auth_cookie.setApiKeyPrefix("Token");
    +
    +        UserApi apiInstance = new UserApi();
    +        User user = ; // User | 
    +        try {
    +            apiInstance.createUser(user);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling UserApi#createUser");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import org.openapitools.client.api.UserApi;
    +
    +public class UserApiExample {
    +
    +    public static void main(String[] args) {
    +        UserApi apiInstance = new UserApi();
    +        User user = ; // User | 
    +        try {
    +            apiInstance.createUser(user);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling UserApi#createUser");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    Configuration *apiConfig = [Configuration sharedConfig];
    +
    +// Configure API key authorization: (authentication scheme: auth_cookie)
    +[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"AUTH_KEY"];
    +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    +//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"AUTH_KEY"];
    +
    +User *user = ; // 
    +
    +UserApi *apiInstance = [[UserApi alloc] init];
    +
    +// Create user
    +[apiInstance createUserWith:user
    +              completionHandler: ^(NSError* error) {
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var OpenApiPetstore = require('open_api_petstore');
    +var defaultClient = OpenApiPetstore.ApiClient.instance;
    +
    +// Configure API key authorization: auth_cookie
    +var auth_cookie = defaultClient.authentications['auth_cookie'];
    +auth_cookie.apiKey = "YOUR API KEY"
    +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    +//auth_cookie.apiKeyPrefix['AUTH_KEY'] = "Token"
    +
    +var api = new OpenApiPetstore.UserApi()
    +var user = ; // {User} 
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully.');
    +  }
    +};
    +api.createUser(user, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using Org.OpenAPITools.Api;
    +using Org.OpenAPITools.Client;
    +using Org.OpenAPITools.Model;
    +
    +namespace Example
    +{
    +    public class createUserExample
    +    {
    +        public void main()
    +        {
    +            
    +            // Configure API key authorization: auth_cookie
    +            Configuration.Default.ApiKey.Add("AUTH_KEY", "YOUR_API_KEY");
    +            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    +            // Configuration.Default.ApiKeyPrefix.Add("AUTH_KEY", "Bearer");
    +
    +            var apiInstance = new UserApi();
    +            var user = new User(); // User | 
    +
    +            try
    +            {
    +                // Create user
    +                apiInstance.createUser(user);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling UserApi.createUser: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +// Configure API key authorization: auth_cookie
    +OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('AUTH_KEY', 'YOUR_API_KEY');
    +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    +// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('AUTH_KEY', 'Bearer');
    +
    +$api_instance = new OpenAPITools\Client\Api\UserApi();
    +$user = ; // User | 
    +
    +try {
    +    $api_instance->createUser($user);
    +} catch (Exception $e) {
    +    echo 'Exception when calling UserApi->createUser: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use WWW::OPenAPIClient::Configuration;
    +use WWW::OPenAPIClient::UserApi;
    +
    +# Configure API key authorization: auth_cookie
    +$WWW::OPenAPIClient::Configuration::api_key->{'AUTH_KEY'} = 'YOUR_API_KEY';
    +# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    +#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'AUTH_KEY'} = "Bearer";
    +
    +my $api_instance = WWW::OPenAPIClient::UserApi->new();
    +my $user = WWW::OPenAPIClient::Object::User->new(); # User | 
    +
    +eval { 
    +    $api_instance->createUser(user => $user);
    +};
    +if ($@) {
    +    warn "Exception when calling UserApi->createUser: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import openapi_client
    +from openapi_client.rest import ApiException
    +from pprint import pprint
    +
    +# Configure API key authorization: auth_cookie
    +openapi_client.configuration.api_key['AUTH_KEY'] = 'YOUR_API_KEY'
    +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    +# openapi_client.configuration.api_key_prefix['AUTH_KEY'] = 'Bearer'
    +
    +# create an instance of the API class
    +api_instance = openapi_client.UserApi()
    +user =  # User | 
    +
    +try: 
    +    # Create user
    +    api_instance.create_user(user)
    +except ApiException as e:
    +    print("Exception when calling UserApi->createUser: %s\n" % e)
    +
    + +
    +
    extern crate UserApi;
    +
    +pub fn main() {
    +    let user = ; // User
    +
    +    let mut context = UserApi::Context::default();
    +    let result = client.createUser(user, &context).wait();
    +    println!("{:?}", result);
    +
    +}
    +
    +
    +
    + +

    Scopes

    + + +
    + +

    Parameters

    + + + +
    Body parameters
    + + + + + + + + + +
    NameDescription
    user * +

    Created user object

    + +
    +
    + + + +

    Responses

    +

    +

    + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    +

    createUsersWithArrayInput

    +

    Creates list of users with given input array

    +
    +
    +
    +

    +

    +

    +
    +
    /user/createWithArray
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X POST "http://petstore.swagger.io/v2/user/createWithArray"
    +
    +
    +
    import org.openapitools.client.*;
    +import org.openapitools.client.auth.*;
    +import org.openapitools.client.model.*;
    +import org.openapitools.client.api.UserApi;
    +
    +import java.io.File;
    +import java.util.*;
    +
    +public class UserApiExample {
    +
    +    public static void main(String[] args) {
    +        ApiClient defaultClient = Configuration.getDefaultApiClient();
    +        
    +        // Configure API key authorization: auth_cookie
    +        ApiKeyAuth auth_cookie = (ApiKeyAuth) defaultClient.getAuthentication("auth_cookie");
    +        auth_cookie.setApiKey("YOUR API KEY");
    +        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    +        //auth_cookie.setApiKeyPrefix("Token");
    +
    +        UserApi apiInstance = new UserApi();
    +        array[User] user = ; // array[User] | 
    +        try {
    +            apiInstance.createUsersWithArrayInput(user);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling UserApi#createUsersWithArrayInput");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import org.openapitools.client.api.UserApi;
    +
    +public class UserApiExample {
    +
    +    public static void main(String[] args) {
    +        UserApi apiInstance = new UserApi();
    +        array[User] user = ; // array[User] | 
    +        try {
    +            apiInstance.createUsersWithArrayInput(user);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling UserApi#createUsersWithArrayInput");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    Configuration *apiConfig = [Configuration sharedConfig];
    +
    +// Configure API key authorization: (authentication scheme: auth_cookie)
    +[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"AUTH_KEY"];
    +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    +//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"AUTH_KEY"];
    +
    +array[User] *user = ; // 
    +
    +UserApi *apiInstance = [[UserApi alloc] init];
    +
    +// Creates list of users with given input array
    +[apiInstance createUsersWithArrayInputWith:user
    +              completionHandler: ^(NSError* error) {
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var OpenApiPetstore = require('open_api_petstore');
    +var defaultClient = OpenApiPetstore.ApiClient.instance;
    +
    +// Configure API key authorization: auth_cookie
    +var auth_cookie = defaultClient.authentications['auth_cookie'];
    +auth_cookie.apiKey = "YOUR API KEY"
    +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    +//auth_cookie.apiKeyPrefix['AUTH_KEY'] = "Token"
    +
    +var api = new OpenApiPetstore.UserApi()
    +var user = ; // {array[User]} 
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully.');
    +  }
    +};
    +api.createUsersWithArrayInput(user, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using Org.OpenAPITools.Api;
    +using Org.OpenAPITools.Client;
    +using Org.OpenAPITools.Model;
    +
    +namespace Example
    +{
    +    public class createUsersWithArrayInputExample
    +    {
    +        public void main()
    +        {
    +            
    +            // Configure API key authorization: auth_cookie
    +            Configuration.Default.ApiKey.Add("AUTH_KEY", "YOUR_API_KEY");
    +            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    +            // Configuration.Default.ApiKeyPrefix.Add("AUTH_KEY", "Bearer");
    +
    +            var apiInstance = new UserApi();
    +            var user = new array[User](); // array[User] | 
    +
    +            try
    +            {
    +                // Creates list of users with given input array
    +                apiInstance.createUsersWithArrayInput(user);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling UserApi.createUsersWithArrayInput: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +// Configure API key authorization: auth_cookie
    +OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('AUTH_KEY', 'YOUR_API_KEY');
    +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    +// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('AUTH_KEY', 'Bearer');
    +
    +$api_instance = new OpenAPITools\Client\Api\UserApi();
    +$user = ; // array[User] | 
    +
    +try {
    +    $api_instance->createUsersWithArrayInput($user);
    +} catch (Exception $e) {
    +    echo 'Exception when calling UserApi->createUsersWithArrayInput: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use WWW::OPenAPIClient::Configuration;
    +use WWW::OPenAPIClient::UserApi;
    +
    +# Configure API key authorization: auth_cookie
    +$WWW::OPenAPIClient::Configuration::api_key->{'AUTH_KEY'} = 'YOUR_API_KEY';
    +# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    +#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'AUTH_KEY'} = "Bearer";
    +
    +my $api_instance = WWW::OPenAPIClient::UserApi->new();
    +my $user = [WWW::OPenAPIClient::Object::array[User]->new()]; # array[User] | 
    +
    +eval { 
    +    $api_instance->createUsersWithArrayInput(user => $user);
    +};
    +if ($@) {
    +    warn "Exception when calling UserApi->createUsersWithArrayInput: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import openapi_client
    +from openapi_client.rest import ApiException
    +from pprint import pprint
    +
    +# Configure API key authorization: auth_cookie
    +openapi_client.configuration.api_key['AUTH_KEY'] = 'YOUR_API_KEY'
    +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    +# openapi_client.configuration.api_key_prefix['AUTH_KEY'] = 'Bearer'
    +
    +# create an instance of the API class
    +api_instance = openapi_client.UserApi()
    +user =  # array[User] | 
    +
    +try: 
    +    # Creates list of users with given input array
    +    api_instance.create_users_with_array_input(user)
    +except ApiException as e:
    +    print("Exception when calling UserApi->createUsersWithArrayInput: %s\n" % e)
    +
    + +
    +
    extern crate UserApi;
    +
    +pub fn main() {
    +    let user = ; // array[User]
    +
    +    let mut context = UserApi::Context::default();
    +    let result = client.createUsersWithArrayInput(user, &context).wait();
    +    println!("{:?}", result);
    +
    +}
    +
    +
    +
    + +

    Scopes

    + + +
    + +

    Parameters

    + + + +
    Body parameters
    + + + + + + + + + +
    NameDescription
    user * +

    List of user object

    + +
    +
    + + + +

    Responses

    +

    +

    + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    +

    createUsersWithListInput

    +

    Creates list of users with given input array

    +
    +
    +
    +

    +

    +

    +
    +
    /user/createWithList
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X POST "http://petstore.swagger.io/v2/user/createWithList"
    +
    +
    +
    import org.openapitools.client.*;
    +import org.openapitools.client.auth.*;
    +import org.openapitools.client.model.*;
    +import org.openapitools.client.api.UserApi;
    +
    +import java.io.File;
    +import java.util.*;
    +
    +public class UserApiExample {
    +
    +    public static void main(String[] args) {
    +        ApiClient defaultClient = Configuration.getDefaultApiClient();
    +        
    +        // Configure API key authorization: auth_cookie
    +        ApiKeyAuth auth_cookie = (ApiKeyAuth) defaultClient.getAuthentication("auth_cookie");
    +        auth_cookie.setApiKey("YOUR API KEY");
    +        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    +        //auth_cookie.setApiKeyPrefix("Token");
    +
    +        UserApi apiInstance = new UserApi();
    +        array[User] user = ; // array[User] | 
    +        try {
    +            apiInstance.createUsersWithListInput(user);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling UserApi#createUsersWithListInput");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import org.openapitools.client.api.UserApi;
    +
    +public class UserApiExample {
    +
    +    public static void main(String[] args) {
    +        UserApi apiInstance = new UserApi();
    +        array[User] user = ; // array[User] | 
    +        try {
    +            apiInstance.createUsersWithListInput(user);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling UserApi#createUsersWithListInput");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    Configuration *apiConfig = [Configuration sharedConfig];
    +
    +// Configure API key authorization: (authentication scheme: auth_cookie)
    +[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"AUTH_KEY"];
    +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    +//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"AUTH_KEY"];
    +
    +array[User] *user = ; // 
    +
    +UserApi *apiInstance = [[UserApi alloc] init];
    +
    +// Creates list of users with given input array
    +[apiInstance createUsersWithListInputWith:user
    +              completionHandler: ^(NSError* error) {
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var OpenApiPetstore = require('open_api_petstore');
    +var defaultClient = OpenApiPetstore.ApiClient.instance;
    +
    +// Configure API key authorization: auth_cookie
    +var auth_cookie = defaultClient.authentications['auth_cookie'];
    +auth_cookie.apiKey = "YOUR API KEY"
    +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    +//auth_cookie.apiKeyPrefix['AUTH_KEY'] = "Token"
    +
    +var api = new OpenApiPetstore.UserApi()
    +var user = ; // {array[User]} 
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully.');
    +  }
    +};
    +api.createUsersWithListInput(user, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using Org.OpenAPITools.Api;
    +using Org.OpenAPITools.Client;
    +using Org.OpenAPITools.Model;
    +
    +namespace Example
    +{
    +    public class createUsersWithListInputExample
    +    {
    +        public void main()
    +        {
    +            
    +            // Configure API key authorization: auth_cookie
    +            Configuration.Default.ApiKey.Add("AUTH_KEY", "YOUR_API_KEY");
    +            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    +            // Configuration.Default.ApiKeyPrefix.Add("AUTH_KEY", "Bearer");
    +
    +            var apiInstance = new UserApi();
    +            var user = new array[User](); // array[User] | 
    +
    +            try
    +            {
    +                // Creates list of users with given input array
    +                apiInstance.createUsersWithListInput(user);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling UserApi.createUsersWithListInput: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +// Configure API key authorization: auth_cookie
    +OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('AUTH_KEY', 'YOUR_API_KEY');
    +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    +// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('AUTH_KEY', 'Bearer');
    +
    +$api_instance = new OpenAPITools\Client\Api\UserApi();
    +$user = ; // array[User] | 
    +
    +try {
    +    $api_instance->createUsersWithListInput($user);
    +} catch (Exception $e) {
    +    echo 'Exception when calling UserApi->createUsersWithListInput: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use WWW::OPenAPIClient::Configuration;
    +use WWW::OPenAPIClient::UserApi;
    +
    +# Configure API key authorization: auth_cookie
    +$WWW::OPenAPIClient::Configuration::api_key->{'AUTH_KEY'} = 'YOUR_API_KEY';
    +# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    +#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'AUTH_KEY'} = "Bearer";
    +
    +my $api_instance = WWW::OPenAPIClient::UserApi->new();
    +my $user = [WWW::OPenAPIClient::Object::array[User]->new()]; # array[User] | 
    +
    +eval { 
    +    $api_instance->createUsersWithListInput(user => $user);
    +};
    +if ($@) {
    +    warn "Exception when calling UserApi->createUsersWithListInput: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import openapi_client
    +from openapi_client.rest import ApiException
    +from pprint import pprint
    +
    +# Configure API key authorization: auth_cookie
    +openapi_client.configuration.api_key['AUTH_KEY'] = 'YOUR_API_KEY'
    +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    +# openapi_client.configuration.api_key_prefix['AUTH_KEY'] = 'Bearer'
    +
    +# create an instance of the API class
    +api_instance = openapi_client.UserApi()
    +user =  # array[User] | 
    +
    +try: 
    +    # Creates list of users with given input array
    +    api_instance.create_users_with_list_input(user)
    +except ApiException as e:
    +    print("Exception when calling UserApi->createUsersWithListInput: %s\n" % e)
    +
    + +
    +
    extern crate UserApi;
    +
    +pub fn main() {
    +    let user = ; // array[User]
    +
    +    let mut context = UserApi::Context::default();
    +    let result = client.createUsersWithListInput(user, &context).wait();
    +    println!("{:?}", result);
    +
    +}
    +
    +
    +
    + +

    Scopes

    + + +
    + +

    Parameters

    + + + +
    Body parameters
    + + + + + + + + + +
    NameDescription
    user * +

    List of user object

    + +
    +
    + + + +

    Responses

    +

    +

    + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    +

    deleteUser

    +

    Delete user

    +
    +
    +
    +

    +

    This can only be done by the logged in user.

    +

    +
    +
    /user/{username}
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X DELETE "http://petstore.swagger.io/v2/user/{username}"
    +
    +
    +
    import org.openapitools.client.*;
    +import org.openapitools.client.auth.*;
    +import org.openapitools.client.model.*;
    +import org.openapitools.client.api.UserApi;
    +
    +import java.io.File;
    +import java.util.*;
    +
    +public class UserApiExample {
    +
    +    public static void main(String[] args) {
    +        ApiClient defaultClient = Configuration.getDefaultApiClient();
    +        
    +        // Configure API key authorization: auth_cookie
    +        ApiKeyAuth auth_cookie = (ApiKeyAuth) defaultClient.getAuthentication("auth_cookie");
    +        auth_cookie.setApiKey("YOUR API KEY");
    +        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    +        //auth_cookie.setApiKeyPrefix("Token");
    +
    +        UserApi apiInstance = new UserApi();
    +        String username = username_example; // String | The name that needs to be deleted
    +        try {
    +            apiInstance.deleteUser(username);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling UserApi#deleteUser");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import org.openapitools.client.api.UserApi;
    +
    +public class UserApiExample {
    +
    +    public static void main(String[] args) {
    +        UserApi apiInstance = new UserApi();
    +        String username = username_example; // String | The name that needs to be deleted
    +        try {
    +            apiInstance.deleteUser(username);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling UserApi#deleteUser");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    Configuration *apiConfig = [Configuration sharedConfig];
    +
    +// Configure API key authorization: (authentication scheme: auth_cookie)
    +[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"AUTH_KEY"];
    +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    +//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"AUTH_KEY"];
    +
    +String *username = username_example; // The name that needs to be deleted (default to null)
    +
    +UserApi *apiInstance = [[UserApi alloc] init];
    +
    +// Delete user
    +[apiInstance deleteUserWith:username
    +              completionHandler: ^(NSError* error) {
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var OpenApiPetstore = require('open_api_petstore');
    +var defaultClient = OpenApiPetstore.ApiClient.instance;
    +
    +// Configure API key authorization: auth_cookie
    +var auth_cookie = defaultClient.authentications['auth_cookie'];
    +auth_cookie.apiKey = "YOUR API KEY"
    +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    +//auth_cookie.apiKeyPrefix['AUTH_KEY'] = "Token"
    +
    +var api = new OpenApiPetstore.UserApi()
    +var username = username_example; // {String} The name that needs to be deleted
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully.');
    +  }
    +};
    +api.deleteUser(username, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using Org.OpenAPITools.Api;
    +using Org.OpenAPITools.Client;
    +using Org.OpenAPITools.Model;
    +
    +namespace Example
    +{
    +    public class deleteUserExample
    +    {
    +        public void main()
    +        {
    +            
    +            // Configure API key authorization: auth_cookie
    +            Configuration.Default.ApiKey.Add("AUTH_KEY", "YOUR_API_KEY");
    +            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    +            // Configuration.Default.ApiKeyPrefix.Add("AUTH_KEY", "Bearer");
    +
    +            var apiInstance = new UserApi();
    +            var username = username_example;  // String | The name that needs to be deleted (default to null)
    +
    +            try
    +            {
    +                // Delete user
    +                apiInstance.deleteUser(username);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling UserApi.deleteUser: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +// Configure API key authorization: auth_cookie
    +OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('AUTH_KEY', 'YOUR_API_KEY');
    +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    +// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('AUTH_KEY', 'Bearer');
    +
    +$api_instance = new OpenAPITools\Client\Api\UserApi();
    +$username = username_example; // String | The name that needs to be deleted
    +
    +try {
    +    $api_instance->deleteUser($username);
    +} catch (Exception $e) {
    +    echo 'Exception when calling UserApi->deleteUser: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use WWW::OPenAPIClient::Configuration;
    +use WWW::OPenAPIClient::UserApi;
    +
    +# Configure API key authorization: auth_cookie
    +$WWW::OPenAPIClient::Configuration::api_key->{'AUTH_KEY'} = 'YOUR_API_KEY';
    +# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    +#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'AUTH_KEY'} = "Bearer";
    +
    +my $api_instance = WWW::OPenAPIClient::UserApi->new();
    +my $username = username_example; # String | The name that needs to be deleted
    +
    +eval { 
    +    $api_instance->deleteUser(username => $username);
    +};
    +if ($@) {
    +    warn "Exception when calling UserApi->deleteUser: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import openapi_client
    +from openapi_client.rest import ApiException
    +from pprint import pprint
    +
    +# Configure API key authorization: auth_cookie
    +openapi_client.configuration.api_key['AUTH_KEY'] = 'YOUR_API_KEY'
    +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    +# openapi_client.configuration.api_key_prefix['AUTH_KEY'] = 'Bearer'
    +
    +# create an instance of the API class
    +api_instance = openapi_client.UserApi()
    +username = username_example # String | The name that needs to be deleted (default to null)
    +
    +try: 
    +    # Delete user
    +    api_instance.delete_user(username)
    +except ApiException as e:
    +    print("Exception when calling UserApi->deleteUser: %s\n" % e)
    +
    + +
    +
    extern crate UserApi;
    +
    +pub fn main() {
    +    let username = username_example; // String
    +
    +    let mut context = UserApi::Context::default();
    +    let result = client.deleteUser(username, &context).wait();
    +    println!("{:?}", result);
    +
    +}
    +
    +
    +
    + +

    Scopes

    + + +
    + +

    Parameters

    + +
    Path parameters
    + + + + + + + + + +
    NameDescription
    username* + + +
    +
    +
    + + String + + +
    +The name that needs to be deleted +
    +
    +
    + Required +
    +
    +
    +
    + + + + + +

    Responses

    +

    +

    + + + + + + +
    +
    +

    +

    + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    +

    getUserByName

    +

    Get user by user name

    +
    +
    +
    +

    +

    +

    +
    +
    /user/{username}
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X GET "http://petstore.swagger.io/v2/user/{username}"
    +
    +
    +
    import org.openapitools.client.*;
    +import org.openapitools.client.auth.*;
    +import org.openapitools.client.model.*;
    +import org.openapitools.client.api.UserApi;
    +
    +import java.io.File;
    +import java.util.*;
    +
    +public class UserApiExample {
    +
    +    public static void main(String[] args) {
    +        
    +        UserApi apiInstance = new UserApi();
    +        String username = username_example; // String | The name that needs to be fetched. Use user1 for testing.
    +        try {
    +            User result = apiInstance.getUserByName(username);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling UserApi#getUserByName");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import org.openapitools.client.api.UserApi;
    +
    +public class UserApiExample {
    +
    +    public static void main(String[] args) {
    +        UserApi apiInstance = new UserApi();
    +        String username = username_example; // String | The name that needs to be fetched. Use user1 for testing.
    +        try {
    +            User result = apiInstance.getUserByName(username);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling UserApi#getUserByName");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    String *username = username_example; // The name that needs to be fetched. Use user1 for testing. (default to null)
    +
    +UserApi *apiInstance = [[UserApi alloc] init];
    +
    +// Get user by user name
    +[apiInstance getUserByNameWith:username
    +              completionHandler: ^(User output, NSError* error) {
    +                            if (output) {
    +                                NSLog(@"%@", output);
    +                            }
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var OpenApiPetstore = require('open_api_petstore');
    +
    +var api = new OpenApiPetstore.UserApi()
    +var username = username_example; // {String} The name that needs to be fetched. Use user1 for testing.
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully. Returned data: ' + data);
    +  }
    +};
    +api.getUserByName(username, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using Org.OpenAPITools.Api;
    +using Org.OpenAPITools.Client;
    +using Org.OpenAPITools.Model;
    +
    +namespace Example
    +{
    +    public class getUserByNameExample
    +    {
    +        public void main()
    +        {
    +            
    +            var apiInstance = new UserApi();
    +            var username = username_example;  // String | The name that needs to be fetched. Use user1 for testing. (default to null)
    +
    +            try
    +            {
    +                // Get user by user name
    +                User result = apiInstance.getUserByName(username);
    +                Debug.WriteLine(result);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling UserApi.getUserByName: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +$api_instance = new OpenAPITools\Client\Api\UserApi();
    +$username = username_example; // String | The name that needs to be fetched. Use user1 for testing.
    +
    +try {
    +    $result = $api_instance->getUserByName($username);
    +    print_r($result);
    +} catch (Exception $e) {
    +    echo 'Exception when calling UserApi->getUserByName: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use WWW::OPenAPIClient::Configuration;
    +use WWW::OPenAPIClient::UserApi;
    +
    +my $api_instance = WWW::OPenAPIClient::UserApi->new();
    +my $username = username_example; # String | The name that needs to be fetched. Use user1 for testing.
    +
    +eval { 
    +    my $result = $api_instance->getUserByName(username => $username);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling UserApi->getUserByName: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import openapi_client
    +from openapi_client.rest import ApiException
    +from pprint import pprint
    +
    +# create an instance of the API class
    +api_instance = openapi_client.UserApi()
    +username = username_example # String | The name that needs to be fetched. Use user1 for testing. (default to null)
    +
    +try: 
    +    # Get user by user name
    +    api_response = api_instance.get_user_by_name(username)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling UserApi->getUserByName: %s\n" % e)
    +
    + +
    +
    extern crate UserApi;
    +
    +pub fn main() {
    +    let username = username_example; // String
    +
    +    let mut context = UserApi::Context::default();
    +    let result = client.getUserByName(username, &context).wait();
    +    println!("{:?}", result);
    +
    +}
    +
    +
    +
    + +

    Scopes

    + + +
    + +

    Parameters

    + +
    Path parameters
    + + + + + + + + + +
    NameDescription
    username* + + +
    +
    +
    + + String + + +
    +The name that needs to be fetched. Use user1 for testing. +
    +
    +
    + Required +
    +
    +
    +
    + + + + + +

    Responses

    +

    +

    + + + + + + +
    +
    +
    + +
    + +
    +
    +

    +

    + + + + + + +
    +
    +

    +

    + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    +

    loginUser

    +

    Logs user into the system

    +
    +
    +
    +

    +

    +

    +
    +
    /user/login
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X GET "http://petstore.swagger.io/v2/user/login?username=&password="
    +
    +
    +
    import org.openapitools.client.*;
    +import org.openapitools.client.auth.*;
    +import org.openapitools.client.model.*;
    +import org.openapitools.client.api.UserApi;
    +
    +import java.io.File;
    +import java.util.*;
    +
    +public class UserApiExample {
    +
    +    public static void main(String[] args) {
    +        
    +        UserApi apiInstance = new UserApi();
    +        String username = username_example; // String | The user name for login
    +        String password = password_example; // String | The password for login in clear text
    +        try {
    +            'String' result = apiInstance.loginUser(username, password);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling UserApi#loginUser");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import org.openapitools.client.api.UserApi;
    +
    +public class UserApiExample {
    +
    +    public static void main(String[] args) {
    +        UserApi apiInstance = new UserApi();
    +        String username = username_example; // String | The user name for login
    +        String password = password_example; // String | The password for login in clear text
    +        try {
    +            'String' result = apiInstance.loginUser(username, password);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling UserApi#loginUser");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    String *username = username_example; // The user name for login (default to null)
    +String *password = password_example; // The password for login in clear text (default to null)
    +
    +UserApi *apiInstance = [[UserApi alloc] init];
    +
    +// Logs user into the system
    +[apiInstance loginUserWith:username
    +    password:password
    +              completionHandler: ^('String' output, NSError* error) {
    +                            if (output) {
    +                                NSLog(@"%@", output);
    +                            }
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var OpenApiPetstore = require('open_api_petstore');
    +
    +var api = new OpenApiPetstore.UserApi()
    +var username = username_example; // {String} The user name for login
    +var password = password_example; // {String} The password for login in clear text
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully. Returned data: ' + data);
    +  }
    +};
    +api.loginUser(username, password, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using Org.OpenAPITools.Api;
    +using Org.OpenAPITools.Client;
    +using Org.OpenAPITools.Model;
    +
    +namespace Example
    +{
    +    public class loginUserExample
    +    {
    +        public void main()
    +        {
    +            
    +            var apiInstance = new UserApi();
    +            var username = username_example;  // String | The user name for login (default to null)
    +            var password = password_example;  // String | The password for login in clear text (default to null)
    +
    +            try
    +            {
    +                // Logs user into the system
    +                'String' result = apiInstance.loginUser(username, password);
    +                Debug.WriteLine(result);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling UserApi.loginUser: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +$api_instance = new OpenAPITools\Client\Api\UserApi();
    +$username = username_example; // String | The user name for login
    +$password = password_example; // String | The password for login in clear text
    +
    +try {
    +    $result = $api_instance->loginUser($username, $password);
    +    print_r($result);
    +} catch (Exception $e) {
    +    echo 'Exception when calling UserApi->loginUser: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use WWW::OPenAPIClient::Configuration;
    +use WWW::OPenAPIClient::UserApi;
    +
    +my $api_instance = WWW::OPenAPIClient::UserApi->new();
    +my $username = username_example; # String | The user name for login
    +my $password = password_example; # String | The password for login in clear text
    +
    +eval { 
    +    my $result = $api_instance->loginUser(username => $username, password => $password);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling UserApi->loginUser: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import openapi_client
    +from openapi_client.rest import ApiException
    +from pprint import pprint
    +
    +# create an instance of the API class
    +api_instance = openapi_client.UserApi()
    +username = username_example # String | The user name for login (default to null)
    +password = password_example # String | The password for login in clear text (default to null)
    +
    +try: 
    +    # Logs user into the system
    +    api_response = api_instance.login_user(username, password)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling UserApi->loginUser: %s\n" % e)
    +
    + +
    +
    extern crate UserApi;
    +
    +pub fn main() {
    +    let username = username_example; // String
    +    let password = password_example; // String
    +
    +    let mut context = UserApi::Context::default();
    +    let result = client.loginUser(username, password, &context).wait();
    +    println!("{:?}", result);
    +
    +}
    +
    +
    +
    + +

    Scopes

    + + +
    + +

    Parameters

    + + + + + +
    Query parameters
    + + + + + + + + + + + + + +
    NameDescription
    username* + + +
    +
    +
    + + String + + +
    +The user name for login +
    +
    +
    + Required +
    +
    +
    +
    password* + + +
    +
    +
    + + String + + +
    +The password for login in clear text +
    +
    +
    + Required +
    +
    +
    +
    + +

    Responses

    +

    +

    + + + + + + +
    +
    +
    + +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeFormatDescription
    SetMinusCookieStringCookie authentication key for use with the `auth_cookie` apiKey authentication.
    XMinusRateMinusLimitIntegerint32calls per hour allowed by the user
    XMinusExpiresMinusAfterDatedate-timedate in UTC when toekn expires
    +
    +
    +

    +

    + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    +

    logoutUser

    +

    Logs out current logged in user session

    +
    +
    +
    +

    +

    +

    +
    +
    /user/logout
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X GET "http://petstore.swagger.io/v2/user/logout"
    +
    +
    +
    import org.openapitools.client.*;
    +import org.openapitools.client.auth.*;
    +import org.openapitools.client.model.*;
    +import org.openapitools.client.api.UserApi;
    +
    +import java.io.File;
    +import java.util.*;
    +
    +public class UserApiExample {
    +
    +    public static void main(String[] args) {
    +        ApiClient defaultClient = Configuration.getDefaultApiClient();
    +        
    +        // Configure API key authorization: auth_cookie
    +        ApiKeyAuth auth_cookie = (ApiKeyAuth) defaultClient.getAuthentication("auth_cookie");
    +        auth_cookie.setApiKey("YOUR API KEY");
    +        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    +        //auth_cookie.setApiKeyPrefix("Token");
    +
    +        UserApi apiInstance = new UserApi();
    +        try {
    +            apiInstance.logoutUser();
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling UserApi#logoutUser");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import org.openapitools.client.api.UserApi;
    +
    +public class UserApiExample {
    +
    +    public static void main(String[] args) {
    +        UserApi apiInstance = new UserApi();
    +        try {
    +            apiInstance.logoutUser();
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling UserApi#logoutUser");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    Configuration *apiConfig = [Configuration sharedConfig];
    +
    +// Configure API key authorization: (authentication scheme: auth_cookie)
    +[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"AUTH_KEY"];
    +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    +//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"AUTH_KEY"];
    +
    +
    +UserApi *apiInstance = [[UserApi alloc] init];
    +
    +// Logs out current logged in user session
    +[apiInstance logoutUserWithCompletionHandler: 
    +              ^(NSError* error) {
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var OpenApiPetstore = require('open_api_petstore');
    +var defaultClient = OpenApiPetstore.ApiClient.instance;
    +
    +// Configure API key authorization: auth_cookie
    +var auth_cookie = defaultClient.authentications['auth_cookie'];
    +auth_cookie.apiKey = "YOUR API KEY"
    +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    +//auth_cookie.apiKeyPrefix['AUTH_KEY'] = "Token"
    +
    +var api = new OpenApiPetstore.UserApi()
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully.');
    +  }
    +};
    +api.logoutUser(callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using Org.OpenAPITools.Api;
    +using Org.OpenAPITools.Client;
    +using Org.OpenAPITools.Model;
    +
    +namespace Example
    +{
    +    public class logoutUserExample
    +    {
    +        public void main()
    +        {
    +            
    +            // Configure API key authorization: auth_cookie
    +            Configuration.Default.ApiKey.Add("AUTH_KEY", "YOUR_API_KEY");
    +            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    +            // Configuration.Default.ApiKeyPrefix.Add("AUTH_KEY", "Bearer");
    +
    +            var apiInstance = new UserApi();
    +
    +            try
    +            {
    +                // Logs out current logged in user session
    +                apiInstance.logoutUser();
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling UserApi.logoutUser: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +// Configure API key authorization: auth_cookie
    +OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('AUTH_KEY', 'YOUR_API_KEY');
    +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    +// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('AUTH_KEY', 'Bearer');
    +
    +$api_instance = new OpenAPITools\Client\Api\UserApi();
    +
    +try {
    +    $api_instance->logoutUser();
    +} catch (Exception $e) {
    +    echo 'Exception when calling UserApi->logoutUser: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use WWW::OPenAPIClient::Configuration;
    +use WWW::OPenAPIClient::UserApi;
    +
    +# Configure API key authorization: auth_cookie
    +$WWW::OPenAPIClient::Configuration::api_key->{'AUTH_KEY'} = 'YOUR_API_KEY';
    +# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    +#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'AUTH_KEY'} = "Bearer";
    +
    +my $api_instance = WWW::OPenAPIClient::UserApi->new();
    +
    +eval { 
    +    $api_instance->logoutUser();
    +};
    +if ($@) {
    +    warn "Exception when calling UserApi->logoutUser: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import openapi_client
    +from openapi_client.rest import ApiException
    +from pprint import pprint
    +
    +# Configure API key authorization: auth_cookie
    +openapi_client.configuration.api_key['AUTH_KEY'] = 'YOUR_API_KEY'
    +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    +# openapi_client.configuration.api_key_prefix['AUTH_KEY'] = 'Bearer'
    +
    +# create an instance of the API class
    +api_instance = openapi_client.UserApi()
    +
    +try: 
    +    # Logs out current logged in user session
    +    api_instance.logout_user()
    +except ApiException as e:
    +    print("Exception when calling UserApi->logoutUser: %s\n" % e)
    +
    + +
    +
    extern crate UserApi;
    +
    +pub fn main() {
    +
    +    let mut context = UserApi::Context::default();
    +    let result = client.logoutUser(&context).wait();
    +    println!("{:?}", result);
    +
    +}
    +
    +
    +
    + +

    Scopes

    + + +
    + +

    Parameters

    + + + + + + +

    Responses

    +

    +

    + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    +

    updateUser

    +

    Updated user

    +
    +
    +
    +

    +

    This can only be done by the logged in user.

    +

    +
    +
    /user/{username}
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X PUT "http://petstore.swagger.io/v2/user/{username}"
    +
    +
    +
    import org.openapitools.client.*;
    +import org.openapitools.client.auth.*;
    +import org.openapitools.client.model.*;
    +import org.openapitools.client.api.UserApi;
    +
    +import java.io.File;
    +import java.util.*;
    +
    +public class UserApiExample {
    +
    +    public static void main(String[] args) {
    +        ApiClient defaultClient = Configuration.getDefaultApiClient();
    +        
    +        // Configure API key authorization: auth_cookie
    +        ApiKeyAuth auth_cookie = (ApiKeyAuth) defaultClient.getAuthentication("auth_cookie");
    +        auth_cookie.setApiKey("YOUR API KEY");
    +        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    +        //auth_cookie.setApiKeyPrefix("Token");
    +
    +        UserApi apiInstance = new UserApi();
    +        String username = username_example; // String | name that need to be deleted
    +        User user = ; // User | 
    +        try {
    +            apiInstance.updateUser(username, user);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling UserApi#updateUser");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import org.openapitools.client.api.UserApi;
    +
    +public class UserApiExample {
    +
    +    public static void main(String[] args) {
    +        UserApi apiInstance = new UserApi();
    +        String username = username_example; // String | name that need to be deleted
    +        User user = ; // User | 
    +        try {
    +            apiInstance.updateUser(username, user);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling UserApi#updateUser");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    Configuration *apiConfig = [Configuration sharedConfig];
    +
    +// Configure API key authorization: (authentication scheme: auth_cookie)
    +[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"AUTH_KEY"];
    +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    +//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"AUTH_KEY"];
    +
    +String *username = username_example; // name that need to be deleted (default to null)
    +User *user = ; // 
    +
    +UserApi *apiInstance = [[UserApi alloc] init];
    +
    +// Updated user
    +[apiInstance updateUserWith:username
    +    user:user
    +              completionHandler: ^(NSError* error) {
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var OpenApiPetstore = require('open_api_petstore');
    +var defaultClient = OpenApiPetstore.ApiClient.instance;
    +
    +// Configure API key authorization: auth_cookie
    +var auth_cookie = defaultClient.authentications['auth_cookie'];
    +auth_cookie.apiKey = "YOUR API KEY"
    +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    +//auth_cookie.apiKeyPrefix['AUTH_KEY'] = "Token"
    +
    +var api = new OpenApiPetstore.UserApi()
    +var username = username_example; // {String} name that need to be deleted
    +var user = ; // {User} 
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully.');
    +  }
    +};
    +api.updateUser(username, user, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using Org.OpenAPITools.Api;
    +using Org.OpenAPITools.Client;
    +using Org.OpenAPITools.Model;
    +
    +namespace Example
    +{
    +    public class updateUserExample
    +    {
    +        public void main()
    +        {
    +            
    +            // Configure API key authorization: auth_cookie
    +            Configuration.Default.ApiKey.Add("AUTH_KEY", "YOUR_API_KEY");
    +            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    +            // Configuration.Default.ApiKeyPrefix.Add("AUTH_KEY", "Bearer");
    +
    +            var apiInstance = new UserApi();
    +            var username = username_example;  // String | name that need to be deleted (default to null)
    +            var user = new User(); // User | 
    +
    +            try
    +            {
    +                // Updated user
    +                apiInstance.updateUser(username, user);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling UserApi.updateUser: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +// Configure API key authorization: auth_cookie
    +OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('AUTH_KEY', 'YOUR_API_KEY');
    +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    +// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('AUTH_KEY', 'Bearer');
    +
    +$api_instance = new OpenAPITools\Client\Api\UserApi();
    +$username = username_example; // String | name that need to be deleted
    +$user = ; // User | 
    +
    +try {
    +    $api_instance->updateUser($username, $user);
    +} catch (Exception $e) {
    +    echo 'Exception when calling UserApi->updateUser: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use WWW::OPenAPIClient::Configuration;
    +use WWW::OPenAPIClient::UserApi;
    +
    +# Configure API key authorization: auth_cookie
    +$WWW::OPenAPIClient::Configuration::api_key->{'AUTH_KEY'} = 'YOUR_API_KEY';
    +# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    +#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'AUTH_KEY'} = "Bearer";
    +
    +my $api_instance = WWW::OPenAPIClient::UserApi->new();
    +my $username = username_example; # String | name that need to be deleted
    +my $user = WWW::OPenAPIClient::Object::User->new(); # User | 
    +
    +eval { 
    +    $api_instance->updateUser(username => $username, user => $user);
    +};
    +if ($@) {
    +    warn "Exception when calling UserApi->updateUser: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import openapi_client
    +from openapi_client.rest import ApiException
    +from pprint import pprint
    +
    +# Configure API key authorization: auth_cookie
    +openapi_client.configuration.api_key['AUTH_KEY'] = 'YOUR_API_KEY'
    +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    +# openapi_client.configuration.api_key_prefix['AUTH_KEY'] = 'Bearer'
    +
    +# create an instance of the API class
    +api_instance = openapi_client.UserApi()
    +username = username_example # String | name that need to be deleted (default to null)
    +user =  # User | 
    +
    +try: 
    +    # Updated user
    +    api_instance.update_user(username, user)
    +except ApiException as e:
    +    print("Exception when calling UserApi->updateUser: %s\n" % e)
    +
    + +
    +
    extern crate UserApi;
    +
    +pub fn main() {
    +    let username = username_example; // String
    +    let user = ; // User
    +
    +    let mut context = UserApi::Context::default();
    +    let result = client.updateUser(username, user, &context).wait();
    +    println!("{:?}", result);
    +
    +}
    +
    +
    +
    + +

    Scopes

    + + +
    + +

    Parameters

    + +
    Path parameters
    + + + + + + + + + +
    NameDescription
    username* + + +
    +
    +
    + + String + + +
    +name that need to be deleted +
    +
    +
    + Required +
    +
    +
    +
    + + +
    Body parameters
    + + + + + + + + + +
    NameDescription
    user * +

    Updated user object

    + +
    +
    + + + +

    Responses

    +

    +

    + + + + + + +
    +
    +

    +

    + + + + + + +
    +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/.openapi-generator/VERSION b/samples/openapi3/client/petstore/csharp/OpenAPIClient/.openapi-generator/VERSION index afa636560641..83a328a9227e 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/README.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/README.md index 960cc01cd7e0..5efb63e7cc18 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/README.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/README.md @@ -8,18 +8,21 @@ This C# SDK is automatically generated by the [OpenAPI Generator](https://openap - SDK version: 1.0.0 - Build package: org.openapitools.codegen.languages.CSharpClientCodegen - ## Frameworks supported + + - .NET 4.0 or later - Windows Phone 7.1 (Mango) - ## Dependencies + + - [RestSharp](https://www.nuget.org/packages/RestSharp) - 105.1.0 or later - [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 7.0.0 or later - [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.2.0 or later The DLLs included in the package may not be the latest version. We recommend using [NuGet](https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages: + ``` Install-Package RestSharp Install-Package Newtonsoft.Json @@ -28,19 +31,23 @@ Install-Package JsonSubTypes NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See [RestSharp#742](https://github.com/restsharp/RestSharp/issues/742) - ## Installation + Run the following command to generate the DLL + - [Mac/Linux] `/bin/sh build.sh` - [Windows] `build.bat` Then include the DLL (under the `bin` folder) in the C# project, and use the namespaces: + ```csharp using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; using Org.OpenAPITools.Model; + ``` - + + ## Packaging A `.nuspec` is included with the project. You can follow the Nuget quickstart to [create](https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package#create-the-package) and [publish](https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package#publish-the-package) packages. @@ -53,11 +60,11 @@ nuget pack -Build -OutputDirectory out Org.OpenAPITools.csproj Then, publish to a [local feed](https://docs.microsoft.com/en-us/nuget/hosting-packages/local-feeds) or [other host](https://docs.microsoft.com/en-us/nuget/hosting-packages/overview) and consume the new package via Nuget as usual. - + ## Getting Started ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -67,10 +74,11 @@ namespace Example { public class Example { - public void main() + public static void Main() { - var apiInstance = new AnotherFakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new AnotherFakeApi(Configuration.Default); var modelClient = new ModelClient(); // ModelClient | client model try @@ -79,9 +87,11 @@ namespace Example ModelClient result = apiInstance.Call123TestSpecialTags(modelClient); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling AnotherFakeApi.Call123TestSpecialTags: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } @@ -89,7 +99,6 @@ namespace Example } ``` - ## Documentation for API Endpoints All URIs are relative to *http://petstore.swagger.io:80/v2* @@ -135,7 +144,6 @@ Class | Method | HTTP request | Description *UserApi* | [**UpdateUser**](docs/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user - ## Documentation for Models - [Model.AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) @@ -146,9 +154,11 @@ Class | Method | HTTP request | Description - [Model.ArrayTest](docs/ArrayTest.md) - [Model.Capitalization](docs/Capitalization.md) - [Model.Cat](docs/Cat.md) + - [Model.CatAllOf](docs/CatAllOf.md) - [Model.Category](docs/Category.md) - [Model.ClassModel](docs/ClassModel.md) - [Model.Dog](docs/Dog.md) + - [Model.DogAllOf](docs/DogAllOf.md) - [Model.EnumArrays](docs/EnumArrays.md) - [Model.EnumClass](docs/EnumClass.md) - [Model.EnumTest](docs/EnumTest.md) @@ -187,36 +197,40 @@ Class | Method | HTTP request | Description - [Model.User](docs/User.md) - ## Documentation for Authorization - + ### api_key - **Type**: API key + - **API key parameter name**: api_key - **Location**: HTTP header - + ### api_key_query - **Type**: API key + - **API key parameter name**: api_key_query - **Location**: URL query string - + ### bearer_test + - **Type**: HTTP basic authentication - + ### http_basic_test + - **Type**: HTTP basic authentication - + ### petstore_auth + - **Type**: OAuth - **Flow**: implicit - **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/build.bat b/samples/openapi3/client/petstore/csharp/OpenAPIClient/build.bat index 88942a71d0f7..75153d5f899c 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/build.bat +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/build.bat @@ -10,8 +10,8 @@ if not exist ".\nuget.exe" powershell -Command "(new-object System.Net.WebClient if not exist ".\bin" mkdir bin -copy packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll bin\Newtonsoft.Json.dll -copy packages\JsonSubTypes.1.2.0\lib\net45\JsonSubTypes.dll bin\JsonSubTypes.dll +copy packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll bin\Newtonsoft.Json.dll +copy packages\JsonSubTypes.1.5.2\lib\net45\JsonSubTypes.dll bin\JsonSubTypes.dll copy packages\RestSharp.105.1.0\lib\net45\RestSharp.dll bin\RestSharp.dll %CSCPATH%\csc /reference:bin\Newtonsoft.Json.dll;bin\JsonSubTypes.dll;bin\RestSharp.dll;System.ComponentModel.DataAnnotations.dll /target:library /out:bin\Org.OpenAPITools.dll /recurse:src\Org.OpenAPITools\*.cs /doc:bin\Org.OpenAPITools.xml diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/build.sh b/samples/openapi3/client/petstore/csharp/OpenAPIClient/build.sh index 269c087258e9..7edc32f68862 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/build.sh +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/build.sh @@ -44,9 +44,9 @@ ${nuget_cmd} install src/Org.OpenAPITools/packages.config -o packages; echo "[INFO] Copy DLLs to the 'bin' folder" mkdir -p bin; -cp packages/Newtonsoft.Json.10.0.3/lib/net45/Newtonsoft.Json.dll bin/Newtonsoft.Json.dll; +cp packages/Newtonsoft.Json.12.0.1/lib/net45/Newtonsoft.Json.dll bin/Newtonsoft.Json.dll; cp packages/RestSharp.105.1.0/lib/net45/RestSharp.dll bin/RestSharp.dll; -cp packages/JsonSubTypes.1.2.0/lib/net45/JsonSubTypes.dll bin/JsonSubTypes.dll +cp packages/JsonSubTypes.1.5.2/lib/net45/JsonSubTypes.dll bin/JsonSubTypes.dll echo "[INFO] Run 'mcs' to build bin/Org.OpenAPITools.dll" mcs -langversion:${langversion} -sdk:${sdk} -r:bin/Newtonsoft.Json.dll,bin/JsonSubTypes.dll,\ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/AdditionalPropertiesClass.md index 057f5bd65dfc..847bf120968f 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/AdditionalPropertiesClass.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/AdditionalPropertiesClass.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.AdditionalPropertiesClass + ## Properties Name | Type | Description | Notes @@ -6,5 +8,7 @@ Name | Type | Description | Notes **MapProperty** | **Dictionary<string, string>** | | [optional] **MapOfMapProperty** | **Dictionary<string, Dictionary<string, string>>** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Animal.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Animal.md index a97ce49b8018..0a05bcdf0616 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Animal.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Animal.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.Animal + ## Properties Name | Type | Description | Notes @@ -6,5 +8,7 @@ Name | Type | Description | Notes **ClassName** | **string** | | **Color** | **string** | | [optional] [default to "red"] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/AnotherFakeApi.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/AnotherFakeApi.md index 81cc3106d64f..c7cb3d05138b 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/AnotherFakeApi.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/AnotherFakeApi.md @@ -7,8 +7,9 @@ Method | HTTP request | Description [**Call123TestSpecialTags**](AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags - -# **Call123TestSpecialTags** + +## Call123TestSpecialTags + > ModelClient Call123TestSpecialTags (ModelClient modelClient) To test special tags @@ -16,8 +17,9 @@ To test special tags To test special tags and operation ID starting with number ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -27,9 +29,10 @@ namespace Example { public class Call123TestSpecialTagsExample { - public void main() + public static void Main() { - var apiInstance = new AnotherFakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new AnotherFakeApi(Configuration.Default); var modelClient = new ModelClient(); // ModelClient | client model try @@ -38,9 +41,11 @@ namespace Example ModelClient result = apiInstance.Call123TestSpecialTags(modelClient); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling AnotherFakeApi.Call123TestSpecialTags: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -49,6 +54,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **modelClient** | [**ModelClient**](ModelClient.md)| client model | @@ -63,8 +69,16 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ApiResponse.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ApiResponse.md index 01b35815bd40..e16dea75cc2e 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ApiResponse.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ApiResponse.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.ApiResponse + ## Properties Name | Type | Description | Notes @@ -7,5 +9,7 @@ Name | Type | Description | Notes **Type** | **string** | | [optional] **Message** | **string** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ArrayOfArrayOfNumberOnly.md index 614546d32564..12616c6718b9 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ArrayOfArrayOfNumberOnly.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ArrayOfArrayOfNumberOnly.md @@ -1,9 +1,13 @@ + # Org.OpenAPITools.Model.ArrayOfArrayOfNumberOnly + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **ArrayArrayNumber** | **List<List<decimal?>>** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ArrayOfNumberOnly.md index 1886a6edcb46..04facf7d5d1b 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ArrayOfNumberOnly.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ArrayOfNumberOnly.md @@ -1,9 +1,13 @@ + # Org.OpenAPITools.Model.ArrayOfNumberOnly + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **ArrayNumber** | **List<decimal?>** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ArrayTest.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ArrayTest.md index ff6a6cb24b0e..9c297f062a99 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ArrayTest.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ArrayTest.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.ArrayTest + ## Properties Name | Type | Description | Notes @@ -7,5 +9,7 @@ Name | Type | Description | Notes **ArrayArrayOfInteger** | **List<List<long?>>** | | [optional] **ArrayArrayOfModel** | **List<List<ReadOnlyFirst>>** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Capitalization.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Capitalization.md index 74c1ab66db29..0c66f2d2d440 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Capitalization.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Capitalization.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.Capitalization + ## Properties Name | Type | Description | Notes @@ -10,5 +12,7 @@ Name | Type | Description | Notes **SCAETHFlowPoints** | **string** | | [optional] **ATT_NAME** | **string** | Name of the pet | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Cat.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Cat.md index 4b79315204f3..4545a1243692 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Cat.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Cat.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.Cat + ## Properties Name | Type | Description | Notes @@ -7,5 +9,7 @@ Name | Type | Description | Notes **Color** | **string** | | [optional] [default to "red"] **Declawed** | **bool?** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/CatAllOf.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/CatAllOf.md new file mode 100644 index 000000000000..1a6307604551 --- /dev/null +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/CatAllOf.md @@ -0,0 +1,13 @@ + +# Org.OpenAPITools.Model.CatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Declawed** | **bool?** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Category.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Category.md index 67e28fe8d08e..87ad855ca6f7 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Category.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Category.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.Category + ## Properties Name | Type | Description | Notes @@ -6,5 +8,7 @@ Name | Type | Description | Notes **Id** | **long?** | | [optional] **Name** | **string** | | [default to "default-name"] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ClassModel.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ClassModel.md index 556b05db2410..b2b42407d2b0 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ClassModel.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ClassModel.md @@ -1,9 +1,13 @@ + # Org.OpenAPITools.Model.ClassModel + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Class** | **string** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/DefaultApi.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/DefaultApi.md index 92f2dc125c04..7ee074eba27c 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/DefaultApi.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/DefaultApi.md @@ -7,15 +7,17 @@ Method | HTTP request | Description [**FooGet**](DefaultApi.md#fooget) | **GET** /foo | - -# **FooGet** + +## FooGet + > InlineResponseDefault FooGet () ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -25,18 +27,21 @@ namespace Example { public class FooGetExample { - public void main() + public static void Main() { - var apiInstance = new DefaultApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new DefaultApi(Configuration.Default); try { InlineResponseDefault result = apiInstance.FooGet(); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling DefaultApi.FooGet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -44,6 +49,7 @@ namespace Example ``` ### Parameters + This endpoint does not need any parameter. ### Return type @@ -56,8 +62,16 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | response | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Dog.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Dog.md index aa5df1a927a1..1f39769d2b93 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Dog.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Dog.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.Dog + ## Properties Name | Type | Description | Notes @@ -7,5 +9,7 @@ Name | Type | Description | Notes **Color** | **string** | | [optional] [default to "red"] **Breed** | **string** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/DogAllOf.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/DogAllOf.md new file mode 100644 index 000000000000..d72134a0f5f6 --- /dev/null +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/DogAllOf.md @@ -0,0 +1,13 @@ + +# Org.OpenAPITools.Model.DogAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Breed** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/EnumArrays.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/EnumArrays.md index 2dfe0e223884..9d58d25f9729 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/EnumArrays.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/EnumArrays.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.EnumArrays + ## Properties Name | Type | Description | Notes @@ -6,5 +8,7 @@ Name | Type | Description | Notes **JustSymbol** | **string** | | [optional] **ArrayEnum** | **List<string>** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/EnumClass.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/EnumClass.md index 4fb1eae9c066..16d21587b4c8 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/EnumClass.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/EnumClass.md @@ -1,8 +1,12 @@ + # Org.OpenAPITools.Model.EnumClass + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/EnumTest.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/EnumTest.md index 904379e7adeb..3e6bde560845 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/EnumTest.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/EnumTest.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.EnumTest + ## Properties Name | Type | Description | Notes @@ -7,10 +9,12 @@ Name | Type | Description | Notes **EnumStringRequired** | **string** | | **EnumInteger** | **int?** | | [optional] **EnumNumber** | **double?** | | [optional] -**OuterEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] -**OuterEnumInteger** | [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional] -**OuterEnumDefaultValue** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] -**OuterEnumIntegerDefaultValue** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] +**OuterEnum** | **OuterEnum** | | [optional] +**OuterEnumInteger** | **OuterEnumInteger** | | [optional] +**OuterEnumDefaultValue** | **OuterEnumDefaultValue** | | [optional] +**OuterEnumIntegerDefaultValue** | **OuterEnumIntegerDefaultValue** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md index 57ad5eefda36..eb0c8650dc49 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md @@ -19,15 +19,17 @@ Method | HTTP request | Description [**TestJsonFormData**](FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data - -# **FakeHealthGet** + +## FakeHealthGet + > HealthCheckResult FakeHealthGet () Health check endpoint ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -37,9 +39,10 @@ namespace Example { public class FakeHealthGetExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); try { @@ -47,9 +50,11 @@ namespace Example HealthCheckResult result = apiInstance.FakeHealthGet(); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.FakeHealthGet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -57,6 +62,7 @@ namespace Example ``` ### Parameters + This endpoint does not need any parameter. ### Return type @@ -69,13 +75,22 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The instance started successfully | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FakeOuterBooleanSerialize - -# **FakeOuterBooleanSerialize** > bool? FakeOuterBooleanSerialize (bool? body = null) @@ -83,8 +98,9 @@ No authorization required Test serialization of outer boolean types ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -94,9 +110,10 @@ namespace Example { public class FakeOuterBooleanSerializeExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var body = true; // bool? | Input boolean as post body (optional) try @@ -104,9 +121,11 @@ namespace Example bool? result = apiInstance.FakeOuterBooleanSerialize(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.FakeOuterBooleanSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -115,6 +134,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | **bool?**| Input boolean as post body | [optional] @@ -129,13 +149,22 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: */* +- **Content-Type**: application/json +- **Accept**: */* -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output boolean | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FakeOuterCompositeSerialize - -# **FakeOuterCompositeSerialize** > OuterComposite FakeOuterCompositeSerialize (OuterComposite outerComposite = null) @@ -143,8 +172,9 @@ No authorization required Test serialization of object with outer number type ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -154,9 +184,10 @@ namespace Example { public class FakeOuterCompositeSerializeExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var outerComposite = new OuterComposite(); // OuterComposite | Input composite as post body (optional) try @@ -164,9 +195,11 @@ namespace Example OuterComposite result = apiInstance.FakeOuterCompositeSerialize(outerComposite); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.FakeOuterCompositeSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -175,6 +208,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] @@ -189,13 +223,22 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: */* +- **Content-Type**: application/json +- **Accept**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output composite | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +## FakeOuterNumberSerialize - -# **FakeOuterNumberSerialize** > decimal? FakeOuterNumberSerialize (decimal? body = null) @@ -203,8 +246,9 @@ No authorization required Test serialization of outer number types ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -214,9 +258,10 @@ namespace Example { public class FakeOuterNumberSerializeExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var body = 8.14; // decimal? | Input number as post body (optional) try @@ -224,9 +269,11 @@ namespace Example decimal? result = apiInstance.FakeOuterNumberSerialize(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.FakeOuterNumberSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -235,6 +282,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | **decimal?**| Input number as post body | [optional] @@ -249,13 +297,22 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: */* +- **Content-Type**: application/json +- **Accept**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output number | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **FakeOuterStringSerialize** +## FakeOuterStringSerialize + > string FakeOuterStringSerialize (string body = null) @@ -263,8 +320,9 @@ No authorization required Test serialization of outer string types ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -274,9 +332,10 @@ namespace Example { public class FakeOuterStringSerializeExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var body = body_example; // string | Input string as post body (optional) try @@ -284,9 +343,11 @@ namespace Example string result = apiInstance.FakeOuterStringSerialize(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.FakeOuterStringSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -295,6 +356,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | **string**| Input string as post body | [optional] @@ -309,13 +371,22 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: */* +- **Content-Type**: application/json +- **Accept**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output string | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## TestBodyWithFileSchema - -# **TestBodyWithFileSchema** > void TestBodyWithFileSchema (FileSchemaTestClass fileSchemaTestClass) @@ -323,8 +394,9 @@ No authorization required For this test, the body for this request much reference a schema named `File`. ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -334,18 +406,21 @@ namespace Example { public class TestBodyWithFileSchemaExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass | try { apiInstance.TestBodyWithFileSchema(fileSchemaTestClass); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestBodyWithFileSchema: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -354,6 +429,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | @@ -368,20 +444,30 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: Not defined +- **Content-Type**: application/json +- **Accept**: Not defined -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## TestBodyWithQueryParams - -# **TestBodyWithQueryParams** > void TestBodyWithQueryParams (string query, User user) ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -391,9 +477,10 @@ namespace Example { public class TestBodyWithQueryParamsExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var query = query_example; // string | var user = new User(); // User | @@ -401,9 +488,11 @@ namespace Example { apiInstance.TestBodyWithQueryParams(query, user); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestBodyWithQueryParams: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -412,6 +501,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **query** | **string**| | @@ -427,13 +517,22 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: Not defined +- **Content-Type**: application/json +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +## TestClientModel - -# **TestClientModel** > ModelClient TestClientModel (ModelClient modelClient) To test \"client\" model @@ -441,8 +540,9 @@ To test \"client\" model To test \"client\" model ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -452,9 +552,10 @@ namespace Example { public class TestClientModelExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var modelClient = new ModelClient(); // ModelClient | client model try @@ -463,9 +564,11 @@ namespace Example ModelClient result = apiInstance.TestClientModel(modelClient); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestClientModel: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -474,6 +577,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **modelClient** | [**ModelClient**](ModelClient.md)| client model | @@ -488,13 +592,22 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **TestEndpointParameters** +## TestEndpointParameters + > void TestEndpointParameters (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null) Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -502,8 +615,9 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -513,13 +627,14 @@ namespace Example { public class TestEndpointParametersExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure HTTP basic authorization: http_basic_test Configuration.Default.Username = "YOUR_USERNAME"; Configuration.Default.Password = "YOUR_PASSWORD"; - var apiInstance = new FakeApi(); + var apiInstance = new FakeApi(Configuration.Default); var number = 8.14; // decimal? | None var _double = 1.2D; // double? | None var patternWithoutDelimiter = patternWithoutDelimiter_example; // string | None @@ -540,9 +655,11 @@ namespace Example // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 apiInstance.TestEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestEndpointParameters: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -551,6 +668,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **number** | **decimal?**| None | @@ -578,13 +696,23 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## TestEnumParameters - -# **TestEnumParameters** > void TestEnumParameters (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null) To test enum parameters @@ -592,8 +720,9 @@ To test enum parameters To test enum parameters ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -603,9 +732,10 @@ namespace Example { public class TestEnumParametersExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var enumHeaderStringArray = enumHeaderStringArray_example; // List | Header parameter enum test (string array) (optional) var enumHeaderString = enumHeaderString_example; // string | Header parameter enum test (string) (optional) (default to -efg) var enumQueryStringArray = enumQueryStringArray_example; // List | Query parameter enum test (string array) (optional) @@ -620,9 +750,11 @@ namespace Example // To test enum parameters apiInstance.TestEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestEnumParameters: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -631,6 +763,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **enumHeaderStringArray** | **List<string>**| Header parameter enum test (string array) | [optional] @@ -652,13 +785,23 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid request | - | +| **404** | Not found | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## TestGroupParameters - -# **TestGroupParameters** > void TestGroupParameters (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null) Fake endpoint to test group parameters (optional) @@ -666,8 +809,9 @@ Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters (optional) ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -677,13 +821,14 @@ namespace Example { public class TestGroupParametersExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure HTTP basic authorization: bearer_test Configuration.Default.Username = "YOUR_USERNAME"; Configuration.Default.Password = "YOUR_PASSWORD"; - var apiInstance = new FakeApi(); + var apiInstance = new FakeApi(Configuration.Default); var requiredStringGroup = 56; // int? | Required String in group parameters var requiredBooleanGroup = true; // bool? | Required Boolean in group parameters var requiredInt64Group = 789; // long? | Required Integer in group parameters @@ -696,9 +841,11 @@ namespace Example // Fake endpoint to test group parameters (optional) apiInstance.TestGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestGroupParameters: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -707,6 +854,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **requiredStringGroup** | **int?**| Required String in group parameters | @@ -726,20 +874,30 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Someting wrong | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +## TestInlineAdditionalProperties - -# **TestInlineAdditionalProperties** > void TestInlineAdditionalProperties (Dictionary requestBody) test inline additionalProperties ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -749,9 +907,10 @@ namespace Example { public class TestInlineAdditionalPropertiesExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var requestBody = new Dictionary(); // Dictionary | request body try @@ -759,9 +918,11 @@ namespace Example // test inline additionalProperties apiInstance.TestInlineAdditionalProperties(requestBody); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestInlineAdditionalProperties: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -770,6 +931,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **requestBody** | [**Dictionary<string, string>**](string.md)| request body | @@ -784,20 +946,30 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: Not defined +- **Content-Type**: application/json +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **TestJsonFormData** +## TestJsonFormData + > void TestJsonFormData (string param, string param2) test json serialization of form data ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -807,9 +979,10 @@ namespace Example { public class TestJsonFormDataExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var param = param_example; // string | field1 var param2 = param2_example; // string | field2 @@ -818,9 +991,11 @@ namespace Example // test json serialization of form data apiInstance.TestJsonFormData(param, param2); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestJsonFormData: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -829,6 +1004,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **param** | **string**| field1 | @@ -844,8 +1020,16 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/FakeClassnameTags123Api.md index f069b0983997..93eb8b274552 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/FakeClassnameTags123Api.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/FakeClassnameTags123Api.md @@ -7,8 +7,9 @@ Method | HTTP request | Description [**TestClassname**](FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case - -# **TestClassname** + +## TestClassname + > ModelClient TestClassname (ModelClient modelClient) To test class name in snake case @@ -16,8 +17,9 @@ To test class name in snake case To test class name in snake case ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -27,14 +29,15 @@ namespace Example { public class TestClassnameExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure API key authorization: api_key_query Configuration.Default.AddApiKey("api_key_query", "YOUR_API_KEY"); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Configuration.Default.AddApiKeyPrefix("api_key_query", "Bearer"); - var apiInstance = new FakeClassnameTags123Api(); + var apiInstance = new FakeClassnameTags123Api(Configuration.Default); var modelClient = new ModelClient(); // ModelClient | client model try @@ -43,9 +46,11 @@ namespace Example ModelClient result = apiInstance.TestClassname(modelClient); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeClassnameTags123Api.TestClassname: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -54,6 +59,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **modelClient** | [**ModelClient**](ModelClient.md)| client model | @@ -68,8 +74,16 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/File.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/File.md index acf85a4c001a..b71051025797 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/File.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/File.md @@ -1,9 +1,13 @@ + # Org.OpenAPITools.Model.File + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **SourceURI** | **string** | Test capitalization | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/FileSchemaTestClass.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/FileSchemaTestClass.md index 244164accbe6..df1453f686bd 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/FileSchemaTestClass.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/FileSchemaTestClass.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.FileSchemaTestClass + ## Properties Name | Type | Description | Notes @@ -6,5 +8,7 @@ Name | Type | Description | Notes **File** | [**File**](File.md) | | [optional] **Files** | [**List<File>**](File.md) | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Foo.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Foo.md index fd84dc2038c9..ea6f4245da6e 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Foo.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Foo.md @@ -1,9 +1,13 @@ + # Org.OpenAPITools.Model.Foo + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Bar** | **string** | | [optional] [default to "bar"] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/FormatTest.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/FormatTest.md index bba9daef559d..a1bdd78699de 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/FormatTest.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/FormatTest.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.FormatTest + ## Properties Name | Type | Description | Notes @@ -19,5 +21,7 @@ Name | Type | Description | Notes **PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [optional] **PatternWithDigitsAndDelimiter** | **string** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/HasOnlyReadOnly.md index 95f49de194c1..4a2624f11182 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/HasOnlyReadOnly.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/HasOnlyReadOnly.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.HasOnlyReadOnly + ## Properties Name | Type | Description | Notes @@ -6,5 +8,7 @@ Name | Type | Description | Notes **Bar** | **string** | | [optional] **Foo** | **string** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/HealthCheckResult.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/HealthCheckResult.md index c8f299aaa258..08e5992d20cb 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/HealthCheckResult.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/HealthCheckResult.md @@ -1,9 +1,13 @@ + # Org.OpenAPITools.Model.HealthCheckResult + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **NullableMessage** | **string** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/InlineObject.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/InlineObject.md index 40e16da1bb7d..12ec90a8c699 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/InlineObject.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/InlineObject.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.InlineObject + ## Properties Name | Type | Description | Notes @@ -6,5 +8,7 @@ Name | Type | Description | Notes **Name** | **string** | Updated name of the pet | [optional] **Status** | **string** | Updated status of the pet | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/InlineObject1.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/InlineObject1.md index 2e6d226754e4..581fe20b1e21 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/InlineObject1.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/InlineObject1.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.InlineObject1 + ## Properties Name | Type | Description | Notes @@ -6,5 +8,7 @@ Name | Type | Description | Notes **AdditionalMetadata** | **string** | Additional data to pass to server | [optional] **File** | **System.IO.Stream** | file to upload | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/InlineObject2.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/InlineObject2.md index c02c78f9b2d0..79abb7a467c4 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/InlineObject2.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/InlineObject2.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.InlineObject2 + ## Properties Name | Type | Description | Notes @@ -6,5 +8,7 @@ Name | Type | Description | Notes **EnumFormStringArray** | **List<string>** | Form parameter enum test (string array) | [optional] **EnumFormString** | **string** | Form parameter enum test (string) | [optional] [default to EnumFormStringEnum.Efg] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/InlineObject3.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/InlineObject3.md index 192926bbe927..eb70006e29bd 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/InlineObject3.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/InlineObject3.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.InlineObject3 + ## Properties Name | Type | Description | Notes @@ -18,5 +20,7 @@ Name | Type | Description | Notes **Password** | **string** | None | [optional] **Callback** | **string** | None | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/InlineObject4.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/InlineObject4.md index c8e00663ee88..18e4a1f3ce50 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/InlineObject4.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/InlineObject4.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.InlineObject4 + ## Properties Name | Type | Description | Notes @@ -6,5 +8,7 @@ Name | Type | Description | Notes **Param** | **string** | field1 | **Param2** | **string** | field2 | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/InlineObject5.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/InlineObject5.md index a28ff47f2ec0..291c88623eea 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/InlineObject5.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/InlineObject5.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.InlineObject5 + ## Properties Name | Type | Description | Notes @@ -6,5 +8,7 @@ Name | Type | Description | Notes **AdditionalMetadata** | **string** | Additional data to pass to server | [optional] **RequiredFile** | **System.IO.Stream** | file to upload | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/InlineResponseDefault.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/InlineResponseDefault.md index 8c96fb62ac88..ecfb254001a2 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/InlineResponseDefault.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/InlineResponseDefault.md @@ -1,9 +1,13 @@ + # Org.OpenAPITools.Model.InlineResponseDefault + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **String** | [**Foo**](Foo.md) | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/List.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/List.md index 484c2a0992c6..cb41193b43eb 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/List.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/List.md @@ -1,9 +1,13 @@ + # Org.OpenAPITools.Model.List + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **_123List** | **string** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/MapTest.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/MapTest.md index 2c44f95808ae..89be5aa12cfd 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/MapTest.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/MapTest.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.MapTest + ## Properties Name | Type | Description | Notes @@ -8,5 +10,7 @@ Name | Type | Description | Notes **DirectMap** | **Dictionary<string, bool?>** | | [optional] **IndirectMap** | **Dictionary<string, bool?>** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/MixedPropertiesAndAdditionalPropertiesClass.md index 9b8e2e3434c1..323933588de3 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.MixedPropertiesAndAdditionalPropertiesClass + ## Properties Name | Type | Description | Notes @@ -7,5 +9,7 @@ Name | Type | Description | Notes **DateTime** | **DateTime?** | | [optional] **Map** | [**Dictionary<string, Animal>**](Animal.md) | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Model200Response.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Model200Response.md index 16337f9b6b2d..59918913107c 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Model200Response.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Model200Response.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.Model200Response + ## Properties Name | Type | Description | Notes @@ -6,5 +8,7 @@ Name | Type | Description | Notes **Name** | **int?** | | [optional] **Class** | **string** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ModelClient.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ModelClient.md index ecc7b60ce558..e36e1fad802f 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ModelClient.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ModelClient.md @@ -1,9 +1,13 @@ + # Org.OpenAPITools.Model.ModelClient + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **__Client** | **string** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Name.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Name.md index e22fef95673d..80d0a9f31f3f 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Name.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Name.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.Name + ## Properties Name | Type | Description | Notes @@ -8,5 +10,7 @@ Name | Type | Description | Notes **Property** | **string** | | [optional] **_123Number** | **int?** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/NullableClass.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/NullableClass.md index 0ca2455a4ab2..84dd092d8a38 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/NullableClass.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/NullableClass.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.NullableClass + ## Properties Name | Type | Description | Notes @@ -16,5 +18,7 @@ Name | Type | Description | Notes **ObjectAndItemsNullableProp** | **Dictionary<string, Object>** | | [optional] **ObjectItemsNullable** | **Dictionary<string, Object>** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/NumberOnly.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/NumberOnly.md index 5f00dedf1c39..8fd05997a931 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/NumberOnly.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/NumberOnly.md @@ -1,9 +1,13 @@ + # Org.OpenAPITools.Model.NumberOnly + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **JustNumber** | **decimal?** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Order.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Order.md index 984bd5ca063e..f28ee2ad0064 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Order.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Order.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.Order + ## Properties Name | Type | Description | Notes @@ -10,5 +12,7 @@ Name | Type | Description | Notes **Status** | **string** | Order Status | [optional] **Complete** | **bool?** | | [optional] [default to false] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/OuterComposite.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/OuterComposite.md index 4091cd23f2e1..e371f712633e 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/OuterComposite.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/OuterComposite.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.OuterComposite + ## Properties Name | Type | Description | Notes @@ -7,5 +9,7 @@ Name | Type | Description | Notes **MyString** | **string** | | [optional] **MyBoolean** | **bool?** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/OuterEnum.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/OuterEnum.md index 22713352ca08..edc2300684d9 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/OuterEnum.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/OuterEnum.md @@ -1,8 +1,12 @@ + # Org.OpenAPITools.Model.OuterEnum + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/OuterEnumDefaultValue.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/OuterEnumDefaultValue.md index 09f6b91ee623..41474099f2ee 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/OuterEnumDefaultValue.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/OuterEnumDefaultValue.md @@ -1,8 +1,12 @@ + # Org.OpenAPITools.Model.OuterEnumDefaultValue + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/OuterEnumInteger.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/OuterEnumInteger.md index 149bb5a8dd16..b82abc3adac4 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/OuterEnumInteger.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/OuterEnumInteger.md @@ -1,8 +1,12 @@ + # Org.OpenAPITools.Model.OuterEnumInteger + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/OuterEnumIntegerDefaultValue.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/OuterEnumIntegerDefaultValue.md index 29de71509745..46939d01522e 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/OuterEnumIntegerDefaultValue.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/OuterEnumIntegerDefaultValue.md @@ -1,8 +1,12 @@ + # Org.OpenAPITools.Model.OuterEnumIntegerDefaultValue + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Pet.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Pet.md index 0ac711337aa8..51022249270f 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Pet.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Pet.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.Pet + ## Properties Name | Type | Description | Notes @@ -10,5 +12,7 @@ Name | Type | Description | Notes **Tags** | [**List<Tag>**](Tag.md) | | [optional] **Status** | **string** | pet status in the store | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/PetApi.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/PetApi.md index dd23df9b3683..a1e139d83e48 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/PetApi.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/PetApi.md @@ -15,15 +15,17 @@ Method | HTTP request | Description [**UploadFileWithRequiredFile**](PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) - -# **AddPet** + +## AddPet + > void AddPet (Pet pet) Add a new pet to the store ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -33,12 +35,13 @@ namespace Example { public class AddPetExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var pet = new Pet(); // Pet | Pet object that needs to be added to the store try @@ -46,9 +49,11 @@ namespace Example // Add a new pet to the store apiInstance.AddPet(pet); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.AddPet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -57,6 +62,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | @@ -71,20 +77,30 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **405** | Invalid input | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **DeletePet** +## DeletePet + > void DeletePet (long? petId, string apiKey = null) Deletes a pet ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -94,12 +110,13 @@ namespace Example { public class DeletePetExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var petId = 789; // long? | Pet id to delete var apiKey = apiKey_example; // string | (optional) @@ -108,9 +125,11 @@ namespace Example // Deletes a pet apiInstance.DeletePet(petId, apiKey); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.DeletePet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -119,6 +138,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **long?**| Pet id to delete | @@ -134,22 +154,32 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid pet value | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +## FindPetsByStatus - -# **FindPetsByStatus** -> List FindPetsByStatus (List status) +> List<Pet> FindPetsByStatus (List status) Finds Pets by status Multiple status values can be provided with comma separated strings ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -159,23 +189,26 @@ namespace Example { public class FindPetsByStatusExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var status = status_example; // List | Status values that need to be considered for filter try { // Finds Pets by status - List<Pet> result = apiInstance.FindPetsByStatus(status); + List result = apiInstance.FindPetsByStatus(status); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.FindPetsByStatus: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -184,13 +217,14 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **status** | **List<string>**| Status values that need to be considered for filter | ### Return type -[**List**](Pet.md) +[**List<Pet>**](Pet.md) ### Authorization @@ -198,22 +232,33 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid status value | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) - -# **FindPetsByTags** -> List FindPetsByTags (List tags) + +## FindPetsByTags + +> List<Pet> FindPetsByTags (List tags) Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -223,23 +268,26 @@ namespace Example { public class FindPetsByTagsExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var tags = new List(); // List | Tags to filter by try { // Finds Pets by tags - List<Pet> result = apiInstance.FindPetsByTags(tags); + List result = apiInstance.FindPetsByTags(tags); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.FindPetsByTags: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -248,13 +296,14 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **tags** | [**List<string>**](string.md)| Tags to filter by | ### Return type -[**List**](Pet.md) +[**List<Pet>**](Pet.md) ### Authorization @@ -262,13 +311,23 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid tag value | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GetPetById** +## GetPetById + > Pet GetPetById (long? petId) Find pet by ID @@ -276,8 +335,9 @@ Find pet by ID Returns a single pet ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -287,14 +347,15 @@ namespace Example { public class GetPetByIdExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure API key authorization: api_key Configuration.Default.AddApiKey("api_key", "YOUR_API_KEY"); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Configuration.Default.AddApiKeyPrefix("api_key", "Bearer"); - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var petId = 789; // long? | ID of pet to return try @@ -303,9 +364,11 @@ namespace Example Pet result = apiInstance.GetPetById(petId); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.GetPetById: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -314,6 +377,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **long?**| ID of pet to return | @@ -328,20 +392,32 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **UpdatePet** +## UpdatePet + > void UpdatePet (Pet pet) Update an existing pet ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -351,12 +427,13 @@ namespace Example { public class UpdatePetExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var pet = new Pet(); // Pet | Pet object that needs to be added to the store try @@ -364,9 +441,11 @@ namespace Example // Update an existing pet apiInstance.UpdatePet(pet); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.UpdatePet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -375,6 +454,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | @@ -389,20 +469,32 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | +| **405** | Validation exception | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## UpdatePetWithForm - -# **UpdatePetWithForm** > void UpdatePetWithForm (long? petId, string name = null, string status = null) Updates a pet in the store with form data ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -412,12 +504,13 @@ namespace Example { public class UpdatePetWithFormExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var petId = 789; // long? | ID of pet that needs to be updated var name = name_example; // string | Updated name of the pet (optional) var status = status_example; // string | Updated status of the pet (optional) @@ -427,9 +520,11 @@ namespace Example // Updates a pet in the store with form data apiInstance.UpdatePetWithForm(petId, name, status); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.UpdatePetWithForm: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -438,6 +533,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **long?**| ID of pet that needs to be updated | @@ -454,20 +550,30 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **405** | Invalid input | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## UploadFile - -# **UploadFile** > ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream file = null) uploads an image ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -477,12 +583,13 @@ namespace Example { public class UploadFileExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var petId = 789; // long? | ID of pet to update var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional) var file = BINARY_DATA_HERE; // System.IO.Stream | file to upload (optional) @@ -493,9 +600,11 @@ namespace Example ApiResponse result = apiInstance.UploadFile(petId, additionalMetadata, file); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.UploadFile: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -504,6 +613,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **long?**| ID of pet to update | @@ -520,20 +630,30 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: multipart/form-data - - **Accept**: application/json +- **Content-Type**: multipart/form-data +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## UploadFileWithRequiredFile - -# **UploadFileWithRequiredFile** > ApiResponse UploadFileWithRequiredFile (long? petId, System.IO.Stream requiredFile, string additionalMetadata = null) uploads an image (required) ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -543,12 +663,13 @@ namespace Example { public class UploadFileWithRequiredFileExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var petId = 789; // long? | ID of pet to update var requiredFile = BINARY_DATA_HERE; // System.IO.Stream | file to upload var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional) @@ -559,9 +680,11 @@ namespace Example ApiResponse result = apiInstance.UploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.UploadFileWithRequiredFile: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -570,6 +693,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **long?**| ID of pet to update | @@ -586,8 +710,16 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: multipart/form-data - - **Accept**: application/json +- **Content-Type**: multipart/form-data +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ReadOnlyFirst.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ReadOnlyFirst.md index 6c2571cb48f5..f4581ec10515 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ReadOnlyFirst.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/ReadOnlyFirst.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.ReadOnlyFirst + ## Properties Name | Type | Description | Notes @@ -6,5 +8,7 @@ Name | Type | Description | Notes **Bar** | **string** | | [optional] **Baz** | **string** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Return.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Return.md index 21a269c63f4b..65481f45cf21 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Return.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Return.md @@ -1,9 +1,13 @@ + # Org.OpenAPITools.Model.Return + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **_Return** | **int?** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/SpecialModelName.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/SpecialModelName.md index 306e65392a2e..c1154219ccc8 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/SpecialModelName.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/SpecialModelName.md @@ -1,9 +1,13 @@ + # Org.OpenAPITools.Model.SpecialModelName + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **SpecialPropertyName** | **long?** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/StoreApi.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/StoreApi.md index f8b4d3422db4..cb61a7c619ec 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/StoreApi.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/StoreApi.md @@ -10,8 +10,9 @@ Method | HTTP request | Description [**PlaceOrder**](StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet - -# **DeleteOrder** + +## DeleteOrder + > void DeleteOrder (string orderId) Delete purchase order by ID @@ -19,8 +20,9 @@ Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -30,9 +32,10 @@ namespace Example { public class DeleteOrderExample { - public void main() + public static void Main() { - var apiInstance = new StoreApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(Configuration.Default); var orderId = orderId_example; // string | ID of the order that needs to be deleted try @@ -40,9 +43,11 @@ namespace Example // Delete purchase order by ID apiInstance.DeleteOrder(orderId); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling StoreApi.DeleteOrder: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -51,6 +56,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **orderId** | **string**| ID of the order that needs to be deleted | @@ -65,22 +71,33 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) - -# **GetInventory** -> Dictionary GetInventory () + +## GetInventory + +> Dictionary<string, int?> GetInventory () Returns pet inventories by status Returns a map of status codes to quantities ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -90,24 +107,27 @@ namespace Example { public class GetInventoryExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure API key authorization: api_key Configuration.Default.AddApiKey("api_key", "YOUR_API_KEY"); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Configuration.Default.AddApiKeyPrefix("api_key", "Bearer"); - var apiInstance = new StoreApi(); + var apiInstance = new StoreApi(Configuration.Default); try { // Returns pet inventories by status - Dictionary<string, int?> result = apiInstance.GetInventory(); + Dictionary result = apiInstance.GetInventory(); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling StoreApi.GetInventory: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -115,6 +135,7 @@ namespace Example ``` ### Parameters + This endpoint does not need any parameter. ### Return type @@ -127,13 +148,22 @@ This endpoint does not need any parameter. ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetOrderById - -# **GetOrderById** > Order GetOrderById (long? orderId) Find purchase order by ID @@ -141,8 +171,9 @@ Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -152,9 +183,10 @@ namespace Example { public class GetOrderByIdExample { - public void main() + public static void Main() { - var apiInstance = new StoreApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(Configuration.Default); var orderId = 789; // long? | ID of pet that needs to be fetched try @@ -163,9 +195,11 @@ namespace Example Order result = apiInstance.GetOrderById(orderId); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling StoreApi.GetOrderById: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -174,6 +208,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **orderId** | **long?**| ID of pet that needs to be fetched | @@ -188,20 +223,32 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## PlaceOrder - -# **PlaceOrder** > Order PlaceOrder (Order order) Place an order for a pet ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -211,9 +258,10 @@ namespace Example { public class PlaceOrderExample { - public void main() + public static void Main() { - var apiInstance = new StoreApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(Configuration.Default); var order = new Order(); // Order | order placed for purchasing the pet try @@ -222,9 +270,11 @@ namespace Example Order result = apiInstance.PlaceOrder(order); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling StoreApi.PlaceOrder: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -233,6 +283,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **order** | [**Order**](Order.md)| order placed for purchasing the pet | @@ -247,8 +298,17 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/xml, application/json +- **Content-Type**: application/json +- **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid Order | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Tag.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Tag.md index 6a76c28595f7..864cac0c8d34 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Tag.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/Tag.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.Tag + ## Properties Name | Type | Description | Notes @@ -6,5 +8,7 @@ Name | Type | Description | Notes **Id** | **long?** | | [optional] **Name** | **string** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/User.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/User.md index 04dd24a3423c..6faa1df688d7 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/User.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/User.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.User + ## Properties Name | Type | Description | Notes @@ -12,5 +14,7 @@ Name | Type | Description | Notes **Phone** | **string** | | [optional] **UserStatus** | **int?** | User Status | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/UserApi.md b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/UserApi.md index 2fb4c422cf56..7c37179a9102 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/UserApi.md +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/docs/UserApi.md @@ -14,8 +14,9 @@ Method | HTTP request | Description [**UpdateUser**](UserApi.md#updateuser) | **PUT** /user/{username} | Updated user - -# **CreateUser** + +## CreateUser + > void CreateUser (User user) Create user @@ -23,8 +24,9 @@ Create user This can only be done by the logged in user. ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -34,9 +36,10 @@ namespace Example { public class CreateUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var user = new User(); // User | Created user object try @@ -44,9 +47,11 @@ namespace Example // Create user apiInstance.CreateUser(user); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.CreateUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -55,6 +60,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **user** | [**User**](User.md)| Created user object | @@ -69,20 +75,30 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: Not defined +- **Content-Type**: application/json +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## CreateUsersWithArrayInput - -# **CreateUsersWithArrayInput** > void CreateUsersWithArrayInput (List user) Creates list of users with given input array ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -92,9 +108,10 @@ namespace Example { public class CreateUsersWithArrayInputExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var user = new List(); // List | List of user object try @@ -102,9 +119,11 @@ namespace Example // Creates list of users with given input array apiInstance.CreateUsersWithArrayInput(user); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.CreateUsersWithArrayInput: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -113,9 +132,10 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**List<User>**](List.md)| List of user object | + **user** | [**List<User>**](User.md)| List of user object | ### Return type @@ -127,20 +147,30 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: Not defined +- **Content-Type**: application/json +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## CreateUsersWithListInput - -# **CreateUsersWithListInput** > void CreateUsersWithListInput (List user) Creates list of users with given input array ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -150,9 +180,10 @@ namespace Example { public class CreateUsersWithListInputExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var user = new List(); // List | List of user object try @@ -160,9 +191,11 @@ namespace Example // Creates list of users with given input array apiInstance.CreateUsersWithListInput(user); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.CreateUsersWithListInput: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -171,9 +204,10 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**List<User>**](List.md)| List of user object | + **user** | [**List<User>**](User.md)| List of user object | ### Return type @@ -185,13 +219,22 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: Not defined +- **Content-Type**: application/json +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DeleteUser - -# **DeleteUser** > void DeleteUser (string username) Delete user @@ -199,8 +242,9 @@ Delete user This can only be done by the logged in user. ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -210,9 +254,10 @@ namespace Example { public class DeleteUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var username = username_example; // string | The name that needs to be deleted try @@ -220,9 +265,11 @@ namespace Example // Delete user apiInstance.DeleteUser(username); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.DeleteUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -231,6 +278,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **string**| The name that needs to be deleted | @@ -245,20 +293,31 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetUserByName - -# **GetUserByName** > User GetUserByName (string username) Get user by user name ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -268,9 +327,10 @@ namespace Example { public class GetUserByNameExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var username = username_example; // string | The name that needs to be fetched. Use user1 for testing. try @@ -279,9 +339,11 @@ namespace Example User result = apiInstance.GetUserByName(username); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.GetUserByName: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -290,6 +352,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **string**| The name that needs to be fetched. Use user1 for testing. | @@ -304,20 +367,32 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid username supplied | - | +| **404** | User not found | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## LoginUser - -# **LoginUser** > string LoginUser (string username, string password) Logs user into the system ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -327,9 +402,10 @@ namespace Example { public class LoginUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var username = username_example; // string | The user name for login var password = password_example; // string | The password for login in clear text @@ -339,9 +415,11 @@ namespace Example string result = apiInstance.LoginUser(username, password); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.LoginUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -350,6 +428,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **string**| The user name for login | @@ -365,20 +444,31 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
    * X-Expires-After - date in UTC when token expires
    | +| **400** | Invalid username/password supplied | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## LogoutUser - -# **LogoutUser** > void LogoutUser () Logs out current logged in user session ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -388,18 +478,21 @@ namespace Example { public class LogoutUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); try { // Logs out current logged in user session apiInstance.LogoutUser(); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.LogoutUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -407,6 +500,7 @@ namespace Example ``` ### Parameters + This endpoint does not need any parameter. ### Return type @@ -419,13 +513,22 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## UpdateUser - -# **UpdateUser** > void UpdateUser (string username, User user) Updated user @@ -433,8 +536,9 @@ Updated user This can only be done by the logged in user. ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -444,9 +548,10 @@ namespace Example { public class UpdateUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var username = username_example; // string | name that need to be deleted var user = new User(); // User | Updated user object @@ -455,9 +560,11 @@ namespace Example // Updated user apiInstance.UpdateUser(username, user); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.UpdateUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -466,6 +573,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **string**| name that need to be deleted | @@ -481,8 +589,17 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: Not defined +- **Content-Type**: application/json +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid user supplied | - | +| **404** | User not found | - | -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/mono_nunit_test.sh b/samples/openapi3/client/petstore/csharp/OpenAPIClient/mono_nunit_test.sh index 039eba8ed42a..ef4209de27b2 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/mono_nunit_test.sh +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/mono_nunit_test.sh @@ -14,9 +14,9 @@ wget -nc https://dist.nuget.org/win-x86-commandline/latest/nuget.exe mozroots --import --sync mono nuget.exe install src/Org.OpenAPITools.Test/packages.config -o packages -echo "[INFO] Install NUnit runners via NuGet" -mono nuget.exe install NUnit.Runners -Version 2.6.4 -OutputDirectory packages +echo "[INFO] Install NUnit Console 3.x runners via NuGet" +mono nuget.exe install NUnit.ConsoleRunner -Version 3.10.0 -OutputDirectory packages echo "[INFO] Build the solution and run the unit test" xbuild Org.OpenAPITools.sln && \ - mono ./packages/NUnit.Runners.2.6.4/tools/nunit-console.exe src/Org.OpenAPITools.Test/bin/Debug/Org.OpenAPITools.Test.dll + mono ./packages/NUnit.ConsoleRunner.3.10.0/tools/nunit3-console.exe src/Org.OpenAPITools.Test/bin/Debug/Org.OpenAPITools.Test.dll diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/CatAllOfTests.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/CatAllOfTests.cs new file mode 100644 index 000000000000..d7afe6310fa7 --- /dev/null +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/CatAllOfTests.cs @@ -0,0 +1,79 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test +{ + /// + /// Class for testing CatAllOf + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class CatAllOfTests + { + // TODO uncomment below to declare an instance variable for CatAllOf + //private CatAllOf instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of CatAllOf + //instance = new CatAllOf(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of CatAllOf + /// + [Test] + public void CatAllOfInstanceTest() + { + // TODO uncomment below to test "IsInstanceOf" CatAllOf + //Assert.IsInstanceOf(typeof(CatAllOf), instance); + } + + + /// + /// Test the property 'Declawed' + /// + [Test] + public void DeclawedTest() + { + // TODO unit test for the property 'Declawed' + } + + } + +} diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/DogAllOfTests.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/DogAllOfTests.cs new file mode 100644 index 000000000000..30f5bed38e19 --- /dev/null +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/DogAllOfTests.cs @@ -0,0 +1,79 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test +{ + /// + /// Class for testing DogAllOf + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class DogAllOfTests + { + // TODO uncomment below to declare an instance variable for DogAllOf + //private DogAllOf instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of DogAllOf + //instance = new DogAllOf(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of DogAllOf + /// + [Test] + public void DogAllOfInstanceTest() + { + // TODO uncomment below to test "IsInstanceOf" DogAllOf + //Assert.IsInstanceOf(typeof(DogAllOf), instance); + } + + + /// + /// Test the property 'Breed' + /// + [Test] + public void BreedTest() + { + // TODO unit test for the property 'Breed' + } + + } + +} diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj index 48ec5e0f7c18..d64419ce9231 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj @@ -4,7 +4,7 @@ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 --> @@ -47,16 +47,16 @@ OpenAPI spec version: 1.0.0 - $(SolutionDir)\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll - ..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll - ..\..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll - ..\..\vendor\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll + $(SolutionDir)\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll + ..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll + ..\..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll + ..\..\vendor\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll - $(SolutionDir)\packages\JsonSubTypes.1.2.0\lib\net45\JsonSubTypes.dll - ..\packages\JsonSubTypes.1.2.0\lib\net45\JsonSubTypes.dll - ..\..\packages\JsonSubTypes.1.2.0\lib\net45\JsonSubTypes.dll - ..\..\vendor\JsonSubTypes.1.2.0\lib\net45\JsonSubTypes.dll + $(SolutionDir)\packages\JsonSubTypes.1.5.2\lib\net45\JsonSubTypes.dll + ..\packages\JsonSubTypes.1.5.2\lib\net45\JsonSubTypes.dll + ..\..\packages\JsonSubTypes.1.5.2\lib\net45\JsonSubTypes.dll + ..\..\vendor\JsonSubTypes.1.5.2\lib\net45\JsonSubTypes.dll $(SolutionDir)\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll @@ -65,10 +65,10 @@ OpenAPI spec version: 1.0.0 ..\..\vendor\RestSharp.105.1.0\lib\net45\RestSharp.dll - $(SolutionDir)\packages\NUnit.2.6.4\lib\nunit.framework.dll - ..\packages\NUnit.2.6.4\lib\nunit.framework.dll - ..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll - ..\..\vendor\NUnit.2.6.4\lib\nunit.framework.dll + $(SolutionDir)\packages\NUnit.3.11.0\lib\net45\nunit.framework.dll + ..\packages\NUnit.3.11.0\lib\net45\nunit.framework.dll + ..\..\packages\NUnit.3.11.0\lib\net45\nunit.framework.dll + ..\..\vendor\NUnit.3.11.0\lib\net45\nunit.framework.dll diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/packages.config b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/packages.config index ac390c1dcb3c..e70b078702de 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/packages.config +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/packages.config @@ -1,7 +1,7 @@ - + - - + + diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index 563a1e9f64ab..5e6c79c2d42d 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/DefaultApi.cs index 20e11dbf458e..5a7c8a418253 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs index 22f8ef1bafce..12804736a06a 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index 9ff2cf1d8611..20021324b332 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/PetApi.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/PetApi.cs index 2385be9dc63f..5fd97533d827 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/PetApi.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/StoreApi.cs index e84290e5a6b9..5a5e25d793a2 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/StoreApi.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/UserApi.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/UserApi.cs index b2d8fe094c8f..7199e8c746d5 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/UserApi.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/ApiClient.cs index 030d56543c4b..216469e1c8b9 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/ApiClient.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/ApiException.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/ApiException.cs index 875026e65f41..e7ac15569b93 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/ApiException.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/ApiException.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/ApiResponse.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/ApiResponse.cs index 3e395de9dfbb..4b462cf5424d 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/ApiResponse.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/ApiResponse.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/Configuration.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/Configuration.cs index b530746cb5a1..926007e22caf 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/Configuration.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/Configuration.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/ExceptionFactory.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/ExceptionFactory.cs index 66c4aa3a1408..d855d96821f2 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/ExceptionFactory.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/ExceptionFactory.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/GlobalConfiguration.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/GlobalConfiguration.cs index 309e385f25a7..a79bea966bd5 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/GlobalConfiguration.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/GlobalConfiguration.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/IApiAccessor.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/IApiAccessor.cs index 3b4834c409df..cd03e8c1f975 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/IApiAccessor.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/IApiAccessor.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/IReadableConfiguration.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/IReadableConfiguration.cs index 76a5f5124fdf..23e1a0c2e197 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/IReadableConfiguration.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/IReadableConfiguration.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs index 4f5c219d5c6e..a1bd6b08f3b1 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index adafe21ea167..fa5137751772 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -100,11 +100,13 @@ public bool Equals(AdditionalPropertiesClass input) ( this.MapProperty == input.MapProperty || this.MapProperty != null && + input.MapProperty != null && this.MapProperty.SequenceEqual(input.MapProperty) ) && ( this.MapOfMapProperty == input.MapOfMapProperty || this.MapOfMapProperty != null && + input.MapOfMapProperty != null && this.MapOfMapProperty.SequenceEqual(input.MapOfMapProperty) ); } diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Animal.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Animal.cs index 16c89207e31d..d158ed573a6d 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Animal.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -55,6 +55,7 @@ protected Animal() { } { this.ClassName = className; } + // use default value if no "color" provided if (color == null) { diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ApiResponse.cs index da35fa03b6dc..ca5099c2e1aa 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs index eb23cf99943f..2ca48dc1b12b 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -91,6 +91,7 @@ public bool Equals(ArrayOfArrayOfNumberOnly input) ( this.ArrayArrayNumber == input.ArrayArrayNumber || this.ArrayArrayNumber != null && + input.ArrayArrayNumber != null && this.ArrayArrayNumber.SequenceEqual(input.ArrayArrayNumber) ); } diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs index a1aac93fc2fa..9b600f4a79ba 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -91,6 +91,7 @@ public bool Equals(ArrayOfNumberOnly input) ( this.ArrayNumber == input.ArrayNumber || this.ArrayNumber != null && + input.ArrayNumber != null && this.ArrayNumber.SequenceEqual(input.ArrayNumber) ); } diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayTest.cs index c99d9289344a..3738a4e44732 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayTest.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -109,16 +109,19 @@ public bool Equals(ArrayTest input) ( this.ArrayOfString == input.ArrayOfString || this.ArrayOfString != null && + input.ArrayOfString != null && this.ArrayOfString.SequenceEqual(input.ArrayOfString) ) && ( this.ArrayArrayOfInteger == input.ArrayArrayOfInteger || this.ArrayArrayOfInteger != null && + input.ArrayArrayOfInteger != null && this.ArrayArrayOfInteger.SequenceEqual(input.ArrayArrayOfInteger) ) && ( this.ArrayArrayOfModel == input.ArrayArrayOfModel || this.ArrayArrayOfModel != null && + input.ArrayArrayOfModel != null && this.ArrayArrayOfModel.SequenceEqual(input.ArrayArrayOfModel) ); } diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Capitalization.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Capitalization.cs index eba3bc685996..058ce89df0d7 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Capitalization.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Capitalization.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Cat.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Cat.cs index 1504638f6f26..8dd338b3e594 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Cat.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/CatAllOf.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/CatAllOf.cs new file mode 100644 index 000000000000..e17ff89769cf --- /dev/null +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/CatAllOf.cs @@ -0,0 +1,124 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// CatAllOf + /// + [DataContract] + public partial class CatAllOf : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// declawed. + public CatAllOf(bool? declawed = default(bool?)) + { + this.Declawed = declawed; + } + + /// + /// Gets or Sets Declawed + /// + [DataMember(Name="declawed", EmitDefaultValue=false)] + public bool? Declawed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class CatAllOf {\n"); + sb.Append(" Declawed: ").Append(Declawed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as CatAllOf); + } + + /// + /// Returns true if CatAllOf instances are equal + /// + /// Instance of CatAllOf to be compared + /// Boolean + public bool Equals(CatAllOf input) + { + if (input == null) + return false; + + return + ( + this.Declawed == input.Declawed || + (this.Declawed != null && + this.Declawed.Equals(input.Declawed)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Declawed != null) + hashCode = hashCode * 59 + this.Declawed.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Category.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Category.cs index a795fc58c582..e8827551b57a 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Category.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -51,6 +51,7 @@ protected Category() { } { this.Name = name; } + this.Id = id; } diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ClassModel.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ClassModel.cs index 30753a34e643..4a7d5372a1a8 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ClassModel.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ClassModel.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Dog.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Dog.cs index ecd67f40b6e2..96e568628fe5 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Dog.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Dog.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/DogAllOf.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/DogAllOf.cs new file mode 100644 index 000000000000..24d4b43de854 --- /dev/null +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/DogAllOf.cs @@ -0,0 +1,124 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// DogAllOf + /// + [DataContract] + public partial class DogAllOf : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// breed. + public DogAllOf(string breed = default(string)) + { + this.Breed = breed; + } + + /// + /// Gets or Sets Breed + /// + [DataMember(Name="breed", EmitDefaultValue=false)] + public string Breed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class DogAllOf {\n"); + sb.Append(" Breed: ").Append(Breed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as DogAllOf); + } + + /// + /// Returns true if DogAllOf instances are equal + /// + /// Instance of DogAllOf to be compared + /// Boolean + public bool Equals(DogAllOf input) + { + if (input == null) + return false; + + return + ( + this.Breed == input.Breed || + (this.Breed != null && + this.Breed.Equals(input.Breed)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Breed != null) + hashCode = hashCode * 59 + this.Breed.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/EnumArrays.cs index 567a207068c2..6887c901d117 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/EnumArrays.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -146,6 +146,7 @@ public bool Equals(EnumArrays input) ( this.ArrayEnum == input.ArrayEnum || this.ArrayEnum != null && + input.ArrayEnum != null && this.ArrayEnum.SequenceEqual(input.ArrayEnum) ); } diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/EnumClass.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/EnumClass.cs index 33643e475f51..96e427f9b327 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/EnumClass.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/EnumClass.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/EnumTest.cs index 381572d5dfe3..a12606e1ad48 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/EnumTest.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/EnumTest.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -140,6 +140,26 @@ public enum EnumNumberEnum [DataMember(Name="enum_number", EmitDefaultValue=false)] public EnumNumberEnum? EnumNumber { get; set; } /// + /// Gets or Sets OuterEnum + /// + [DataMember(Name="outerEnum", EmitDefaultValue=true)] + public OuterEnum? OuterEnum { get; set; } + /// + /// Gets or Sets OuterEnumInteger + /// + [DataMember(Name="outerEnumInteger", EmitDefaultValue=false)] + public OuterEnumInteger? OuterEnumInteger { get; set; } + /// + /// Gets or Sets OuterEnumDefaultValue + /// + [DataMember(Name="outerEnumDefaultValue", EmitDefaultValue=false)] + public OuterEnumDefaultValue? OuterEnumDefaultValue { get; set; } + /// + /// Gets or Sets OuterEnumIntegerDefaultValue + /// + [DataMember(Name="outerEnumIntegerDefaultValue", EmitDefaultValue=false)] + public OuterEnumIntegerDefaultValue? OuterEnumIntegerDefaultValue { get; set; } + /// /// Initializes a new instance of the class. /// [JsonConstructorAttribute] @@ -166,6 +186,8 @@ protected EnumTest() { } { this.EnumStringRequired = enumStringRequired; } + + this.OuterEnum = outerEnum; this.EnumString = enumString; this.EnumInteger = enumInteger; this.EnumNumber = enumNumber; @@ -179,29 +201,9 @@ protected EnumTest() { } - /// - /// Gets or Sets OuterEnum - /// - [DataMember(Name="outerEnum", EmitDefaultValue=false)] - public OuterEnum OuterEnum { get; set; } - /// - /// Gets or Sets OuterEnumInteger - /// - [DataMember(Name="outerEnumInteger", EmitDefaultValue=false)] - public OuterEnumInteger OuterEnumInteger { get; set; } - /// - /// Gets or Sets OuterEnumDefaultValue - /// - [DataMember(Name="outerEnumDefaultValue", EmitDefaultValue=false)] - public OuterEnumDefaultValue OuterEnumDefaultValue { get; set; } - /// - /// Gets or Sets OuterEnumIntegerDefaultValue - /// - [DataMember(Name="outerEnumIntegerDefaultValue", EmitDefaultValue=false)] - public OuterEnumIntegerDefaultValue OuterEnumIntegerDefaultValue { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/File.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/File.cs index 68d564d17e72..3cf268524f93 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/File.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/File.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs index 7853ca2a0de3..73a8b61aa754 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -105,6 +105,7 @@ public bool Equals(FileSchemaTestClass input) ( this.Files == input.Files || this.Files != null && + input.Files != null && this.Files.SequenceEqual(input.Files) ); } diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Foo.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Foo.cs index 394f5adc052a..5f3b3bcd9d52 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Foo.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Foo.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/FormatTest.cs index 195270a84710..490806191177 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/FormatTest.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -64,6 +64,7 @@ protected FormatTest() { } { this.Number = number; } + // to ensure "_byte" is required (not null) if (_byte == null) { @@ -73,6 +74,7 @@ protected FormatTest() { } { this.Byte = _byte; } + // to ensure "date" is required (not null) if (date == null) { @@ -82,6 +84,7 @@ protected FormatTest() { } { this.Date = date; } + // to ensure "password" is required (not null) if (password == null) { @@ -91,6 +94,7 @@ protected FormatTest() { } { this.Password = password; } + this.Integer = integer; this.Int32 = int32; this.Int64 = int64; diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs index 520640366921..10b9939f5ad3 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/HealthCheckResult.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/HealthCheckResult.cs index 08dd777f5b79..dffd3ccfa611 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/HealthCheckResult.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/HealthCheckResult.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -37,12 +37,13 @@ public partial class HealthCheckResult : IEquatable, IValida public HealthCheckResult(string nullableMessage = default(string)) { this.NullableMessage = nullableMessage; + this.NullableMessage = nullableMessage; } /// /// Gets or Sets NullableMessage /// - [DataMember(Name="NullableMessage", EmitDefaultValue=false)] + [DataMember(Name="NullableMessage", EmitDefaultValue=true)] public string NullableMessage { get; set; } /// diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/InlineObject.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/InlineObject.cs index 95ea944a8c61..7a3a6114012c 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/InlineObject.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/InlineObject.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/InlineObject1.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/InlineObject1.cs index 473147e67492..f08aeb4eb375 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/InlineObject1.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/InlineObject1.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/InlineObject2.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/InlineObject2.cs index c354d941f270..5e512e7d3b94 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/InlineObject2.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/InlineObject2.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -158,6 +158,7 @@ public bool Equals(InlineObject2 input) ( this.EnumFormStringArray == input.EnumFormStringArray || this.EnumFormStringArray != null && + input.EnumFormStringArray != null && this.EnumFormStringArray.SequenceEqual(input.EnumFormStringArray) ) && ( diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/InlineObject3.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/InlineObject3.cs index cb7c53f698de..94f52f75aa78 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/InlineObject3.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/InlineObject3.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -63,6 +63,7 @@ protected InlineObject3() { } { this.Number = number; } + // to ensure "_double" is required (not null) if (_double == null) { @@ -72,6 +73,7 @@ protected InlineObject3() { } { this.Double = _double; } + // to ensure "patternWithoutDelimiter" is required (not null) if (patternWithoutDelimiter == null) { @@ -81,6 +83,7 @@ protected InlineObject3() { } { this.PatternWithoutDelimiter = patternWithoutDelimiter; } + // to ensure "_byte" is required (not null) if (_byte == null) { @@ -90,6 +93,7 @@ protected InlineObject3() { } { this.Byte = _byte; } + this.Integer = integer; this.Int32 = int32; this.Int64 = int64; diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/InlineObject4.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/InlineObject4.cs index 70326154bfce..9eeacab7bfb1 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/InlineObject4.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/InlineObject4.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -51,6 +51,7 @@ protected InlineObject4() { } { this.Param = param; } + // to ensure "param2" is required (not null) if (param2 == null) { @@ -60,6 +61,7 @@ protected InlineObject4() { } { this.Param2 = param2; } + } /// diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/InlineObject5.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/InlineObject5.cs index 8821e41a8ac7..5b4bc2256d4f 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/InlineObject5.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/InlineObject5.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -51,6 +51,7 @@ protected InlineObject5() { } { this.RequiredFile = requiredFile; } + this.AdditionalMetadata = additionalMetadata; } diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/InlineResponseDefault.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/InlineResponseDefault.cs index a264f2e0b2fb..a553a49ec799 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/InlineResponseDefault.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/InlineResponseDefault.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/List.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/List.cs index 14c7ed746a0e..6b3ace11cf4e 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/List.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/List.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/MapTest.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/MapTest.cs index 3f44bcf22eaa..01f5a9b7840f 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/MapTest.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -139,21 +139,25 @@ public bool Equals(MapTest input) ( this.MapMapOfString == input.MapMapOfString || this.MapMapOfString != null && + input.MapMapOfString != null && this.MapMapOfString.SequenceEqual(input.MapMapOfString) ) && ( this.MapOfEnumString == input.MapOfEnumString || this.MapOfEnumString != null && + input.MapOfEnumString != null && this.MapOfEnumString.SequenceEqual(input.MapOfEnumString) ) && ( this.DirectMap == input.DirectMap || this.DirectMap != null && + input.DirectMap != null && this.DirectMap.SequenceEqual(input.DirectMap) ) && ( this.IndirectMap == input.IndirectMap || this.IndirectMap != null && + input.IndirectMap != null && this.IndirectMap.SequenceEqual(input.IndirectMap) ); } diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 19df6fd34891..c9cf10c0cb28 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -119,6 +119,7 @@ public bool Equals(MixedPropertiesAndAdditionalPropertiesClass input) ( this.Map == input.Map || this.Map != null && + input.Map != null && this.Map.SequenceEqual(input.Map) ); } diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Model200Response.cs index 69767330c053..9abadca143f1 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Model200Response.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Model200Response.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ModelClient.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ModelClient.cs index 2e9d79ef1419..2d93513c7681 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ModelClient.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ModelClient.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Name.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Name.cs index 68f848ca0915..603c7d887078 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Name.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -51,6 +51,7 @@ protected Name() { } { this._Name = name; } + this.Property = property; } diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/NullableClass.cs index 2feb2eb9aead..c7aefda57568 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/NullableClass.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/NullableClass.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -47,6 +47,16 @@ public partial class NullableClass : Dictionary, IEquatableobjectItemsNullable. public NullableClass(int? integerProp = default(int?), decimal? numberProp = default(decimal?), bool? booleanProp = default(bool?), string stringProp = default(string), DateTime? dateProp = default(DateTime?), DateTime? datetimeProp = default(DateTime?), List arrayNullableProp = default(List), List arrayAndItemsNullableProp = default(List), List arrayItemsNullable = default(List), Dictionary objectNullableProp = default(Dictionary), Dictionary objectAndItemsNullableProp = default(Dictionary), Dictionary objectItemsNullable = default(Dictionary)) : base() { + this.IntegerProp = integerProp; + this.NumberProp = numberProp; + this.BooleanProp = booleanProp; + this.StringProp = stringProp; + this.DateProp = dateProp; + this.DatetimeProp = datetimeProp; + this.ArrayNullableProp = arrayNullableProp; + this.ArrayAndItemsNullableProp = arrayAndItemsNullableProp; + this.ObjectNullableProp = objectNullableProp; + this.ObjectAndItemsNullableProp = objectAndItemsNullableProp; this.IntegerProp = integerProp; this.NumberProp = numberProp; this.BooleanProp = booleanProp; @@ -64,50 +74,50 @@ public partial class NullableClass : Dictionary, IEquatable /// Gets or Sets IntegerProp /// - [DataMember(Name="integer_prop", EmitDefaultValue=false)] + [DataMember(Name="integer_prop", EmitDefaultValue=true)] public int? IntegerProp { get; set; } /// /// Gets or Sets NumberProp /// - [DataMember(Name="number_prop", EmitDefaultValue=false)] + [DataMember(Name="number_prop", EmitDefaultValue=true)] public decimal? NumberProp { get; set; } /// /// Gets or Sets BooleanProp /// - [DataMember(Name="boolean_prop", EmitDefaultValue=false)] + [DataMember(Name="boolean_prop", EmitDefaultValue=true)] public bool? BooleanProp { get; set; } /// /// Gets or Sets StringProp /// - [DataMember(Name="string_prop", EmitDefaultValue=false)] + [DataMember(Name="string_prop", EmitDefaultValue=true)] public string StringProp { get; set; } /// /// Gets or Sets DateProp /// - [DataMember(Name="date_prop", EmitDefaultValue=false)] + [DataMember(Name="date_prop", EmitDefaultValue=true)] [JsonConverter(typeof(OpenAPIDateConverter))] public DateTime? DateProp { get; set; } /// /// Gets or Sets DatetimeProp /// - [DataMember(Name="datetime_prop", EmitDefaultValue=false)] + [DataMember(Name="datetime_prop", EmitDefaultValue=true)] public DateTime? DatetimeProp { get; set; } /// /// Gets or Sets ArrayNullableProp /// - [DataMember(Name="array_nullable_prop", EmitDefaultValue=false)] + [DataMember(Name="array_nullable_prop", EmitDefaultValue=true)] public List ArrayNullableProp { get; set; } /// /// Gets or Sets ArrayAndItemsNullableProp /// - [DataMember(Name="array_and_items_nullable_prop", EmitDefaultValue=false)] + [DataMember(Name="array_and_items_nullable_prop", EmitDefaultValue=true)] public List ArrayAndItemsNullableProp { get; set; } /// @@ -119,13 +129,13 @@ public partial class NullableClass : Dictionary, IEquatable /// Gets or Sets ObjectNullableProp /// - [DataMember(Name="object_nullable_prop", EmitDefaultValue=false)] + [DataMember(Name="object_nullable_prop", EmitDefaultValue=true)] public Dictionary ObjectNullableProp { get; set; } /// /// Gets or Sets ObjectAndItemsNullableProp /// - [DataMember(Name="object_and_items_nullable_prop", EmitDefaultValue=false)] + [DataMember(Name="object_and_items_nullable_prop", EmitDefaultValue=true)] public Dictionary ObjectAndItemsNullableProp { get; set; } /// @@ -222,31 +232,37 @@ public bool Equals(NullableClass input) ( this.ArrayNullableProp == input.ArrayNullableProp || this.ArrayNullableProp != null && + input.ArrayNullableProp != null && this.ArrayNullableProp.SequenceEqual(input.ArrayNullableProp) ) && base.Equals(input) && ( this.ArrayAndItemsNullableProp == input.ArrayAndItemsNullableProp || this.ArrayAndItemsNullableProp != null && + input.ArrayAndItemsNullableProp != null && this.ArrayAndItemsNullableProp.SequenceEqual(input.ArrayAndItemsNullableProp) ) && base.Equals(input) && ( this.ArrayItemsNullable == input.ArrayItemsNullable || this.ArrayItemsNullable != null && + input.ArrayItemsNullable != null && this.ArrayItemsNullable.SequenceEqual(input.ArrayItemsNullable) ) && base.Equals(input) && ( this.ObjectNullableProp == input.ObjectNullableProp || this.ObjectNullableProp != null && + input.ObjectNullableProp != null && this.ObjectNullableProp.SequenceEqual(input.ObjectNullableProp) ) && base.Equals(input) && ( this.ObjectAndItemsNullableProp == input.ObjectAndItemsNullableProp || this.ObjectAndItemsNullableProp != null && + input.ObjectAndItemsNullableProp != null && this.ObjectAndItemsNullableProp.SequenceEqual(input.ObjectAndItemsNullableProp) ) && base.Equals(input) && ( this.ObjectItemsNullable == input.ObjectItemsNullable || this.ObjectItemsNullable != null && + input.ObjectItemsNullable != null && this.ObjectItemsNullable.SequenceEqual(input.ObjectItemsNullable) ); } diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/NumberOnly.cs index 0d3c613d18bc..00a4f3281e3e 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/NumberOnly.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Order.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Order.cs index f895f035192b..6bc71d339cca 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Order.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/OuterComposite.cs index 3bb725402152..7a1aaea94e38 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/OuterComposite.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/OuterEnum.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/OuterEnum.cs index be116aff60ab..e902802e0d60 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/OuterEnum.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/OuterEnum.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs index a49b7640982d..196d097f9584 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/OuterEnumInteger.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/OuterEnumInteger.cs index ea69ed635c87..55aec73401f7 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/OuterEnumInteger.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/OuterEnumInteger.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs index c1262d92aa4c..e265103c92a5 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Pet.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Pet.cs index 1e213e5006ad..83103aaf28ee 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Pet.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -88,6 +88,7 @@ protected Pet() { } { this.Name = name; } + // to ensure "photoUrls" is required (not null) if (photoUrls == null) { @@ -97,6 +98,7 @@ protected Pet() { } { this.PhotoUrls = photoUrls; } + this.Id = id; this.Category = category; this.Tags = tags; @@ -200,11 +202,13 @@ public bool Equals(Pet input) ( this.PhotoUrls == input.PhotoUrls || this.PhotoUrls != null && + input.PhotoUrls != null && this.PhotoUrls.SequenceEqual(input.PhotoUrls) ) && ( this.Tags == input.Tags || this.Tags != null && + input.Tags != null && this.Tags.SequenceEqual(input.Tags) ) && ( diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs index 6e82eb5819e2..bb1c7edde085 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Return.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Return.cs index 401b8e2c70d4..f66b4ae50fb1 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Return.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Return.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/SpecialModelName.cs index 54ea66dd81b2..32c04672a4ff 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/SpecialModelName.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Tag.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Tag.cs index f95860219eeb..9929598f0e67 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Tag.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/User.cs b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/User.cs index cf491294ec95..173ac15c2dc6 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/User.cs +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/User.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Org.OpenAPITools.csproj index af2274727547..9356e9991f69 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -4,7 +4,7 @@ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 --> @@ -28,6 +28,7 @@ OpenAPI spec version: 1.0.0 DEBUG;TRACE prompt 4 + bin\Debug\Org.OpenAPITools.xml pdbonly @@ -36,6 +37,7 @@ OpenAPI spec version: 1.0.0 TRACE prompt 4 + bin\Release\Org.OpenAPITools.xml @@ -48,16 +50,16 @@ OpenAPI spec version: 1.0.0 - $(SolutionDir)\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll - ..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll - ..\..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll - ..\..\vendor\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll + $(SolutionDir)\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll + ..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll + ..\..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll + ..\..\vendor\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll - $(SolutionDir)\packages\JsonSubTypes.1.2.0\lib\net45\JsonSubTypes.dll - ..\packages\JsonSubTypes.1.2.0\lib\net45\JsonSubTypes.dll - ..\..\packages\JsonSubTypes.1.2.0\lib\net45\JsonSubTypes.dll - ..\..\vendor\JsonSubTypes.1.2.0\lib\net45\JsonSubTypes.dll + $(SolutionDir)\packages\JsonSubTypes.1.5.2\lib\net45\JsonSubTypes.dll + ..\packages\JsonSubTypes.1.5.2\lib\net45\JsonSubTypes.dll + ..\..\packages\JsonSubTypes.1.5.2\lib\net45\JsonSubTypes.dll + ..\..\vendor\JsonSubTypes.1.5.2\lib\net45\JsonSubTypes.dll $(SolutionDir)\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Org.OpenAPITools.nuspec b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Org.OpenAPITools.nuspec index c49c57e44030..c275a14d2af5 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Org.OpenAPITools.nuspec +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Org.OpenAPITools.nuspec @@ -25,8 +25,8 @@ - - + + diff --git a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/packages.config b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/packages.config index 3caf34e0d765..a970e5e3a960 100644 --- a/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/packages.config +++ b/samples/openapi3/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/packages.config @@ -1,6 +1,6 @@ - - + + diff --git a/samples/openapi3/client/petstore/elm/.openapi-generator/VERSION b/samples/openapi3/client/petstore/elm/.openapi-generator/VERSION index 479c313e87b9..83a328a9227e 100644 --- a/samples/openapi3/client/petstore/elm/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/elm/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.3-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/.gitignore b/samples/openapi3/client/petstore/go-experimental/go-petstore/.gitignore new file mode 100644 index 000000000000..daf913b1b347 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/.gitignore @@ -0,0 +1,24 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/.openapi-generator-ignore b/samples/openapi3/client/petstore/go-experimental/go-petstore/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/.openapi-generator/VERSION b/samples/openapi3/client/petstore/go-experimental/go-petstore/.openapi-generator/VERSION new file mode 100644 index 000000000000..83a328a9227e --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/.openapi-generator/VERSION @@ -0,0 +1 @@ +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/.travis.yml b/samples/openapi3/client/petstore/go-experimental/go-petstore/.travis.yml new file mode 100644 index 000000000000..f5cb2ce9a5aa --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/.travis.yml @@ -0,0 +1,8 @@ +language: go + +install: + - go get -d -v . + +script: + - go build -v ./ + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/README.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/README.md new file mode 100644 index 000000000000..041ec013dafa --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/README.md @@ -0,0 +1,240 @@ +# Go API client for openapi + +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientExperimentalCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/oauth2 +go get golang.org/x/net/context +go get github.com/antihax/optional +``` + +Put the package under your project folder and add the following in import: + +```golang +import "./openapi" +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AnotherFakeApi* | [**Call123TestSpecialTags**](docs/AnotherFakeApi.md#call123testspecialtags) | **Patch** /another-fake/dummy | To test special tags +*DefaultApi* | [**FooGet**](docs/DefaultApi.md#fooget) | **Get** /foo | +*FakeApi* | [**FakeHealthGet**](docs/FakeApi.md#fakehealthget) | **Get** /fake/health | Health check endpoint +*FakeApi* | [**FakeOuterBooleanSerialize**](docs/FakeApi.md#fakeouterbooleanserialize) | **Post** /fake/outer/boolean | +*FakeApi* | [**FakeOuterCompositeSerialize**](docs/FakeApi.md#fakeoutercompositeserialize) | **Post** /fake/outer/composite | +*FakeApi* | [**FakeOuterNumberSerialize**](docs/FakeApi.md#fakeouternumberserialize) | **Post** /fake/outer/number | +*FakeApi* | [**FakeOuterStringSerialize**](docs/FakeApi.md#fakeouterstringserialize) | **Post** /fake/outer/string | +*FakeApi* | [**TestBodyWithFileSchema**](docs/FakeApi.md#testbodywithfileschema) | **Put** /fake/body-with-file-schema | +*FakeApi* | [**TestBodyWithQueryParams**](docs/FakeApi.md#testbodywithqueryparams) | **Put** /fake/body-with-query-params | +*FakeApi* | [**TestClientModel**](docs/FakeApi.md#testclientmodel) | **Patch** /fake | To test \"client\" model +*FakeApi* | [**TestEndpointParameters**](docs/FakeApi.md#testendpointparameters) | **Post** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeApi* | [**TestEnumParameters**](docs/FakeApi.md#testenumparameters) | **Get** /fake | To test enum parameters +*FakeApi* | [**TestGroupParameters**](docs/FakeApi.md#testgroupparameters) | **Delete** /fake | Fake endpoint to test group parameters (optional) +*FakeApi* | [**TestInlineAdditionalProperties**](docs/FakeApi.md#testinlineadditionalproperties) | **Post** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**TestJsonFormData**](docs/FakeApi.md#testjsonformdata) | **Get** /fake/jsonFormData | test json serialization of form data +*FakeClassnameTags123Api* | [**TestClassname**](docs/FakeClassnameTags123Api.md#testclassname) | **Patch** /fake_classname_test | To test class name in snake case +*PetApi* | [**AddPet**](docs/PetApi.md#addpet) | **Post** /pet | Add a new pet to the store +*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* | [**UpdatePet**](docs/PetApi.md#updatepet) | **Put** /pet | Update an existing pet +*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 +*PetApi* | [**UploadFileWithRequiredFile**](docs/PetApi.md#uploadfilewithrequiredfile) | **Post** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) +*StoreApi* | [**DeleteOrder**](docs/StoreApi.md#deleteorder) | **Delete** /store/order/{order_id} | Delete purchase order by ID +*StoreApi* | [**GetInventory**](docs/StoreApi.md#getinventory) | **Get** /store/inventory | Returns pet inventories by status +*StoreApi* | [**GetOrderById**](docs/StoreApi.md#getorderbyid) | **Get** /store/order/{order_id} | Find purchase order by ID +*StoreApi* | [**PlaceOrder**](docs/StoreApi.md#placeorder) | **Post** /store/order | Place an order for a pet +*UserApi* | [**CreateUser**](docs/UserApi.md#createuser) | **Post** /user | Create user +*UserApi* | [**CreateUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **Post** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**CreateUsersWithListInput**](docs/UserApi.md#createuserswithlistinput) | **Post** /user/createWithList | Creates list of users with given input array +*UserApi* | [**DeleteUser**](docs/UserApi.md#deleteuser) | **Delete** /user/{username} | Delete user +*UserApi* | [**GetUserByName**](docs/UserApi.md#getuserbyname) | **Get** /user/{username} | Get user by user name +*UserApi* | [**LoginUser**](docs/UserApi.md#loginuser) | **Get** /user/login | Logs user into the system +*UserApi* | [**LogoutUser**](docs/UserApi.md#logoutuser) | **Get** /user/logout | Logs out current logged in user session +*UserApi* | [**UpdateUser**](docs/UserApi.md#updateuser) | **Put** /user/{username} | Updated user + + +## Documentation For Models + + - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) + - [Animal](docs/Animal.md) + - [ApiResponse](docs/ApiResponse.md) + - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) + - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) + - [ArrayTest](docs/ArrayTest.md) + - [Capitalization](docs/Capitalization.md) + - [Cat](docs/Cat.md) + - [CatAllOf](docs/CatAllOf.md) + - [Category](docs/Category.md) + - [ClassModel](docs/ClassModel.md) + - [Client](docs/Client.md) + - [Dog](docs/Dog.md) + - [DogAllOf](docs/DogAllOf.md) + - [EnumArrays](docs/EnumArrays.md) + - [EnumClass](docs/EnumClass.md) + - [EnumTest](docs/EnumTest.md) + - [File](docs/File.md) + - [FileSchemaTestClass](docs/FileSchemaTestClass.md) + - [Foo](docs/Foo.md) + - [FormatTest](docs/FormatTest.md) + - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [HealthCheckResult](docs/HealthCheckResult.md) + - [InlineObject](docs/InlineObject.md) + - [InlineObject1](docs/InlineObject1.md) + - [InlineObject2](docs/InlineObject2.md) + - [InlineObject3](docs/InlineObject3.md) + - [InlineObject4](docs/InlineObject4.md) + - [InlineObject5](docs/InlineObject5.md) + - [InlineResponseDefault](docs/InlineResponseDefault.md) + - [List](docs/List.md) + - [MapTest](docs/MapTest.md) + - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) + - [Model200Response](docs/Model200Response.md) + - [Name](docs/Name.md) + - [NullableClass](docs/NullableClass.md) + - [NumberOnly](docs/NumberOnly.md) + - [Order](docs/Order.md) + - [OuterComposite](docs/OuterComposite.md) + - [OuterEnum](docs/OuterEnum.md) + - [OuterEnumDefaultValue](docs/OuterEnumDefaultValue.md) + - [OuterEnumInteger](docs/OuterEnumInteger.md) + - [OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md) + - [Pet](docs/Pet.md) + - [ReadOnlyFirst](docs/ReadOnlyFirst.md) + - [Return](docs/Return.md) + - [SpecialModelName](docs/SpecialModelName.md) + - [Tag](docs/Tag.md) + - [User](docs/User.md) + + +## Documentation For Authorization + + + +## api_key + +- **Type**: API key + +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextAPIKey, sw.APIKey{ + Key: "APIKEY", + Prefix: "Bearer", // Omit if not necessary. +}) +r, err := client.Service.Operation(auth, args) +``` + + +## api_key_query + +- **Type**: API key + +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextAPIKey, sw.APIKey{ + Key: "APIKEY", + Prefix: "Bearer", // Omit if not necessary. +}) +r, err := client.Service.Operation(auth, args) +``` + + +## bearer_test + +- **Type**: HTTP basic authentication + +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ + UserName: "username", + Password: "password", +}) +r, err := client.Service.Operation(auth, args) +``` + + +## http_basic_test + +- **Type**: HTTP basic authentication + +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ + UserName: "username", + Password: "password", +}) +r, err := client.Service.Operation(auth, args) +``` + + +## petstore_auth + + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - **write:pets**: modify pets in your account + - **read:pets**: read your pets + +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextAccessToken, "ACCESSTOKENSTRING") +r, err := client.Service.Operation(auth, args) +``` + +Or via OAuth2 module to automatically refresh tokens and perform user authentication. + +```golang +import "golang.org/x/oauth2" + +/* Perform OAuth2 round trip request and obtain a token */ + +tokenSource := oauth2cfg.TokenSource(createContext(httpClient), &token) +auth := context.WithValue(oauth2.NoContext, sw.ContextOAuth2, tokenSource) +r, err := client.Service.Operation(auth, args) +``` + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/api/openapi.yaml b/samples/openapi3/client/petstore/go-experimental/go-petstore/api/openapi.yaml new file mode 100644 index 000000000000..95b487afebfc --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/api/openapi.yaml @@ -0,0 +1,2004 @@ +openapi: 3.0.0 +info: + description: 'This spec is mainly for testing Petstore server and contains fake + endpoints, models. Please do not use this for any other purpose. Special characters: + " \' + license: + name: Apache-2.0 + url: http://www.apache.org/licenses/LICENSE-2.0.html + title: OpenAPI Petstore + version: 1.0.0 +servers: +- description: petstore server + url: http://{server}.swagger.io:{port}/v2 + variables: + server: + default: petstore + enum: + - petstore + - qa-petstore + - dev-petstore + port: + default: "80" + enum: + - "80" + - "8080" +- description: The local server + url: https://localhost:8080/{version} + variables: + version: + default: v2 + enum: + - v1 + - v2 +tags: +- description: Everything about your Pets + name: pet +- description: Access to Petstore orders + name: store +- description: Operations about user + name: user +paths: + /foo: + get: + responses: + default: + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_default' + description: response + /pet: + post: + operationId: addPet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + 405: + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Add a new pet to the store + tags: + - pet + put: + operationId: updatePet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + 400: + description: Invalid ID supplied + 404: + description: Pet not found + 405: + description: Validation exception + security: + - petstore_auth: + - write:pets + - read:pets + summary: Update an existing pet + tags: + - pet + servers: + - url: http://petstore.swagger.io/v2 + - url: http://path-server-test.petstore.local/v2 + /pet/findByStatus: + get: + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - description: Status values that need to be considered for filter + explode: false + in: query + name: status + required: true + schema: + items: + default: available + enum: + - available + - pending + - sold + type: string + type: array + style: form + responses: + 200: + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + 400: + description: Invalid status value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by status + tags: + - pet + /pet/findByTags: + get: + deprecated: true + description: Multiple tags can be provided with comma separated strings. Use + tag1, tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + style: form + responses: + 200: + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + 400: + description: Invalid tag value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by tags + tags: + - pet + /pet/{petId}: + delete: + operationId: deletePet + parameters: + - explode: false + in: header + name: api_key + required: false + schema: + type: string + style: simple + - description: Pet id to delete + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + 400: + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Deletes a pet + tags: + - pet + get: + description: Returns a single pet + operationId: getPetById + parameters: + - description: ID of pet to return + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + 200: + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation + 400: + description: Invalid ID supplied + 404: + description: Pet not found + security: + - api_key: [] + summary: Find pet by ID + tags: + - pet + post: + operationId: updatePetWithForm + parameters: + - description: ID of pet that needs to be updated + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + $ref: '#/components/requestBodies/inline_object' + content: + application/x-www-form-urlencoded: + schema: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + type: object + responses: + 405: + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Updates a pet in the store with form data + tags: + - pet + /pet/{petId}/uploadImage: + post: + operationId: uploadFile + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + $ref: '#/components/requestBodies/inline_object_1' + content: + multipart/form-data: + schema: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + type: object + responses: + 200: + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image + tags: + - pet + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + 200: + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + /store/order: + post: + operationId: placeOrder + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + responses: + 200: + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + 400: + description: Invalid Order + summary: Place an order for a pet + tags: + - store + /store/order/{order_id}: + delete: + description: For valid response try integer IDs with value < 1000. Anything + above 1000 or nonintegers will generate API errors + operationId: deleteOrder + parameters: + - description: ID of the order that needs to be deleted + explode: false + in: path + name: order_id + required: true + schema: + type: string + style: simple + responses: + 400: + description: Invalid ID supplied + 404: + description: Order not found + summary: Delete purchase order by ID + tags: + - store + get: + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generated exceptions + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + explode: false + in: path + name: order_id + required: true + schema: + format: int64 + maximum: 5 + minimum: 1 + type: integer + style: simple + responses: + 200: + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + 400: + description: Invalid ID supplied + 404: + description: Order not found + summary: Find purchase order by ID + tags: + - store + /user: + post: + description: This can only be done by the logged in user. + operationId: createUser + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + responses: + default: + description: successful operation + summary: Create user + tags: + - user + /user/createWithArray: + post: + operationId: createUsersWithArrayInput + requestBody: + $ref: '#/components/requestBodies/UserArray' + responses: + default: + description: successful operation + summary: Creates list of users with given input array + tags: + - user + /user/createWithList: + post: + operationId: createUsersWithListInput + requestBody: + $ref: '#/components/requestBodies/UserArray' + responses: + default: + description: successful operation + summary: Creates list of users with given input array + tags: + - user + /user/login: + get: + operationId: loginUser + parameters: + - description: The user name for login + explode: true + in: query + name: username + required: true + schema: + type: string + style: form + - description: The password for login in clear text + explode: true + in: query + name: password + required: true + schema: + type: string + style: form + responses: + 200: + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + explode: false + schema: + format: int32 + type: integer + style: simple + X-Expires-After: + description: date in UTC when token expires + explode: false + schema: + format: date-time + type: string + style: simple + 400: + description: Invalid username/password supplied + summary: Logs user into the system + tags: + - user + /user/logout: + get: + operationId: logoutUser + responses: + default: + description: successful operation + summary: Logs out current logged in user session + tags: + - user + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + 400: + description: Invalid username supplied + 404: + description: User not found + summary: Delete user + tags: + - user + get: + operationId: getUserByName + parameters: + - description: The name that needs to be fetched. Use user1 for testing. + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + 200: + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + description: successful operation + 400: + description: Invalid username supplied + 404: + description: User not found + summary: Get user by user name + tags: + - user + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + responses: + 400: + description: Invalid user supplied + 404: + description: User not found + summary: Updated user + tags: + - user + /fake_classname_test: + patch: + description: To test class name in snake case + operationId: testClassname + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + 200: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + security: + - api_key_query: [] + summary: To test class name in snake case + tags: + - fake_classname_tags 123#$%^ + /fake: + delete: + description: Fake endpoint to test group parameters (optional) + operationId: testGroupParameters + parameters: + - description: Required String in group parameters + explode: true + in: query + name: required_string_group + required: true + schema: + type: integer + style: form + - description: Required Boolean in group parameters + explode: false + in: header + name: required_boolean_group + required: true + schema: + type: boolean + style: simple + - description: Required Integer in group parameters + explode: true + in: query + name: required_int64_group + required: true + schema: + format: int64 + type: integer + style: form + - description: String in group parameters + explode: true + in: query + name: string_group + required: false + schema: + type: integer + style: form + - description: Boolean in group parameters + explode: false + in: header + name: boolean_group + required: false + schema: + type: boolean + style: simple + - description: Integer in group parameters + explode: true + in: query + name: int64_group + required: false + schema: + format: int64 + type: integer + style: form + responses: + 400: + description: Someting wrong + security: + - bearer_test: [] + summary: Fake endpoint to test group parameters (optional) + tags: + - fake + x-group-parameters: true + get: + description: To test enum parameters + operationId: testEnumParameters + parameters: + - description: Header parameter enum test (string array) + explode: false + in: header + name: enum_header_string_array + required: false + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: simple + - description: Header parameter enum test (string) + explode: false + in: header + name: enum_header_string + required: false + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + style: simple + - description: Query parameter enum test (string array) + explode: true + in: query + name: enum_query_string_array + required: false + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: form + - description: Query parameter enum test (string) + explode: true + in: query + name: enum_query_string + required: false + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + style: form + - description: Query parameter enum test (double) + explode: true + in: query + name: enum_query_integer + required: false + schema: + enum: + - 1 + - -2 + format: int32 + type: integer + style: form + - description: Query parameter enum test (double) + explode: true + in: query + name: enum_query_double + required: false + schema: + enum: + - 1.1 + - -1.2 + format: double + type: number + style: form + requestBody: + $ref: '#/components/requestBodies/inline_object_2' + content: + application/x-www-form-urlencoded: + schema: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + type: object + responses: + 400: + description: Invalid request + 404: + description: Not found + summary: To test enum parameters + tags: + - fake + patch: + description: To test "client" model + operationId: testClientModel + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + 200: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test "client" model + tags: + - fake + post: + description: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + requestBody: + $ref: '#/components/requestBodies/inline_object_3' + content: + application/x-www-form-urlencoded: + schema: + properties: + integer: + description: None + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: /[a-z]/i + type: string + pattern_without_delimiter: + description: None + pattern: ^[A-Z].* + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + type: object + responses: + 400: + description: Invalid username supplied + 404: + description: User not found + security: + - http_basic_test: [] + summary: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + tags: + - fake + /fake/outer/number: + post: + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterNumber' + description: Input number as post body + responses: + 200: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Output number + tags: + - fake + /fake/outer/string: + post: + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterString' + description: Input string as post body + responses: + 200: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Output string + tags: + - fake + /fake/outer/boolean: + post: + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Input boolean as post body + responses: + 200: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Output boolean + tags: + - fake + /fake/outer/composite: + post: + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterComposite' + description: Input composite as post body + responses: + 200: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Output composite + tags: + - fake + /fake/jsonFormData: + get: + operationId: testJsonFormData + requestBody: + $ref: '#/components/requestBodies/inline_object_4' + content: + application/x-www-form-urlencoded: + schema: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + type: object + responses: + 200: + description: successful operation + summary: test json serialization of form data + tags: + - fake + /fake/inline-additionalProperties: + post: + operationId: testInlineAdditionalProperties + requestBody: + content: + application/json: + schema: + additionalProperties: + type: string + type: object + description: request body + required: true + responses: + 200: + description: successful operation + summary: test inline additionalProperties + tags: + - fake + /fake/body-with-query-params: + put: + operationId: testBodyWithQueryParams + parameters: + - explode: true + in: query + name: query + required: true + schema: + type: string + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + responses: + 200: + description: Success + tags: + - fake + /another-fake/dummy: + patch: + description: To test special tags and operation ID starting with number + operationId: 123_test_@#$%_special_tags + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + 200: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test special tags + tags: + - $another-fake? + /fake/body-with-file-schema: + put: + description: For this test, the body for this request much reference a schema + named `File`. + operationId: testBodyWithFileSchema + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FileSchemaTestClass' + required: true + responses: + 200: + description: Success + tags: + - fake + /fake/{petId}/uploadImageWithRequiredFile: + post: + operationId: uploadFileWithRequiredFile + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + $ref: '#/components/requestBodies/inline_object_5' + content: + multipart/form-data: + schema: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile + type: object + responses: + 200: + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image (required) + tags: + - pet + /fake/health: + get: + responses: + 200: + content: + application/json: + schema: + $ref: '#/components/schemas/HealthCheckResult' + description: The instance started successfully + summary: Health check endpoint + tags: + - fake +components: + requestBodies: + UserArray: + content: + application/json: + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + Client: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + inline_object: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/inline_object' + inline_object_1: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/inline_object_1' + inline_object_2: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/inline_object_2' + inline_object_3: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/inline_object_3' + inline_object_4: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/inline_object_4' + inline_object_5: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/inline_object_5' + schemas: + Foo: + example: + bar: bar + properties: + bar: + default: bar + type: string + type: object + Bar: + default: bar + type: string + Order: + example: + petId: 6 + quantity: 1 + id: 0 + shipDate: 2000-01-23T04:56:07.000+00:00 + complete: false + status: placed + properties: + id: + format: int64 + type: integer + petId: + format: int64 + type: integer + quantity: + format: int32 + type: integer + shipDate: + format: date-time + type: string + status: + description: Order Status + enum: + - placed + - approved + - delivered + type: string + complete: + default: false + type: boolean + type: object + xml: + name: Order + Category: + example: + name: default-name + id: 6 + properties: + id: + format: int64 + type: integer + name: + default: default-name + type: string + required: + - name + type: object + xml: + name: Category + User: + example: + firstName: firstName + lastName: lastName + password: password + userStatus: 6 + phone: phone + id: 0 + email: email + username: username + properties: + id: + format: int64 + type: integer + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + description: User Status + format: int32 + type: integer + type: object + xml: + name: User + Tag: + example: + name: name + id: 1 + properties: + id: + format: int64 + type: integer + name: + type: string + type: object + xml: + name: Tag + Pet: + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: default-name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available + properties: + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie + type: string + photoUrls: + items: + type: string + type: array + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + type: object + xml: + name: Pet + ApiResponse: + example: + code: 0 + type: type + message: message + properties: + code: + format: int32 + type: integer + type: + type: string + message: + type: string + type: object + Return: + description: Model for testing reserved words + properties: + return: + format: int32 + type: integer + xml: + name: Return + Name: + description: Model for testing model name same as property name + properties: + name: + format: int32 + type: integer + snake_case: + format: int32 + readOnly: true + type: integer + property: + type: string + 123Number: + readOnly: true + type: integer + required: + - name + xml: + name: Name + 200_response: + description: Model for testing model name starting with number + properties: + name: + format: int32 + type: integer + class: + type: string + xml: + name: Name + ClassModel: + description: Model for testing model with "_class" property + properties: + _class: + type: string + Dog: + allOf: + - $ref: '#/components/schemas/Animal' + - $ref: '#/components/schemas/Dog_allOf' + Cat: + allOf: + - $ref: '#/components/schemas/Animal' + - $ref: '#/components/schemas/Cat_allOf' + Animal: + discriminator: + propertyName: className + properties: + className: + type: string + color: + default: red + type: string + required: + - className + type: object + AnimalFarm: + items: + $ref: '#/components/schemas/Animal' + type: array + format_test: + properties: + integer: + maximum: 100 + minimum: 10 + type: integer + int32: + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + format: int64 + type: integer + number: + maximum: 543.2 + minimum: 32.1 + type: number + float: + format: float + maximum: 987.6 + minimum: 54.3 + type: number + double: + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + pattern: /[a-z]/i + type: string + byte: + format: byte + type: string + binary: + format: binary + type: string + date: + format: date + type: string + dateTime: + format: date-time + type: string + uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + type: string + password: + format: password + maxLength: 64 + minLength: 10 + type: string + pattern_with_digits: + description: A string that is a 10 digit number. Can have leading zeros. + pattern: ^\d{10}$ + type: string + pattern_with_digits_and_delimiter: + description: A string starting with 'image_' (case insensitive) and one + to three digits following i.e. Image_01. + pattern: /^image_\d{1,3}$/i + type: string + required: + - byte + - date + - number + - password + type: object + EnumClass: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + Enum_Test: + properties: + enum_string: + enum: + - UPPER + - lower + - "" + type: string + enum_string_required: + enum: + - UPPER + - lower + - "" + type: string + enum_integer: + enum: + - 1 + - -1 + format: int32 + type: integer + enum_number: + enum: + - 1.1 + - -1.2 + format: double + type: number + outerEnum: + $ref: '#/components/schemas/OuterEnum' + outerEnumInteger: + $ref: '#/components/schemas/OuterEnumInteger' + outerEnumDefaultValue: + $ref: '#/components/schemas/OuterEnumDefaultValue' + outerEnumIntegerDefaultValue: + $ref: '#/components/schemas/OuterEnumIntegerDefaultValue' + required: + - enum_string_required + type: object + AdditionalPropertiesClass: + properties: + map_property: + additionalProperties: + type: string + type: object + map_of_map_property: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + type: object + MixedPropertiesAndAdditionalPropertiesClass: + properties: + uuid: + format: uuid + type: string + dateTime: + format: date-time + type: string + map: + additionalProperties: + $ref: '#/components/schemas/Animal' + type: object + type: object + List: + properties: + 123-list: + type: string + type: object + Client: + example: + client: client + properties: + client: + type: string + type: object + ReadOnlyFirst: + properties: + bar: + readOnly: true + type: string + baz: + type: string + type: object + hasOnlyReadOnly: + properties: + bar: + readOnly: true + type: string + foo: + readOnly: true + type: string + type: object + Capitalization: + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + type: object + MapTest: + properties: + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + additionalProperties: + type: boolean + type: object + type: object + ArrayTest: + properties: + array_of_string: + items: + type: string + type: array + array_array_of_integer: + items: + items: + format: int64 + type: integer + type: array + type: array + array_array_of_model: + items: + items: + $ref: '#/components/schemas/ReadOnlyFirst' + type: array + type: array + type: object + NumberOnly: + properties: + JustNumber: + type: number + type: object + ArrayOfNumberOnly: + properties: + ArrayNumber: + items: + type: number + type: array + type: object + ArrayOfArrayOfNumberOnly: + properties: + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array + type: object + EnumArrays: + properties: + just_symbol: + enum: + - '>=' + - $ + type: string + array_enum: + items: + enum: + - fish + - crab + type: string + type: array + type: object + OuterEnum: + enum: + - placed + - approved + - delivered + nullable: true + type: string + OuterEnumInteger: + enum: + - 0 + - 1 + - 2 + type: integer + OuterEnumDefaultValue: + default: placed + enum: + - placed + - approved + - delivered + type: string + OuterEnumIntegerDefaultValue: + default: 0 + enum: + - 0 + - 1 + - 2 + type: integer + OuterComposite: + example: + my_string: my_string + my_number: 0.8008281904610115 + my_boolean: true + properties: + my_number: + type: number + my_string: + type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + type: object + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + type: object + FileSchemaTestClass: + example: + file: + sourceURI: sourceURI + files: + - sourceURI: sourceURI + - sourceURI: sourceURI + properties: + file: + $ref: '#/components/schemas/File' + files: + items: + $ref: '#/components/schemas/File' + type: array + type: object + File: + description: Must be named `File` for test. + example: + sourceURI: sourceURI + properties: + sourceURI: + description: Test capitalization + type: string + type: object + _special_model.name_: + properties: + $special[property.name]: + format: int64 + type: integer + xml: + name: $special[model.name] + HealthCheckResult: + description: Just a string to inform instance is up and running. Make it nullable + in hope to get it as pointer in generated model. + example: + NullableMessage: NullableMessage + properties: + NullableMessage: + nullable: true + type: string + type: object + NullableClass: + additionalProperties: + nullable: true + type: object + properties: + integer_prop: + nullable: true + type: integer + number_prop: + nullable: true + type: number + boolean_prop: + nullable: true + type: boolean + string_prop: + nullable: true + type: string + date_prop: + format: date + nullable: true + type: string + datetime_prop: + format: date-time + nullable: true + type: string + array_nullable_prop: + items: + type: object + nullable: true + type: array + array_and_items_nullable_prop: + items: + nullable: true + type: object + nullable: true + type: array + array_items_nullable: + items: + nullable: true + type: object + type: array + object_nullable_prop: + additionalProperties: + type: object + nullable: true + type: object + object_and_items_nullable_prop: + additionalProperties: + nullable: true + type: object + nullable: true + type: object + object_items_nullable: + additionalProperties: + nullable: true + type: object + type: object + type: object + inline_response_default: + example: + string: + bar: bar + properties: + string: + $ref: '#/components/schemas/Foo' + inline_object: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + type: object + inline_object_1: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + type: object + inline_object_2: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + type: object + inline_object_3: + properties: + integer: + description: None + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: /[a-z]/i + type: string + pattern_without_delimiter: + description: None + pattern: ^[A-Z].* + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + type: object + inline_object_4: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + type: object + inline_object_5: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile + type: object + Dog_allOf: + properties: + breed: + type: string + Cat_allOf: + properties: + declawed: + type: boolean + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http + bearer_test: + bearerFormat: JWT + scheme: bearer + type: http diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_another_fake.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_another_fake.go new file mode 100644 index 000000000000..7598641102ca --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_another_fake.go @@ -0,0 +1,113 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" +) + +// Linger please +var ( + _ context.Context +) + +type AnotherFakeApiService service + +/* +AnotherFakeApiService To test special tags +To test special tags and operation ID starting with number + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param client client model +@return Client +*/ +func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx context.Context, client Client) (Client, *http.Response, error) { + var ( + localVarHttpMethod = http.MethodPatch + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Client + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/another-fake/dummy" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + localVarPostBody = &client + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Client + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_default.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_default.go new file mode 100644 index 000000000000..2d063733fdd6 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_default.go @@ -0,0 +1,109 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" +) + +// Linger please +var ( + _ context.Context +) + +type DefaultApiService service + +/* +DefaultApiService + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +@return InlineResponseDefault +*/ +func (a *DefaultApiService) FooGet(ctx context.Context) (InlineResponseDefault, *http.Response, error) { + var ( + localVarHttpMethod = http.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue InlineResponseDefault + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/foo" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 0 { + var v InlineResponseDefault + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_fake.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_fake.go new file mode 100644 index 000000000000..9a70d825add0 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_fake.go @@ -0,0 +1,1225 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "github.com/antihax/optional" + "os" +) + +// Linger please +var ( + _ context.Context +) + +type FakeApiService service + +/* +FakeApiService Health check endpoint + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +@return HealthCheckResult +*/ +func (a *FakeApiService) FakeHealthGet(ctx context.Context) (HealthCheckResult, *http.Response, error) { + var ( + localVarHttpMethod = http.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue HealthCheckResult + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/fake/health" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v HealthCheckResult + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +FakeApiService +Test serialization of outer boolean types + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *FakeOuterBooleanSerializeOpts - Optional Parameters: + * @param "Body" (optional.Bool) - Input boolean as post body +@return bool +*/ + +type FakeOuterBooleanSerializeOpts struct { + Body optional.Bool +} + +func (a *FakeApiService) FakeOuterBooleanSerialize(ctx context.Context, localVarOptionals *FakeOuterBooleanSerializeOpts) (bool, *http.Response, error) { + var ( + localVarHttpMethod = http.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue bool + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/fake/outer/boolean" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + localVarPostBody = localVarOptionals.Body.Value() + } + + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v bool + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +FakeApiService +Test serialization of object with outer number type + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *FakeOuterCompositeSerializeOpts - Optional Parameters: + * @param "OuterComposite" (optional.Interface of OuterComposite) - Input composite as post body +@return OuterComposite +*/ + +type FakeOuterCompositeSerializeOpts struct { + OuterComposite optional.Interface +} + +func (a *FakeApiService) FakeOuterCompositeSerialize(ctx context.Context, localVarOptionals *FakeOuterCompositeSerializeOpts) (OuterComposite, *http.Response, error) { + var ( + localVarHttpMethod = http.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue OuterComposite + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/fake/outer/composite" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + if localVarOptionals != nil && localVarOptionals.OuterComposite.IsSet() { + localVarOptionalOuterComposite, localVarOptionalOuterCompositeok := localVarOptionals.OuterComposite.Value().(OuterComposite) + if !localVarOptionalOuterCompositeok { + return localVarReturnValue, nil, reportError("outerComposite should be OuterComposite") + } + localVarPostBody = &localVarOptionalOuterComposite + } + + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v OuterComposite + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +FakeApiService +Test serialization of outer number types + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *FakeOuterNumberSerializeOpts - Optional Parameters: + * @param "Body" (optional.Float32) - Input number as post body +@return float32 +*/ + +type FakeOuterNumberSerializeOpts struct { + Body optional.Float32 +} + +func (a *FakeApiService) FakeOuterNumberSerialize(ctx context.Context, localVarOptionals *FakeOuterNumberSerializeOpts) (float32, *http.Response, error) { + var ( + localVarHttpMethod = http.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue float32 + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/fake/outer/number" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + localVarPostBody = localVarOptionals.Body.Value() + } + + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v float32 + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +FakeApiService +Test serialization of outer string types + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *FakeOuterStringSerializeOpts - Optional Parameters: + * @param "Body" (optional.String) - Input string as post body +@return string +*/ + +type FakeOuterStringSerializeOpts struct { + Body optional.String +} + +func (a *FakeApiService) FakeOuterStringSerialize(ctx context.Context, localVarOptionals *FakeOuterStringSerializeOpts) (string, *http.Response, error) { + var ( + localVarHttpMethod = http.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue string + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/fake/outer/string" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + localVarPostBody = localVarOptionals.Body.Value() + } + + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v string + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +FakeApiService +For this test, the body for this request much reference a schema named `File`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param fileSchemaTestClass +*/ +func (a *FakeApiService) TestBodyWithFileSchema(ctx context.Context, fileSchemaTestClass FileSchemaTestClass) (*http.Response, error) { + var ( + localVarHttpMethod = http.MethodPut + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/fake/body-with-file-schema" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + localVarPostBody = &fileSchemaTestClass + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +FakeApiService + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param query + * @param user +*/ +func (a *FakeApiService) TestBodyWithQueryParams(ctx context.Context, query string, user User) (*http.Response, error) { + var ( + localVarHttpMethod = http.MethodPut + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/fake/body-with-query-params" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + localVarQueryParams.Add("query", parameterToString(query, "")) + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + localVarPostBody = &user + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +FakeApiService To test \"client\" model +To test \"client\" model + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param client client model +@return Client +*/ +func (a *FakeApiService) TestClientModel(ctx context.Context, client Client) (Client, *http.Response, error) { + var ( + localVarHttpMethod = http.MethodPatch + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Client + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/fake" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + localVarPostBody = &client + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Client + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +FakeApiService Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param number None + * @param double None + * @param patternWithoutDelimiter None + * @param byte_ None + * @param optional nil or *TestEndpointParametersOpts - Optional Parameters: + * @param "Integer" (optional.Int32) - None + * @param "Int32_" (optional.Int32) - None + * @param "Int64_" (optional.Int64) - None + * @param "Float" (optional.Float32) - None + * @param "String_" (optional.String) - None + * @param "Binary" (optional.Interface of *os.File) - None + * @param "Date" (optional.String) - None + * @param "DateTime" (optional.Time) - None + * @param "Password" (optional.String) - None + * @param "Callback" (optional.String) - None +*/ + +type TestEndpointParametersOpts struct { + Integer optional.Int32 + Int32_ optional.Int32 + Int64_ optional.Int64 + Float optional.Float32 + String_ optional.String + Binary optional.Interface + Date optional.String + DateTime optional.Time + Password optional.String + Callback optional.String +} + +func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number float32, double float64, patternWithoutDelimiter string, byte_ string, localVarOptionals *TestEndpointParametersOpts) (*http.Response, error) { + var ( + localVarHttpMethod = http.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/fake" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if number < 32.1 { + return nil, reportError("number must be greater than 32.1") + } + if number > 543.2 { + return nil, reportError("number must be less than 543.2") + } + if double < 67.8 { + return nil, reportError("double must be greater than 67.8") + } + if double > 123.4 { + return nil, reportError("double must be less than 123.4") + } + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/x-www-form-urlencoded"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.Integer.IsSet() { + localVarFormParams.Add("integer", parameterToString(localVarOptionals.Integer.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Int32_.IsSet() { + localVarFormParams.Add("int32", parameterToString(localVarOptionals.Int32_.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Int64_.IsSet() { + localVarFormParams.Add("int64", parameterToString(localVarOptionals.Int64_.Value(), "")) + } + localVarFormParams.Add("number", parameterToString(number, "")) + if localVarOptionals != nil && localVarOptionals.Float.IsSet() { + localVarFormParams.Add("float", parameterToString(localVarOptionals.Float.Value(), "")) + } + localVarFormParams.Add("double", parameterToString(double, "")) + if localVarOptionals != nil && localVarOptionals.String_.IsSet() { + localVarFormParams.Add("string", parameterToString(localVarOptionals.String_.Value(), "")) + } + localVarFormParams.Add("pattern_without_delimiter", parameterToString(patternWithoutDelimiter, "")) + localVarFormParams.Add("byte", parameterToString(byte_, "")) + localVarFormFileName = "binary" + var localVarFile *os.File + if localVarOptionals != nil && localVarOptionals.Binary.IsSet() { + localVarFileOk := false + localVarFile, localVarFileOk = localVarOptionals.Binary.Value().(*os.File) + if !localVarFileOk { + return nil, reportError("binary should be *os.File") + } + } + if localVarFile != nil { + fbs, _ := ioutil.ReadAll(localVarFile) + localVarFileBytes = fbs + localVarFileName = localVarFile.Name() + localVarFile.Close() + } + if localVarOptionals != nil && localVarOptionals.Date.IsSet() { + localVarFormParams.Add("date", parameterToString(localVarOptionals.Date.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.DateTime.IsSet() { + paramJson, err := parameterToJson(localVarOptionals.DateTime.Value()) + if err != nil { + return nil, err + } + localVarFormParams.Add("dateTime", paramJson) + } + if localVarOptionals != nil && localVarOptionals.Password.IsSet() { + localVarFormParams.Add("password", parameterToString(localVarOptionals.Password.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Callback.IsSet() { + localVarFormParams.Add("callback", parameterToString(localVarOptionals.Callback.Value(), "")) + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +FakeApiService To test enum parameters +To test enum parameters + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *TestEnumParametersOpts - Optional Parameters: + * @param "EnumHeaderStringArray" (optional.Interface of []string) - Header parameter enum test (string array) + * @param "EnumHeaderString" (optional.String) - Header parameter enum test (string) + * @param "EnumQueryStringArray" (optional.Interface of []string) - Query parameter enum test (string array) + * @param "EnumQueryString" (optional.String) - Query parameter enum test (string) + * @param "EnumQueryInteger" (optional.Int32) - Query parameter enum test (double) + * @param "EnumQueryDouble" (optional.Float64) - Query parameter enum test (double) + * @param "EnumFormStringArray" (optional.Interface of []string) - Form parameter enum test (string array) + * @param "EnumFormString" (optional.String) - Form parameter enum test (string) +*/ + +type TestEnumParametersOpts struct { + EnumHeaderStringArray optional.Interface + EnumHeaderString optional.String + EnumQueryStringArray optional.Interface + EnumQueryString optional.String + EnumQueryInteger optional.Int32 + EnumQueryDouble optional.Float64 + EnumFormStringArray optional.Interface + EnumFormString optional.String +} + +func (a *FakeApiService) TestEnumParameters(ctx context.Context, localVarOptionals *TestEnumParametersOpts) (*http.Response, error) { + var ( + localVarHttpMethod = http.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/fake" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.EnumQueryStringArray.IsSet() { + localVarQueryParams.Add("enum_query_string_array", parameterToString(localVarOptionals.EnumQueryStringArray.Value(), "multi")) + } + if localVarOptionals != nil && localVarOptionals.EnumQueryString.IsSet() { + localVarQueryParams.Add("enum_query_string", parameterToString(localVarOptionals.EnumQueryString.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.EnumQueryInteger.IsSet() { + localVarQueryParams.Add("enum_query_integer", parameterToString(localVarOptionals.EnumQueryInteger.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.EnumQueryDouble.IsSet() { + localVarQueryParams.Add("enum_query_double", parameterToString(localVarOptionals.EnumQueryDouble.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/x-www-form-urlencoded"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.EnumHeaderStringArray.IsSet() { + localVarHeaderParams["enum_header_string_array"] = parameterToString(localVarOptionals.EnumHeaderStringArray.Value(), "csv") + } + if localVarOptionals != nil && localVarOptionals.EnumHeaderString.IsSet() { + localVarHeaderParams["enum_header_string"] = parameterToString(localVarOptionals.EnumHeaderString.Value(), "") + } + if localVarOptionals != nil && localVarOptionals.EnumFormStringArray.IsSet() { + localVarFormParams.Add("enum_form_string_array", parameterToString(localVarOptionals.EnumFormStringArray.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.EnumFormString.IsSet() { + localVarFormParams.Add("enum_form_string", parameterToString(localVarOptionals.EnumFormString.Value(), "")) + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +FakeApiService Fake endpoint to test group parameters (optional) +Fake endpoint to test group parameters (optional) + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param requiredStringGroup Required String in group parameters + * @param requiredBooleanGroup Required Boolean in group parameters + * @param requiredInt64Group Required Integer in group parameters + * @param optional nil or *TestGroupParametersOpts - Optional Parameters: + * @param "StringGroup" (optional.Int32) - String in group parameters + * @param "BooleanGroup" (optional.Bool) - Boolean in group parameters + * @param "Int64Group" (optional.Int64) - Integer in group parameters +*/ + +type TestGroupParametersOpts struct { + StringGroup optional.Int32 + BooleanGroup optional.Bool + Int64Group optional.Int64 +} + +func (a *FakeApiService) TestGroupParameters(ctx context.Context, requiredStringGroup int32, requiredBooleanGroup bool, requiredInt64Group int64, localVarOptionals *TestGroupParametersOpts) (*http.Response, error) { + var ( + localVarHttpMethod = http.MethodDelete + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/fake" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + localVarQueryParams.Add("required_string_group", parameterToString(requiredStringGroup, "")) + localVarQueryParams.Add("required_int64_group", parameterToString(requiredInt64Group, "")) + if localVarOptionals != nil && localVarOptionals.StringGroup.IsSet() { + localVarQueryParams.Add("string_group", parameterToString(localVarOptionals.StringGroup.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Int64Group.IsSet() { + localVarQueryParams.Add("int64_group", parameterToString(localVarOptionals.Int64Group.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + localVarHeaderParams["required_boolean_group"] = parameterToString(requiredBooleanGroup, "") + if localVarOptionals != nil && localVarOptionals.BooleanGroup.IsSet() { + localVarHeaderParams["boolean_group"] = parameterToString(localVarOptionals.BooleanGroup.Value(), "") + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +FakeApiService test inline additionalProperties + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param requestBody request body +*/ +func (a *FakeApiService) TestInlineAdditionalProperties(ctx context.Context, requestBody map[string]string) (*http.Response, error) { + var ( + localVarHttpMethod = http.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/fake/inline-additionalProperties" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + localVarPostBody = &requestBody + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +FakeApiService test json serialization of form data + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param param field1 + * @param param2 field2 +*/ +func (a *FakeApiService) TestJsonFormData(ctx context.Context, param string, param2 string) (*http.Response, error) { + var ( + localVarHttpMethod = http.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/fake/jsonFormData" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/x-www-form-urlencoded"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + localVarFormParams.Add("param", parameterToString(param, "")) + localVarFormParams.Add("param2", parameterToString(param2, "")) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_fake_classname_tags123.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_fake_classname_tags123.go new file mode 100644 index 000000000000..54c0c9c557b8 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_fake_classname_tags123.go @@ -0,0 +1,125 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" +) + +// Linger please +var ( + _ context.Context +) + +type FakeClassnameTags123ApiService service + +/* +FakeClassnameTags123ApiService To test class name in snake case +To test class name in snake case + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param client client model +@return Client +*/ +func (a *FakeClassnameTags123ApiService) TestClassname(ctx context.Context, client Client) (Client, *http.Response, error) { + var ( + localVarHttpMethod = http.MethodPatch + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Client + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/fake_classname_test" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + localVarPostBody = &client + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarQueryParams.Add("api_key_query", key) + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Client + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_pet.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_pet.go new file mode 100644 index 000000000000..2375a34415fc --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_pet.go @@ -0,0 +1,815 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "fmt" + "strings" + "github.com/antihax/optional" + "os" +) + +// Linger please +var ( + _ context.Context +) + +type PetApiService service + +/* +PetApiService Add a new pet to the store + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param pet Pet object that needs to be added to the store +*/ +func (a *PetApiService) AddPet(ctx context.Context, pet Pet) (*http.Response, error) { + var ( + localVarHttpMethod = http.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/pet" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "application/xml"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + localVarPostBody = &pet + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +PetApiService Deletes a pet + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param petId Pet id to delete + * @param optional nil or *DeletePetOpts - Optional Parameters: + * @param "ApiKey" (optional.String) - +*/ + +type DeletePetOpts struct { + ApiKey optional.String +} + +func (a *PetApiService) DeletePet(ctx context.Context, petId int64, localVarOptionals *DeletePetOpts) (*http.Response, error) { + var ( + localVarHttpMethod = http.MethodDelete + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/pet/{petId}" + localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", fmt.Sprintf("%v", petId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.ApiKey.IsSet() { + localVarHeaderParams["api_key"] = parameterToString(localVarOptionals.ApiKey.Value(), "") + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +PetApiService Finds Pets by status +Multiple status values can be provided with comma separated strings + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param status Status values that need to be considered for filter +@return []Pet +*/ +func (a *PetApiService) FindPetsByStatus(ctx context.Context, status []string) ([]Pet, *http.Response, error) { + var ( + localVarHttpMethod = http.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []Pet + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/pet/findByStatus" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + localVarQueryParams.Add("status", parameterToString(status, "csv")) + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/xml", "application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []Pet + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +PetApiService Finds Pets by tags +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param tags Tags to filter by +@return []Pet +*/ +func (a *PetApiService) FindPetsByTags(ctx context.Context, tags []string) ([]Pet, *http.Response, error) { + var ( + localVarHttpMethod = http.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []Pet + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/pet/findByTags" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + localVarQueryParams.Add("tags", parameterToString(tags, "csv")) + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/xml", "application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []Pet + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +PetApiService Find pet by ID +Returns a single pet + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param petId ID of pet to return +@return Pet +*/ +func (a *PetApiService) GetPetById(ctx context.Context, petId int64) (Pet, *http.Response, error) { + var ( + localVarHttpMethod = http.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Pet + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/pet/{petId}" + localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", fmt.Sprintf("%v", petId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/xml", "application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["api_key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Pet + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +PetApiService Update an existing pet + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param pet Pet object that needs to be added to the store +*/ +func (a *PetApiService) UpdatePet(ctx context.Context, pet Pet) (*http.Response, error) { + var ( + localVarHttpMethod = http.MethodPut + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/pet" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "application/xml"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + localVarPostBody = &pet + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +PetApiService Updates a pet in the store with form data + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param petId ID of pet that needs to be updated + * @param optional nil or *UpdatePetWithFormOpts - Optional Parameters: + * @param "Name" (optional.String) - Updated name of the pet + * @param "Status" (optional.String) - Updated status of the pet +*/ + +type UpdatePetWithFormOpts struct { + Name optional.String + Status optional.String +} + +func (a *PetApiService) UpdatePetWithForm(ctx context.Context, petId int64, localVarOptionals *UpdatePetWithFormOpts) (*http.Response, error) { + var ( + localVarHttpMethod = http.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/pet/{petId}" + localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", fmt.Sprintf("%v", petId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/x-www-form-urlencoded"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.Name.IsSet() { + localVarFormParams.Add("name", parameterToString(localVarOptionals.Name.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Status.IsSet() { + localVarFormParams.Add("status", parameterToString(localVarOptionals.Status.Value(), "")) + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +PetApiService uploads an image + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param petId ID of pet to update + * @param optional nil or *UploadFileOpts - Optional Parameters: + * @param "AdditionalMetadata" (optional.String) - Additional data to pass to server + * @param "File" (optional.Interface of *os.File) - file to upload +@return ApiResponse +*/ + +type UploadFileOpts struct { + AdditionalMetadata optional.String + File optional.Interface +} + +func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOptionals *UploadFileOpts) (ApiResponse, *http.Response, error) { + var ( + localVarHttpMethod = http.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ApiResponse + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/pet/{petId}/uploadImage" + localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", fmt.Sprintf("%v", petId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AdditionalMetadata.IsSet() { + localVarFormParams.Add("additionalMetadata", parameterToString(localVarOptionals.AdditionalMetadata.Value(), "")) + } + localVarFormFileName = "file" + var localVarFile *os.File + if localVarOptionals != nil && localVarOptionals.File.IsSet() { + localVarFileOk := false + localVarFile, localVarFileOk = localVarOptionals.File.Value().(*os.File) + if !localVarFileOk { + return localVarReturnValue, nil, reportError("file should be *os.File") + } + } + if localVarFile != nil { + fbs, _ := ioutil.ReadAll(localVarFile) + localVarFileBytes = fbs + localVarFileName = localVarFile.Name() + localVarFile.Close() + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v ApiResponse + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +PetApiService uploads an image (required) + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param petId ID of pet to update + * @param requiredFile file to upload + * @param optional nil or *UploadFileWithRequiredFileOpts - Optional Parameters: + * @param "AdditionalMetadata" (optional.String) - Additional data to pass to server +@return ApiResponse +*/ + +type UploadFileWithRequiredFileOpts struct { + AdditionalMetadata optional.String +} + +func (a *PetApiService) UploadFileWithRequiredFile(ctx context.Context, petId int64, requiredFile *os.File, localVarOptionals *UploadFileWithRequiredFileOpts) (ApiResponse, *http.Response, error) { + var ( + localVarHttpMethod = http.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ApiResponse + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/fake/{petId}/uploadImageWithRequiredFile" + localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", fmt.Sprintf("%v", petId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AdditionalMetadata.IsSet() { + localVarFormParams.Add("additionalMetadata", parameterToString(localVarOptionals.AdditionalMetadata.Value(), "")) + } + localVarFormFileName = "requiredFile" + localVarFile := requiredFile + if localVarFile != nil { + fbs, _ := ioutil.ReadAll(localVarFile) + localVarFileBytes = fbs + localVarFileName = localVarFile.Name() + localVarFile.Close() + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v ApiResponse + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_store.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_store.go new file mode 100644 index 000000000000..dcab411de38a --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_store.go @@ -0,0 +1,373 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "fmt" + "strings" +) + +// Linger please +var ( + _ context.Context +) + +type StoreApiService service + +/* +StoreApiService Delete purchase order by ID +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param orderId ID of the order that needs to be deleted +*/ +func (a *StoreApiService) DeleteOrder(ctx context.Context, orderId string) (*http.Response, error) { + var ( + localVarHttpMethod = http.MethodDelete + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/store/order/{order_id}" + localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", fmt.Sprintf("%v", orderId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +StoreApiService Returns pet inventories by status +Returns a map of status codes to quantities + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +@return map[string]int32 +*/ +func (a *StoreApiService) GetInventory(ctx context.Context) (map[string]int32, *http.Response, error) { + var ( + localVarHttpMethod = http.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue map[string]int32 + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/store/inventory" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["api_key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v map[string]int32 + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +StoreApiService Find purchase order by ID +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param orderId ID of pet that needs to be fetched +@return Order +*/ +func (a *StoreApiService) GetOrderById(ctx context.Context, orderId int64) (Order, *http.Response, error) { + var ( + localVarHttpMethod = http.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Order + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/store/order/{order_id}" + localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", fmt.Sprintf("%v", orderId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if orderId < 1 { + return localVarReturnValue, nil, reportError("orderId must be greater than 1") + } + if orderId > 5 { + return localVarReturnValue, nil, reportError("orderId must be less than 5") + } + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/xml", "application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Order + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +StoreApiService Place an order for a pet + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param order order placed for purchasing the pet +@return Order +*/ +func (a *StoreApiService) PlaceOrder(ctx context.Context, order Order) (Order, *http.Response, error) { + var ( + localVarHttpMethod = http.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Order + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/store/order" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/xml", "application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + localVarPostBody = &order + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Order + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_user.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_user.go new file mode 100644 index 000000000000..7ade2436bad2 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_user.go @@ -0,0 +1,605 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "fmt" + "strings" +) + +// Linger please +var ( + _ context.Context +) + +type UserApiService service + +/* +UserApiService Create user +This can only be done by the logged in user. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param user Created user object +*/ +func (a *UserApiService) CreateUser(ctx context.Context, user User) (*http.Response, error) { + var ( + localVarHttpMethod = http.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/user" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + localVarPostBody = &user + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +UserApiService Creates list of users with given input array + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param user List of user object +*/ +func (a *UserApiService) CreateUsersWithArrayInput(ctx context.Context, user []User) (*http.Response, error) { + var ( + localVarHttpMethod = http.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/user/createWithArray" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + localVarPostBody = &user + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +UserApiService Creates list of users with given input array + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param user List of user object +*/ +func (a *UserApiService) CreateUsersWithListInput(ctx context.Context, user []User) (*http.Response, error) { + var ( + localVarHttpMethod = http.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/user/createWithList" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + localVarPostBody = &user + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +UserApiService Delete user +This can only be done by the logged in user. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param username The name that needs to be deleted +*/ +func (a *UserApiService) DeleteUser(ctx context.Context, username string) (*http.Response, error) { + var ( + localVarHttpMethod = http.MethodDelete + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/user/{username}" + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", fmt.Sprintf("%v", username), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +UserApiService Get user by user name + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param username The name that needs to be fetched. Use user1 for testing. +@return User +*/ +func (a *UserApiService) GetUserByName(ctx context.Context, username string) (User, *http.Response, error) { + var ( + localVarHttpMethod = http.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue User + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/user/{username}" + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", fmt.Sprintf("%v", username), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/xml", "application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v User + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +UserApiService Logs user into the system + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param username The user name for login + * @param password The password for login in clear text +@return string +*/ +func (a *UserApiService) LoginUser(ctx context.Context, username string, password string) (string, *http.Response, error) { + var ( + localVarHttpMethod = http.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue string + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/user/login" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + localVarQueryParams.Add("username", parameterToString(username, "")) + localVarQueryParams.Add("password", parameterToString(password, "")) + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/xml", "application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v string + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +UserApiService Logs out current logged in user session + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +*/ +func (a *UserApiService) LogoutUser(ctx context.Context) (*http.Response, error) { + var ( + localVarHttpMethod = http.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/user/logout" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +UserApiService Updated user +This can only be done by the logged in user. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param username name that need to be deleted + * @param user Updated user object +*/ +func (a *UserApiService) UpdateUser(ctx context.Context, username string, user User) (*http.Response, error) { + var ( + localVarHttpMethod = http.MethodPut + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/user/{username}" + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", fmt.Sprintf("%v", username), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + localVarPostBody = &user + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/client.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/client.go new file mode 100644 index 000000000000..3724e502d6c8 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/client.go @@ -0,0 +1,517 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "mime/multipart" + "net/http" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + + "golang.org/x/oauth2" +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) +) + +// APIClient manages communication with the OpenAPI Petstore API v1.0.0 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + AnotherFakeApi *AnotherFakeApiService + + DefaultApi *DefaultApiService + + FakeApi *FakeApiService + + FakeClassnameTags123Api *FakeClassnameTags123ApiService + + PetApi *PetApiService + + StoreApi *StoreApiService + + UserApi *UserApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.AnotherFakeApi = (*AnotherFakeApiService)(&c.common) + c.DefaultApi = (*DefaultApiService)(&c.common) + c.FakeApi = (*FakeApiService)(&c.common) + c.FakeClassnameTags123Api = (*FakeClassnameTags123ApiService)(&c.common) + c.PetApi = (*PetApiService)(&c.common) + c.StoreApi = (*StoreApiService)(&c.common) + c.UserApi = (*UserApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insenstive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.ToLower(a) == strings.ToLower(needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("Expected %s to be of type %s but received %s.", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +// parameterToString convert interface{} parameters to string, using a delimiter if format is provided. +func parameterToString(obj interface{}, collectionFormat string) string { + var delimiter string + + switch collectionFormat { + case "pipes": + delimiter = "|" + case "ssv": + delimiter = " " + case "tsv": + delimiter = "\t" + case "csv": + delimiter = "," + } + + if reflect.TypeOf(obj).Kind() == reflect.Slice { + return strings.Trim(strings.Replace(fmt.Sprint(obj), " ", delimiter, -1), "[]") + } else if t, ok := obj.(time.Time); ok { + return t.Format(time.RFC3339) + } + + return fmt.Sprintf("%v", obj) +} + +// helper for converting interface{} parameters to json strings +func parameterToJson(obj interface{}) (string, error) { + jsonBuf, err := json.Marshal(obj) + if err != nil { + return "", err + } + return string(jsonBuf), err +} + + +// callAPI do the request. +func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { + return c.cfg.HTTPClient.Do(request) +} + +// Change base path to allow switching to mocks +func (c *APIClient) ChangeBasePath(path string) { + c.cfg.BasePath = path +} + +// prepareRequest build the request +func (c *APIClient) prepareRequest( + ctx context.Context, + path string, method string, + postBody interface{}, + headerParams map[string]string, + queryParams url.Values, + formParams url.Values, + formFileName string, + fileName string, + fileBytes []byte) (localVarRequest *http.Request, err error) { + + var body *bytes.Buffer + + // Detect postBody type and post. + if postBody != nil { + contentType := headerParams["Content-Type"] + if contentType == "" { + contentType = detectContentType(postBody) + headerParams["Content-Type"] = contentType + } + + body, err = setBody(postBody, contentType) + if err != nil { + return nil, err + } + } + + // add form parameters and file if available. + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + if len(fileBytes) > 0 && fileName != "" { + w.Boundary() + //_, fileNm := filepath.Split(fileName) + part, err := w.CreateFormFile(formFileName, filepath.Base(fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(fileBytes) + if err != nil { + return nil, err + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = query.Encode() + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers.Set(h, v) + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + // OAuth2 authentication + if tok, ok := ctx.Value(ContextOAuth2).(oauth2.TokenSource); ok { + // We were able to grab an oauth2 token from the context + var latestToken *oauth2.Token + if latestToken, err = tok.Token(); err != nil { + return nil, err + } + + latestToken.SetAuthHeader(localVarRequest) + } + + // Basic HTTP Authentication + if auth, ok := ctx.Value(ContextBasicAuth).(BasicAuth); ok { + localVarRequest.SetBasicAuth(auth.UserName, auth.Password) + } + + // AccessToken Authentication + if auth, ok := ctx.Value(ContextAccessToken).(string); ok { + localVarRequest.Header.Add("Authorization", "Bearer "+auth) + } + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if err = json.Unmarshal(b, v); err != nil { + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(path) + if err != nil { + return err + } + defer file.Close() + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("Invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/configuration.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/configuration.go new file mode 100644 index 000000000000..a2e676fda98c --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/configuration.go @@ -0,0 +1,72 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi + +import ( + "net/http" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextOAuth2 takes an oauth2.TokenSource as authentication for the request. + ContextOAuth2 = contextKey("token") + + // ContextBasicAuth takes BasicAuth as authentication for the request. + ContextBasicAuth = contextKey("basic") + + // ContextAccessToken takes a string oauth2 access token as authentication for the request. + ContextAccessToken = contextKey("accesstoken") + + // ContextAPIKey takes an APIKey as authentication for the request + ContextAPIKey = contextKey("apikey") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +type Configuration struct { + BasePath string `json:"basePath,omitempty"` + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + HTTPClient *http.Client +} + +func NewConfiguration() *Configuration { + cfg := &Configuration{ + BasePath: "http://petstore.swagger.io:80/v2", + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + } + return cfg +} + +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesClass.md new file mode 100644 index 000000000000..264d926fceda --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesClass.md @@ -0,0 +1,65 @@ +# AdditionalPropertiesClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MapProperty** | Pointer to **map[string]string** | | [optional] +**MapOfMapProperty** | Pointer to [**map[string]map[string]string**](map.md) | | [optional] + +## Methods + +### GetMapProperty + +`func (o *AdditionalPropertiesClass) GetMapProperty() map[string]string` + +GetMapProperty returns the MapProperty field if non-nil, zero value otherwise. + +### GetMapPropertyOk + +`func (o *AdditionalPropertiesClass) GetMapPropertyOk() (map[string]string, bool)` + +GetMapPropertyOk returns a tuple with the MapProperty field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasMapProperty + +`func (o *AdditionalPropertiesClass) HasMapProperty() bool` + +HasMapProperty returns a boolean if a field has been set. + +### SetMapProperty + +`func (o *AdditionalPropertiesClass) SetMapProperty(v map[string]string)` + +SetMapProperty gets a reference to the given map[string]string and assigns it to the MapProperty field. + +### GetMapOfMapProperty + +`func (o *AdditionalPropertiesClass) GetMapOfMapProperty() map[string]map[string]string` + +GetMapOfMapProperty returns the MapOfMapProperty field if non-nil, zero value otherwise. + +### GetMapOfMapPropertyOk + +`func (o *AdditionalPropertiesClass) GetMapOfMapPropertyOk() (map[string]map[string]string, bool)` + +GetMapOfMapPropertyOk returns a tuple with the MapOfMapProperty field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasMapOfMapProperty + +`func (o *AdditionalPropertiesClass) HasMapOfMapProperty() bool` + +HasMapOfMapProperty returns a boolean if a field has been set. + +### SetMapOfMapProperty + +`func (o *AdditionalPropertiesClass) SetMapOfMapProperty(v map[string]map[string]string)` + +SetMapOfMapProperty gets a reference to the given map[string]map[string]string and assigns it to the MapOfMapProperty field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Animal.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Animal.md new file mode 100644 index 000000000000..55133b29745a --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Animal.md @@ -0,0 +1,65 @@ +# Animal + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | Pointer to **string** | | +**Color** | Pointer to **string** | | [optional] [default to red] + +## Methods + +### GetClassName + +`func (o *Animal) GetClassName() string` + +GetClassName returns the ClassName field if non-nil, zero value otherwise. + +### GetClassNameOk + +`func (o *Animal) GetClassNameOk() (string, bool)` + +GetClassNameOk returns a tuple with the ClassName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasClassName + +`func (o *Animal) HasClassName() bool` + +HasClassName returns a boolean if a field has been set. + +### SetClassName + +`func (o *Animal) SetClassName(v string)` + +SetClassName gets a reference to the given string and assigns it to the ClassName field. + +### GetColor + +`func (o *Animal) GetColor() string` + +GetColor returns the Color field if non-nil, zero value otherwise. + +### GetColorOk + +`func (o *Animal) GetColorOk() (string, bool)` + +GetColorOk returns a tuple with the Color field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasColor + +`func (o *Animal) HasColor() bool` + +HasColor returns a boolean if a field has been set. + +### SetColor + +`func (o *Animal) SetColor(v string)` + +SetColor gets a reference to the given string and assigns it to the Color field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/AnotherFakeApi.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/AnotherFakeApi.md new file mode 100644 index 000000000000..9c6ce64e293b --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/AnotherFakeApi.md @@ -0,0 +1,42 @@ +# \AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**Call123TestSpecialTags**](AnotherFakeApi.md#Call123TestSpecialTags) | **Patch** /another-fake/dummy | To test special tags + + + +## Call123TestSpecialTags + +> Client Call123TestSpecialTags(ctx, client) +To test special tags + +To test special tags and operation ID starting with number + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**client** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/ApiResponse.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/ApiResponse.md new file mode 100644 index 000000000000..b0c891bbc960 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/ApiResponse.md @@ -0,0 +1,91 @@ +# ApiResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Code** | Pointer to **int32** | | [optional] +**Type** | Pointer to **string** | | [optional] +**Message** | Pointer to **string** | | [optional] + +## Methods + +### GetCode + +`func (o *ApiResponse) GetCode() int32` + +GetCode returns the Code field if non-nil, zero value otherwise. + +### GetCodeOk + +`func (o *ApiResponse) GetCodeOk() (int32, bool)` + +GetCodeOk returns a tuple with the Code field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasCode + +`func (o *ApiResponse) HasCode() bool` + +HasCode returns a boolean if a field has been set. + +### SetCode + +`func (o *ApiResponse) SetCode(v int32)` + +SetCode gets a reference to the given int32 and assigns it to the Code field. + +### GetType + +`func (o *ApiResponse) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *ApiResponse) GetTypeOk() (string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasType + +`func (o *ApiResponse) HasType() bool` + +HasType returns a boolean if a field has been set. + +### SetType + +`func (o *ApiResponse) SetType(v string)` + +SetType gets a reference to the given string and assigns it to the Type field. + +### GetMessage + +`func (o *ApiResponse) GetMessage() string` + +GetMessage returns the Message field if non-nil, zero value otherwise. + +### GetMessageOk + +`func (o *ApiResponse) GetMessageOk() (string, bool)` + +GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasMessage + +`func (o *ApiResponse) HasMessage() bool` + +HasMessage returns a boolean if a field has been set. + +### SetMessage + +`func (o *ApiResponse) SetMessage(v string)` + +SetMessage gets a reference to the given string and assigns it to the Message field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 000000000000..64ad908ea3bf --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,39 @@ +# ArrayOfArrayOfNumberOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ArrayArrayNumber** | Pointer to [**[][]float32**](array.md) | | [optional] + +## Methods + +### GetArrayArrayNumber + +`func (o *ArrayOfArrayOfNumberOnly) GetArrayArrayNumber() [][]float32` + +GetArrayArrayNumber returns the ArrayArrayNumber field if non-nil, zero value otherwise. + +### GetArrayArrayNumberOk + +`func (o *ArrayOfArrayOfNumberOnly) GetArrayArrayNumberOk() ([][]float32, bool)` + +GetArrayArrayNumberOk returns a tuple with the ArrayArrayNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasArrayArrayNumber + +`func (o *ArrayOfArrayOfNumberOnly) HasArrayArrayNumber() bool` + +HasArrayArrayNumber returns a boolean if a field has been set. + +### SetArrayArrayNumber + +`func (o *ArrayOfArrayOfNumberOnly) SetArrayArrayNumber(v [][]float32)` + +SetArrayArrayNumber gets a reference to the given [][]float32 and assigns it to the ArrayArrayNumber field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/ArrayOfNumberOnly.md new file mode 100644 index 000000000000..0ce95922a5ed --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/ArrayOfNumberOnly.md @@ -0,0 +1,39 @@ +# ArrayOfNumberOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ArrayNumber** | Pointer to **[]float32** | | [optional] + +## Methods + +### GetArrayNumber + +`func (o *ArrayOfNumberOnly) GetArrayNumber() []float32` + +GetArrayNumber returns the ArrayNumber field if non-nil, zero value otherwise. + +### GetArrayNumberOk + +`func (o *ArrayOfNumberOnly) GetArrayNumberOk() ([]float32, bool)` + +GetArrayNumberOk returns a tuple with the ArrayNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasArrayNumber + +`func (o *ArrayOfNumberOnly) HasArrayNumber() bool` + +HasArrayNumber returns a boolean if a field has been set. + +### SetArrayNumber + +`func (o *ArrayOfNumberOnly) SetArrayNumber(v []float32)` + +SetArrayNumber gets a reference to the given []float32 and assigns it to the ArrayNumber field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/ArrayTest.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/ArrayTest.md new file mode 100644 index 000000000000..f7020fadea38 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/ArrayTest.md @@ -0,0 +1,91 @@ +# ArrayTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ArrayOfString** | Pointer to **[]string** | | [optional] +**ArrayArrayOfInteger** | Pointer to [**[][]int64**](array.md) | | [optional] +**ArrayArrayOfModel** | Pointer to [**[][]ReadOnlyFirst**](array.md) | | [optional] + +## Methods + +### GetArrayOfString + +`func (o *ArrayTest) GetArrayOfString() []string` + +GetArrayOfString returns the ArrayOfString field if non-nil, zero value otherwise. + +### GetArrayOfStringOk + +`func (o *ArrayTest) GetArrayOfStringOk() ([]string, bool)` + +GetArrayOfStringOk returns a tuple with the ArrayOfString field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasArrayOfString + +`func (o *ArrayTest) HasArrayOfString() bool` + +HasArrayOfString returns a boolean if a field has been set. + +### SetArrayOfString + +`func (o *ArrayTest) SetArrayOfString(v []string)` + +SetArrayOfString gets a reference to the given []string and assigns it to the ArrayOfString field. + +### GetArrayArrayOfInteger + +`func (o *ArrayTest) GetArrayArrayOfInteger() [][]int64` + +GetArrayArrayOfInteger returns the ArrayArrayOfInteger field if non-nil, zero value otherwise. + +### GetArrayArrayOfIntegerOk + +`func (o *ArrayTest) GetArrayArrayOfIntegerOk() ([][]int64, bool)` + +GetArrayArrayOfIntegerOk returns a tuple with the ArrayArrayOfInteger field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasArrayArrayOfInteger + +`func (o *ArrayTest) HasArrayArrayOfInteger() bool` + +HasArrayArrayOfInteger returns a boolean if a field has been set. + +### SetArrayArrayOfInteger + +`func (o *ArrayTest) SetArrayArrayOfInteger(v [][]int64)` + +SetArrayArrayOfInteger gets a reference to the given [][]int64 and assigns it to the ArrayArrayOfInteger field. + +### GetArrayArrayOfModel + +`func (o *ArrayTest) GetArrayArrayOfModel() [][]ReadOnlyFirst` + +GetArrayArrayOfModel returns the ArrayArrayOfModel field if non-nil, zero value otherwise. + +### GetArrayArrayOfModelOk + +`func (o *ArrayTest) GetArrayArrayOfModelOk() ([][]ReadOnlyFirst, bool)` + +GetArrayArrayOfModelOk returns a tuple with the ArrayArrayOfModel field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasArrayArrayOfModel + +`func (o *ArrayTest) HasArrayArrayOfModel() bool` + +HasArrayArrayOfModel returns a boolean if a field has been set. + +### SetArrayArrayOfModel + +`func (o *ArrayTest) SetArrayArrayOfModel(v [][]ReadOnlyFirst)` + +SetArrayArrayOfModel gets a reference to the given [][]ReadOnlyFirst and assigns it to the ArrayArrayOfModel field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Capitalization.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Capitalization.md new file mode 100644 index 000000000000..a4772d740066 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Capitalization.md @@ -0,0 +1,169 @@ +# Capitalization + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SmallCamel** | Pointer to **string** | | [optional] +**CapitalCamel** | Pointer to **string** | | [optional] +**SmallSnake** | Pointer to **string** | | [optional] +**CapitalSnake** | Pointer to **string** | | [optional] +**SCAETHFlowPoints** | Pointer to **string** | | [optional] +**ATT_NAME** | Pointer to **string** | Name of the pet | [optional] + +## Methods + +### GetSmallCamel + +`func (o *Capitalization) GetSmallCamel() string` + +GetSmallCamel returns the SmallCamel field if non-nil, zero value otherwise. + +### GetSmallCamelOk + +`func (o *Capitalization) GetSmallCamelOk() (string, bool)` + +GetSmallCamelOk returns a tuple with the SmallCamel field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasSmallCamel + +`func (o *Capitalization) HasSmallCamel() bool` + +HasSmallCamel returns a boolean if a field has been set. + +### SetSmallCamel + +`func (o *Capitalization) SetSmallCamel(v string)` + +SetSmallCamel gets a reference to the given string and assigns it to the SmallCamel field. + +### GetCapitalCamel + +`func (o *Capitalization) GetCapitalCamel() string` + +GetCapitalCamel returns the CapitalCamel field if non-nil, zero value otherwise. + +### GetCapitalCamelOk + +`func (o *Capitalization) GetCapitalCamelOk() (string, bool)` + +GetCapitalCamelOk returns a tuple with the CapitalCamel field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasCapitalCamel + +`func (o *Capitalization) HasCapitalCamel() bool` + +HasCapitalCamel returns a boolean if a field has been set. + +### SetCapitalCamel + +`func (o *Capitalization) SetCapitalCamel(v string)` + +SetCapitalCamel gets a reference to the given string and assigns it to the CapitalCamel field. + +### GetSmallSnake + +`func (o *Capitalization) GetSmallSnake() string` + +GetSmallSnake returns the SmallSnake field if non-nil, zero value otherwise. + +### GetSmallSnakeOk + +`func (o *Capitalization) GetSmallSnakeOk() (string, bool)` + +GetSmallSnakeOk returns a tuple with the SmallSnake field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasSmallSnake + +`func (o *Capitalization) HasSmallSnake() bool` + +HasSmallSnake returns a boolean if a field has been set. + +### SetSmallSnake + +`func (o *Capitalization) SetSmallSnake(v string)` + +SetSmallSnake gets a reference to the given string and assigns it to the SmallSnake field. + +### GetCapitalSnake + +`func (o *Capitalization) GetCapitalSnake() string` + +GetCapitalSnake returns the CapitalSnake field if non-nil, zero value otherwise. + +### GetCapitalSnakeOk + +`func (o *Capitalization) GetCapitalSnakeOk() (string, bool)` + +GetCapitalSnakeOk returns a tuple with the CapitalSnake field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasCapitalSnake + +`func (o *Capitalization) HasCapitalSnake() bool` + +HasCapitalSnake returns a boolean if a field has been set. + +### SetCapitalSnake + +`func (o *Capitalization) SetCapitalSnake(v string)` + +SetCapitalSnake gets a reference to the given string and assigns it to the CapitalSnake field. + +### GetSCAETHFlowPoints + +`func (o *Capitalization) GetSCAETHFlowPoints() string` + +GetSCAETHFlowPoints returns the SCAETHFlowPoints field if non-nil, zero value otherwise. + +### GetSCAETHFlowPointsOk + +`func (o *Capitalization) GetSCAETHFlowPointsOk() (string, bool)` + +GetSCAETHFlowPointsOk returns a tuple with the SCAETHFlowPoints field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasSCAETHFlowPoints + +`func (o *Capitalization) HasSCAETHFlowPoints() bool` + +HasSCAETHFlowPoints returns a boolean if a field has been set. + +### SetSCAETHFlowPoints + +`func (o *Capitalization) SetSCAETHFlowPoints(v string)` + +SetSCAETHFlowPoints gets a reference to the given string and assigns it to the SCAETHFlowPoints field. + +### GetATT_NAME + +`func (o *Capitalization) GetATT_NAME() string` + +GetATT_NAME returns the ATT_NAME field if non-nil, zero value otherwise. + +### GetATT_NAMEOk + +`func (o *Capitalization) GetATT_NAMEOk() (string, bool)` + +GetATT_NAMEOk returns a tuple with the ATT_NAME field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasATT_NAME + +`func (o *Capitalization) HasATT_NAME() bool` + +HasATT_NAME returns a boolean if a field has been set. + +### SetATT_NAME + +`func (o *Capitalization) SetATT_NAME(v string)` + +SetATT_NAME gets a reference to the given string and assigns it to the ATT_NAME field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Cat.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Cat.md new file mode 100644 index 000000000000..0f2fe5a1f1f8 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Cat.md @@ -0,0 +1,91 @@ +# Cat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | Pointer to **string** | | +**Color** | Pointer to **string** | | [optional] [default to red] +**Declawed** | Pointer to **bool** | | [optional] + +## Methods + +### GetClassName + +`func (o *Cat) GetClassName() string` + +GetClassName returns the ClassName field if non-nil, zero value otherwise. + +### GetClassNameOk + +`func (o *Cat) GetClassNameOk() (string, bool)` + +GetClassNameOk returns a tuple with the ClassName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasClassName + +`func (o *Cat) HasClassName() bool` + +HasClassName returns a boolean if a field has been set. + +### SetClassName + +`func (o *Cat) SetClassName(v string)` + +SetClassName gets a reference to the given string and assigns it to the ClassName field. + +### GetColor + +`func (o *Cat) GetColor() string` + +GetColor returns the Color field if non-nil, zero value otherwise. + +### GetColorOk + +`func (o *Cat) GetColorOk() (string, bool)` + +GetColorOk returns a tuple with the Color field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasColor + +`func (o *Cat) HasColor() bool` + +HasColor returns a boolean if a field has been set. + +### SetColor + +`func (o *Cat) SetColor(v string)` + +SetColor gets a reference to the given string and assigns it to the Color field. + +### GetDeclawed + +`func (o *Cat) GetDeclawed() bool` + +GetDeclawed returns the Declawed field if non-nil, zero value otherwise. + +### GetDeclawedOk + +`func (o *Cat) GetDeclawedOk() (bool, bool)` + +GetDeclawedOk returns a tuple with the Declawed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasDeclawed + +`func (o *Cat) HasDeclawed() bool` + +HasDeclawed returns a boolean if a field has been set. + +### SetDeclawed + +`func (o *Cat) SetDeclawed(v bool)` + +SetDeclawed gets a reference to the given bool and assigns it to the Declawed field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/CatAllOf.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/CatAllOf.md new file mode 100644 index 000000000000..85f40d251d94 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/CatAllOf.md @@ -0,0 +1,39 @@ +# CatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Declawed** | Pointer to **bool** | | [optional] + +## Methods + +### GetDeclawed + +`func (o *CatAllOf) GetDeclawed() bool` + +GetDeclawed returns the Declawed field if non-nil, zero value otherwise. + +### GetDeclawedOk + +`func (o *CatAllOf) GetDeclawedOk() (bool, bool)` + +GetDeclawedOk returns a tuple with the Declawed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasDeclawed + +`func (o *CatAllOf) HasDeclawed() bool` + +HasDeclawed returns a boolean if a field has been set. + +### SetDeclawed + +`func (o *CatAllOf) SetDeclawed(v bool)` + +SetDeclawed gets a reference to the given bool and assigns it to the Declawed field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Category.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Category.md new file mode 100644 index 000000000000..88b525bade15 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Category.md @@ -0,0 +1,65 @@ +# Category + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | Pointer to **int64** | | [optional] +**Name** | Pointer to **string** | | [default to default-name] + +## Methods + +### GetId + +`func (o *Category) GetId() int64` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *Category) GetIdOk() (int64, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasId + +`func (o *Category) HasId() bool` + +HasId returns a boolean if a field has been set. + +### SetId + +`func (o *Category) SetId(v int64)` + +SetId gets a reference to the given int64 and assigns it to the Id field. + +### GetName + +`func (o *Category) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *Category) GetNameOk() (string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasName + +`func (o *Category) HasName() bool` + +HasName returns a boolean if a field has been set. + +### SetName + +`func (o *Category) SetName(v string)` + +SetName gets a reference to the given string and assigns it to the Name field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/ClassModel.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/ClassModel.md new file mode 100644 index 000000000000..d9c4f41e98bc --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/ClassModel.md @@ -0,0 +1,39 @@ +# ClassModel + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Class** | Pointer to **string** | | [optional] + +## Methods + +### GetClass + +`func (o *ClassModel) GetClass() string` + +GetClass returns the Class field if non-nil, zero value otherwise. + +### GetClassOk + +`func (o *ClassModel) GetClassOk() (string, bool)` + +GetClassOk returns a tuple with the Class field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasClass + +`func (o *ClassModel) HasClass() bool` + +HasClass returns a boolean if a field has been set. + +### SetClass + +`func (o *ClassModel) SetClass(v string)` + +SetClass gets a reference to the given string and assigns it to the Class field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Client.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Client.md new file mode 100644 index 000000000000..5ed3098fd491 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Client.md @@ -0,0 +1,39 @@ +# Client + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Client** | Pointer to **string** | | [optional] + +## Methods + +### GetClient + +`func (o *Client) GetClient() string` + +GetClient returns the Client field if non-nil, zero value otherwise. + +### GetClientOk + +`func (o *Client) GetClientOk() (string, bool)` + +GetClientOk returns a tuple with the Client field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasClient + +`func (o *Client) HasClient() bool` + +HasClient returns a boolean if a field has been set. + +### SetClient + +`func (o *Client) SetClient(v string)` + +SetClient gets a reference to the given string and assigns it to the Client field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/DefaultApi.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/DefaultApi.md new file mode 100644 index 000000000000..4fd0ab987209 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/DefaultApi.md @@ -0,0 +1,36 @@ +# \DefaultApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**FooGet**](DefaultApi.md#FooGet) | **Get** /foo | + + + +## FooGet + +> InlineResponseDefault FooGet(ctx, ) + + +### Required Parameters + +This endpoint does not need any parameter. + +### Return type + +[**InlineResponseDefault**](inline_response_default.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Dog.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Dog.md new file mode 100644 index 000000000000..4b5c332d8e14 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Dog.md @@ -0,0 +1,91 @@ +# Dog + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | Pointer to **string** | | +**Color** | Pointer to **string** | | [optional] [default to red] +**Breed** | Pointer to **string** | | [optional] + +## Methods + +### GetClassName + +`func (o *Dog) GetClassName() string` + +GetClassName returns the ClassName field if non-nil, zero value otherwise. + +### GetClassNameOk + +`func (o *Dog) GetClassNameOk() (string, bool)` + +GetClassNameOk returns a tuple with the ClassName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasClassName + +`func (o *Dog) HasClassName() bool` + +HasClassName returns a boolean if a field has been set. + +### SetClassName + +`func (o *Dog) SetClassName(v string)` + +SetClassName gets a reference to the given string and assigns it to the ClassName field. + +### GetColor + +`func (o *Dog) GetColor() string` + +GetColor returns the Color field if non-nil, zero value otherwise. + +### GetColorOk + +`func (o *Dog) GetColorOk() (string, bool)` + +GetColorOk returns a tuple with the Color field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasColor + +`func (o *Dog) HasColor() bool` + +HasColor returns a boolean if a field has been set. + +### SetColor + +`func (o *Dog) SetColor(v string)` + +SetColor gets a reference to the given string and assigns it to the Color field. + +### GetBreed + +`func (o *Dog) GetBreed() string` + +GetBreed returns the Breed field if non-nil, zero value otherwise. + +### GetBreedOk + +`func (o *Dog) GetBreedOk() (string, bool)` + +GetBreedOk returns a tuple with the Breed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasBreed + +`func (o *Dog) HasBreed() bool` + +HasBreed returns a boolean if a field has been set. + +### SetBreed + +`func (o *Dog) SetBreed(v string)` + +SetBreed gets a reference to the given string and assigns it to the Breed field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/DogAllOf.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/DogAllOf.md new file mode 100644 index 000000000000..a3169521cecc --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/DogAllOf.md @@ -0,0 +1,39 @@ +# DogAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Breed** | Pointer to **string** | | [optional] + +## Methods + +### GetBreed + +`func (o *DogAllOf) GetBreed() string` + +GetBreed returns the Breed field if non-nil, zero value otherwise. + +### GetBreedOk + +`func (o *DogAllOf) GetBreedOk() (string, bool)` + +GetBreedOk returns a tuple with the Breed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasBreed + +`func (o *DogAllOf) HasBreed() bool` + +HasBreed returns a boolean if a field has been set. + +### SetBreed + +`func (o *DogAllOf) SetBreed(v string)` + +SetBreed gets a reference to the given string and assigns it to the Breed field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/EnumArrays.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/EnumArrays.md new file mode 100644 index 000000000000..31d7b2b9faaa --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/EnumArrays.md @@ -0,0 +1,65 @@ +# EnumArrays + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**JustSymbol** | Pointer to **string** | | [optional] +**ArrayEnum** | Pointer to **[]string** | | [optional] + +## Methods + +### GetJustSymbol + +`func (o *EnumArrays) GetJustSymbol() string` + +GetJustSymbol returns the JustSymbol field if non-nil, zero value otherwise. + +### GetJustSymbolOk + +`func (o *EnumArrays) GetJustSymbolOk() (string, bool)` + +GetJustSymbolOk returns a tuple with the JustSymbol field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasJustSymbol + +`func (o *EnumArrays) HasJustSymbol() bool` + +HasJustSymbol returns a boolean if a field has been set. + +### SetJustSymbol + +`func (o *EnumArrays) SetJustSymbol(v string)` + +SetJustSymbol gets a reference to the given string and assigns it to the JustSymbol field. + +### GetArrayEnum + +`func (o *EnumArrays) GetArrayEnum() []string` + +GetArrayEnum returns the ArrayEnum field if non-nil, zero value otherwise. + +### GetArrayEnumOk + +`func (o *EnumArrays) GetArrayEnumOk() ([]string, bool)` + +GetArrayEnumOk returns a tuple with the ArrayEnum field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasArrayEnum + +`func (o *EnumArrays) HasArrayEnum() bool` + +HasArrayEnum returns a boolean if a field has been set. + +### SetArrayEnum + +`func (o *EnumArrays) SetArrayEnum(v []string)` + +SetArrayEnum gets a reference to the given []string and assigns it to the ArrayEnum field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/EnumClass.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/EnumClass.md new file mode 100644 index 000000000000..e231f94bd73c --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/EnumClass.md @@ -0,0 +1,11 @@ +# EnumClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/EnumTest.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/EnumTest.md new file mode 100644 index 000000000000..45b1b7e5adb3 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/EnumTest.md @@ -0,0 +1,228 @@ +# EnumTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**EnumString** | Pointer to **string** | | [optional] +**EnumStringRequired** | Pointer to **string** | | +**EnumInteger** | Pointer to **int32** | | [optional] +**EnumNumber** | Pointer to **float64** | | [optional] +**OuterEnum** | Pointer to [**OuterEnum**](OuterEnum.md) | | [optional] +**OuterEnumInteger** | Pointer to [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional] +**OuterEnumDefaultValue** | Pointer to [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] +**OuterEnumIntegerDefaultValue** | Pointer to [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] + +## Methods + +### GetEnumString + +`func (o *EnumTest) GetEnumString() string` + +GetEnumString returns the EnumString field if non-nil, zero value otherwise. + +### GetEnumStringOk + +`func (o *EnumTest) GetEnumStringOk() (string, bool)` + +GetEnumStringOk returns a tuple with the EnumString field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasEnumString + +`func (o *EnumTest) HasEnumString() bool` + +HasEnumString returns a boolean if a field has been set. + +### SetEnumString + +`func (o *EnumTest) SetEnumString(v string)` + +SetEnumString gets a reference to the given string and assigns it to the EnumString field. + +### GetEnumStringRequired + +`func (o *EnumTest) GetEnumStringRequired() string` + +GetEnumStringRequired returns the EnumStringRequired field if non-nil, zero value otherwise. + +### GetEnumStringRequiredOk + +`func (o *EnumTest) GetEnumStringRequiredOk() (string, bool)` + +GetEnumStringRequiredOk returns a tuple with the EnumStringRequired field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasEnumStringRequired + +`func (o *EnumTest) HasEnumStringRequired() bool` + +HasEnumStringRequired returns a boolean if a field has been set. + +### SetEnumStringRequired + +`func (o *EnumTest) SetEnumStringRequired(v string)` + +SetEnumStringRequired gets a reference to the given string and assigns it to the EnumStringRequired field. + +### GetEnumInteger + +`func (o *EnumTest) GetEnumInteger() int32` + +GetEnumInteger returns the EnumInteger field if non-nil, zero value otherwise. + +### GetEnumIntegerOk + +`func (o *EnumTest) GetEnumIntegerOk() (int32, bool)` + +GetEnumIntegerOk returns a tuple with the EnumInteger field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasEnumInteger + +`func (o *EnumTest) HasEnumInteger() bool` + +HasEnumInteger returns a boolean if a field has been set. + +### SetEnumInteger + +`func (o *EnumTest) SetEnumInteger(v int32)` + +SetEnumInteger gets a reference to the given int32 and assigns it to the EnumInteger field. + +### GetEnumNumber + +`func (o *EnumTest) GetEnumNumber() float64` + +GetEnumNumber returns the EnumNumber field if non-nil, zero value otherwise. + +### GetEnumNumberOk + +`func (o *EnumTest) GetEnumNumberOk() (float64, bool)` + +GetEnumNumberOk returns a tuple with the EnumNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasEnumNumber + +`func (o *EnumTest) HasEnumNumber() bool` + +HasEnumNumber returns a boolean if a field has been set. + +### SetEnumNumber + +`func (o *EnumTest) SetEnumNumber(v float64)` + +SetEnumNumber gets a reference to the given float64 and assigns it to the EnumNumber field. + +### GetOuterEnum + +`func (o *EnumTest) GetOuterEnum() OuterEnum` + +GetOuterEnum returns the OuterEnum field if non-nil, zero value otherwise. + +### GetOuterEnumOk + +`func (o *EnumTest) GetOuterEnumOk() (OuterEnum, bool)` + +GetOuterEnumOk returns a tuple with the OuterEnum field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasOuterEnum + +`func (o *EnumTest) HasOuterEnum() bool` + +HasOuterEnum returns a boolean if a field has been set. + +### SetOuterEnum + +`func (o *EnumTest) SetOuterEnum(v OuterEnum)` + +SetOuterEnum gets a reference to the given OuterEnum and assigns it to the OuterEnum field. + +### SetOuterEnumExplicitNull + +`func (o *EnumTest) SetOuterEnumExplicitNull(b bool)` + +SetOuterEnumExplicitNull (un)sets OuterEnum to be considered as explicit "null" value +when serializing to JSON (pass true as argument to set this, false to unset) +The OuterEnum value is set to nil even if false is passed +### GetOuterEnumInteger + +`func (o *EnumTest) GetOuterEnumInteger() OuterEnumInteger` + +GetOuterEnumInteger returns the OuterEnumInteger field if non-nil, zero value otherwise. + +### GetOuterEnumIntegerOk + +`func (o *EnumTest) GetOuterEnumIntegerOk() (OuterEnumInteger, bool)` + +GetOuterEnumIntegerOk returns a tuple with the OuterEnumInteger field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasOuterEnumInteger + +`func (o *EnumTest) HasOuterEnumInteger() bool` + +HasOuterEnumInteger returns a boolean if a field has been set. + +### SetOuterEnumInteger + +`func (o *EnumTest) SetOuterEnumInteger(v OuterEnumInteger)` + +SetOuterEnumInteger gets a reference to the given OuterEnumInteger and assigns it to the OuterEnumInteger field. + +### GetOuterEnumDefaultValue + +`func (o *EnumTest) GetOuterEnumDefaultValue() OuterEnumDefaultValue` + +GetOuterEnumDefaultValue returns the OuterEnumDefaultValue field if non-nil, zero value otherwise. + +### GetOuterEnumDefaultValueOk + +`func (o *EnumTest) GetOuterEnumDefaultValueOk() (OuterEnumDefaultValue, bool)` + +GetOuterEnumDefaultValueOk returns a tuple with the OuterEnumDefaultValue field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasOuterEnumDefaultValue + +`func (o *EnumTest) HasOuterEnumDefaultValue() bool` + +HasOuterEnumDefaultValue returns a boolean if a field has been set. + +### SetOuterEnumDefaultValue + +`func (o *EnumTest) SetOuterEnumDefaultValue(v OuterEnumDefaultValue)` + +SetOuterEnumDefaultValue gets a reference to the given OuterEnumDefaultValue and assigns it to the OuterEnumDefaultValue field. + +### GetOuterEnumIntegerDefaultValue + +`func (o *EnumTest) GetOuterEnumIntegerDefaultValue() OuterEnumIntegerDefaultValue` + +GetOuterEnumIntegerDefaultValue returns the OuterEnumIntegerDefaultValue field if non-nil, zero value otherwise. + +### GetOuterEnumIntegerDefaultValueOk + +`func (o *EnumTest) GetOuterEnumIntegerDefaultValueOk() (OuterEnumIntegerDefaultValue, bool)` + +GetOuterEnumIntegerDefaultValueOk returns a tuple with the OuterEnumIntegerDefaultValue field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasOuterEnumIntegerDefaultValue + +`func (o *EnumTest) HasOuterEnumIntegerDefaultValue() bool` + +HasOuterEnumIntegerDefaultValue returns a boolean if a field has been set. + +### SetOuterEnumIntegerDefaultValue + +`func (o *EnumTest) SetOuterEnumIntegerDefaultValue(v OuterEnumIntegerDefaultValue)` + +SetOuterEnumIntegerDefaultValue gets a reference to the given OuterEnumIntegerDefaultValue and assigns it to the OuterEnumIntegerDefaultValue field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/FakeApi.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/FakeApi.md new file mode 100644 index 000000000000..5695233a26c9 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/FakeApi.md @@ -0,0 +1,535 @@ +# \FakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**FakeHealthGet**](FakeApi.md#FakeHealthGet) | **Get** /fake/health | Health check endpoint +[**FakeOuterBooleanSerialize**](FakeApi.md#FakeOuterBooleanSerialize) | **Post** /fake/outer/boolean | +[**FakeOuterCompositeSerialize**](FakeApi.md#FakeOuterCompositeSerialize) | **Post** /fake/outer/composite | +[**FakeOuterNumberSerialize**](FakeApi.md#FakeOuterNumberSerialize) | **Post** /fake/outer/number | +[**FakeOuterStringSerialize**](FakeApi.md#FakeOuterStringSerialize) | **Post** /fake/outer/string | +[**TestBodyWithFileSchema**](FakeApi.md#TestBodyWithFileSchema) | **Put** /fake/body-with-file-schema | +[**TestBodyWithQueryParams**](FakeApi.md#TestBodyWithQueryParams) | **Put** /fake/body-with-query-params | +[**TestClientModel**](FakeApi.md#TestClientModel) | **Patch** /fake | To test \"client\" model +[**TestEndpointParameters**](FakeApi.md#TestEndpointParameters) | **Post** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**TestEnumParameters**](FakeApi.md#TestEnumParameters) | **Get** /fake | To test enum parameters +[**TestGroupParameters**](FakeApi.md#TestGroupParameters) | **Delete** /fake | Fake endpoint to test group parameters (optional) +[**TestInlineAdditionalProperties**](FakeApi.md#TestInlineAdditionalProperties) | **Post** /fake/inline-additionalProperties | test inline additionalProperties +[**TestJsonFormData**](FakeApi.md#TestJsonFormData) | **Get** /fake/jsonFormData | test json serialization of form data + + + +## FakeHealthGet + +> HealthCheckResult FakeHealthGet(ctx, ) +Health check endpoint + +### Required Parameters + +This endpoint does not need any parameter. + +### Return type + +[**HealthCheckResult**](HealthCheckResult.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FakeOuterBooleanSerialize + +> bool FakeOuterBooleanSerialize(ctx, optional) + + +Test serialization of outer boolean types + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***FakeOuterBooleanSerializeOpts** | optional parameters | nil if no parameters + +### Optional Parameters + +Optional parameters are passed through a pointer to a FakeOuterBooleanSerializeOpts struct + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **optional.Bool**| Input boolean as post body | + +### Return type + +**bool** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FakeOuterCompositeSerialize + +> OuterComposite FakeOuterCompositeSerialize(ctx, optional) + + +Test serialization of object with outer number type + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***FakeOuterCompositeSerializeOpts** | optional parameters | nil if no parameters + +### Optional Parameters + +Optional parameters are passed through a pointer to a FakeOuterCompositeSerializeOpts struct + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **outerComposite** | [**optional.Interface of OuterComposite**](OuterComposite.md)| Input composite as post body | + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FakeOuterNumberSerialize + +> float32 FakeOuterNumberSerialize(ctx, optional) + + +Test serialization of outer number types + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***FakeOuterNumberSerializeOpts** | optional parameters | nil if no parameters + +### Optional Parameters + +Optional parameters are passed through a pointer to a FakeOuterNumberSerializeOpts struct + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **optional.Float32**| Input number as post body | + +### Return type + +**float32** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FakeOuterStringSerialize + +> string FakeOuterStringSerialize(ctx, optional) + + +Test serialization of outer string types + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***FakeOuterStringSerializeOpts** | optional parameters | nil if no parameters + +### Optional Parameters + +Optional parameters are passed through a pointer to a FakeOuterStringSerializeOpts struct + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **optional.String**| Input string as post body | + +### Return type + +**string** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## TestBodyWithFileSchema + +> TestBodyWithFileSchema(ctx, fileSchemaTestClass) + + +For this test, the body for this request much reference a schema named `File`. + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## TestBodyWithQueryParams + +> TestBodyWithQueryParams(ctx, query, user) + + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**query** | **string**| | +**user** | [**User**](User.md)| | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## TestClientModel + +> Client TestClientModel(ctx, client) +To test \"client\" model + +To test \"client\" model + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**client** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## TestEndpointParameters + +> TestEndpointParameters(ctx, number, double, patternWithoutDelimiter, byte_, optional) +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**number** | **float32**| None | +**double** | **float64**| None | +**patternWithoutDelimiter** | **string**| None | +**byte_** | **string**| None | + **optional** | ***TestEndpointParametersOpts** | optional parameters | nil if no parameters + +### Optional Parameters + +Optional parameters are passed through a pointer to a TestEndpointParametersOpts struct + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + + **integer** | **optional.Int32**| None | + **int32_** | **optional.Int32**| None | + **int64_** | **optional.Int64**| None | + **float** | **optional.Float32**| None | + **string_** | **optional.String**| None | + **binary** | **optional.Interface of *os.File****optional.*os.File**| None | + **date** | **optional.String**| None | + **dateTime** | **optional.Time**| None | + **password** | **optional.String**| None | + **callback** | **optional.String**| None | + +### Return type + + (empty response body) + +### Authorization + +[http_basic_test](../README.md#http_basic_test) + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## TestEnumParameters + +> TestEnumParameters(ctx, optional) +To test enum parameters + +To test enum parameters + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***TestEnumParametersOpts** | optional parameters | nil if no parameters + +### Optional Parameters + +Optional parameters are passed through a pointer to a TestEnumParametersOpts struct + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **enumHeaderStringArray** | [**optional.Interface of []string**](string.md)| Header parameter enum test (string array) | + **enumHeaderString** | **optional.String**| Header parameter enum test (string) | [default to -efg] + **enumQueryStringArray** | [**optional.Interface of []string**](string.md)| Query parameter enum test (string array) | + **enumQueryString** | **optional.String**| Query parameter enum test (string) | [default to -efg] + **enumQueryInteger** | **optional.Int32**| Query parameter enum test (double) | + **enumQueryDouble** | **optional.Float64**| Query parameter enum test (double) | + **enumFormStringArray** | [**optional.Interface of []string**](string.md)| Form parameter enum test (string array) | [default to $] + **enumFormString** | **optional.String**| Form parameter enum test (string) | [default to -efg] + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## TestGroupParameters + +> TestGroupParameters(ctx, requiredStringGroup, requiredBooleanGroup, requiredInt64Group, optional) +Fake endpoint to test group parameters (optional) + +Fake endpoint to test group parameters (optional) + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**requiredStringGroup** | **int32**| Required String in group parameters | +**requiredBooleanGroup** | **bool**| Required Boolean in group parameters | +**requiredInt64Group** | **int64**| Required Integer in group parameters | + **optional** | ***TestGroupParametersOpts** | optional parameters | nil if no parameters + +### Optional Parameters + +Optional parameters are passed through a pointer to a TestGroupParametersOpts struct + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **stringGroup** | **optional.Int32**| String in group parameters | + **booleanGroup** | **optional.Bool**| Boolean in group parameters | + **int64Group** | **optional.Int64**| Integer in group parameters | + +### Return type + + (empty response body) + +### Authorization + +[bearer_test](../README.md#bearer_test) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## TestInlineAdditionalProperties + +> TestInlineAdditionalProperties(ctx, requestBody) +test inline additionalProperties + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**requestBody** | [**map[string]string**](string.md)| request body | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## TestJsonFormData + +> TestJsonFormData(ctx, param, param2) +test json serialization of form data + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**param** | **string**| field1 | +**param2** | **string**| field2 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/FakeClassnameTags123Api.md new file mode 100644 index 000000000000..5bf7b3bcc991 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/FakeClassnameTags123Api.md @@ -0,0 +1,42 @@ +# \FakeClassnameTags123Api + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**TestClassname**](FakeClassnameTags123Api.md#TestClassname) | **Patch** /fake_classname_test | To test class name in snake case + + + +## TestClassname + +> Client TestClassname(ctx, client) +To test class name in snake case + +To test class name in snake case + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**client** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +[api_key_query](../README.md#api_key_query) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/File.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/File.md new file mode 100644 index 000000000000..454b159609c1 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/File.md @@ -0,0 +1,39 @@ +# File + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SourceURI** | Pointer to **string** | Test capitalization | [optional] + +## Methods + +### GetSourceURI + +`func (o *File) GetSourceURI() string` + +GetSourceURI returns the SourceURI field if non-nil, zero value otherwise. + +### GetSourceURIOk + +`func (o *File) GetSourceURIOk() (string, bool)` + +GetSourceURIOk returns a tuple with the SourceURI field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasSourceURI + +`func (o *File) HasSourceURI() bool` + +HasSourceURI returns a boolean if a field has been set. + +### SetSourceURI + +`func (o *File) SetSourceURI(v string)` + +SetSourceURI gets a reference to the given string and assigns it to the SourceURI field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/FileSchemaTestClass.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/FileSchemaTestClass.md new file mode 100644 index 000000000000..d4a4da7206c4 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/FileSchemaTestClass.md @@ -0,0 +1,65 @@ +# FileSchemaTestClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**File** | Pointer to [**File**](File.md) | | [optional] +**Files** | Pointer to [**[]File**](File.md) | | [optional] + +## Methods + +### GetFile + +`func (o *FileSchemaTestClass) GetFile() File` + +GetFile returns the File field if non-nil, zero value otherwise. + +### GetFileOk + +`func (o *FileSchemaTestClass) GetFileOk() (File, bool)` + +GetFileOk returns a tuple with the File field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasFile + +`func (o *FileSchemaTestClass) HasFile() bool` + +HasFile returns a boolean if a field has been set. + +### SetFile + +`func (o *FileSchemaTestClass) SetFile(v File)` + +SetFile gets a reference to the given File and assigns it to the File field. + +### GetFiles + +`func (o *FileSchemaTestClass) GetFiles() []File` + +GetFiles returns the Files field if non-nil, zero value otherwise. + +### GetFilesOk + +`func (o *FileSchemaTestClass) GetFilesOk() ([]File, bool)` + +GetFilesOk returns a tuple with the Files field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasFiles + +`func (o *FileSchemaTestClass) HasFiles() bool` + +HasFiles returns a boolean if a field has been set. + +### SetFiles + +`func (o *FileSchemaTestClass) SetFiles(v []File)` + +SetFiles gets a reference to the given []File and assigns it to the Files field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Foo.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Foo.md new file mode 100644 index 000000000000..82e3c253f2ee --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Foo.md @@ -0,0 +1,39 @@ +# Foo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Bar** | Pointer to **string** | | [optional] [default to bar] + +## Methods + +### GetBar + +`func (o *Foo) GetBar() string` + +GetBar returns the Bar field if non-nil, zero value otherwise. + +### GetBarOk + +`func (o *Foo) GetBarOk() (string, bool)` + +GetBarOk returns a tuple with the Bar field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasBar + +`func (o *Foo) HasBar() bool` + +HasBar returns a boolean if a field has been set. + +### SetBar + +`func (o *Foo) SetBar(v string)` + +SetBar gets a reference to the given string and assigns it to the Bar field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/FormatTest.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/FormatTest.md new file mode 100644 index 000000000000..861d7aa3eb15 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/FormatTest.md @@ -0,0 +1,403 @@ +# FormatTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Integer** | Pointer to **int32** | | [optional] +**Int32** | Pointer to **int32** | | [optional] +**Int64** | Pointer to **int64** | | [optional] +**Number** | Pointer to **float32** | | +**Float** | Pointer to **float32** | | [optional] +**Double** | Pointer to **float64** | | [optional] +**String** | Pointer to **string** | | [optional] +**Byte** | Pointer to **string** | | +**Binary** | Pointer to [***os.File**](*os.File.md) | | [optional] +**Date** | Pointer to **string** | | +**DateTime** | Pointer to [**time.Time**](time.Time.md) | | [optional] +**Uuid** | Pointer to **string** | | [optional] +**Password** | Pointer to **string** | | +**PatternWithDigits** | Pointer to **string** | A string that is a 10 digit number. Can have leading zeros. | [optional] +**PatternWithDigitsAndDelimiter** | Pointer to **string** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] + +## Methods + +### GetInteger + +`func (o *FormatTest) GetInteger() int32` + +GetInteger returns the Integer field if non-nil, zero value otherwise. + +### GetIntegerOk + +`func (o *FormatTest) GetIntegerOk() (int32, bool)` + +GetIntegerOk returns a tuple with the Integer field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasInteger + +`func (o *FormatTest) HasInteger() bool` + +HasInteger returns a boolean if a field has been set. + +### SetInteger + +`func (o *FormatTest) SetInteger(v int32)` + +SetInteger gets a reference to the given int32 and assigns it to the Integer field. + +### GetInt32 + +`func (o *FormatTest) GetInt32() int32` + +GetInt32 returns the Int32 field if non-nil, zero value otherwise. + +### GetInt32Ok + +`func (o *FormatTest) GetInt32Ok() (int32, bool)` + +GetInt32Ok returns a tuple with the Int32 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasInt32 + +`func (o *FormatTest) HasInt32() bool` + +HasInt32 returns a boolean if a field has been set. + +### SetInt32 + +`func (o *FormatTest) SetInt32(v int32)` + +SetInt32 gets a reference to the given int32 and assigns it to the Int32 field. + +### GetInt64 + +`func (o *FormatTest) GetInt64() int64` + +GetInt64 returns the Int64 field if non-nil, zero value otherwise. + +### GetInt64Ok + +`func (o *FormatTest) GetInt64Ok() (int64, bool)` + +GetInt64Ok returns a tuple with the Int64 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasInt64 + +`func (o *FormatTest) HasInt64() bool` + +HasInt64 returns a boolean if a field has been set. + +### SetInt64 + +`func (o *FormatTest) SetInt64(v int64)` + +SetInt64 gets a reference to the given int64 and assigns it to the Int64 field. + +### GetNumber + +`func (o *FormatTest) GetNumber() float32` + +GetNumber returns the Number field if non-nil, zero value otherwise. + +### GetNumberOk + +`func (o *FormatTest) GetNumberOk() (float32, bool)` + +GetNumberOk returns a tuple with the Number field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasNumber + +`func (o *FormatTest) HasNumber() bool` + +HasNumber returns a boolean if a field has been set. + +### SetNumber + +`func (o *FormatTest) SetNumber(v float32)` + +SetNumber gets a reference to the given float32 and assigns it to the Number field. + +### GetFloat + +`func (o *FormatTest) GetFloat() float32` + +GetFloat returns the Float field if non-nil, zero value otherwise. + +### GetFloatOk + +`func (o *FormatTest) GetFloatOk() (float32, bool)` + +GetFloatOk returns a tuple with the Float field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasFloat + +`func (o *FormatTest) HasFloat() bool` + +HasFloat returns a boolean if a field has been set. + +### SetFloat + +`func (o *FormatTest) SetFloat(v float32)` + +SetFloat gets a reference to the given float32 and assigns it to the Float field. + +### GetDouble + +`func (o *FormatTest) GetDouble() float64` + +GetDouble returns the Double field if non-nil, zero value otherwise. + +### GetDoubleOk + +`func (o *FormatTest) GetDoubleOk() (float64, bool)` + +GetDoubleOk returns a tuple with the Double field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasDouble + +`func (o *FormatTest) HasDouble() bool` + +HasDouble returns a boolean if a field has been set. + +### SetDouble + +`func (o *FormatTest) SetDouble(v float64)` + +SetDouble gets a reference to the given float64 and assigns it to the Double field. + +### GetString + +`func (o *FormatTest) GetString() string` + +GetString returns the String field if non-nil, zero value otherwise. + +### GetStringOk + +`func (o *FormatTest) GetStringOk() (string, bool)` + +GetStringOk returns a tuple with the String field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasString + +`func (o *FormatTest) HasString() bool` + +HasString returns a boolean if a field has been set. + +### SetString + +`func (o *FormatTest) SetString(v string)` + +SetString gets a reference to the given string and assigns it to the String field. + +### GetByte + +`func (o *FormatTest) GetByte() string` + +GetByte returns the Byte field if non-nil, zero value otherwise. + +### GetByteOk + +`func (o *FormatTest) GetByteOk() (string, bool)` + +GetByteOk returns a tuple with the Byte field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasByte + +`func (o *FormatTest) HasByte() bool` + +HasByte returns a boolean if a field has been set. + +### SetByte + +`func (o *FormatTest) SetByte(v string)` + +SetByte gets a reference to the given string and assigns it to the Byte field. + +### GetBinary + +`func (o *FormatTest) GetBinary() *os.File` + +GetBinary returns the Binary field if non-nil, zero value otherwise. + +### GetBinaryOk + +`func (o *FormatTest) GetBinaryOk() (*os.File, bool)` + +GetBinaryOk returns a tuple with the Binary field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasBinary + +`func (o *FormatTest) HasBinary() bool` + +HasBinary returns a boolean if a field has been set. + +### SetBinary + +`func (o *FormatTest) SetBinary(v *os.File)` + +SetBinary gets a reference to the given *os.File and assigns it to the Binary field. + +### GetDate + +`func (o *FormatTest) GetDate() string` + +GetDate returns the Date field if non-nil, zero value otherwise. + +### GetDateOk + +`func (o *FormatTest) GetDateOk() (string, bool)` + +GetDateOk returns a tuple with the Date field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasDate + +`func (o *FormatTest) HasDate() bool` + +HasDate returns a boolean if a field has been set. + +### SetDate + +`func (o *FormatTest) SetDate(v string)` + +SetDate gets a reference to the given string and assigns it to the Date field. + +### GetDateTime + +`func (o *FormatTest) GetDateTime() time.Time` + +GetDateTime returns the DateTime field if non-nil, zero value otherwise. + +### GetDateTimeOk + +`func (o *FormatTest) GetDateTimeOk() (time.Time, bool)` + +GetDateTimeOk returns a tuple with the DateTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasDateTime + +`func (o *FormatTest) HasDateTime() bool` + +HasDateTime returns a boolean if a field has been set. + +### SetDateTime + +`func (o *FormatTest) SetDateTime(v time.Time)` + +SetDateTime gets a reference to the given time.Time and assigns it to the DateTime field. + +### GetUuid + +`func (o *FormatTest) GetUuid() string` + +GetUuid returns the Uuid field if non-nil, zero value otherwise. + +### GetUuidOk + +`func (o *FormatTest) GetUuidOk() (string, bool)` + +GetUuidOk returns a tuple with the Uuid field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasUuid + +`func (o *FormatTest) HasUuid() bool` + +HasUuid returns a boolean if a field has been set. + +### SetUuid + +`func (o *FormatTest) SetUuid(v string)` + +SetUuid gets a reference to the given string and assigns it to the Uuid field. + +### GetPassword + +`func (o *FormatTest) GetPassword() string` + +GetPassword returns the Password field if non-nil, zero value otherwise. + +### GetPasswordOk + +`func (o *FormatTest) GetPasswordOk() (string, bool)` + +GetPasswordOk returns a tuple with the Password field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasPassword + +`func (o *FormatTest) HasPassword() bool` + +HasPassword returns a boolean if a field has been set. + +### SetPassword + +`func (o *FormatTest) SetPassword(v string)` + +SetPassword gets a reference to the given string and assigns it to the Password field. + +### GetPatternWithDigits + +`func (o *FormatTest) GetPatternWithDigits() string` + +GetPatternWithDigits returns the PatternWithDigits field if non-nil, zero value otherwise. + +### GetPatternWithDigitsOk + +`func (o *FormatTest) GetPatternWithDigitsOk() (string, bool)` + +GetPatternWithDigitsOk returns a tuple with the PatternWithDigits field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasPatternWithDigits + +`func (o *FormatTest) HasPatternWithDigits() bool` + +HasPatternWithDigits returns a boolean if a field has been set. + +### SetPatternWithDigits + +`func (o *FormatTest) SetPatternWithDigits(v string)` + +SetPatternWithDigits gets a reference to the given string and assigns it to the PatternWithDigits field. + +### GetPatternWithDigitsAndDelimiter + +`func (o *FormatTest) GetPatternWithDigitsAndDelimiter() string` + +GetPatternWithDigitsAndDelimiter returns the PatternWithDigitsAndDelimiter field if non-nil, zero value otherwise. + +### GetPatternWithDigitsAndDelimiterOk + +`func (o *FormatTest) GetPatternWithDigitsAndDelimiterOk() (string, bool)` + +GetPatternWithDigitsAndDelimiterOk returns a tuple with the PatternWithDigitsAndDelimiter field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasPatternWithDigitsAndDelimiter + +`func (o *FormatTest) HasPatternWithDigitsAndDelimiter() bool` + +HasPatternWithDigitsAndDelimiter returns a boolean if a field has been set. + +### SetPatternWithDigitsAndDelimiter + +`func (o *FormatTest) SetPatternWithDigitsAndDelimiter(v string)` + +SetPatternWithDigitsAndDelimiter gets a reference to the given string and assigns it to the PatternWithDigitsAndDelimiter field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/HasOnlyReadOnly.md new file mode 100644 index 000000000000..78f67041d33a --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/HasOnlyReadOnly.md @@ -0,0 +1,65 @@ +# HasOnlyReadOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Bar** | Pointer to **string** | | [optional] +**Foo** | Pointer to **string** | | [optional] + +## Methods + +### GetBar + +`func (o *HasOnlyReadOnly) GetBar() string` + +GetBar returns the Bar field if non-nil, zero value otherwise. + +### GetBarOk + +`func (o *HasOnlyReadOnly) GetBarOk() (string, bool)` + +GetBarOk returns a tuple with the Bar field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasBar + +`func (o *HasOnlyReadOnly) HasBar() bool` + +HasBar returns a boolean if a field has been set. + +### SetBar + +`func (o *HasOnlyReadOnly) SetBar(v string)` + +SetBar gets a reference to the given string and assigns it to the Bar field. + +### GetFoo + +`func (o *HasOnlyReadOnly) GetFoo() string` + +GetFoo returns the Foo field if non-nil, zero value otherwise. + +### GetFooOk + +`func (o *HasOnlyReadOnly) GetFooOk() (string, bool)` + +GetFooOk returns a tuple with the Foo field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasFoo + +`func (o *HasOnlyReadOnly) HasFoo() bool` + +HasFoo returns a boolean if a field has been set. + +### SetFoo + +`func (o *HasOnlyReadOnly) SetFoo(v string)` + +SetFoo gets a reference to the given string and assigns it to the Foo field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/HealthCheckResult.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/HealthCheckResult.md new file mode 100644 index 000000000000..63f7a2fa8467 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/HealthCheckResult.md @@ -0,0 +1,46 @@ +# HealthCheckResult + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**NullableMessage** | Pointer to **string** | | [optional] + +## Methods + +### GetNullableMessage + +`func (o *HealthCheckResult) GetNullableMessage() string` + +GetNullableMessage returns the NullableMessage field if non-nil, zero value otherwise. + +### GetNullableMessageOk + +`func (o *HealthCheckResult) GetNullableMessageOk() (string, bool)` + +GetNullableMessageOk returns a tuple with the NullableMessage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasNullableMessage + +`func (o *HealthCheckResult) HasNullableMessage() bool` + +HasNullableMessage returns a boolean if a field has been set. + +### SetNullableMessage + +`func (o *HealthCheckResult) SetNullableMessage(v string)` + +SetNullableMessage gets a reference to the given string and assigns it to the NullableMessage field. + +### SetNullableMessageExplicitNull + +`func (o *HealthCheckResult) SetNullableMessageExplicitNull(b bool)` + +SetNullableMessageExplicitNull (un)sets NullableMessage to be considered as explicit "null" value +when serializing to JSON (pass true as argument to set this, false to unset) +The NullableMessage value is set to nil even if false is passed + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineObject.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineObject.md new file mode 100644 index 000000000000..0c93a8999ad5 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineObject.md @@ -0,0 +1,65 @@ +# InlineObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | Pointer to **string** | Updated name of the pet | [optional] +**Status** | Pointer to **string** | Updated status of the pet | [optional] + +## Methods + +### GetName + +`func (o *InlineObject) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *InlineObject) GetNameOk() (string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasName + +`func (o *InlineObject) HasName() bool` + +HasName returns a boolean if a field has been set. + +### SetName + +`func (o *InlineObject) SetName(v string)` + +SetName gets a reference to the given string and assigns it to the Name field. + +### GetStatus + +`func (o *InlineObject) GetStatus() string` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *InlineObject) GetStatusOk() (string, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasStatus + +`func (o *InlineObject) HasStatus() bool` + +HasStatus returns a boolean if a field has been set. + +### SetStatus + +`func (o *InlineObject) SetStatus(v string)` + +SetStatus gets a reference to the given string and assigns it to the Status field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineObject1.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineObject1.md new file mode 100644 index 000000000000..f30ef94a8379 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineObject1.md @@ -0,0 +1,65 @@ +# InlineObject1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AdditionalMetadata** | Pointer to **string** | Additional data to pass to server | [optional] +**File** | Pointer to [***os.File**](*os.File.md) | file to upload | [optional] + +## Methods + +### GetAdditionalMetadata + +`func (o *InlineObject1) GetAdditionalMetadata() string` + +GetAdditionalMetadata returns the AdditionalMetadata field if non-nil, zero value otherwise. + +### GetAdditionalMetadataOk + +`func (o *InlineObject1) GetAdditionalMetadataOk() (string, bool)` + +GetAdditionalMetadataOk returns a tuple with the AdditionalMetadata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasAdditionalMetadata + +`func (o *InlineObject1) HasAdditionalMetadata() bool` + +HasAdditionalMetadata returns a boolean if a field has been set. + +### SetAdditionalMetadata + +`func (o *InlineObject1) SetAdditionalMetadata(v string)` + +SetAdditionalMetadata gets a reference to the given string and assigns it to the AdditionalMetadata field. + +### GetFile + +`func (o *InlineObject1) GetFile() *os.File` + +GetFile returns the File field if non-nil, zero value otherwise. + +### GetFileOk + +`func (o *InlineObject1) GetFileOk() (*os.File, bool)` + +GetFileOk returns a tuple with the File field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasFile + +`func (o *InlineObject1) HasFile() bool` + +HasFile returns a boolean if a field has been set. + +### SetFile + +`func (o *InlineObject1) SetFile(v *os.File)` + +SetFile gets a reference to the given *os.File and assigns it to the File field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineObject2.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineObject2.md new file mode 100644 index 000000000000..62a7142a4d0d --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineObject2.md @@ -0,0 +1,65 @@ +# InlineObject2 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**EnumFormStringArray** | Pointer to **[]string** | Form parameter enum test (string array) | [optional] +**EnumFormString** | Pointer to **string** | Form parameter enum test (string) | [optional] [default to ENUM_FORM_STRING_EFG] + +## Methods + +### GetEnumFormStringArray + +`func (o *InlineObject2) GetEnumFormStringArray() []string` + +GetEnumFormStringArray returns the EnumFormStringArray field if non-nil, zero value otherwise. + +### GetEnumFormStringArrayOk + +`func (o *InlineObject2) GetEnumFormStringArrayOk() ([]string, bool)` + +GetEnumFormStringArrayOk returns a tuple with the EnumFormStringArray field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasEnumFormStringArray + +`func (o *InlineObject2) HasEnumFormStringArray() bool` + +HasEnumFormStringArray returns a boolean if a field has been set. + +### SetEnumFormStringArray + +`func (o *InlineObject2) SetEnumFormStringArray(v []string)` + +SetEnumFormStringArray gets a reference to the given []string and assigns it to the EnumFormStringArray field. + +### GetEnumFormString + +`func (o *InlineObject2) GetEnumFormString() string` + +GetEnumFormString returns the EnumFormString field if non-nil, zero value otherwise. + +### GetEnumFormStringOk + +`func (o *InlineObject2) GetEnumFormStringOk() (string, bool)` + +GetEnumFormStringOk returns a tuple with the EnumFormString field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasEnumFormString + +`func (o *InlineObject2) HasEnumFormString() bool` + +HasEnumFormString returns a boolean if a field has been set. + +### SetEnumFormString + +`func (o *InlineObject2) SetEnumFormString(v string)` + +SetEnumFormString gets a reference to the given string and assigns it to the EnumFormString field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineObject3.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineObject3.md new file mode 100644 index 000000000000..911b0ffb9181 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineObject3.md @@ -0,0 +1,377 @@ +# InlineObject3 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Integer** | Pointer to **int32** | None | [optional] +**Int32** | Pointer to **int32** | None | [optional] +**Int64** | Pointer to **int64** | None | [optional] +**Number** | Pointer to **float32** | None | +**Float** | Pointer to **float32** | None | [optional] +**Double** | Pointer to **float64** | None | +**String** | Pointer to **string** | None | [optional] +**PatternWithoutDelimiter** | Pointer to **string** | None | +**Byte** | Pointer to **string** | None | +**Binary** | Pointer to [***os.File**](*os.File.md) | None | [optional] +**Date** | Pointer to **string** | None | [optional] +**DateTime** | Pointer to [**time.Time**](time.Time.md) | None | [optional] +**Password** | Pointer to **string** | None | [optional] +**Callback** | Pointer to **string** | None | [optional] + +## Methods + +### GetInteger + +`func (o *InlineObject3) GetInteger() int32` + +GetInteger returns the Integer field if non-nil, zero value otherwise. + +### GetIntegerOk + +`func (o *InlineObject3) GetIntegerOk() (int32, bool)` + +GetIntegerOk returns a tuple with the Integer field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasInteger + +`func (o *InlineObject3) HasInteger() bool` + +HasInteger returns a boolean if a field has been set. + +### SetInteger + +`func (o *InlineObject3) SetInteger(v int32)` + +SetInteger gets a reference to the given int32 and assigns it to the Integer field. + +### GetInt32 + +`func (o *InlineObject3) GetInt32() int32` + +GetInt32 returns the Int32 field if non-nil, zero value otherwise. + +### GetInt32Ok + +`func (o *InlineObject3) GetInt32Ok() (int32, bool)` + +GetInt32Ok returns a tuple with the Int32 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasInt32 + +`func (o *InlineObject3) HasInt32() bool` + +HasInt32 returns a boolean if a field has been set. + +### SetInt32 + +`func (o *InlineObject3) SetInt32(v int32)` + +SetInt32 gets a reference to the given int32 and assigns it to the Int32 field. + +### GetInt64 + +`func (o *InlineObject3) GetInt64() int64` + +GetInt64 returns the Int64 field if non-nil, zero value otherwise. + +### GetInt64Ok + +`func (o *InlineObject3) GetInt64Ok() (int64, bool)` + +GetInt64Ok returns a tuple with the Int64 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasInt64 + +`func (o *InlineObject3) HasInt64() bool` + +HasInt64 returns a boolean if a field has been set. + +### SetInt64 + +`func (o *InlineObject3) SetInt64(v int64)` + +SetInt64 gets a reference to the given int64 and assigns it to the Int64 field. + +### GetNumber + +`func (o *InlineObject3) GetNumber() float32` + +GetNumber returns the Number field if non-nil, zero value otherwise. + +### GetNumberOk + +`func (o *InlineObject3) GetNumberOk() (float32, bool)` + +GetNumberOk returns a tuple with the Number field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasNumber + +`func (o *InlineObject3) HasNumber() bool` + +HasNumber returns a boolean if a field has been set. + +### SetNumber + +`func (o *InlineObject3) SetNumber(v float32)` + +SetNumber gets a reference to the given float32 and assigns it to the Number field. + +### GetFloat + +`func (o *InlineObject3) GetFloat() float32` + +GetFloat returns the Float field if non-nil, zero value otherwise. + +### GetFloatOk + +`func (o *InlineObject3) GetFloatOk() (float32, bool)` + +GetFloatOk returns a tuple with the Float field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasFloat + +`func (o *InlineObject3) HasFloat() bool` + +HasFloat returns a boolean if a field has been set. + +### SetFloat + +`func (o *InlineObject3) SetFloat(v float32)` + +SetFloat gets a reference to the given float32 and assigns it to the Float field. + +### GetDouble + +`func (o *InlineObject3) GetDouble() float64` + +GetDouble returns the Double field if non-nil, zero value otherwise. + +### GetDoubleOk + +`func (o *InlineObject3) GetDoubleOk() (float64, bool)` + +GetDoubleOk returns a tuple with the Double field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasDouble + +`func (o *InlineObject3) HasDouble() bool` + +HasDouble returns a boolean if a field has been set. + +### SetDouble + +`func (o *InlineObject3) SetDouble(v float64)` + +SetDouble gets a reference to the given float64 and assigns it to the Double field. + +### GetString + +`func (o *InlineObject3) GetString() string` + +GetString returns the String field if non-nil, zero value otherwise. + +### GetStringOk + +`func (o *InlineObject3) GetStringOk() (string, bool)` + +GetStringOk returns a tuple with the String field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasString + +`func (o *InlineObject3) HasString() bool` + +HasString returns a boolean if a field has been set. + +### SetString + +`func (o *InlineObject3) SetString(v string)` + +SetString gets a reference to the given string and assigns it to the String field. + +### GetPatternWithoutDelimiter + +`func (o *InlineObject3) GetPatternWithoutDelimiter() string` + +GetPatternWithoutDelimiter returns the PatternWithoutDelimiter field if non-nil, zero value otherwise. + +### GetPatternWithoutDelimiterOk + +`func (o *InlineObject3) GetPatternWithoutDelimiterOk() (string, bool)` + +GetPatternWithoutDelimiterOk returns a tuple with the PatternWithoutDelimiter field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasPatternWithoutDelimiter + +`func (o *InlineObject3) HasPatternWithoutDelimiter() bool` + +HasPatternWithoutDelimiter returns a boolean if a field has been set. + +### SetPatternWithoutDelimiter + +`func (o *InlineObject3) SetPatternWithoutDelimiter(v string)` + +SetPatternWithoutDelimiter gets a reference to the given string and assigns it to the PatternWithoutDelimiter field. + +### GetByte + +`func (o *InlineObject3) GetByte() string` + +GetByte returns the Byte field if non-nil, zero value otherwise. + +### GetByteOk + +`func (o *InlineObject3) GetByteOk() (string, bool)` + +GetByteOk returns a tuple with the Byte field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasByte + +`func (o *InlineObject3) HasByte() bool` + +HasByte returns a boolean if a field has been set. + +### SetByte + +`func (o *InlineObject3) SetByte(v string)` + +SetByte gets a reference to the given string and assigns it to the Byte field. + +### GetBinary + +`func (o *InlineObject3) GetBinary() *os.File` + +GetBinary returns the Binary field if non-nil, zero value otherwise. + +### GetBinaryOk + +`func (o *InlineObject3) GetBinaryOk() (*os.File, bool)` + +GetBinaryOk returns a tuple with the Binary field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasBinary + +`func (o *InlineObject3) HasBinary() bool` + +HasBinary returns a boolean if a field has been set. + +### SetBinary + +`func (o *InlineObject3) SetBinary(v *os.File)` + +SetBinary gets a reference to the given *os.File and assigns it to the Binary field. + +### GetDate + +`func (o *InlineObject3) GetDate() string` + +GetDate returns the Date field if non-nil, zero value otherwise. + +### GetDateOk + +`func (o *InlineObject3) GetDateOk() (string, bool)` + +GetDateOk returns a tuple with the Date field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasDate + +`func (o *InlineObject3) HasDate() bool` + +HasDate returns a boolean if a field has been set. + +### SetDate + +`func (o *InlineObject3) SetDate(v string)` + +SetDate gets a reference to the given string and assigns it to the Date field. + +### GetDateTime + +`func (o *InlineObject3) GetDateTime() time.Time` + +GetDateTime returns the DateTime field if non-nil, zero value otherwise. + +### GetDateTimeOk + +`func (o *InlineObject3) GetDateTimeOk() (time.Time, bool)` + +GetDateTimeOk returns a tuple with the DateTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasDateTime + +`func (o *InlineObject3) HasDateTime() bool` + +HasDateTime returns a boolean if a field has been set. + +### SetDateTime + +`func (o *InlineObject3) SetDateTime(v time.Time)` + +SetDateTime gets a reference to the given time.Time and assigns it to the DateTime field. + +### GetPassword + +`func (o *InlineObject3) GetPassword() string` + +GetPassword returns the Password field if non-nil, zero value otherwise. + +### GetPasswordOk + +`func (o *InlineObject3) GetPasswordOk() (string, bool)` + +GetPasswordOk returns a tuple with the Password field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasPassword + +`func (o *InlineObject3) HasPassword() bool` + +HasPassword returns a boolean if a field has been set. + +### SetPassword + +`func (o *InlineObject3) SetPassword(v string)` + +SetPassword gets a reference to the given string and assigns it to the Password field. + +### GetCallback + +`func (o *InlineObject3) GetCallback() string` + +GetCallback returns the Callback field if non-nil, zero value otherwise. + +### GetCallbackOk + +`func (o *InlineObject3) GetCallbackOk() (string, bool)` + +GetCallbackOk returns a tuple with the Callback field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasCallback + +`func (o *InlineObject3) HasCallback() bool` + +HasCallback returns a boolean if a field has been set. + +### SetCallback + +`func (o *InlineObject3) SetCallback(v string)` + +SetCallback gets a reference to the given string and assigns it to the Callback field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineObject4.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineObject4.md new file mode 100644 index 000000000000..8316407b6521 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineObject4.md @@ -0,0 +1,65 @@ +# InlineObject4 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Param** | Pointer to **string** | field1 | +**Param2** | Pointer to **string** | field2 | + +## Methods + +### GetParam + +`func (o *InlineObject4) GetParam() string` + +GetParam returns the Param field if non-nil, zero value otherwise. + +### GetParamOk + +`func (o *InlineObject4) GetParamOk() (string, bool)` + +GetParamOk returns a tuple with the Param field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasParam + +`func (o *InlineObject4) HasParam() bool` + +HasParam returns a boolean if a field has been set. + +### SetParam + +`func (o *InlineObject4) SetParam(v string)` + +SetParam gets a reference to the given string and assigns it to the Param field. + +### GetParam2 + +`func (o *InlineObject4) GetParam2() string` + +GetParam2 returns the Param2 field if non-nil, zero value otherwise. + +### GetParam2Ok + +`func (o *InlineObject4) GetParam2Ok() (string, bool)` + +GetParam2Ok returns a tuple with the Param2 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasParam2 + +`func (o *InlineObject4) HasParam2() bool` + +HasParam2 returns a boolean if a field has been set. + +### SetParam2 + +`func (o *InlineObject4) SetParam2(v string)` + +SetParam2 gets a reference to the given string and assigns it to the Param2 field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineObject5.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineObject5.md new file mode 100644 index 000000000000..24aa799df391 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineObject5.md @@ -0,0 +1,65 @@ +# InlineObject5 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AdditionalMetadata** | Pointer to **string** | Additional data to pass to server | [optional] +**RequiredFile** | Pointer to [***os.File**](*os.File.md) | file to upload | + +## Methods + +### GetAdditionalMetadata + +`func (o *InlineObject5) GetAdditionalMetadata() string` + +GetAdditionalMetadata returns the AdditionalMetadata field if non-nil, zero value otherwise. + +### GetAdditionalMetadataOk + +`func (o *InlineObject5) GetAdditionalMetadataOk() (string, bool)` + +GetAdditionalMetadataOk returns a tuple with the AdditionalMetadata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasAdditionalMetadata + +`func (o *InlineObject5) HasAdditionalMetadata() bool` + +HasAdditionalMetadata returns a boolean if a field has been set. + +### SetAdditionalMetadata + +`func (o *InlineObject5) SetAdditionalMetadata(v string)` + +SetAdditionalMetadata gets a reference to the given string and assigns it to the AdditionalMetadata field. + +### GetRequiredFile + +`func (o *InlineObject5) GetRequiredFile() *os.File` + +GetRequiredFile returns the RequiredFile field if non-nil, zero value otherwise. + +### GetRequiredFileOk + +`func (o *InlineObject5) GetRequiredFileOk() (*os.File, bool)` + +GetRequiredFileOk returns a tuple with the RequiredFile field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasRequiredFile + +`func (o *InlineObject5) HasRequiredFile() bool` + +HasRequiredFile returns a boolean if a field has been set. + +### SetRequiredFile + +`func (o *InlineObject5) SetRequiredFile(v *os.File)` + +SetRequiredFile gets a reference to the given *os.File and assigns it to the RequiredFile field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineResponseDefault.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineResponseDefault.md new file mode 100644 index 000000000000..714067d561b3 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineResponseDefault.md @@ -0,0 +1,39 @@ +# InlineResponseDefault + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**String** | Pointer to [**Foo**](Foo.md) | | [optional] + +## Methods + +### GetString + +`func (o *InlineResponseDefault) GetString() Foo` + +GetString returns the String field if non-nil, zero value otherwise. + +### GetStringOk + +`func (o *InlineResponseDefault) GetStringOk() (Foo, bool)` + +GetStringOk returns a tuple with the String field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasString + +`func (o *InlineResponseDefault) HasString() bool` + +HasString returns a boolean if a field has been set. + +### SetString + +`func (o *InlineResponseDefault) SetString(v Foo)` + +SetString gets a reference to the given Foo and assigns it to the String field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/List.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/List.md new file mode 100644 index 000000000000..ca8849936e72 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/List.md @@ -0,0 +1,39 @@ +# List + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Var123List** | Pointer to **string** | | [optional] + +## Methods + +### GetVar123List + +`func (o *List) GetVar123List() string` + +GetVar123List returns the Var123List field if non-nil, zero value otherwise. + +### GetVar123ListOk + +`func (o *List) GetVar123ListOk() (string, bool)` + +GetVar123ListOk returns a tuple with the Var123List field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasVar123List + +`func (o *List) HasVar123List() bool` + +HasVar123List returns a boolean if a field has been set. + +### SetVar123List + +`func (o *List) SetVar123List(v string)` + +SetVar123List gets a reference to the given string and assigns it to the Var123List field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/MapTest.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/MapTest.md new file mode 100644 index 000000000000..6c84c2e89c2a --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/MapTest.md @@ -0,0 +1,117 @@ +# MapTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MapMapOfString** | Pointer to [**map[string]map[string]string**](map.md) | | [optional] +**MapOfEnumString** | Pointer to **map[string]string** | | [optional] +**DirectMap** | Pointer to **map[string]bool** | | [optional] +**IndirectMap** | Pointer to **map[string]bool** | | [optional] + +## Methods + +### GetMapMapOfString + +`func (o *MapTest) GetMapMapOfString() map[string]map[string]string` + +GetMapMapOfString returns the MapMapOfString field if non-nil, zero value otherwise. + +### GetMapMapOfStringOk + +`func (o *MapTest) GetMapMapOfStringOk() (map[string]map[string]string, bool)` + +GetMapMapOfStringOk returns a tuple with the MapMapOfString field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasMapMapOfString + +`func (o *MapTest) HasMapMapOfString() bool` + +HasMapMapOfString returns a boolean if a field has been set. + +### SetMapMapOfString + +`func (o *MapTest) SetMapMapOfString(v map[string]map[string]string)` + +SetMapMapOfString gets a reference to the given map[string]map[string]string and assigns it to the MapMapOfString field. + +### GetMapOfEnumString + +`func (o *MapTest) GetMapOfEnumString() map[string]string` + +GetMapOfEnumString returns the MapOfEnumString field if non-nil, zero value otherwise. + +### GetMapOfEnumStringOk + +`func (o *MapTest) GetMapOfEnumStringOk() (map[string]string, bool)` + +GetMapOfEnumStringOk returns a tuple with the MapOfEnumString field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasMapOfEnumString + +`func (o *MapTest) HasMapOfEnumString() bool` + +HasMapOfEnumString returns a boolean if a field has been set. + +### SetMapOfEnumString + +`func (o *MapTest) SetMapOfEnumString(v map[string]string)` + +SetMapOfEnumString gets a reference to the given map[string]string and assigns it to the MapOfEnumString field. + +### GetDirectMap + +`func (o *MapTest) GetDirectMap() map[string]bool` + +GetDirectMap returns the DirectMap field if non-nil, zero value otherwise. + +### GetDirectMapOk + +`func (o *MapTest) GetDirectMapOk() (map[string]bool, bool)` + +GetDirectMapOk returns a tuple with the DirectMap field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasDirectMap + +`func (o *MapTest) HasDirectMap() bool` + +HasDirectMap returns a boolean if a field has been set. + +### SetDirectMap + +`func (o *MapTest) SetDirectMap(v map[string]bool)` + +SetDirectMap gets a reference to the given map[string]bool and assigns it to the DirectMap field. + +### GetIndirectMap + +`func (o *MapTest) GetIndirectMap() map[string]bool` + +GetIndirectMap returns the IndirectMap field if non-nil, zero value otherwise. + +### GetIndirectMapOk + +`func (o *MapTest) GetIndirectMapOk() (map[string]bool, bool)` + +GetIndirectMapOk returns a tuple with the IndirectMap field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasIndirectMap + +`func (o *MapTest) HasIndirectMap() bool` + +HasIndirectMap returns a boolean if a field has been set. + +### SetIndirectMap + +`func (o *MapTest) SetIndirectMap(v map[string]bool)` + +SetIndirectMap gets a reference to the given map[string]bool and assigns it to the IndirectMap field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 000000000000..49f7c8eb7687 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,91 @@ +# MixedPropertiesAndAdditionalPropertiesClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Uuid** | Pointer to **string** | | [optional] +**DateTime** | Pointer to [**time.Time**](time.Time.md) | | [optional] +**Map** | Pointer to [**map[string]Animal**](Animal.md) | | [optional] + +## Methods + +### GetUuid + +`func (o *MixedPropertiesAndAdditionalPropertiesClass) GetUuid() string` + +GetUuid returns the Uuid field if non-nil, zero value otherwise. + +### GetUuidOk + +`func (o *MixedPropertiesAndAdditionalPropertiesClass) GetUuidOk() (string, bool)` + +GetUuidOk returns a tuple with the Uuid field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasUuid + +`func (o *MixedPropertiesAndAdditionalPropertiesClass) HasUuid() bool` + +HasUuid returns a boolean if a field has been set. + +### SetUuid + +`func (o *MixedPropertiesAndAdditionalPropertiesClass) SetUuid(v string)` + +SetUuid gets a reference to the given string and assigns it to the Uuid field. + +### GetDateTime + +`func (o *MixedPropertiesAndAdditionalPropertiesClass) GetDateTime() time.Time` + +GetDateTime returns the DateTime field if non-nil, zero value otherwise. + +### GetDateTimeOk + +`func (o *MixedPropertiesAndAdditionalPropertiesClass) GetDateTimeOk() (time.Time, bool)` + +GetDateTimeOk returns a tuple with the DateTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasDateTime + +`func (o *MixedPropertiesAndAdditionalPropertiesClass) HasDateTime() bool` + +HasDateTime returns a boolean if a field has been set. + +### SetDateTime + +`func (o *MixedPropertiesAndAdditionalPropertiesClass) SetDateTime(v time.Time)` + +SetDateTime gets a reference to the given time.Time and assigns it to the DateTime field. + +### GetMap + +`func (o *MixedPropertiesAndAdditionalPropertiesClass) GetMap() map[string]Animal` + +GetMap returns the Map field if non-nil, zero value otherwise. + +### GetMapOk + +`func (o *MixedPropertiesAndAdditionalPropertiesClass) GetMapOk() (map[string]Animal, bool)` + +GetMapOk returns a tuple with the Map field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasMap + +`func (o *MixedPropertiesAndAdditionalPropertiesClass) HasMap() bool` + +HasMap returns a boolean if a field has been set. + +### SetMap + +`func (o *MixedPropertiesAndAdditionalPropertiesClass) SetMap(v map[string]Animal)` + +SetMap gets a reference to the given map[string]Animal and assigns it to the Map field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Model200Response.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Model200Response.md new file mode 100644 index 000000000000..d0bde7b7f7b3 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Model200Response.md @@ -0,0 +1,65 @@ +# Model200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | Pointer to **int32** | | [optional] +**Class** | Pointer to **string** | | [optional] + +## Methods + +### GetName + +`func (o *Model200Response) GetName() int32` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *Model200Response) GetNameOk() (int32, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasName + +`func (o *Model200Response) HasName() bool` + +HasName returns a boolean if a field has been set. + +### SetName + +`func (o *Model200Response) SetName(v int32)` + +SetName gets a reference to the given int32 and assigns it to the Name field. + +### GetClass + +`func (o *Model200Response) GetClass() string` + +GetClass returns the Class field if non-nil, zero value otherwise. + +### GetClassOk + +`func (o *Model200Response) GetClassOk() (string, bool)` + +GetClassOk returns a tuple with the Class field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasClass + +`func (o *Model200Response) HasClass() bool` + +HasClass returns a boolean if a field has been set. + +### SetClass + +`func (o *Model200Response) SetClass(v string)` + +SetClass gets a reference to the given string and assigns it to the Class field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Name.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Name.md new file mode 100644 index 000000000000..7cc6fd6a3a43 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Name.md @@ -0,0 +1,117 @@ +# Name + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | Pointer to **int32** | | +**SnakeCase** | Pointer to **int32** | | [optional] +**Property** | Pointer to **string** | | [optional] +**Var123Number** | Pointer to **int32** | | [optional] + +## Methods + +### GetName + +`func (o *Name) GetName() int32` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *Name) GetNameOk() (int32, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasName + +`func (o *Name) HasName() bool` + +HasName returns a boolean if a field has been set. + +### SetName + +`func (o *Name) SetName(v int32)` + +SetName gets a reference to the given int32 and assigns it to the Name field. + +### GetSnakeCase + +`func (o *Name) GetSnakeCase() int32` + +GetSnakeCase returns the SnakeCase field if non-nil, zero value otherwise. + +### GetSnakeCaseOk + +`func (o *Name) GetSnakeCaseOk() (int32, bool)` + +GetSnakeCaseOk returns a tuple with the SnakeCase field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasSnakeCase + +`func (o *Name) HasSnakeCase() bool` + +HasSnakeCase returns a boolean if a field has been set. + +### SetSnakeCase + +`func (o *Name) SetSnakeCase(v int32)` + +SetSnakeCase gets a reference to the given int32 and assigns it to the SnakeCase field. + +### GetProperty + +`func (o *Name) GetProperty() string` + +GetProperty returns the Property field if non-nil, zero value otherwise. + +### GetPropertyOk + +`func (o *Name) GetPropertyOk() (string, bool)` + +GetPropertyOk returns a tuple with the Property field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasProperty + +`func (o *Name) HasProperty() bool` + +HasProperty returns a boolean if a field has been set. + +### SetProperty + +`func (o *Name) SetProperty(v string)` + +SetProperty gets a reference to the given string and assigns it to the Property field. + +### GetVar123Number + +`func (o *Name) GetVar123Number() int32` + +GetVar123Number returns the Var123Number field if non-nil, zero value otherwise. + +### GetVar123NumberOk + +`func (o *Name) GetVar123NumberOk() (int32, bool)` + +GetVar123NumberOk returns a tuple with the Var123Number field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasVar123Number + +`func (o *Name) HasVar123Number() bool` + +HasVar123Number returns a boolean if a field has been set. + +### SetVar123Number + +`func (o *Name) SetVar123Number(v int32)` + +SetVar123Number gets a reference to the given int32 and assigns it to the Var123Number field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/NullableClass.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/NullableClass.md new file mode 100644 index 000000000000..65067eda2ae3 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/NullableClass.md @@ -0,0 +1,395 @@ +# NullableClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**IntegerProp** | Pointer to **int32** | | [optional] +**NumberProp** | Pointer to **float32** | | [optional] +**BooleanProp** | Pointer to **bool** | | [optional] +**StringProp** | Pointer to **string** | | [optional] +**DateProp** | Pointer to **string** | | [optional] +**DatetimeProp** | Pointer to [**time.Time**](time.Time.md) | | [optional] +**ArrayNullableProp** | Pointer to [**[]map[string]interface{}**](map[string]interface{}.md) | | [optional] +**ArrayAndItemsNullableProp** | Pointer to [**[]map[string]interface{}**](map[string]interface{}.md) | | [optional] +**ArrayItemsNullable** | Pointer to [**[]map[string]interface{}**](map[string]interface{}.md) | | [optional] +**ObjectNullableProp** | Pointer to [**map[string]map[string]interface{}**](map[string]interface{}.md) | | [optional] +**ObjectAndItemsNullableProp** | Pointer to [**map[string]map[string]interface{}**](map[string]interface{}.md) | | [optional] +**ObjectItemsNullable** | Pointer to [**map[string]map[string]interface{}**](map[string]interface{}.md) | | [optional] + +## Methods + +### GetIntegerProp + +`func (o *NullableClass) GetIntegerProp() int32` + +GetIntegerProp returns the IntegerProp field if non-nil, zero value otherwise. + +### GetIntegerPropOk + +`func (o *NullableClass) GetIntegerPropOk() (int32, bool)` + +GetIntegerPropOk returns a tuple with the IntegerProp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasIntegerProp + +`func (o *NullableClass) HasIntegerProp() bool` + +HasIntegerProp returns a boolean if a field has been set. + +### SetIntegerProp + +`func (o *NullableClass) SetIntegerProp(v int32)` + +SetIntegerProp gets a reference to the given int32 and assigns it to the IntegerProp field. + +### SetIntegerPropExplicitNull + +`func (o *NullableClass) SetIntegerPropExplicitNull(b bool)` + +SetIntegerPropExplicitNull (un)sets IntegerProp to be considered as explicit "null" value +when serializing to JSON (pass true as argument to set this, false to unset) +The IntegerProp value is set to nil even if false is passed +### GetNumberProp + +`func (o *NullableClass) GetNumberProp() float32` + +GetNumberProp returns the NumberProp field if non-nil, zero value otherwise. + +### GetNumberPropOk + +`func (o *NullableClass) GetNumberPropOk() (float32, bool)` + +GetNumberPropOk returns a tuple with the NumberProp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasNumberProp + +`func (o *NullableClass) HasNumberProp() bool` + +HasNumberProp returns a boolean if a field has been set. + +### SetNumberProp + +`func (o *NullableClass) SetNumberProp(v float32)` + +SetNumberProp gets a reference to the given float32 and assigns it to the NumberProp field. + +### SetNumberPropExplicitNull + +`func (o *NullableClass) SetNumberPropExplicitNull(b bool)` + +SetNumberPropExplicitNull (un)sets NumberProp to be considered as explicit "null" value +when serializing to JSON (pass true as argument to set this, false to unset) +The NumberProp value is set to nil even if false is passed +### GetBooleanProp + +`func (o *NullableClass) GetBooleanProp() bool` + +GetBooleanProp returns the BooleanProp field if non-nil, zero value otherwise. + +### GetBooleanPropOk + +`func (o *NullableClass) GetBooleanPropOk() (bool, bool)` + +GetBooleanPropOk returns a tuple with the BooleanProp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasBooleanProp + +`func (o *NullableClass) HasBooleanProp() bool` + +HasBooleanProp returns a boolean if a field has been set. + +### SetBooleanProp + +`func (o *NullableClass) SetBooleanProp(v bool)` + +SetBooleanProp gets a reference to the given bool and assigns it to the BooleanProp field. + +### SetBooleanPropExplicitNull + +`func (o *NullableClass) SetBooleanPropExplicitNull(b bool)` + +SetBooleanPropExplicitNull (un)sets BooleanProp to be considered as explicit "null" value +when serializing to JSON (pass true as argument to set this, false to unset) +The BooleanProp value is set to nil even if false is passed +### GetStringProp + +`func (o *NullableClass) GetStringProp() string` + +GetStringProp returns the StringProp field if non-nil, zero value otherwise. + +### GetStringPropOk + +`func (o *NullableClass) GetStringPropOk() (string, bool)` + +GetStringPropOk returns a tuple with the StringProp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasStringProp + +`func (o *NullableClass) HasStringProp() bool` + +HasStringProp returns a boolean if a field has been set. + +### SetStringProp + +`func (o *NullableClass) SetStringProp(v string)` + +SetStringProp gets a reference to the given string and assigns it to the StringProp field. + +### SetStringPropExplicitNull + +`func (o *NullableClass) SetStringPropExplicitNull(b bool)` + +SetStringPropExplicitNull (un)sets StringProp to be considered as explicit "null" value +when serializing to JSON (pass true as argument to set this, false to unset) +The StringProp value is set to nil even if false is passed +### GetDateProp + +`func (o *NullableClass) GetDateProp() string` + +GetDateProp returns the DateProp field if non-nil, zero value otherwise. + +### GetDatePropOk + +`func (o *NullableClass) GetDatePropOk() (string, bool)` + +GetDatePropOk returns a tuple with the DateProp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasDateProp + +`func (o *NullableClass) HasDateProp() bool` + +HasDateProp returns a boolean if a field has been set. + +### SetDateProp + +`func (o *NullableClass) SetDateProp(v string)` + +SetDateProp gets a reference to the given string and assigns it to the DateProp field. + +### SetDatePropExplicitNull + +`func (o *NullableClass) SetDatePropExplicitNull(b bool)` + +SetDatePropExplicitNull (un)sets DateProp to be considered as explicit "null" value +when serializing to JSON (pass true as argument to set this, false to unset) +The DateProp value is set to nil even if false is passed +### GetDatetimeProp + +`func (o *NullableClass) GetDatetimeProp() time.Time` + +GetDatetimeProp returns the DatetimeProp field if non-nil, zero value otherwise. + +### GetDatetimePropOk + +`func (o *NullableClass) GetDatetimePropOk() (time.Time, bool)` + +GetDatetimePropOk returns a tuple with the DatetimeProp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasDatetimeProp + +`func (o *NullableClass) HasDatetimeProp() bool` + +HasDatetimeProp returns a boolean if a field has been set. + +### SetDatetimeProp + +`func (o *NullableClass) SetDatetimeProp(v time.Time)` + +SetDatetimeProp gets a reference to the given time.Time and assigns it to the DatetimeProp field. + +### SetDatetimePropExplicitNull + +`func (o *NullableClass) SetDatetimePropExplicitNull(b bool)` + +SetDatetimePropExplicitNull (un)sets DatetimeProp to be considered as explicit "null" value +when serializing to JSON (pass true as argument to set this, false to unset) +The DatetimeProp value is set to nil even if false is passed +### GetArrayNullableProp + +`func (o *NullableClass) GetArrayNullableProp() []map[string]interface{}` + +GetArrayNullableProp returns the ArrayNullableProp field if non-nil, zero value otherwise. + +### GetArrayNullablePropOk + +`func (o *NullableClass) GetArrayNullablePropOk() ([]map[string]interface{}, bool)` + +GetArrayNullablePropOk returns a tuple with the ArrayNullableProp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasArrayNullableProp + +`func (o *NullableClass) HasArrayNullableProp() bool` + +HasArrayNullableProp returns a boolean if a field has been set. + +### SetArrayNullableProp + +`func (o *NullableClass) SetArrayNullableProp(v []map[string]interface{})` + +SetArrayNullableProp gets a reference to the given []map[string]interface{} and assigns it to the ArrayNullableProp field. + +### SetArrayNullablePropExplicitNull + +`func (o *NullableClass) SetArrayNullablePropExplicitNull(b bool)` + +SetArrayNullablePropExplicitNull (un)sets ArrayNullableProp to be considered as explicit "null" value +when serializing to JSON (pass true as argument to set this, false to unset) +The ArrayNullableProp value is set to nil even if false is passed +### GetArrayAndItemsNullableProp + +`func (o *NullableClass) GetArrayAndItemsNullableProp() []map[string]interface{}` + +GetArrayAndItemsNullableProp returns the ArrayAndItemsNullableProp field if non-nil, zero value otherwise. + +### GetArrayAndItemsNullablePropOk + +`func (o *NullableClass) GetArrayAndItemsNullablePropOk() ([]map[string]interface{}, bool)` + +GetArrayAndItemsNullablePropOk returns a tuple with the ArrayAndItemsNullableProp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasArrayAndItemsNullableProp + +`func (o *NullableClass) HasArrayAndItemsNullableProp() bool` + +HasArrayAndItemsNullableProp returns a boolean if a field has been set. + +### SetArrayAndItemsNullableProp + +`func (o *NullableClass) SetArrayAndItemsNullableProp(v []map[string]interface{})` + +SetArrayAndItemsNullableProp gets a reference to the given []map[string]interface{} and assigns it to the ArrayAndItemsNullableProp field. + +### SetArrayAndItemsNullablePropExplicitNull + +`func (o *NullableClass) SetArrayAndItemsNullablePropExplicitNull(b bool)` + +SetArrayAndItemsNullablePropExplicitNull (un)sets ArrayAndItemsNullableProp to be considered as explicit "null" value +when serializing to JSON (pass true as argument to set this, false to unset) +The ArrayAndItemsNullableProp value is set to nil even if false is passed +### GetArrayItemsNullable + +`func (o *NullableClass) GetArrayItemsNullable() []map[string]interface{}` + +GetArrayItemsNullable returns the ArrayItemsNullable field if non-nil, zero value otherwise. + +### GetArrayItemsNullableOk + +`func (o *NullableClass) GetArrayItemsNullableOk() ([]map[string]interface{}, bool)` + +GetArrayItemsNullableOk returns a tuple with the ArrayItemsNullable field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasArrayItemsNullable + +`func (o *NullableClass) HasArrayItemsNullable() bool` + +HasArrayItemsNullable returns a boolean if a field has been set. + +### SetArrayItemsNullable + +`func (o *NullableClass) SetArrayItemsNullable(v []map[string]interface{})` + +SetArrayItemsNullable gets a reference to the given []map[string]interface{} and assigns it to the ArrayItemsNullable field. + +### GetObjectNullableProp + +`func (o *NullableClass) GetObjectNullableProp() map[string]map[string]interface{}` + +GetObjectNullableProp returns the ObjectNullableProp field if non-nil, zero value otherwise. + +### GetObjectNullablePropOk + +`func (o *NullableClass) GetObjectNullablePropOk() (map[string]map[string]interface{}, bool)` + +GetObjectNullablePropOk returns a tuple with the ObjectNullableProp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasObjectNullableProp + +`func (o *NullableClass) HasObjectNullableProp() bool` + +HasObjectNullableProp returns a boolean if a field has been set. + +### SetObjectNullableProp + +`func (o *NullableClass) SetObjectNullableProp(v map[string]map[string]interface{})` + +SetObjectNullableProp gets a reference to the given map[string]map[string]interface{} and assigns it to the ObjectNullableProp field. + +### SetObjectNullablePropExplicitNull + +`func (o *NullableClass) SetObjectNullablePropExplicitNull(b bool)` + +SetObjectNullablePropExplicitNull (un)sets ObjectNullableProp to be considered as explicit "null" value +when serializing to JSON (pass true as argument to set this, false to unset) +The ObjectNullableProp value is set to nil even if false is passed +### GetObjectAndItemsNullableProp + +`func (o *NullableClass) GetObjectAndItemsNullableProp() map[string]map[string]interface{}` + +GetObjectAndItemsNullableProp returns the ObjectAndItemsNullableProp field if non-nil, zero value otherwise. + +### GetObjectAndItemsNullablePropOk + +`func (o *NullableClass) GetObjectAndItemsNullablePropOk() (map[string]map[string]interface{}, bool)` + +GetObjectAndItemsNullablePropOk returns a tuple with the ObjectAndItemsNullableProp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasObjectAndItemsNullableProp + +`func (o *NullableClass) HasObjectAndItemsNullableProp() bool` + +HasObjectAndItemsNullableProp returns a boolean if a field has been set. + +### SetObjectAndItemsNullableProp + +`func (o *NullableClass) SetObjectAndItemsNullableProp(v map[string]map[string]interface{})` + +SetObjectAndItemsNullableProp gets a reference to the given map[string]map[string]interface{} and assigns it to the ObjectAndItemsNullableProp field. + +### SetObjectAndItemsNullablePropExplicitNull + +`func (o *NullableClass) SetObjectAndItemsNullablePropExplicitNull(b bool)` + +SetObjectAndItemsNullablePropExplicitNull (un)sets ObjectAndItemsNullableProp to be considered as explicit "null" value +when serializing to JSON (pass true as argument to set this, false to unset) +The ObjectAndItemsNullableProp value is set to nil even if false is passed +### GetObjectItemsNullable + +`func (o *NullableClass) GetObjectItemsNullable() map[string]map[string]interface{}` + +GetObjectItemsNullable returns the ObjectItemsNullable field if non-nil, zero value otherwise. + +### GetObjectItemsNullableOk + +`func (o *NullableClass) GetObjectItemsNullableOk() (map[string]map[string]interface{}, bool)` + +GetObjectItemsNullableOk returns a tuple with the ObjectItemsNullable field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasObjectItemsNullable + +`func (o *NullableClass) HasObjectItemsNullable() bool` + +HasObjectItemsNullable returns a boolean if a field has been set. + +### SetObjectItemsNullable + +`func (o *NullableClass) SetObjectItemsNullable(v map[string]map[string]interface{})` + +SetObjectItemsNullable gets a reference to the given map[string]map[string]interface{} and assigns it to the ObjectItemsNullable field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/NumberOnly.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/NumberOnly.md new file mode 100644 index 000000000000..c8dcac264c2d --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/NumberOnly.md @@ -0,0 +1,39 @@ +# NumberOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**JustNumber** | Pointer to **float32** | | [optional] + +## Methods + +### GetJustNumber + +`func (o *NumberOnly) GetJustNumber() float32` + +GetJustNumber returns the JustNumber field if non-nil, zero value otherwise. + +### GetJustNumberOk + +`func (o *NumberOnly) GetJustNumberOk() (float32, bool)` + +GetJustNumberOk returns a tuple with the JustNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasJustNumber + +`func (o *NumberOnly) HasJustNumber() bool` + +HasJustNumber returns a boolean if a field has been set. + +### SetJustNumber + +`func (o *NumberOnly) SetJustNumber(v float32)` + +SetJustNumber gets a reference to the given float32 and assigns it to the JustNumber field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Order.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Order.md new file mode 100644 index 000000000000..8aa8bbd1ee54 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Order.md @@ -0,0 +1,169 @@ +# Order + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | Pointer to **int64** | | [optional] +**PetId** | Pointer to **int64** | | [optional] +**Quantity** | Pointer to **int32** | | [optional] +**ShipDate** | Pointer to [**time.Time**](time.Time.md) | | [optional] +**Status** | Pointer to **string** | Order Status | [optional] +**Complete** | Pointer to **bool** | | [optional] [default to false] + +## Methods + +### GetId + +`func (o *Order) GetId() int64` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *Order) GetIdOk() (int64, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasId + +`func (o *Order) HasId() bool` + +HasId returns a boolean if a field has been set. + +### SetId + +`func (o *Order) SetId(v int64)` + +SetId gets a reference to the given int64 and assigns it to the Id field. + +### GetPetId + +`func (o *Order) GetPetId() int64` + +GetPetId returns the PetId field if non-nil, zero value otherwise. + +### GetPetIdOk + +`func (o *Order) GetPetIdOk() (int64, bool)` + +GetPetIdOk returns a tuple with the PetId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasPetId + +`func (o *Order) HasPetId() bool` + +HasPetId returns a boolean if a field has been set. + +### SetPetId + +`func (o *Order) SetPetId(v int64)` + +SetPetId gets a reference to the given int64 and assigns it to the PetId field. + +### GetQuantity + +`func (o *Order) GetQuantity() int32` + +GetQuantity returns the Quantity field if non-nil, zero value otherwise. + +### GetQuantityOk + +`func (o *Order) GetQuantityOk() (int32, bool)` + +GetQuantityOk returns a tuple with the Quantity field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasQuantity + +`func (o *Order) HasQuantity() bool` + +HasQuantity returns a boolean if a field has been set. + +### SetQuantity + +`func (o *Order) SetQuantity(v int32)` + +SetQuantity gets a reference to the given int32 and assigns it to the Quantity field. + +### GetShipDate + +`func (o *Order) GetShipDate() time.Time` + +GetShipDate returns the ShipDate field if non-nil, zero value otherwise. + +### GetShipDateOk + +`func (o *Order) GetShipDateOk() (time.Time, bool)` + +GetShipDateOk returns a tuple with the ShipDate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasShipDate + +`func (o *Order) HasShipDate() bool` + +HasShipDate returns a boolean if a field has been set. + +### SetShipDate + +`func (o *Order) SetShipDate(v time.Time)` + +SetShipDate gets a reference to the given time.Time and assigns it to the ShipDate field. + +### GetStatus + +`func (o *Order) GetStatus() string` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *Order) GetStatusOk() (string, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasStatus + +`func (o *Order) HasStatus() bool` + +HasStatus returns a boolean if a field has been set. + +### SetStatus + +`func (o *Order) SetStatus(v string)` + +SetStatus gets a reference to the given string and assigns it to the Status field. + +### GetComplete + +`func (o *Order) GetComplete() bool` + +GetComplete returns the Complete field if non-nil, zero value otherwise. + +### GetCompleteOk + +`func (o *Order) GetCompleteOk() (bool, bool)` + +GetCompleteOk returns a tuple with the Complete field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasComplete + +`func (o *Order) HasComplete() bool` + +HasComplete returns a boolean if a field has been set. + +### SetComplete + +`func (o *Order) SetComplete(v bool)` + +SetComplete gets a reference to the given bool and assigns it to the Complete field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/OuterComposite.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/OuterComposite.md new file mode 100644 index 000000000000..f89080222827 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/OuterComposite.md @@ -0,0 +1,91 @@ +# OuterComposite + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MyNumber** | Pointer to **float32** | | [optional] +**MyString** | Pointer to **string** | | [optional] +**MyBoolean** | Pointer to **bool** | | [optional] + +## Methods + +### GetMyNumber + +`func (o *OuterComposite) GetMyNumber() float32` + +GetMyNumber returns the MyNumber field if non-nil, zero value otherwise. + +### GetMyNumberOk + +`func (o *OuterComposite) GetMyNumberOk() (float32, bool)` + +GetMyNumberOk returns a tuple with the MyNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasMyNumber + +`func (o *OuterComposite) HasMyNumber() bool` + +HasMyNumber returns a boolean if a field has been set. + +### SetMyNumber + +`func (o *OuterComposite) SetMyNumber(v float32)` + +SetMyNumber gets a reference to the given float32 and assigns it to the MyNumber field. + +### GetMyString + +`func (o *OuterComposite) GetMyString() string` + +GetMyString returns the MyString field if non-nil, zero value otherwise. + +### GetMyStringOk + +`func (o *OuterComposite) GetMyStringOk() (string, bool)` + +GetMyStringOk returns a tuple with the MyString field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasMyString + +`func (o *OuterComposite) HasMyString() bool` + +HasMyString returns a boolean if a field has been set. + +### SetMyString + +`func (o *OuterComposite) SetMyString(v string)` + +SetMyString gets a reference to the given string and assigns it to the MyString field. + +### GetMyBoolean + +`func (o *OuterComposite) GetMyBoolean() bool` + +GetMyBoolean returns the MyBoolean field if non-nil, zero value otherwise. + +### GetMyBooleanOk + +`func (o *OuterComposite) GetMyBooleanOk() (bool, bool)` + +GetMyBooleanOk returns a tuple with the MyBoolean field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasMyBoolean + +`func (o *OuterComposite) HasMyBoolean() bool` + +HasMyBoolean returns a boolean if a field has been set. + +### SetMyBoolean + +`func (o *OuterComposite) SetMyBoolean(v bool)` + +SetMyBoolean gets a reference to the given bool and assigns it to the MyBoolean field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/OuterEnum.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/OuterEnum.md new file mode 100644 index 000000000000..13bed2d17fd8 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/OuterEnum.md @@ -0,0 +1,11 @@ +# OuterEnum + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/OuterEnumDefaultValue.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/OuterEnumDefaultValue.md new file mode 100644 index 000000000000..50f8ab0096cc --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/OuterEnumDefaultValue.md @@ -0,0 +1,11 @@ +# OuterEnumDefaultValue + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/OuterEnumInteger.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/OuterEnumInteger.md new file mode 100644 index 000000000000..eb033db7cc54 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/OuterEnumInteger.md @@ -0,0 +1,11 @@ +# OuterEnumInteger + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/OuterEnumIntegerDefaultValue.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/OuterEnumIntegerDefaultValue.md new file mode 100644 index 000000000000..7a1634329542 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/OuterEnumIntegerDefaultValue.md @@ -0,0 +1,11 @@ +# OuterEnumIntegerDefaultValue + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Pet.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Pet.md new file mode 100644 index 000000000000..dba9589f9d77 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Pet.md @@ -0,0 +1,169 @@ +# Pet + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | Pointer to **int64** | | [optional] +**Category** | Pointer to [**Category**](Category.md) | | [optional] +**Name** | Pointer to **string** | | +**PhotoUrls** | Pointer to **[]string** | | +**Tags** | Pointer to [**[]Tag**](Tag.md) | | [optional] +**Status** | Pointer to **string** | pet status in the store | [optional] + +## Methods + +### GetId + +`func (o *Pet) GetId() int64` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *Pet) GetIdOk() (int64, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasId + +`func (o *Pet) HasId() bool` + +HasId returns a boolean if a field has been set. + +### SetId + +`func (o *Pet) SetId(v int64)` + +SetId gets a reference to the given int64 and assigns it to the Id field. + +### GetCategory + +`func (o *Pet) GetCategory() Category` + +GetCategory returns the Category field if non-nil, zero value otherwise. + +### GetCategoryOk + +`func (o *Pet) GetCategoryOk() (Category, bool)` + +GetCategoryOk returns a tuple with the Category field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasCategory + +`func (o *Pet) HasCategory() bool` + +HasCategory returns a boolean if a field has been set. + +### SetCategory + +`func (o *Pet) SetCategory(v Category)` + +SetCategory gets a reference to the given Category and assigns it to the Category field. + +### GetName + +`func (o *Pet) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *Pet) GetNameOk() (string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasName + +`func (o *Pet) HasName() bool` + +HasName returns a boolean if a field has been set. + +### SetName + +`func (o *Pet) SetName(v string)` + +SetName gets a reference to the given string and assigns it to the Name field. + +### GetPhotoUrls + +`func (o *Pet) GetPhotoUrls() []string` + +GetPhotoUrls returns the PhotoUrls field if non-nil, zero value otherwise. + +### GetPhotoUrlsOk + +`func (o *Pet) GetPhotoUrlsOk() ([]string, bool)` + +GetPhotoUrlsOk returns a tuple with the PhotoUrls field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasPhotoUrls + +`func (o *Pet) HasPhotoUrls() bool` + +HasPhotoUrls returns a boolean if a field has been set. + +### SetPhotoUrls + +`func (o *Pet) SetPhotoUrls(v []string)` + +SetPhotoUrls gets a reference to the given []string and assigns it to the PhotoUrls field. + +### GetTags + +`func (o *Pet) GetTags() []Tag` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *Pet) GetTagsOk() ([]Tag, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasTags + +`func (o *Pet) HasTags() bool` + +HasTags returns a boolean if a field has been set. + +### SetTags + +`func (o *Pet) SetTags(v []Tag)` + +SetTags gets a reference to the given []Tag and assigns it to the Tags field. + +### GetStatus + +`func (o *Pet) GetStatus() string` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *Pet) GetStatusOk() (string, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasStatus + +`func (o *Pet) HasStatus() bool` + +HasStatus returns a boolean if a field has been set. + +### SetStatus + +`func (o *Pet) SetStatus(v string)` + +SetStatus gets a reference to the given string and assigns it to the Status field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/PetApi.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/PetApi.md new file mode 100644 index 000000000000..c4f37589f0c2 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/PetApi.md @@ -0,0 +1,350 @@ +# \PetApi + +All URIs are relative to *http://petstore.swagger.io:80/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} | 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 +[**UpdatePet**](PetApi.md#UpdatePet) | **Put** /pet | Update an existing pet +[**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 +[**UploadFileWithRequiredFile**](PetApi.md#UploadFileWithRequiredFile) | **Post** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) + + + +## AddPet + +> AddPet(ctx, pet) +Add a new pet to the store + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + + (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DeletePet + +> DeletePet(ctx, petId, optional) +Deletes a pet + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**petId** | **int64**| Pet id to delete | + **optional** | ***DeletePetOpts** | optional parameters | nil if no parameters + +### Optional Parameters + +Optional parameters are passed through a pointer to a DeletePetOpts struct + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **apiKey** | **optional.String**| | + +### Return type + + (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindPetsByStatus + +> []Pet FindPetsByStatus(ctx, status) +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**status** | [**[]string**](string.md)| Status values that need to be considered for filter | + +### Return type + +[**[]Pet**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindPetsByTags + +> []Pet FindPetsByTags(ctx, tags) +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**tags** | [**[]string**](string.md)| Tags to filter by | + +### Return type + +[**[]Pet**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetPetById + +> Pet GetPetById(ctx, petId) +Find pet by ID + +Returns a single pet + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**petId** | **int64**| ID of pet to return | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## UpdatePet + +> UpdatePet(ctx, pet) +Update an existing pet + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + + (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## UpdatePetWithForm + +> UpdatePetWithForm(ctx, petId, optional) +Updates a pet in the store with form data + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**petId** | **int64**| ID of pet that needs to be updated | + **optional** | ***UpdatePetWithFormOpts** | optional parameters | nil if no parameters + +### Optional Parameters + +Optional parameters are passed through a pointer to a UpdatePetWithFormOpts struct + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **name** | **optional.String**| Updated name of the pet | + **status** | **optional.String**| Updated status of the pet | + +### Return type + + (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## UploadFile + +> ApiResponse UploadFile(ctx, petId, optional) +uploads an image + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**petId** | **int64**| ID of pet to update | + **optional** | ***UploadFileOpts** | optional parameters | nil if no parameters + +### Optional Parameters + +Optional parameters are passed through a pointer to a UploadFileOpts struct + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **additionalMetadata** | **optional.String**| Additional data to pass to server | + **file** | **optional.Interface of *os.File****optional.*os.File**| file to upload | + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## UploadFileWithRequiredFile + +> ApiResponse UploadFileWithRequiredFile(ctx, petId, requiredFile, optional) +uploads an image (required) + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**petId** | **int64**| ID of pet to update | +**requiredFile** | ***os.File*****os.File**| file to upload | + **optional** | ***UploadFileWithRequiredFileOpts** | optional parameters | nil if no parameters + +### Optional Parameters + +Optional parameters are passed through a pointer to a UploadFileWithRequiredFileOpts struct + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **additionalMetadata** | **optional.String**| Additional data to pass to server | + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/ReadOnlyFirst.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/ReadOnlyFirst.md new file mode 100644 index 000000000000..552f0170bd85 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/ReadOnlyFirst.md @@ -0,0 +1,65 @@ +# ReadOnlyFirst + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Bar** | Pointer to **string** | | [optional] +**Baz** | Pointer to **string** | | [optional] + +## Methods + +### GetBar + +`func (o *ReadOnlyFirst) GetBar() string` + +GetBar returns the Bar field if non-nil, zero value otherwise. + +### GetBarOk + +`func (o *ReadOnlyFirst) GetBarOk() (string, bool)` + +GetBarOk returns a tuple with the Bar field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasBar + +`func (o *ReadOnlyFirst) HasBar() bool` + +HasBar returns a boolean if a field has been set. + +### SetBar + +`func (o *ReadOnlyFirst) SetBar(v string)` + +SetBar gets a reference to the given string and assigns it to the Bar field. + +### GetBaz + +`func (o *ReadOnlyFirst) GetBaz() string` + +GetBaz returns the Baz field if non-nil, zero value otherwise. + +### GetBazOk + +`func (o *ReadOnlyFirst) GetBazOk() (string, bool)` + +GetBazOk returns a tuple with the Baz field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasBaz + +`func (o *ReadOnlyFirst) HasBaz() bool` + +HasBaz returns a boolean if a field has been set. + +### SetBaz + +`func (o *ReadOnlyFirst) SetBaz(v string)` + +SetBaz gets a reference to the given string and assigns it to the Baz field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Return.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Return.md new file mode 100644 index 000000000000..1facabb6bbf3 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Return.md @@ -0,0 +1,39 @@ +# Return + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Return** | Pointer to **int32** | | [optional] + +## Methods + +### GetReturn + +`func (o *Return) GetReturn() int32` + +GetReturn returns the Return field if non-nil, zero value otherwise. + +### GetReturnOk + +`func (o *Return) GetReturnOk() (int32, bool)` + +GetReturnOk returns a tuple with the Return field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasReturn + +`func (o *Return) HasReturn() bool` + +HasReturn returns a boolean if a field has been set. + +### SetReturn + +`func (o *Return) SetReturn(v int32)` + +SetReturn gets a reference to the given int32 and assigns it to the Return field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/SpecialModelName.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/SpecialModelName.md new file mode 100644 index 000000000000..34d8d8d89c72 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/SpecialModelName.md @@ -0,0 +1,39 @@ +# SpecialModelName + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SpecialPropertyName** | Pointer to **int64** | | [optional] + +## Methods + +### GetSpecialPropertyName + +`func (o *SpecialModelName) GetSpecialPropertyName() int64` + +GetSpecialPropertyName returns the SpecialPropertyName field if non-nil, zero value otherwise. + +### GetSpecialPropertyNameOk + +`func (o *SpecialModelName) GetSpecialPropertyNameOk() (int64, bool)` + +GetSpecialPropertyNameOk returns a tuple with the SpecialPropertyName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasSpecialPropertyName + +`func (o *SpecialModelName) HasSpecialPropertyName() bool` + +HasSpecialPropertyName returns a boolean if a field has been set. + +### SetSpecialPropertyName + +`func (o *SpecialModelName) SetSpecialPropertyName(v int64)` + +SetSpecialPropertyName gets a reference to the given int64 and assigns it to the SpecialPropertyName field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/StoreApi.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/StoreApi.md new file mode 100644 index 000000000000..c7f9bbcee082 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/StoreApi.md @@ -0,0 +1,138 @@ +# \StoreApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteOrder**](StoreApi.md#DeleteOrder) | **Delete** /store/order/{order_id} | Delete purchase order by ID +[**GetInventory**](StoreApi.md#GetInventory) | **Get** /store/inventory | Returns pet inventories by status +[**GetOrderById**](StoreApi.md#GetOrderById) | **Get** /store/order/{order_id} | Find purchase order by ID +[**PlaceOrder**](StoreApi.md#PlaceOrder) | **Post** /store/order | Place an order for a pet + + + +## DeleteOrder + +> DeleteOrder(ctx, orderId) +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**orderId** | **string**| ID of the order that needs to be deleted | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetInventory + +> map[string]int32 GetInventory(ctx, ) +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Required Parameters + +This endpoint does not need any parameter. + +### Return type + +**map[string]int32** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetOrderById + +> Order GetOrderById(ctx, orderId) +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**orderId** | **int64**| ID of pet that needs to be fetched | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## PlaceOrder + +> Order PlaceOrder(ctx, order) +Place an order for a pet + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**order** | [**Order**](Order.md)| order placed for purchasing the pet | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Tag.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Tag.md new file mode 100644 index 000000000000..bf868298a5e7 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Tag.md @@ -0,0 +1,65 @@ +# Tag + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | Pointer to **int64** | | [optional] +**Name** | Pointer to **string** | | [optional] + +## Methods + +### GetId + +`func (o *Tag) GetId() int64` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *Tag) GetIdOk() (int64, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasId + +`func (o *Tag) HasId() bool` + +HasId returns a boolean if a field has been set. + +### SetId + +`func (o *Tag) SetId(v int64)` + +SetId gets a reference to the given int64 and assigns it to the Id field. + +### GetName + +`func (o *Tag) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *Tag) GetNameOk() (string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasName + +`func (o *Tag) HasName() bool` + +HasName returns a boolean if a field has been set. + +### SetName + +`func (o *Tag) SetName(v string)` + +SetName gets a reference to the given string and assigns it to the Name field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/User.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/User.md new file mode 100644 index 000000000000..8b93a65d8ab7 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/User.md @@ -0,0 +1,221 @@ +# User + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | Pointer to **int64** | | [optional] +**Username** | Pointer to **string** | | [optional] +**FirstName** | Pointer to **string** | | [optional] +**LastName** | Pointer to **string** | | [optional] +**Email** | Pointer to **string** | | [optional] +**Password** | Pointer to **string** | | [optional] +**Phone** | Pointer to **string** | | [optional] +**UserStatus** | Pointer to **int32** | User Status | [optional] + +## Methods + +### GetId + +`func (o *User) GetId() int64` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *User) GetIdOk() (int64, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasId + +`func (o *User) HasId() bool` + +HasId returns a boolean if a field has been set. + +### SetId + +`func (o *User) SetId(v int64)` + +SetId gets a reference to the given int64 and assigns it to the Id field. + +### GetUsername + +`func (o *User) GetUsername() string` + +GetUsername returns the Username field if non-nil, zero value otherwise. + +### GetUsernameOk + +`func (o *User) GetUsernameOk() (string, bool)` + +GetUsernameOk returns a tuple with the Username field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasUsername + +`func (o *User) HasUsername() bool` + +HasUsername returns a boolean if a field has been set. + +### SetUsername + +`func (o *User) SetUsername(v string)` + +SetUsername gets a reference to the given string and assigns it to the Username field. + +### GetFirstName + +`func (o *User) GetFirstName() string` + +GetFirstName returns the FirstName field if non-nil, zero value otherwise. + +### GetFirstNameOk + +`func (o *User) GetFirstNameOk() (string, bool)` + +GetFirstNameOk returns a tuple with the FirstName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasFirstName + +`func (o *User) HasFirstName() bool` + +HasFirstName returns a boolean if a field has been set. + +### SetFirstName + +`func (o *User) SetFirstName(v string)` + +SetFirstName gets a reference to the given string and assigns it to the FirstName field. + +### GetLastName + +`func (o *User) GetLastName() string` + +GetLastName returns the LastName field if non-nil, zero value otherwise. + +### GetLastNameOk + +`func (o *User) GetLastNameOk() (string, bool)` + +GetLastNameOk returns a tuple with the LastName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasLastName + +`func (o *User) HasLastName() bool` + +HasLastName returns a boolean if a field has been set. + +### SetLastName + +`func (o *User) SetLastName(v string)` + +SetLastName gets a reference to the given string and assigns it to the LastName field. + +### GetEmail + +`func (o *User) GetEmail() string` + +GetEmail returns the Email field if non-nil, zero value otherwise. + +### GetEmailOk + +`func (o *User) GetEmailOk() (string, bool)` + +GetEmailOk returns a tuple with the Email field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasEmail + +`func (o *User) HasEmail() bool` + +HasEmail returns a boolean if a field has been set. + +### SetEmail + +`func (o *User) SetEmail(v string)` + +SetEmail gets a reference to the given string and assigns it to the Email field. + +### GetPassword + +`func (o *User) GetPassword() string` + +GetPassword returns the Password field if non-nil, zero value otherwise. + +### GetPasswordOk + +`func (o *User) GetPasswordOk() (string, bool)` + +GetPasswordOk returns a tuple with the Password field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasPassword + +`func (o *User) HasPassword() bool` + +HasPassword returns a boolean if a field has been set. + +### SetPassword + +`func (o *User) SetPassword(v string)` + +SetPassword gets a reference to the given string and assigns it to the Password field. + +### GetPhone + +`func (o *User) GetPhone() string` + +GetPhone returns the Phone field if non-nil, zero value otherwise. + +### GetPhoneOk + +`func (o *User) GetPhoneOk() (string, bool)` + +GetPhoneOk returns a tuple with the Phone field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasPhone + +`func (o *User) HasPhone() bool` + +HasPhone returns a boolean if a field has been set. + +### SetPhone + +`func (o *User) SetPhone(v string)` + +SetPhone gets a reference to the given string and assigns it to the Phone field. + +### GetUserStatus + +`func (o *User) GetUserStatus() int32` + +GetUserStatus returns the UserStatus field if non-nil, zero value otherwise. + +### GetUserStatusOk + +`func (o *User) GetUserStatusOk() (int32, bool)` + +GetUserStatusOk returns a tuple with the UserStatus field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasUserStatus + +`func (o *User) HasUserStatus() bool` + +HasUserStatus returns a boolean if a field has been set. + +### SetUserStatus + +`func (o *User) SetUserStatus(v int32)` + +SetUserStatus gets a reference to the given int32 and assigns it to the UserStatus field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/UserApi.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/UserApi.md new file mode 100644 index 000000000000..6c443592e53f --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/UserApi.md @@ -0,0 +1,268 @@ +# \UserApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateUser**](UserApi.md#CreateUser) | **Post** /user | Create user +[**CreateUsersWithArrayInput**](UserApi.md#CreateUsersWithArrayInput) | **Post** /user/createWithArray | Creates list of users with given input array +[**CreateUsersWithListInput**](UserApi.md#CreateUsersWithListInput) | **Post** /user/createWithList | Creates list of users with given input array +[**DeleteUser**](UserApi.md#DeleteUser) | **Delete** /user/{username} | Delete user +[**GetUserByName**](UserApi.md#GetUserByName) | **Get** /user/{username} | Get user by user name +[**LoginUser**](UserApi.md#LoginUser) | **Get** /user/login | Logs user into the system +[**LogoutUser**](UserApi.md#LogoutUser) | **Get** /user/logout | Logs out current logged in user session +[**UpdateUser**](UserApi.md#UpdateUser) | **Put** /user/{username} | Updated user + + + +## CreateUser + +> CreateUser(ctx, user) +Create user + +This can only be done by the logged in user. + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**user** | [**User**](User.md)| Created user object | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## CreateUsersWithArrayInput + +> CreateUsersWithArrayInput(ctx, user) +Creates list of users with given input array + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**user** | [**[]User**](User.md)| List of user object | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## CreateUsersWithListInput + +> CreateUsersWithListInput(ctx, user) +Creates list of users with given input array + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**user** | [**[]User**](User.md)| List of user object | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DeleteUser + +> DeleteUser(ctx, username) +Delete user + +This can only be done by the logged in user. + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**username** | **string**| The name that needs to be deleted | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetUserByName + +> User GetUserByName(ctx, username) +Get user by user name + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**username** | **string**| The name that needs to be fetched. Use user1 for testing. | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## LoginUser + +> string LoginUser(ctx, username, password) +Logs user into the system + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**username** | **string**| The user name for login | +**password** | **string**| The password for login in clear text | + +### Return type + +**string** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## LogoutUser + +> LogoutUser(ctx, ) +Logs out current logged in user session + +### Required Parameters + +This endpoint does not need any parameter. + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## UpdateUser + +> UpdateUser(ctx, username, user) +Updated user + +This can only be done by the logged in user. + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**username** | **string**| name that need to be deleted | +**user** | [**User**](User.md)| Updated user object | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/git_push.sh b/samples/openapi3/client/petstore/go-experimental/go-petstore/git_push.sh new file mode 100644 index 000000000000..8442b80bb445 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/git_push.sh @@ -0,0 +1,52 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/go.mod b/samples/openapi3/client/petstore/go-experimental/go-petstore/go.mod new file mode 100644 index 000000000000..199809ed7066 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/go.mod @@ -0,0 +1,6 @@ +module github.com/GIT_USER_ID/GIT_REPO_ID + +require ( + github.com/antihax/optional v0.0.0-20180406194304-ca021399b1a6 + golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a +) diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/go.sum b/samples/openapi3/client/petstore/go-experimental/go-petstore/go.sum new file mode 100644 index 000000000000..e3c16fef3ac1 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/go.sum @@ -0,0 +1,11 @@ +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/antihax/optional v0.0.0-20180406194304-ca021399b1a6/go.mod h1:V8iCPQYkqmusNa815XgQio277wI47sdRh1dUOLdyC6Q= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a h1:tImsplftrFpALCYumobsd0K86vlAs/eXGFms2txfJfA= +golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_200_response.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_200_response.go new file mode 100644 index 000000000000..907fa5ab06e0 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_200_response.go @@ -0,0 +1,101 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi +import ( + "encoding/json" +) + +// Model for testing model name starting with number +type Model200Response struct { + Name *int32 `json:"name,omitempty"` + + Class *string `json:"class,omitempty"` + +} + +// GetName returns the Name field if non-nil, zero value otherwise. +func (o *Model200Response) GetName() int32 { + if o == nil || o.Name == nil { + var ret int32 + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Model200Response) GetNameOk() (int32, bool) { + if o == nil || o.Name == nil { + var ret int32 + return ret, false + } + return *o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Model200Response) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given int32 and assigns it to the Name field. +func (o *Model200Response) SetName(v int32) { + o.Name = &v +} + +// GetClass returns the Class field if non-nil, zero value otherwise. +func (o *Model200Response) GetClass() string { + if o == nil || o.Class == nil { + var ret string + return ret + } + return *o.Class +} + +// GetClassOk returns a tuple with the Class field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Model200Response) GetClassOk() (string, bool) { + if o == nil || o.Class == nil { + var ret string + return ret, false + } + return *o.Class, true +} + +// HasClass returns a boolean if a field has been set. +func (o *Model200Response) HasClass() bool { + if o != nil && o.Class != nil { + return true + } + + return false +} + +// SetClass gets a reference to the given string and assigns it to the Class field. +func (o *Model200Response) SetClass(v string) { + o.Class = &v +} + + +func (o Model200Response) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.Class != nil { + toSerialize["class"] = o.Class + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model__special_model_name_.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model__special_model_name_.go new file mode 100644 index 000000000000..6ff13b5160ed --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model__special_model_name_.go @@ -0,0 +1,62 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi +import ( + "encoding/json" +) + +type SpecialModelName struct { + SpecialPropertyName *int64 `json:"$special[property.name],omitempty"` + +} + +// GetSpecialPropertyName returns the SpecialPropertyName field if non-nil, zero value otherwise. +func (o *SpecialModelName) GetSpecialPropertyName() int64 { + if o == nil || o.SpecialPropertyName == nil { + var ret int64 + return ret + } + return *o.SpecialPropertyName +} + +// GetSpecialPropertyNameOk returns a tuple with the SpecialPropertyName field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *SpecialModelName) GetSpecialPropertyNameOk() (int64, bool) { + if o == nil || o.SpecialPropertyName == nil { + var ret int64 + return ret, false + } + return *o.SpecialPropertyName, true +} + +// HasSpecialPropertyName returns a boolean if a field has been set. +func (o *SpecialModelName) HasSpecialPropertyName() bool { + if o != nil && o.SpecialPropertyName != nil { + return true + } + + return false +} + +// SetSpecialPropertyName gets a reference to the given int64 and assigns it to the SpecialPropertyName field. +func (o *SpecialModelName) SetSpecialPropertyName(v int64) { + o.SpecialPropertyName = &v +} + + +func (o SpecialModelName) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.SpecialPropertyName != nil { + toSerialize["$special[property.name]"] = o.SpecialPropertyName + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_additional_properties_class.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_additional_properties_class.go new file mode 100644 index 000000000000..20d76742fce2 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_additional_properties_class.go @@ -0,0 +1,100 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi +import ( + "encoding/json" +) + +type AdditionalPropertiesClass struct { + MapProperty *map[string]string `json:"map_property,omitempty"` + + MapOfMapProperty *map[string]map[string]string `json:"map_of_map_property,omitempty"` + +} + +// GetMapProperty returns the MapProperty field if non-nil, zero value otherwise. +func (o *AdditionalPropertiesClass) GetMapProperty() map[string]string { + if o == nil || o.MapProperty == nil { + var ret map[string]string + return ret + } + return *o.MapProperty +} + +// GetMapPropertyOk returns a tuple with the MapProperty field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *AdditionalPropertiesClass) GetMapPropertyOk() (map[string]string, bool) { + if o == nil || o.MapProperty == nil { + var ret map[string]string + return ret, false + } + return *o.MapProperty, true +} + +// HasMapProperty returns a boolean if a field has been set. +func (o *AdditionalPropertiesClass) HasMapProperty() bool { + if o != nil && o.MapProperty != nil { + return true + } + + return false +} + +// SetMapProperty gets a reference to the given map[string]string and assigns it to the MapProperty field. +func (o *AdditionalPropertiesClass) SetMapProperty(v map[string]string) { + o.MapProperty = &v +} + +// GetMapOfMapProperty returns the MapOfMapProperty field if non-nil, zero value otherwise. +func (o *AdditionalPropertiesClass) GetMapOfMapProperty() map[string]map[string]string { + if o == nil || o.MapOfMapProperty == nil { + var ret map[string]map[string]string + return ret + } + return *o.MapOfMapProperty +} + +// GetMapOfMapPropertyOk returns a tuple with the MapOfMapProperty field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *AdditionalPropertiesClass) GetMapOfMapPropertyOk() (map[string]map[string]string, bool) { + if o == nil || o.MapOfMapProperty == nil { + var ret map[string]map[string]string + return ret, false + } + return *o.MapOfMapProperty, true +} + +// HasMapOfMapProperty returns a boolean if a field has been set. +func (o *AdditionalPropertiesClass) HasMapOfMapProperty() bool { + if o != nil && o.MapOfMapProperty != nil { + return true + } + + return false +} + +// SetMapOfMapProperty gets a reference to the given map[string]map[string]string and assigns it to the MapOfMapProperty field. +func (o *AdditionalPropertiesClass) SetMapOfMapProperty(v map[string]map[string]string) { + o.MapOfMapProperty = &v +} + + +func (o AdditionalPropertiesClass) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.MapProperty != nil { + toSerialize["map_property"] = o.MapProperty + } + if o.MapOfMapProperty != nil { + toSerialize["map_of_map_property"] = o.MapOfMapProperty + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_animal.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_animal.go new file mode 100644 index 000000000000..ae40bd8d3210 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_animal.go @@ -0,0 +1,104 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi +import ( + "encoding/json" + "errors" +) + +type Animal struct { + ClassName *string `json:"className,omitempty"` + + Color *string `json:"color,omitempty"` + +} + +// GetClassName returns the ClassName field if non-nil, zero value otherwise. +func (o *Animal) GetClassName() string { + if o == nil || o.ClassName == nil { + var ret string + return ret + } + return *o.ClassName +} + +// GetClassNameOk returns a tuple with the ClassName field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Animal) GetClassNameOk() (string, bool) { + if o == nil || o.ClassName == nil { + var ret string + return ret, false + } + return *o.ClassName, true +} + +// HasClassName returns a boolean if a field has been set. +func (o *Animal) HasClassName() bool { + if o != nil && o.ClassName != nil { + return true + } + + return false +} + +// SetClassName gets a reference to the given string and assigns it to the ClassName field. +func (o *Animal) SetClassName(v string) { + o.ClassName = &v +} + +// GetColor returns the Color field if non-nil, zero value otherwise. +func (o *Animal) GetColor() string { + if o == nil || o.Color == nil { + var ret string + return ret + } + return *o.Color +} + +// GetColorOk returns a tuple with the Color field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Animal) GetColorOk() (string, bool) { + if o == nil || o.Color == nil { + var ret string + return ret, false + } + return *o.Color, true +} + +// HasColor returns a boolean if a field has been set. +func (o *Animal) HasColor() bool { + if o != nil && o.Color != nil { + return true + } + + return false +} + +// SetColor gets a reference to the given string and assigns it to the Color field. +func (o *Animal) SetColor(v string) { + o.Color = &v +} + + +func (o Animal) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.ClassName == nil { + return nil, errors.New("ClassName is required and not nullable, but was not set on Animal") + } + if o.ClassName != nil { + toSerialize["className"] = o.ClassName + } + if o.Color != nil { + toSerialize["color"] = o.Color + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_api_response.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_api_response.go new file mode 100644 index 000000000000..8305a22a42b4 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_api_response.go @@ -0,0 +1,138 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi +import ( + "encoding/json" +) + +type ApiResponse struct { + Code *int32 `json:"code,omitempty"` + + Type *string `json:"type,omitempty"` + + Message *string `json:"message,omitempty"` + +} + +// GetCode returns the Code field if non-nil, zero value otherwise. +func (o *ApiResponse) GetCode() int32 { + if o == nil || o.Code == nil { + var ret int32 + return ret + } + return *o.Code +} + +// GetCodeOk returns a tuple with the Code field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *ApiResponse) GetCodeOk() (int32, bool) { + if o == nil || o.Code == nil { + var ret int32 + return ret, false + } + return *o.Code, true +} + +// HasCode returns a boolean if a field has been set. +func (o *ApiResponse) HasCode() bool { + if o != nil && o.Code != nil { + return true + } + + return false +} + +// SetCode gets a reference to the given int32 and assigns it to the Code field. +func (o *ApiResponse) SetCode(v int32) { + o.Code = &v +} + +// GetType returns the Type field if non-nil, zero value otherwise. +func (o *ApiResponse) GetType() string { + if o == nil || o.Type == nil { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *ApiResponse) GetTypeOk() (string, bool) { + if o == nil || o.Type == nil { + var ret string + return ret, false + } + return *o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *ApiResponse) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *ApiResponse) SetType(v string) { + o.Type = &v +} + +// GetMessage returns the Message field if non-nil, zero value otherwise. +func (o *ApiResponse) GetMessage() string { + if o == nil || o.Message == nil { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *ApiResponse) GetMessageOk() (string, bool) { + if o == nil || o.Message == nil { + var ret string + return ret, false + } + return *o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *ApiResponse) HasMessage() bool { + if o != nil && o.Message != nil { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *ApiResponse) SetMessage(v string) { + o.Message = &v +} + + +func (o ApiResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Code != nil { + toSerialize["code"] = o.Code + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + if o.Message != nil { + toSerialize["message"] = o.Message + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_array_of_array_of_number_only.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_array_of_array_of_number_only.go new file mode 100644 index 000000000000..fca51374a8a9 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_array_of_array_of_number_only.go @@ -0,0 +1,62 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi +import ( + "encoding/json" +) + +type ArrayOfArrayOfNumberOnly struct { + ArrayArrayNumber *[][]float32 `json:"ArrayArrayNumber,omitempty"` + +} + +// GetArrayArrayNumber returns the ArrayArrayNumber field if non-nil, zero value otherwise. +func (o *ArrayOfArrayOfNumberOnly) GetArrayArrayNumber() [][]float32 { + if o == nil || o.ArrayArrayNumber == nil { + var ret [][]float32 + return ret + } + return *o.ArrayArrayNumber +} + +// GetArrayArrayNumberOk returns a tuple with the ArrayArrayNumber field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *ArrayOfArrayOfNumberOnly) GetArrayArrayNumberOk() ([][]float32, bool) { + if o == nil || o.ArrayArrayNumber == nil { + var ret [][]float32 + return ret, false + } + return *o.ArrayArrayNumber, true +} + +// HasArrayArrayNumber returns a boolean if a field has been set. +func (o *ArrayOfArrayOfNumberOnly) HasArrayArrayNumber() bool { + if o != nil && o.ArrayArrayNumber != nil { + return true + } + + return false +} + +// SetArrayArrayNumber gets a reference to the given [][]float32 and assigns it to the ArrayArrayNumber field. +func (o *ArrayOfArrayOfNumberOnly) SetArrayArrayNumber(v [][]float32) { + o.ArrayArrayNumber = &v +} + + +func (o ArrayOfArrayOfNumberOnly) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.ArrayArrayNumber != nil { + toSerialize["ArrayArrayNumber"] = o.ArrayArrayNumber + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_array_of_number_only.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_array_of_number_only.go new file mode 100644 index 000000000000..bf834e13b0aa --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_array_of_number_only.go @@ -0,0 +1,62 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi +import ( + "encoding/json" +) + +type ArrayOfNumberOnly struct { + ArrayNumber *[]float32 `json:"ArrayNumber,omitempty"` + +} + +// GetArrayNumber returns the ArrayNumber field if non-nil, zero value otherwise. +func (o *ArrayOfNumberOnly) GetArrayNumber() []float32 { + if o == nil || o.ArrayNumber == nil { + var ret []float32 + return ret + } + return *o.ArrayNumber +} + +// GetArrayNumberOk returns a tuple with the ArrayNumber field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *ArrayOfNumberOnly) GetArrayNumberOk() ([]float32, bool) { + if o == nil || o.ArrayNumber == nil { + var ret []float32 + return ret, false + } + return *o.ArrayNumber, true +} + +// HasArrayNumber returns a boolean if a field has been set. +func (o *ArrayOfNumberOnly) HasArrayNumber() bool { + if o != nil && o.ArrayNumber != nil { + return true + } + + return false +} + +// SetArrayNumber gets a reference to the given []float32 and assigns it to the ArrayNumber field. +func (o *ArrayOfNumberOnly) SetArrayNumber(v []float32) { + o.ArrayNumber = &v +} + + +func (o ArrayOfNumberOnly) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.ArrayNumber != nil { + toSerialize["ArrayNumber"] = o.ArrayNumber + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_array_test_.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_array_test_.go new file mode 100644 index 000000000000..adada7756a62 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_array_test_.go @@ -0,0 +1,138 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi +import ( + "encoding/json" +) + +type ArrayTest struct { + ArrayOfString *[]string `json:"array_of_string,omitempty"` + + ArrayArrayOfInteger *[][]int64 `json:"array_array_of_integer,omitempty"` + + ArrayArrayOfModel *[][]ReadOnlyFirst `json:"array_array_of_model,omitempty"` + +} + +// GetArrayOfString returns the ArrayOfString field if non-nil, zero value otherwise. +func (o *ArrayTest) GetArrayOfString() []string { + if o == nil || o.ArrayOfString == nil { + var ret []string + return ret + } + return *o.ArrayOfString +} + +// GetArrayOfStringOk returns a tuple with the ArrayOfString field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *ArrayTest) GetArrayOfStringOk() ([]string, bool) { + if o == nil || o.ArrayOfString == nil { + var ret []string + return ret, false + } + return *o.ArrayOfString, true +} + +// HasArrayOfString returns a boolean if a field has been set. +func (o *ArrayTest) HasArrayOfString() bool { + if o != nil && o.ArrayOfString != nil { + return true + } + + return false +} + +// SetArrayOfString gets a reference to the given []string and assigns it to the ArrayOfString field. +func (o *ArrayTest) SetArrayOfString(v []string) { + o.ArrayOfString = &v +} + +// GetArrayArrayOfInteger returns the ArrayArrayOfInteger field if non-nil, zero value otherwise. +func (o *ArrayTest) GetArrayArrayOfInteger() [][]int64 { + if o == nil || o.ArrayArrayOfInteger == nil { + var ret [][]int64 + return ret + } + return *o.ArrayArrayOfInteger +} + +// GetArrayArrayOfIntegerOk returns a tuple with the ArrayArrayOfInteger field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *ArrayTest) GetArrayArrayOfIntegerOk() ([][]int64, bool) { + if o == nil || o.ArrayArrayOfInteger == nil { + var ret [][]int64 + return ret, false + } + return *o.ArrayArrayOfInteger, true +} + +// HasArrayArrayOfInteger returns a boolean if a field has been set. +func (o *ArrayTest) HasArrayArrayOfInteger() bool { + if o != nil && o.ArrayArrayOfInteger != nil { + return true + } + + return false +} + +// SetArrayArrayOfInteger gets a reference to the given [][]int64 and assigns it to the ArrayArrayOfInteger field. +func (o *ArrayTest) SetArrayArrayOfInteger(v [][]int64) { + o.ArrayArrayOfInteger = &v +} + +// GetArrayArrayOfModel returns the ArrayArrayOfModel field if non-nil, zero value otherwise. +func (o *ArrayTest) GetArrayArrayOfModel() [][]ReadOnlyFirst { + if o == nil || o.ArrayArrayOfModel == nil { + var ret [][]ReadOnlyFirst + return ret + } + return *o.ArrayArrayOfModel +} + +// GetArrayArrayOfModelOk returns a tuple with the ArrayArrayOfModel field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *ArrayTest) GetArrayArrayOfModelOk() ([][]ReadOnlyFirst, bool) { + if o == nil || o.ArrayArrayOfModel == nil { + var ret [][]ReadOnlyFirst + return ret, false + } + return *o.ArrayArrayOfModel, true +} + +// HasArrayArrayOfModel returns a boolean if a field has been set. +func (o *ArrayTest) HasArrayArrayOfModel() bool { + if o != nil && o.ArrayArrayOfModel != nil { + return true + } + + return false +} + +// SetArrayArrayOfModel gets a reference to the given [][]ReadOnlyFirst and assigns it to the ArrayArrayOfModel field. +func (o *ArrayTest) SetArrayArrayOfModel(v [][]ReadOnlyFirst) { + o.ArrayArrayOfModel = &v +} + + +func (o ArrayTest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.ArrayOfString != nil { + toSerialize["array_of_string"] = o.ArrayOfString + } + if o.ArrayArrayOfInteger != nil { + toSerialize["array_array_of_integer"] = o.ArrayArrayOfInteger + } + if o.ArrayArrayOfModel != nil { + toSerialize["array_array_of_model"] = o.ArrayArrayOfModel + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_capitalization.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_capitalization.go new file mode 100644 index 000000000000..965237ba289b --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_capitalization.go @@ -0,0 +1,253 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi +import ( + "encoding/json" +) + +type Capitalization struct { + SmallCamel *string `json:"smallCamel,omitempty"` + + CapitalCamel *string `json:"CapitalCamel,omitempty"` + + SmallSnake *string `json:"small_Snake,omitempty"` + + CapitalSnake *string `json:"Capital_Snake,omitempty"` + + SCAETHFlowPoints *string `json:"SCA_ETH_Flow_Points,omitempty"` + + // Name of the pet + ATT_NAME *string `json:"ATT_NAME,omitempty"` + +} + +// GetSmallCamel returns the SmallCamel field if non-nil, zero value otherwise. +func (o *Capitalization) GetSmallCamel() string { + if o == nil || o.SmallCamel == nil { + var ret string + return ret + } + return *o.SmallCamel +} + +// GetSmallCamelOk returns a tuple with the SmallCamel field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Capitalization) GetSmallCamelOk() (string, bool) { + if o == nil || o.SmallCamel == nil { + var ret string + return ret, false + } + return *o.SmallCamel, true +} + +// HasSmallCamel returns a boolean if a field has been set. +func (o *Capitalization) HasSmallCamel() bool { + if o != nil && o.SmallCamel != nil { + return true + } + + return false +} + +// SetSmallCamel gets a reference to the given string and assigns it to the SmallCamel field. +func (o *Capitalization) SetSmallCamel(v string) { + o.SmallCamel = &v +} + +// GetCapitalCamel returns the CapitalCamel field if non-nil, zero value otherwise. +func (o *Capitalization) GetCapitalCamel() string { + if o == nil || o.CapitalCamel == nil { + var ret string + return ret + } + return *o.CapitalCamel +} + +// GetCapitalCamelOk returns a tuple with the CapitalCamel field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Capitalization) GetCapitalCamelOk() (string, bool) { + if o == nil || o.CapitalCamel == nil { + var ret string + return ret, false + } + return *o.CapitalCamel, true +} + +// HasCapitalCamel returns a boolean if a field has been set. +func (o *Capitalization) HasCapitalCamel() bool { + if o != nil && o.CapitalCamel != nil { + return true + } + + return false +} + +// SetCapitalCamel gets a reference to the given string and assigns it to the CapitalCamel field. +func (o *Capitalization) SetCapitalCamel(v string) { + o.CapitalCamel = &v +} + +// GetSmallSnake returns the SmallSnake field if non-nil, zero value otherwise. +func (o *Capitalization) GetSmallSnake() string { + if o == nil || o.SmallSnake == nil { + var ret string + return ret + } + return *o.SmallSnake +} + +// GetSmallSnakeOk returns a tuple with the SmallSnake field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Capitalization) GetSmallSnakeOk() (string, bool) { + if o == nil || o.SmallSnake == nil { + var ret string + return ret, false + } + return *o.SmallSnake, true +} + +// HasSmallSnake returns a boolean if a field has been set. +func (o *Capitalization) HasSmallSnake() bool { + if o != nil && o.SmallSnake != nil { + return true + } + + return false +} + +// SetSmallSnake gets a reference to the given string and assigns it to the SmallSnake field. +func (o *Capitalization) SetSmallSnake(v string) { + o.SmallSnake = &v +} + +// GetCapitalSnake returns the CapitalSnake field if non-nil, zero value otherwise. +func (o *Capitalization) GetCapitalSnake() string { + if o == nil || o.CapitalSnake == nil { + var ret string + return ret + } + return *o.CapitalSnake +} + +// GetCapitalSnakeOk returns a tuple with the CapitalSnake field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Capitalization) GetCapitalSnakeOk() (string, bool) { + if o == nil || o.CapitalSnake == nil { + var ret string + return ret, false + } + return *o.CapitalSnake, true +} + +// HasCapitalSnake returns a boolean if a field has been set. +func (o *Capitalization) HasCapitalSnake() bool { + if o != nil && o.CapitalSnake != nil { + return true + } + + return false +} + +// SetCapitalSnake gets a reference to the given string and assigns it to the CapitalSnake field. +func (o *Capitalization) SetCapitalSnake(v string) { + o.CapitalSnake = &v +} + +// GetSCAETHFlowPoints returns the SCAETHFlowPoints field if non-nil, zero value otherwise. +func (o *Capitalization) GetSCAETHFlowPoints() string { + if o == nil || o.SCAETHFlowPoints == nil { + var ret string + return ret + } + return *o.SCAETHFlowPoints +} + +// GetSCAETHFlowPointsOk returns a tuple with the SCAETHFlowPoints field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Capitalization) GetSCAETHFlowPointsOk() (string, bool) { + if o == nil || o.SCAETHFlowPoints == nil { + var ret string + return ret, false + } + return *o.SCAETHFlowPoints, true +} + +// HasSCAETHFlowPoints returns a boolean if a field has been set. +func (o *Capitalization) HasSCAETHFlowPoints() bool { + if o != nil && o.SCAETHFlowPoints != nil { + return true + } + + return false +} + +// SetSCAETHFlowPoints gets a reference to the given string and assigns it to the SCAETHFlowPoints field. +func (o *Capitalization) SetSCAETHFlowPoints(v string) { + o.SCAETHFlowPoints = &v +} + +// GetATT_NAME returns the ATT_NAME field if non-nil, zero value otherwise. +func (o *Capitalization) GetATT_NAME() string { + if o == nil || o.ATT_NAME == nil { + var ret string + return ret + } + return *o.ATT_NAME +} + +// GetATT_NAMEOk returns a tuple with the ATT_NAME field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Capitalization) GetATT_NAMEOk() (string, bool) { + if o == nil || o.ATT_NAME == nil { + var ret string + return ret, false + } + return *o.ATT_NAME, true +} + +// HasATT_NAME returns a boolean if a field has been set. +func (o *Capitalization) HasATT_NAME() bool { + if o != nil && o.ATT_NAME != nil { + return true + } + + return false +} + +// SetATT_NAME gets a reference to the given string and assigns it to the ATT_NAME field. +func (o *Capitalization) SetATT_NAME(v string) { + o.ATT_NAME = &v +} + + +func (o Capitalization) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.SmallCamel != nil { + toSerialize["smallCamel"] = o.SmallCamel + } + if o.CapitalCamel != nil { + toSerialize["CapitalCamel"] = o.CapitalCamel + } + if o.SmallSnake != nil { + toSerialize["small_Snake"] = o.SmallSnake + } + if o.CapitalSnake != nil { + toSerialize["Capital_Snake"] = o.CapitalSnake + } + if o.SCAETHFlowPoints != nil { + toSerialize["SCA_ETH_Flow_Points"] = o.SCAETHFlowPoints + } + if o.ATT_NAME != nil { + toSerialize["ATT_NAME"] = o.ATT_NAME + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_cat.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_cat.go new file mode 100644 index 000000000000..2b2902ddce0b --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_cat.go @@ -0,0 +1,142 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi +import ( + "encoding/json" + "errors" +) + +type Cat struct { + ClassName *string `json:"className,omitempty"` + + Color *string `json:"color,omitempty"` + + Declawed *bool `json:"declawed,omitempty"` + +} + +// GetClassName returns the ClassName field if non-nil, zero value otherwise. +func (o *Cat) GetClassName() string { + if o == nil || o.ClassName == nil { + var ret string + return ret + } + return *o.ClassName +} + +// GetClassNameOk returns a tuple with the ClassName field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Cat) GetClassNameOk() (string, bool) { + if o == nil || o.ClassName == nil { + var ret string + return ret, false + } + return *o.ClassName, true +} + +// HasClassName returns a boolean if a field has been set. +func (o *Cat) HasClassName() bool { + if o != nil && o.ClassName != nil { + return true + } + + return false +} + +// SetClassName gets a reference to the given string and assigns it to the ClassName field. +func (o *Cat) SetClassName(v string) { + o.ClassName = &v +} + +// GetColor returns the Color field if non-nil, zero value otherwise. +func (o *Cat) GetColor() string { + if o == nil || o.Color == nil { + var ret string + return ret + } + return *o.Color +} + +// GetColorOk returns a tuple with the Color field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Cat) GetColorOk() (string, bool) { + if o == nil || o.Color == nil { + var ret string + return ret, false + } + return *o.Color, true +} + +// HasColor returns a boolean if a field has been set. +func (o *Cat) HasColor() bool { + if o != nil && o.Color != nil { + return true + } + + return false +} + +// SetColor gets a reference to the given string and assigns it to the Color field. +func (o *Cat) SetColor(v string) { + o.Color = &v +} + +// GetDeclawed returns the Declawed field if non-nil, zero value otherwise. +func (o *Cat) GetDeclawed() bool { + if o == nil || o.Declawed == nil { + var ret bool + return ret + } + return *o.Declawed +} + +// GetDeclawedOk returns a tuple with the Declawed field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Cat) GetDeclawedOk() (bool, bool) { + if o == nil || o.Declawed == nil { + var ret bool + return ret, false + } + return *o.Declawed, true +} + +// HasDeclawed returns a boolean if a field has been set. +func (o *Cat) HasDeclawed() bool { + if o != nil && o.Declawed != nil { + return true + } + + return false +} + +// SetDeclawed gets a reference to the given bool and assigns it to the Declawed field. +func (o *Cat) SetDeclawed(v bool) { + o.Declawed = &v +} + + +func (o Cat) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.ClassName == nil { + return nil, errors.New("ClassName is required and not nullable, but was not set on Cat") + } + if o.ClassName != nil { + toSerialize["className"] = o.ClassName + } + if o.Color != nil { + toSerialize["color"] = o.Color + } + if o.Declawed != nil { + toSerialize["declawed"] = o.Declawed + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_cat_all_of.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_cat_all_of.go new file mode 100644 index 000000000000..68a621c12be1 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_cat_all_of.go @@ -0,0 +1,62 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi +import ( + "encoding/json" +) + +type CatAllOf struct { + Declawed *bool `json:"declawed,omitempty"` + +} + +// GetDeclawed returns the Declawed field if non-nil, zero value otherwise. +func (o *CatAllOf) GetDeclawed() bool { + if o == nil || o.Declawed == nil { + var ret bool + return ret + } + return *o.Declawed +} + +// GetDeclawedOk returns a tuple with the Declawed field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *CatAllOf) GetDeclawedOk() (bool, bool) { + if o == nil || o.Declawed == nil { + var ret bool + return ret, false + } + return *o.Declawed, true +} + +// HasDeclawed returns a boolean if a field has been set. +func (o *CatAllOf) HasDeclawed() bool { + if o != nil && o.Declawed != nil { + return true + } + + return false +} + +// SetDeclawed gets a reference to the given bool and assigns it to the Declawed field. +func (o *CatAllOf) SetDeclawed(v bool) { + o.Declawed = &v +} + + +func (o CatAllOf) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Declawed != nil { + toSerialize["declawed"] = o.Declawed + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_category.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_category.go new file mode 100644 index 000000000000..d8afcecf03fa --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_category.go @@ -0,0 +1,104 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi +import ( + "encoding/json" + "errors" +) + +type Category struct { + Id *int64 `json:"id,omitempty"` + + Name *string `json:"name,omitempty"` + +} + +// GetId returns the Id field if non-nil, zero value otherwise. +func (o *Category) GetId() int64 { + if o == nil || o.Id == nil { + var ret int64 + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Category) GetIdOk() (int64, bool) { + if o == nil || o.Id == nil { + var ret int64 + return ret, false + } + return *o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Category) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// SetId gets a reference to the given int64 and assigns it to the Id field. +func (o *Category) SetId(v int64) { + o.Id = &v +} + +// GetName returns the Name field if non-nil, zero value otherwise. +func (o *Category) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Category) GetNameOk() (string, bool) { + if o == nil || o.Name == nil { + var ret string + return ret, false + } + return *o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Category) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *Category) SetName(v string) { + o.Name = &v +} + + +func (o Category) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Name == nil { + return nil, errors.New("Name is required and not nullable, but was not set on Category") + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_class_model.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_class_model.go new file mode 100644 index 000000000000..aadd38c2f65f --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_class_model.go @@ -0,0 +1,63 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi +import ( + "encoding/json" +) + +// Model for testing model with \"_class\" property +type ClassModel struct { + Class *string `json:"_class,omitempty"` + +} + +// GetClass returns the Class field if non-nil, zero value otherwise. +func (o *ClassModel) GetClass() string { + if o == nil || o.Class == nil { + var ret string + return ret + } + return *o.Class +} + +// GetClassOk returns a tuple with the Class field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *ClassModel) GetClassOk() (string, bool) { + if o == nil || o.Class == nil { + var ret string + return ret, false + } + return *o.Class, true +} + +// HasClass returns a boolean if a field has been set. +func (o *ClassModel) HasClass() bool { + if o != nil && o.Class != nil { + return true + } + + return false +} + +// SetClass gets a reference to the given string and assigns it to the Class field. +func (o *ClassModel) SetClass(v string) { + o.Class = &v +} + + +func (o ClassModel) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Class != nil { + toSerialize["_class"] = o.Class + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_client.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_client.go new file mode 100644 index 000000000000..e4b13eedae63 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_client.go @@ -0,0 +1,62 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi +import ( + "encoding/json" +) + +type Client struct { + Client *string `json:"client,omitempty"` + +} + +// GetClient returns the Client field if non-nil, zero value otherwise. +func (o *Client) GetClient() string { + if o == nil || o.Client == nil { + var ret string + return ret + } + return *o.Client +} + +// GetClientOk returns a tuple with the Client field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Client) GetClientOk() (string, bool) { + if o == nil || o.Client == nil { + var ret string + return ret, false + } + return *o.Client, true +} + +// HasClient returns a boolean if a field has been set. +func (o *Client) HasClient() bool { + if o != nil && o.Client != nil { + return true + } + + return false +} + +// SetClient gets a reference to the given string and assigns it to the Client field. +func (o *Client) SetClient(v string) { + o.Client = &v +} + + +func (o Client) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Client != nil { + toSerialize["client"] = o.Client + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_dog.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_dog.go new file mode 100644 index 000000000000..dcab10f42e06 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_dog.go @@ -0,0 +1,142 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi +import ( + "encoding/json" + "errors" +) + +type Dog struct { + ClassName *string `json:"className,omitempty"` + + Color *string `json:"color,omitempty"` + + Breed *string `json:"breed,omitempty"` + +} + +// GetClassName returns the ClassName field if non-nil, zero value otherwise. +func (o *Dog) GetClassName() string { + if o == nil || o.ClassName == nil { + var ret string + return ret + } + return *o.ClassName +} + +// GetClassNameOk returns a tuple with the ClassName field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Dog) GetClassNameOk() (string, bool) { + if o == nil || o.ClassName == nil { + var ret string + return ret, false + } + return *o.ClassName, true +} + +// HasClassName returns a boolean if a field has been set. +func (o *Dog) HasClassName() bool { + if o != nil && o.ClassName != nil { + return true + } + + return false +} + +// SetClassName gets a reference to the given string and assigns it to the ClassName field. +func (o *Dog) SetClassName(v string) { + o.ClassName = &v +} + +// GetColor returns the Color field if non-nil, zero value otherwise. +func (o *Dog) GetColor() string { + if o == nil || o.Color == nil { + var ret string + return ret + } + return *o.Color +} + +// GetColorOk returns a tuple with the Color field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Dog) GetColorOk() (string, bool) { + if o == nil || o.Color == nil { + var ret string + return ret, false + } + return *o.Color, true +} + +// HasColor returns a boolean if a field has been set. +func (o *Dog) HasColor() bool { + if o != nil && o.Color != nil { + return true + } + + return false +} + +// SetColor gets a reference to the given string and assigns it to the Color field. +func (o *Dog) SetColor(v string) { + o.Color = &v +} + +// GetBreed returns the Breed field if non-nil, zero value otherwise. +func (o *Dog) GetBreed() string { + if o == nil || o.Breed == nil { + var ret string + return ret + } + return *o.Breed +} + +// GetBreedOk returns a tuple with the Breed field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Dog) GetBreedOk() (string, bool) { + if o == nil || o.Breed == nil { + var ret string + return ret, false + } + return *o.Breed, true +} + +// HasBreed returns a boolean if a field has been set. +func (o *Dog) HasBreed() bool { + if o != nil && o.Breed != nil { + return true + } + + return false +} + +// SetBreed gets a reference to the given string and assigns it to the Breed field. +func (o *Dog) SetBreed(v string) { + o.Breed = &v +} + + +func (o Dog) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.ClassName == nil { + return nil, errors.New("ClassName is required and not nullable, but was not set on Dog") + } + if o.ClassName != nil { + toSerialize["className"] = o.ClassName + } + if o.Color != nil { + toSerialize["color"] = o.Color + } + if o.Breed != nil { + toSerialize["breed"] = o.Breed + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_dog_all_of.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_dog_all_of.go new file mode 100644 index 000000000000..96e147741d99 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_dog_all_of.go @@ -0,0 +1,62 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi +import ( + "encoding/json" +) + +type DogAllOf struct { + Breed *string `json:"breed,omitempty"` + +} + +// GetBreed returns the Breed field if non-nil, zero value otherwise. +func (o *DogAllOf) GetBreed() string { + if o == nil || o.Breed == nil { + var ret string + return ret + } + return *o.Breed +} + +// GetBreedOk returns a tuple with the Breed field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *DogAllOf) GetBreedOk() (string, bool) { + if o == nil || o.Breed == nil { + var ret string + return ret, false + } + return *o.Breed, true +} + +// HasBreed returns a boolean if a field has been set. +func (o *DogAllOf) HasBreed() bool { + if o != nil && o.Breed != nil { + return true + } + + return false +} + +// SetBreed gets a reference to the given string and assigns it to the Breed field. +func (o *DogAllOf) SetBreed(v string) { + o.Breed = &v +} + + +func (o DogAllOf) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Breed != nil { + toSerialize["breed"] = o.Breed + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_arrays.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_arrays.go new file mode 100644 index 000000000000..5da3b5f9050f --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_arrays.go @@ -0,0 +1,100 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi +import ( + "encoding/json" +) + +type EnumArrays struct { + JustSymbol *string `json:"just_symbol,omitempty"` + + ArrayEnum *[]string `json:"array_enum,omitempty"` + +} + +// GetJustSymbol returns the JustSymbol field if non-nil, zero value otherwise. +func (o *EnumArrays) GetJustSymbol() string { + if o == nil || o.JustSymbol == nil { + var ret string + return ret + } + return *o.JustSymbol +} + +// GetJustSymbolOk returns a tuple with the JustSymbol field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *EnumArrays) GetJustSymbolOk() (string, bool) { + if o == nil || o.JustSymbol == nil { + var ret string + return ret, false + } + return *o.JustSymbol, true +} + +// HasJustSymbol returns a boolean if a field has been set. +func (o *EnumArrays) HasJustSymbol() bool { + if o != nil && o.JustSymbol != nil { + return true + } + + return false +} + +// SetJustSymbol gets a reference to the given string and assigns it to the JustSymbol field. +func (o *EnumArrays) SetJustSymbol(v string) { + o.JustSymbol = &v +} + +// GetArrayEnum returns the ArrayEnum field if non-nil, zero value otherwise. +func (o *EnumArrays) GetArrayEnum() []string { + if o == nil || o.ArrayEnum == nil { + var ret []string + return ret + } + return *o.ArrayEnum +} + +// GetArrayEnumOk returns a tuple with the ArrayEnum field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *EnumArrays) GetArrayEnumOk() ([]string, bool) { + if o == nil || o.ArrayEnum == nil { + var ret []string + return ret, false + } + return *o.ArrayEnum, true +} + +// HasArrayEnum returns a boolean if a field has been set. +func (o *EnumArrays) HasArrayEnum() bool { + if o != nil && o.ArrayEnum != nil { + return true + } + + return false +} + +// SetArrayEnum gets a reference to the given []string and assigns it to the ArrayEnum field. +func (o *EnumArrays) SetArrayEnum(v []string) { + o.ArrayEnum = &v +} + + +func (o EnumArrays) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.JustSymbol != nil { + toSerialize["just_symbol"] = o.JustSymbol + } + if o.ArrayEnum != nil { + toSerialize["array_enum"] = o.ArrayEnum + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_class.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_class.go new file mode 100644 index 000000000000..a239ba352887 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_class.go @@ -0,0 +1,19 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi +type EnumClass string + +// List of EnumClass +const ( + ABC EnumClass = "_abc" + EFG EnumClass = "-efg" + XYZ EnumClass = "(xyz)" +) + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_test_.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_test_.go new file mode 100644 index 000000000000..fe5d8b050b3c --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_test_.go @@ -0,0 +1,343 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi +import ( + "encoding/json" + "errors" +) + +type EnumTest struct { + EnumString *string `json:"enum_string,omitempty"` + + EnumStringRequired *string `json:"enum_string_required,omitempty"` + + EnumInteger *int32 `json:"enum_integer,omitempty"` + + EnumNumber *float64 `json:"enum_number,omitempty"` + + OuterEnum *OuterEnum `json:"outerEnum,omitempty"` + isExplicitNullOuterEnum bool `json:"-"` + OuterEnumInteger *OuterEnumInteger `json:"outerEnumInteger,omitempty"` + + OuterEnumDefaultValue *OuterEnumDefaultValue `json:"outerEnumDefaultValue,omitempty"` + + OuterEnumIntegerDefaultValue *OuterEnumIntegerDefaultValue `json:"outerEnumIntegerDefaultValue,omitempty"` + +} + +// GetEnumString returns the EnumString field if non-nil, zero value otherwise. +func (o *EnumTest) GetEnumString() string { + if o == nil || o.EnumString == nil { + var ret string + return ret + } + return *o.EnumString +} + +// GetEnumStringOk returns a tuple with the EnumString field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *EnumTest) GetEnumStringOk() (string, bool) { + if o == nil || o.EnumString == nil { + var ret string + return ret, false + } + return *o.EnumString, true +} + +// HasEnumString returns a boolean if a field has been set. +func (o *EnumTest) HasEnumString() bool { + if o != nil && o.EnumString != nil { + return true + } + + return false +} + +// SetEnumString gets a reference to the given string and assigns it to the EnumString field. +func (o *EnumTest) SetEnumString(v string) { + o.EnumString = &v +} + +// GetEnumStringRequired returns the EnumStringRequired field if non-nil, zero value otherwise. +func (o *EnumTest) GetEnumStringRequired() string { + if o == nil || o.EnumStringRequired == nil { + var ret string + return ret + } + return *o.EnumStringRequired +} + +// GetEnumStringRequiredOk returns a tuple with the EnumStringRequired field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *EnumTest) GetEnumStringRequiredOk() (string, bool) { + if o == nil || o.EnumStringRequired == nil { + var ret string + return ret, false + } + return *o.EnumStringRequired, true +} + +// HasEnumStringRequired returns a boolean if a field has been set. +func (o *EnumTest) HasEnumStringRequired() bool { + if o != nil && o.EnumStringRequired != nil { + return true + } + + return false +} + +// SetEnumStringRequired gets a reference to the given string and assigns it to the EnumStringRequired field. +func (o *EnumTest) SetEnumStringRequired(v string) { + o.EnumStringRequired = &v +} + +// GetEnumInteger returns the EnumInteger field if non-nil, zero value otherwise. +func (o *EnumTest) GetEnumInteger() int32 { + if o == nil || o.EnumInteger == nil { + var ret int32 + return ret + } + return *o.EnumInteger +} + +// GetEnumIntegerOk returns a tuple with the EnumInteger field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *EnumTest) GetEnumIntegerOk() (int32, bool) { + if o == nil || o.EnumInteger == nil { + var ret int32 + return ret, false + } + return *o.EnumInteger, true +} + +// HasEnumInteger returns a boolean if a field has been set. +func (o *EnumTest) HasEnumInteger() bool { + if o != nil && o.EnumInteger != nil { + return true + } + + return false +} + +// SetEnumInteger gets a reference to the given int32 and assigns it to the EnumInteger field. +func (o *EnumTest) SetEnumInteger(v int32) { + o.EnumInteger = &v +} + +// GetEnumNumber returns the EnumNumber field if non-nil, zero value otherwise. +func (o *EnumTest) GetEnumNumber() float64 { + if o == nil || o.EnumNumber == nil { + var ret float64 + return ret + } + return *o.EnumNumber +} + +// GetEnumNumberOk returns a tuple with the EnumNumber field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *EnumTest) GetEnumNumberOk() (float64, bool) { + if o == nil || o.EnumNumber == nil { + var ret float64 + return ret, false + } + return *o.EnumNumber, true +} + +// HasEnumNumber returns a boolean if a field has been set. +func (o *EnumTest) HasEnumNumber() bool { + if o != nil && o.EnumNumber != nil { + return true + } + + return false +} + +// SetEnumNumber gets a reference to the given float64 and assigns it to the EnumNumber field. +func (o *EnumTest) SetEnumNumber(v float64) { + o.EnumNumber = &v +} + +// GetOuterEnum returns the OuterEnum field if non-nil, zero value otherwise. +func (o *EnumTest) GetOuterEnum() OuterEnum { + if o == nil || o.OuterEnum == nil { + var ret OuterEnum + return ret + } + return *o.OuterEnum +} + +// GetOuterEnumOk returns a tuple with the OuterEnum field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *EnumTest) GetOuterEnumOk() (OuterEnum, bool) { + if o == nil || o.OuterEnum == nil { + var ret OuterEnum + return ret, false + } + return *o.OuterEnum, true +} + +// HasOuterEnum returns a boolean if a field has been set. +func (o *EnumTest) HasOuterEnum() bool { + if o != nil && o.OuterEnum != nil { + return true + } + + return false +} + +// SetOuterEnum gets a reference to the given OuterEnum and assigns it to the OuterEnum field. +func (o *EnumTest) SetOuterEnum(v OuterEnum) { + o.OuterEnum = &v +} + +// SetOuterEnumExplicitNull (un)sets OuterEnum to be considered as explicit "null" value +// when serializing to JSON (pass true as argument to set this, false to unset) +// The OuterEnum value is set to nil even if false is passed +func (o *EnumTest) SetOuterEnumExplicitNull(b bool) { + o.OuterEnum = nil + o.isExplicitNullOuterEnum = b +} +// GetOuterEnumInteger returns the OuterEnumInteger field if non-nil, zero value otherwise. +func (o *EnumTest) GetOuterEnumInteger() OuterEnumInteger { + if o == nil || o.OuterEnumInteger == nil { + var ret OuterEnumInteger + return ret + } + return *o.OuterEnumInteger +} + +// GetOuterEnumIntegerOk returns a tuple with the OuterEnumInteger field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *EnumTest) GetOuterEnumIntegerOk() (OuterEnumInteger, bool) { + if o == nil || o.OuterEnumInteger == nil { + var ret OuterEnumInteger + return ret, false + } + return *o.OuterEnumInteger, true +} + +// HasOuterEnumInteger returns a boolean if a field has been set. +func (o *EnumTest) HasOuterEnumInteger() bool { + if o != nil && o.OuterEnumInteger != nil { + return true + } + + return false +} + +// SetOuterEnumInteger gets a reference to the given OuterEnumInteger and assigns it to the OuterEnumInteger field. +func (o *EnumTest) SetOuterEnumInteger(v OuterEnumInteger) { + o.OuterEnumInteger = &v +} + +// GetOuterEnumDefaultValue returns the OuterEnumDefaultValue field if non-nil, zero value otherwise. +func (o *EnumTest) GetOuterEnumDefaultValue() OuterEnumDefaultValue { + if o == nil || o.OuterEnumDefaultValue == nil { + var ret OuterEnumDefaultValue + return ret + } + return *o.OuterEnumDefaultValue +} + +// GetOuterEnumDefaultValueOk returns a tuple with the OuterEnumDefaultValue field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *EnumTest) GetOuterEnumDefaultValueOk() (OuterEnumDefaultValue, bool) { + if o == nil || o.OuterEnumDefaultValue == nil { + var ret OuterEnumDefaultValue + return ret, false + } + return *o.OuterEnumDefaultValue, true +} + +// HasOuterEnumDefaultValue returns a boolean if a field has been set. +func (o *EnumTest) HasOuterEnumDefaultValue() bool { + if o != nil && o.OuterEnumDefaultValue != nil { + return true + } + + return false +} + +// SetOuterEnumDefaultValue gets a reference to the given OuterEnumDefaultValue and assigns it to the OuterEnumDefaultValue field. +func (o *EnumTest) SetOuterEnumDefaultValue(v OuterEnumDefaultValue) { + o.OuterEnumDefaultValue = &v +} + +// GetOuterEnumIntegerDefaultValue returns the OuterEnumIntegerDefaultValue field if non-nil, zero value otherwise. +func (o *EnumTest) GetOuterEnumIntegerDefaultValue() OuterEnumIntegerDefaultValue { + if o == nil || o.OuterEnumIntegerDefaultValue == nil { + var ret OuterEnumIntegerDefaultValue + return ret + } + return *o.OuterEnumIntegerDefaultValue +} + +// GetOuterEnumIntegerDefaultValueOk returns a tuple with the OuterEnumIntegerDefaultValue field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *EnumTest) GetOuterEnumIntegerDefaultValueOk() (OuterEnumIntegerDefaultValue, bool) { + if o == nil || o.OuterEnumIntegerDefaultValue == nil { + var ret OuterEnumIntegerDefaultValue + return ret, false + } + return *o.OuterEnumIntegerDefaultValue, true +} + +// HasOuterEnumIntegerDefaultValue returns a boolean if a field has been set. +func (o *EnumTest) HasOuterEnumIntegerDefaultValue() bool { + if o != nil && o.OuterEnumIntegerDefaultValue != nil { + return true + } + + return false +} + +// SetOuterEnumIntegerDefaultValue gets a reference to the given OuterEnumIntegerDefaultValue and assigns it to the OuterEnumIntegerDefaultValue field. +func (o *EnumTest) SetOuterEnumIntegerDefaultValue(v OuterEnumIntegerDefaultValue) { + o.OuterEnumIntegerDefaultValue = &v +} + + +func (o EnumTest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.EnumString != nil { + toSerialize["enum_string"] = o.EnumString + } + if o.EnumStringRequired == nil { + return nil, errors.New("EnumStringRequired is required and not nullable, but was not set on EnumTest") + } + if o.EnumStringRequired != nil { + toSerialize["enum_string_required"] = o.EnumStringRequired + } + if o.EnumInteger != nil { + toSerialize["enum_integer"] = o.EnumInteger + } + if o.EnumNumber != nil { + toSerialize["enum_number"] = o.EnumNumber + } + if o.OuterEnum == nil { + if o.isExplicitNullOuterEnum { + toSerialize["outerEnum"] = o.OuterEnum + } + } else { + toSerialize["outerEnum"] = o.OuterEnum + } + if o.OuterEnumInteger != nil { + toSerialize["outerEnumInteger"] = o.OuterEnumInteger + } + if o.OuterEnumDefaultValue != nil { + toSerialize["outerEnumDefaultValue"] = o.OuterEnumDefaultValue + } + if o.OuterEnumIntegerDefaultValue != nil { + toSerialize["outerEnumIntegerDefaultValue"] = o.OuterEnumIntegerDefaultValue + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_file.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_file.go new file mode 100644 index 000000000000..30202f04be7c --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_file.go @@ -0,0 +1,64 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi +import ( + "encoding/json" +) + +// Must be named `File` for test. +type File struct { + // Test capitalization + SourceURI *string `json:"sourceURI,omitempty"` + +} + +// GetSourceURI returns the SourceURI field if non-nil, zero value otherwise. +func (o *File) GetSourceURI() string { + if o == nil || o.SourceURI == nil { + var ret string + return ret + } + return *o.SourceURI +} + +// GetSourceURIOk returns a tuple with the SourceURI field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *File) GetSourceURIOk() (string, bool) { + if o == nil || o.SourceURI == nil { + var ret string + return ret, false + } + return *o.SourceURI, true +} + +// HasSourceURI returns a boolean if a field has been set. +func (o *File) HasSourceURI() bool { + if o != nil && o.SourceURI != nil { + return true + } + + return false +} + +// SetSourceURI gets a reference to the given string and assigns it to the SourceURI field. +func (o *File) SetSourceURI(v string) { + o.SourceURI = &v +} + + +func (o File) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.SourceURI != nil { + toSerialize["sourceURI"] = o.SourceURI + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_file_schema_test_class.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_file_schema_test_class.go new file mode 100644 index 000000000000..56a93b278017 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_file_schema_test_class.go @@ -0,0 +1,100 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi +import ( + "encoding/json" +) + +type FileSchemaTestClass struct { + File *File `json:"file,omitempty"` + + Files *[]File `json:"files,omitempty"` + +} + +// GetFile returns the File field if non-nil, zero value otherwise. +func (o *FileSchemaTestClass) GetFile() File { + if o == nil || o.File == nil { + var ret File + return ret + } + return *o.File +} + +// GetFileOk returns a tuple with the File field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *FileSchemaTestClass) GetFileOk() (File, bool) { + if o == nil || o.File == nil { + var ret File + return ret, false + } + return *o.File, true +} + +// HasFile returns a boolean if a field has been set. +func (o *FileSchemaTestClass) HasFile() bool { + if o != nil && o.File != nil { + return true + } + + return false +} + +// SetFile gets a reference to the given File and assigns it to the File field. +func (o *FileSchemaTestClass) SetFile(v File) { + o.File = &v +} + +// GetFiles returns the Files field if non-nil, zero value otherwise. +func (o *FileSchemaTestClass) GetFiles() []File { + if o == nil || o.Files == nil { + var ret []File + return ret + } + return *o.Files +} + +// GetFilesOk returns a tuple with the Files field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *FileSchemaTestClass) GetFilesOk() ([]File, bool) { + if o == nil || o.Files == nil { + var ret []File + return ret, false + } + return *o.Files, true +} + +// HasFiles returns a boolean if a field has been set. +func (o *FileSchemaTestClass) HasFiles() bool { + if o != nil && o.Files != nil { + return true + } + + return false +} + +// SetFiles gets a reference to the given []File and assigns it to the Files field. +func (o *FileSchemaTestClass) SetFiles(v []File) { + o.Files = &v +} + + +func (o FileSchemaTestClass) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.File != nil { + toSerialize["file"] = o.File + } + if o.Files != nil { + toSerialize["files"] = o.Files + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_foo.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_foo.go new file mode 100644 index 000000000000..2a06646cd5cd --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_foo.go @@ -0,0 +1,62 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi +import ( + "encoding/json" +) + +type Foo struct { + Bar *string `json:"bar,omitempty"` + +} + +// GetBar returns the Bar field if non-nil, zero value otherwise. +func (o *Foo) GetBar() string { + if o == nil || o.Bar == nil { + var ret string + return ret + } + return *o.Bar +} + +// GetBarOk returns a tuple with the Bar field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Foo) GetBarOk() (string, bool) { + if o == nil || o.Bar == nil { + var ret string + return ret, false + } + return *o.Bar, true +} + +// HasBar returns a boolean if a field has been set. +func (o *Foo) HasBar() bool { + if o != nil && o.Bar != nil { + return true + } + + return false +} + +// SetBar gets a reference to the given string and assigns it to the Bar field. +func (o *Foo) SetBar(v string) { + o.Bar = &v +} + + +func (o Foo) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Bar != nil { + toSerialize["bar"] = o.Bar + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_format_test_.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_format_test_.go new file mode 100644 index 000000000000..225dc0b9eb64 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_format_test_.go @@ -0,0 +1,611 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi +import ( + "os" + "time" + "encoding/json" + "errors" +) + +type FormatTest struct { + Integer *int32 `json:"integer,omitempty"` + + Int32 *int32 `json:"int32,omitempty"` + + Int64 *int64 `json:"int64,omitempty"` + + Number *float32 `json:"number,omitempty"` + + Float *float32 `json:"float,omitempty"` + + Double *float64 `json:"double,omitempty"` + + String *string `json:"string,omitempty"` + + Byte *string `json:"byte,omitempty"` + + Binary **os.File `json:"binary,omitempty"` + + Date *string `json:"date,omitempty"` + + DateTime *time.Time `json:"dateTime,omitempty"` + + Uuid *string `json:"uuid,omitempty"` + + Password *string `json:"password,omitempty"` + + // A string that is a 10 digit number. Can have leading zeros. + PatternWithDigits *string `json:"pattern_with_digits,omitempty"` + + // A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + PatternWithDigitsAndDelimiter *string `json:"pattern_with_digits_and_delimiter,omitempty"` + +} + +// GetInteger returns the Integer field if non-nil, zero value otherwise. +func (o *FormatTest) GetInteger() int32 { + if o == nil || o.Integer == nil { + var ret int32 + return ret + } + return *o.Integer +} + +// GetIntegerOk returns a tuple with the Integer field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *FormatTest) GetIntegerOk() (int32, bool) { + if o == nil || o.Integer == nil { + var ret int32 + return ret, false + } + return *o.Integer, true +} + +// HasInteger returns a boolean if a field has been set. +func (o *FormatTest) HasInteger() bool { + if o != nil && o.Integer != nil { + return true + } + + return false +} + +// SetInteger gets a reference to the given int32 and assigns it to the Integer field. +func (o *FormatTest) SetInteger(v int32) { + o.Integer = &v +} + +// GetInt32 returns the Int32 field if non-nil, zero value otherwise. +func (o *FormatTest) GetInt32() int32 { + if o == nil || o.Int32 == nil { + var ret int32 + return ret + } + return *o.Int32 +} + +// GetInt32Ok returns a tuple with the Int32 field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *FormatTest) GetInt32Ok() (int32, bool) { + if o == nil || o.Int32 == nil { + var ret int32 + return ret, false + } + return *o.Int32, true +} + +// HasInt32 returns a boolean if a field has been set. +func (o *FormatTest) HasInt32() bool { + if o != nil && o.Int32 != nil { + return true + } + + return false +} + +// SetInt32 gets a reference to the given int32 and assigns it to the Int32 field. +func (o *FormatTest) SetInt32(v int32) { + o.Int32 = &v +} + +// GetInt64 returns the Int64 field if non-nil, zero value otherwise. +func (o *FormatTest) GetInt64() int64 { + if o == nil || o.Int64 == nil { + var ret int64 + return ret + } + return *o.Int64 +} + +// GetInt64Ok returns a tuple with the Int64 field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *FormatTest) GetInt64Ok() (int64, bool) { + if o == nil || o.Int64 == nil { + var ret int64 + return ret, false + } + return *o.Int64, true +} + +// HasInt64 returns a boolean if a field has been set. +func (o *FormatTest) HasInt64() bool { + if o != nil && o.Int64 != nil { + return true + } + + return false +} + +// SetInt64 gets a reference to the given int64 and assigns it to the Int64 field. +func (o *FormatTest) SetInt64(v int64) { + o.Int64 = &v +} + +// GetNumber returns the Number field if non-nil, zero value otherwise. +func (o *FormatTest) GetNumber() float32 { + if o == nil || o.Number == nil { + var ret float32 + return ret + } + return *o.Number +} + +// GetNumberOk returns a tuple with the Number field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *FormatTest) GetNumberOk() (float32, bool) { + if o == nil || o.Number == nil { + var ret float32 + return ret, false + } + return *o.Number, true +} + +// HasNumber returns a boolean if a field has been set. +func (o *FormatTest) HasNumber() bool { + if o != nil && o.Number != nil { + return true + } + + return false +} + +// SetNumber gets a reference to the given float32 and assigns it to the Number field. +func (o *FormatTest) SetNumber(v float32) { + o.Number = &v +} + +// GetFloat returns the Float field if non-nil, zero value otherwise. +func (o *FormatTest) GetFloat() float32 { + if o == nil || o.Float == nil { + var ret float32 + return ret + } + return *o.Float +} + +// GetFloatOk returns a tuple with the Float field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *FormatTest) GetFloatOk() (float32, bool) { + if o == nil || o.Float == nil { + var ret float32 + return ret, false + } + return *o.Float, true +} + +// HasFloat returns a boolean if a field has been set. +func (o *FormatTest) HasFloat() bool { + if o != nil && o.Float != nil { + return true + } + + return false +} + +// SetFloat gets a reference to the given float32 and assigns it to the Float field. +func (o *FormatTest) SetFloat(v float32) { + o.Float = &v +} + +// GetDouble returns the Double field if non-nil, zero value otherwise. +func (o *FormatTest) GetDouble() float64 { + if o == nil || o.Double == nil { + var ret float64 + return ret + } + return *o.Double +} + +// GetDoubleOk returns a tuple with the Double field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *FormatTest) GetDoubleOk() (float64, bool) { + if o == nil || o.Double == nil { + var ret float64 + return ret, false + } + return *o.Double, true +} + +// HasDouble returns a boolean if a field has been set. +func (o *FormatTest) HasDouble() bool { + if o != nil && o.Double != nil { + return true + } + + return false +} + +// SetDouble gets a reference to the given float64 and assigns it to the Double field. +func (o *FormatTest) SetDouble(v float64) { + o.Double = &v +} + +// GetString returns the String field if non-nil, zero value otherwise. +func (o *FormatTest) GetString() string { + if o == nil || o.String == nil { + var ret string + return ret + } + return *o.String +} + +// GetStringOk returns a tuple with the String field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *FormatTest) GetStringOk() (string, bool) { + if o == nil || o.String == nil { + var ret string + return ret, false + } + return *o.String, true +} + +// HasString returns a boolean if a field has been set. +func (o *FormatTest) HasString() bool { + if o != nil && o.String != nil { + return true + } + + return false +} + +// SetString gets a reference to the given string and assigns it to the String field. +func (o *FormatTest) SetString(v string) { + o.String = &v +} + +// GetByte returns the Byte field if non-nil, zero value otherwise. +func (o *FormatTest) GetByte() string { + if o == nil || o.Byte == nil { + var ret string + return ret + } + return *o.Byte +} + +// GetByteOk returns a tuple with the Byte field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *FormatTest) GetByteOk() (string, bool) { + if o == nil || o.Byte == nil { + var ret string + return ret, false + } + return *o.Byte, true +} + +// HasByte returns a boolean if a field has been set. +func (o *FormatTest) HasByte() bool { + if o != nil && o.Byte != nil { + return true + } + + return false +} + +// SetByte gets a reference to the given string and assigns it to the Byte field. +func (o *FormatTest) SetByte(v string) { + o.Byte = &v +} + +// GetBinary returns the Binary field if non-nil, zero value otherwise. +func (o *FormatTest) GetBinary() *os.File { + if o == nil || o.Binary == nil { + var ret *os.File + return ret + } + return *o.Binary +} + +// GetBinaryOk returns a tuple with the Binary field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *FormatTest) GetBinaryOk() (*os.File, bool) { + if o == nil || o.Binary == nil { + var ret *os.File + return ret, false + } + return *o.Binary, true +} + +// HasBinary returns a boolean if a field has been set. +func (o *FormatTest) HasBinary() bool { + if o != nil && o.Binary != nil { + return true + } + + return false +} + +// SetBinary gets a reference to the given *os.File and assigns it to the Binary field. +func (o *FormatTest) SetBinary(v *os.File) { + o.Binary = &v +} + +// GetDate returns the Date field if non-nil, zero value otherwise. +func (o *FormatTest) GetDate() string { + if o == nil || o.Date == nil { + var ret string + return ret + } + return *o.Date +} + +// GetDateOk returns a tuple with the Date field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *FormatTest) GetDateOk() (string, bool) { + if o == nil || o.Date == nil { + var ret string + return ret, false + } + return *o.Date, true +} + +// HasDate returns a boolean if a field has been set. +func (o *FormatTest) HasDate() bool { + if o != nil && o.Date != nil { + return true + } + + return false +} + +// SetDate gets a reference to the given string and assigns it to the Date field. +func (o *FormatTest) SetDate(v string) { + o.Date = &v +} + +// GetDateTime returns the DateTime field if non-nil, zero value otherwise. +func (o *FormatTest) GetDateTime() time.Time { + if o == nil || o.DateTime == nil { + var ret time.Time + return ret + } + return *o.DateTime +} + +// GetDateTimeOk returns a tuple with the DateTime field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *FormatTest) GetDateTimeOk() (time.Time, bool) { + if o == nil || o.DateTime == nil { + var ret time.Time + return ret, false + } + return *o.DateTime, true +} + +// HasDateTime returns a boolean if a field has been set. +func (o *FormatTest) HasDateTime() bool { + if o != nil && o.DateTime != nil { + return true + } + + return false +} + +// SetDateTime gets a reference to the given time.Time and assigns it to the DateTime field. +func (o *FormatTest) SetDateTime(v time.Time) { + o.DateTime = &v +} + +// GetUuid returns the Uuid field if non-nil, zero value otherwise. +func (o *FormatTest) GetUuid() string { + if o == nil || o.Uuid == nil { + var ret string + return ret + } + return *o.Uuid +} + +// GetUuidOk returns a tuple with the Uuid field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *FormatTest) GetUuidOk() (string, bool) { + if o == nil || o.Uuid == nil { + var ret string + return ret, false + } + return *o.Uuid, true +} + +// HasUuid returns a boolean if a field has been set. +func (o *FormatTest) HasUuid() bool { + if o != nil && o.Uuid != nil { + return true + } + + return false +} + +// SetUuid gets a reference to the given string and assigns it to the Uuid field. +func (o *FormatTest) SetUuid(v string) { + o.Uuid = &v +} + +// GetPassword returns the Password field if non-nil, zero value otherwise. +func (o *FormatTest) GetPassword() string { + if o == nil || o.Password == nil { + var ret string + return ret + } + return *o.Password +} + +// GetPasswordOk returns a tuple with the Password field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *FormatTest) GetPasswordOk() (string, bool) { + if o == nil || o.Password == nil { + var ret string + return ret, false + } + return *o.Password, true +} + +// HasPassword returns a boolean if a field has been set. +func (o *FormatTest) HasPassword() bool { + if o != nil && o.Password != nil { + return true + } + + return false +} + +// SetPassword gets a reference to the given string and assigns it to the Password field. +func (o *FormatTest) SetPassword(v string) { + o.Password = &v +} + +// GetPatternWithDigits returns the PatternWithDigits field if non-nil, zero value otherwise. +func (o *FormatTest) GetPatternWithDigits() string { + if o == nil || o.PatternWithDigits == nil { + var ret string + return ret + } + return *o.PatternWithDigits +} + +// GetPatternWithDigitsOk returns a tuple with the PatternWithDigits field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *FormatTest) GetPatternWithDigitsOk() (string, bool) { + if o == nil || o.PatternWithDigits == nil { + var ret string + return ret, false + } + return *o.PatternWithDigits, true +} + +// HasPatternWithDigits returns a boolean if a field has been set. +func (o *FormatTest) HasPatternWithDigits() bool { + if o != nil && o.PatternWithDigits != nil { + return true + } + + return false +} + +// SetPatternWithDigits gets a reference to the given string and assigns it to the PatternWithDigits field. +func (o *FormatTest) SetPatternWithDigits(v string) { + o.PatternWithDigits = &v +} + +// GetPatternWithDigitsAndDelimiter returns the PatternWithDigitsAndDelimiter field if non-nil, zero value otherwise. +func (o *FormatTest) GetPatternWithDigitsAndDelimiter() string { + if o == nil || o.PatternWithDigitsAndDelimiter == nil { + var ret string + return ret + } + return *o.PatternWithDigitsAndDelimiter +} + +// GetPatternWithDigitsAndDelimiterOk returns a tuple with the PatternWithDigitsAndDelimiter field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *FormatTest) GetPatternWithDigitsAndDelimiterOk() (string, bool) { + if o == nil || o.PatternWithDigitsAndDelimiter == nil { + var ret string + return ret, false + } + return *o.PatternWithDigitsAndDelimiter, true +} + +// HasPatternWithDigitsAndDelimiter returns a boolean if a field has been set. +func (o *FormatTest) HasPatternWithDigitsAndDelimiter() bool { + if o != nil && o.PatternWithDigitsAndDelimiter != nil { + return true + } + + return false +} + +// SetPatternWithDigitsAndDelimiter gets a reference to the given string and assigns it to the PatternWithDigitsAndDelimiter field. +func (o *FormatTest) SetPatternWithDigitsAndDelimiter(v string) { + o.PatternWithDigitsAndDelimiter = &v +} + + +func (o FormatTest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Integer != nil { + toSerialize["integer"] = o.Integer + } + if o.Int32 != nil { + toSerialize["int32"] = o.Int32 + } + if o.Int64 != nil { + toSerialize["int64"] = o.Int64 + } + if o.Number == nil { + return nil, errors.New("Number is required and not nullable, but was not set on FormatTest") + } + if o.Number != nil { + toSerialize["number"] = o.Number + } + if o.Float != nil { + toSerialize["float"] = o.Float + } + if o.Double != nil { + toSerialize["double"] = o.Double + } + if o.String != nil { + toSerialize["string"] = o.String + } + if o.Byte == nil { + return nil, errors.New("Byte is required and not nullable, but was not set on FormatTest") + } + if o.Byte != nil { + toSerialize["byte"] = o.Byte + } + if o.Binary != nil { + toSerialize["binary"] = o.Binary + } + if o.Date == nil { + return nil, errors.New("Date is required and not nullable, but was not set on FormatTest") + } + if o.Date != nil { + toSerialize["date"] = o.Date + } + if o.DateTime != nil { + toSerialize["dateTime"] = o.DateTime + } + if o.Uuid != nil { + toSerialize["uuid"] = o.Uuid + } + if o.Password == nil { + return nil, errors.New("Password is required and not nullable, but was not set on FormatTest") + } + if o.Password != nil { + toSerialize["password"] = o.Password + } + if o.PatternWithDigits != nil { + toSerialize["pattern_with_digits"] = o.PatternWithDigits + } + if o.PatternWithDigitsAndDelimiter != nil { + toSerialize["pattern_with_digits_and_delimiter"] = o.PatternWithDigitsAndDelimiter + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_has_only_read_only.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_has_only_read_only.go new file mode 100644 index 000000000000..87174461d00f --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_has_only_read_only.go @@ -0,0 +1,100 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi +import ( + "encoding/json" +) + +type HasOnlyReadOnly struct { + Bar *string `json:"bar,omitempty"` + + Foo *string `json:"foo,omitempty"` + +} + +// GetBar returns the Bar field if non-nil, zero value otherwise. +func (o *HasOnlyReadOnly) GetBar() string { + if o == nil || o.Bar == nil { + var ret string + return ret + } + return *o.Bar +} + +// GetBarOk returns a tuple with the Bar field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *HasOnlyReadOnly) GetBarOk() (string, bool) { + if o == nil || o.Bar == nil { + var ret string + return ret, false + } + return *o.Bar, true +} + +// HasBar returns a boolean if a field has been set. +func (o *HasOnlyReadOnly) HasBar() bool { + if o != nil && o.Bar != nil { + return true + } + + return false +} + +// SetBar gets a reference to the given string and assigns it to the Bar field. +func (o *HasOnlyReadOnly) SetBar(v string) { + o.Bar = &v +} + +// GetFoo returns the Foo field if non-nil, zero value otherwise. +func (o *HasOnlyReadOnly) GetFoo() string { + if o == nil || o.Foo == nil { + var ret string + return ret + } + return *o.Foo +} + +// GetFooOk returns a tuple with the Foo field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *HasOnlyReadOnly) GetFooOk() (string, bool) { + if o == nil || o.Foo == nil { + var ret string + return ret, false + } + return *o.Foo, true +} + +// HasFoo returns a boolean if a field has been set. +func (o *HasOnlyReadOnly) HasFoo() bool { + if o != nil && o.Foo != nil { + return true + } + + return false +} + +// SetFoo gets a reference to the given string and assigns it to the Foo field. +func (o *HasOnlyReadOnly) SetFoo(v string) { + o.Foo = &v +} + + +func (o HasOnlyReadOnly) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Bar != nil { + toSerialize["bar"] = o.Bar + } + if o.Foo != nil { + toSerialize["foo"] = o.Foo + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_health_check_result.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_health_check_result.go new file mode 100644 index 000000000000..83ccf7152eaa --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_health_check_result.go @@ -0,0 +1,74 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi +import ( + "encoding/json" +) + +// Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. +type HealthCheckResult struct { + NullableMessage *string `json:"NullableMessage,omitempty"` + isExplicitNullNullableMessage bool `json:"-"` +} + +// GetNullableMessage returns the NullableMessage field if non-nil, zero value otherwise. +func (o *HealthCheckResult) GetNullableMessage() string { + if o == nil || o.NullableMessage == nil { + var ret string + return ret + } + return *o.NullableMessage +} + +// GetNullableMessageOk returns a tuple with the NullableMessage field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *HealthCheckResult) GetNullableMessageOk() (string, bool) { + if o == nil || o.NullableMessage == nil { + var ret string + return ret, false + } + return *o.NullableMessage, true +} + +// HasNullableMessage returns a boolean if a field has been set. +func (o *HealthCheckResult) HasNullableMessage() bool { + if o != nil && o.NullableMessage != nil { + return true + } + + return false +} + +// SetNullableMessage gets a reference to the given string and assigns it to the NullableMessage field. +func (o *HealthCheckResult) SetNullableMessage(v string) { + o.NullableMessage = &v +} + +// SetNullableMessageExplicitNull (un)sets NullableMessage to be considered as explicit "null" value +// when serializing to JSON (pass true as argument to set this, false to unset) +// The NullableMessage value is set to nil even if false is passed +func (o *HealthCheckResult) SetNullableMessageExplicitNull(b bool) { + o.NullableMessage = nil + o.isExplicitNullNullableMessage = b +} + +func (o HealthCheckResult) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.NullableMessage == nil { + if o.isExplicitNullNullableMessage { + toSerialize["NullableMessage"] = o.NullableMessage + } + } else { + toSerialize["NullableMessage"] = o.NullableMessage + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object.go new file mode 100644 index 000000000000..45fa9a555d7e --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object.go @@ -0,0 +1,102 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi +import ( + "encoding/json" +) + +type InlineObject struct { + // Updated name of the pet + Name *string `json:"name,omitempty"` + + // Updated status of the pet + Status *string `json:"status,omitempty"` + +} + +// GetName returns the Name field if non-nil, zero value otherwise. +func (o *InlineObject) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject) GetNameOk() (string, bool) { + if o == nil || o.Name == nil { + var ret string + return ret, false + } + return *o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *InlineObject) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *InlineObject) SetName(v string) { + o.Name = &v +} + +// GetStatus returns the Status field if non-nil, zero value otherwise. +func (o *InlineObject) GetStatus() string { + if o == nil || o.Status == nil { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject) GetStatusOk() (string, bool) { + if o == nil || o.Status == nil { + var ret string + return ret, false + } + return *o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *InlineObject) HasStatus() bool { + if o != nil && o.Status != nil { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *InlineObject) SetStatus(v string) { + o.Status = &v +} + + +func (o InlineObject) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.Status != nil { + toSerialize["status"] = o.Status + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_1.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_1.go new file mode 100644 index 000000000000..8238d95eeb68 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_1.go @@ -0,0 +1,103 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi +import ( + "os" + "encoding/json" +) + +type InlineObject1 struct { + // Additional data to pass to server + AdditionalMetadata *string `json:"additionalMetadata,omitempty"` + + // file to upload + File **os.File `json:"file,omitempty"` + +} + +// GetAdditionalMetadata returns the AdditionalMetadata field if non-nil, zero value otherwise. +func (o *InlineObject1) GetAdditionalMetadata() string { + if o == nil || o.AdditionalMetadata == nil { + var ret string + return ret + } + return *o.AdditionalMetadata +} + +// GetAdditionalMetadataOk returns a tuple with the AdditionalMetadata field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject1) GetAdditionalMetadataOk() (string, bool) { + if o == nil || o.AdditionalMetadata == nil { + var ret string + return ret, false + } + return *o.AdditionalMetadata, true +} + +// HasAdditionalMetadata returns a boolean if a field has been set. +func (o *InlineObject1) HasAdditionalMetadata() bool { + if o != nil && o.AdditionalMetadata != nil { + return true + } + + return false +} + +// SetAdditionalMetadata gets a reference to the given string and assigns it to the AdditionalMetadata field. +func (o *InlineObject1) SetAdditionalMetadata(v string) { + o.AdditionalMetadata = &v +} + +// GetFile returns the File field if non-nil, zero value otherwise. +func (o *InlineObject1) GetFile() *os.File { + if o == nil || o.File == nil { + var ret *os.File + return ret + } + return *o.File +} + +// GetFileOk returns a tuple with the File field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject1) GetFileOk() (*os.File, bool) { + if o == nil || o.File == nil { + var ret *os.File + return ret, false + } + return *o.File, true +} + +// HasFile returns a boolean if a field has been set. +func (o *InlineObject1) HasFile() bool { + if o != nil && o.File != nil { + return true + } + + return false +} + +// SetFile gets a reference to the given *os.File and assigns it to the File field. +func (o *InlineObject1) SetFile(v *os.File) { + o.File = &v +} + + +func (o InlineObject1) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.AdditionalMetadata != nil { + toSerialize["additionalMetadata"] = o.AdditionalMetadata + } + if o.File != nil { + toSerialize["file"] = o.File + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_2.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_2.go new file mode 100644 index 000000000000..1df2a6726e5f --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_2.go @@ -0,0 +1,102 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi +import ( + "encoding/json" +) + +type InlineObject2 struct { + // Form parameter enum test (string array) + EnumFormStringArray *[]string `json:"enum_form_string_array,omitempty"` + + // Form parameter enum test (string) + EnumFormString *string `json:"enum_form_string,omitempty"` + +} + +// GetEnumFormStringArray returns the EnumFormStringArray field if non-nil, zero value otherwise. +func (o *InlineObject2) GetEnumFormStringArray() []string { + if o == nil || o.EnumFormStringArray == nil { + var ret []string + return ret + } + return *o.EnumFormStringArray +} + +// GetEnumFormStringArrayOk returns a tuple with the EnumFormStringArray field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject2) GetEnumFormStringArrayOk() ([]string, bool) { + if o == nil || o.EnumFormStringArray == nil { + var ret []string + return ret, false + } + return *o.EnumFormStringArray, true +} + +// HasEnumFormStringArray returns a boolean if a field has been set. +func (o *InlineObject2) HasEnumFormStringArray() bool { + if o != nil && o.EnumFormStringArray != nil { + return true + } + + return false +} + +// SetEnumFormStringArray gets a reference to the given []string and assigns it to the EnumFormStringArray field. +func (o *InlineObject2) SetEnumFormStringArray(v []string) { + o.EnumFormStringArray = &v +} + +// GetEnumFormString returns the EnumFormString field if non-nil, zero value otherwise. +func (o *InlineObject2) GetEnumFormString() string { + if o == nil || o.EnumFormString == nil { + var ret string + return ret + } + return *o.EnumFormString +} + +// GetEnumFormStringOk returns a tuple with the EnumFormString field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject2) GetEnumFormStringOk() (string, bool) { + if o == nil || o.EnumFormString == nil { + var ret string + return ret, false + } + return *o.EnumFormString, true +} + +// HasEnumFormString returns a boolean if a field has been set. +func (o *InlineObject2) HasEnumFormString() bool { + if o != nil && o.EnumFormString != nil { + return true + } + + return false +} + +// SetEnumFormString gets a reference to the given string and assigns it to the EnumFormString field. +func (o *InlineObject2) SetEnumFormString(v string) { + o.EnumFormString = &v +} + + +func (o InlineObject2) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.EnumFormStringArray != nil { + toSerialize["enum_form_string_array"] = o.EnumFormStringArray + } + if o.EnumFormString != nil { + toSerialize["enum_form_string"] = o.EnumFormString + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_3.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_3.go new file mode 100644 index 000000000000..b1408a8a51e9 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_3.go @@ -0,0 +1,585 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi +import ( + "os" + "time" + "encoding/json" + "errors" +) + +type InlineObject3 struct { + // None + Integer *int32 `json:"integer,omitempty"` + + // None + Int32 *int32 `json:"int32,omitempty"` + + // None + Int64 *int64 `json:"int64,omitempty"` + + // None + Number *float32 `json:"number,omitempty"` + + // None + Float *float32 `json:"float,omitempty"` + + // None + Double *float64 `json:"double,omitempty"` + + // None + String *string `json:"string,omitempty"` + + // None + PatternWithoutDelimiter *string `json:"pattern_without_delimiter,omitempty"` + + // None + Byte *string `json:"byte,omitempty"` + + // None + Binary **os.File `json:"binary,omitempty"` + + // None + Date *string `json:"date,omitempty"` + + // None + DateTime *time.Time `json:"dateTime,omitempty"` + + // None + Password *string `json:"password,omitempty"` + + // None + Callback *string `json:"callback,omitempty"` + +} + +// GetInteger returns the Integer field if non-nil, zero value otherwise. +func (o *InlineObject3) GetInteger() int32 { + if o == nil || o.Integer == nil { + var ret int32 + return ret + } + return *o.Integer +} + +// GetIntegerOk returns a tuple with the Integer field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject3) GetIntegerOk() (int32, bool) { + if o == nil || o.Integer == nil { + var ret int32 + return ret, false + } + return *o.Integer, true +} + +// HasInteger returns a boolean if a field has been set. +func (o *InlineObject3) HasInteger() bool { + if o != nil && o.Integer != nil { + return true + } + + return false +} + +// SetInteger gets a reference to the given int32 and assigns it to the Integer field. +func (o *InlineObject3) SetInteger(v int32) { + o.Integer = &v +} + +// GetInt32 returns the Int32 field if non-nil, zero value otherwise. +func (o *InlineObject3) GetInt32() int32 { + if o == nil || o.Int32 == nil { + var ret int32 + return ret + } + return *o.Int32 +} + +// GetInt32Ok returns a tuple with the Int32 field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject3) GetInt32Ok() (int32, bool) { + if o == nil || o.Int32 == nil { + var ret int32 + return ret, false + } + return *o.Int32, true +} + +// HasInt32 returns a boolean if a field has been set. +func (o *InlineObject3) HasInt32() bool { + if o != nil && o.Int32 != nil { + return true + } + + return false +} + +// SetInt32 gets a reference to the given int32 and assigns it to the Int32 field. +func (o *InlineObject3) SetInt32(v int32) { + o.Int32 = &v +} + +// GetInt64 returns the Int64 field if non-nil, zero value otherwise. +func (o *InlineObject3) GetInt64() int64 { + if o == nil || o.Int64 == nil { + var ret int64 + return ret + } + return *o.Int64 +} + +// GetInt64Ok returns a tuple with the Int64 field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject3) GetInt64Ok() (int64, bool) { + if o == nil || o.Int64 == nil { + var ret int64 + return ret, false + } + return *o.Int64, true +} + +// HasInt64 returns a boolean if a field has been set. +func (o *InlineObject3) HasInt64() bool { + if o != nil && o.Int64 != nil { + return true + } + + return false +} + +// SetInt64 gets a reference to the given int64 and assigns it to the Int64 field. +func (o *InlineObject3) SetInt64(v int64) { + o.Int64 = &v +} + +// GetNumber returns the Number field if non-nil, zero value otherwise. +func (o *InlineObject3) GetNumber() float32 { + if o == nil || o.Number == nil { + var ret float32 + return ret + } + return *o.Number +} + +// GetNumberOk returns a tuple with the Number field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject3) GetNumberOk() (float32, bool) { + if o == nil || o.Number == nil { + var ret float32 + return ret, false + } + return *o.Number, true +} + +// HasNumber returns a boolean if a field has been set. +func (o *InlineObject3) HasNumber() bool { + if o != nil && o.Number != nil { + return true + } + + return false +} + +// SetNumber gets a reference to the given float32 and assigns it to the Number field. +func (o *InlineObject3) SetNumber(v float32) { + o.Number = &v +} + +// GetFloat returns the Float field if non-nil, zero value otherwise. +func (o *InlineObject3) GetFloat() float32 { + if o == nil || o.Float == nil { + var ret float32 + return ret + } + return *o.Float +} + +// GetFloatOk returns a tuple with the Float field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject3) GetFloatOk() (float32, bool) { + if o == nil || o.Float == nil { + var ret float32 + return ret, false + } + return *o.Float, true +} + +// HasFloat returns a boolean if a field has been set. +func (o *InlineObject3) HasFloat() bool { + if o != nil && o.Float != nil { + return true + } + + return false +} + +// SetFloat gets a reference to the given float32 and assigns it to the Float field. +func (o *InlineObject3) SetFloat(v float32) { + o.Float = &v +} + +// GetDouble returns the Double field if non-nil, zero value otherwise. +func (o *InlineObject3) GetDouble() float64 { + if o == nil || o.Double == nil { + var ret float64 + return ret + } + return *o.Double +} + +// GetDoubleOk returns a tuple with the Double field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject3) GetDoubleOk() (float64, bool) { + if o == nil || o.Double == nil { + var ret float64 + return ret, false + } + return *o.Double, true +} + +// HasDouble returns a boolean if a field has been set. +func (o *InlineObject3) HasDouble() bool { + if o != nil && o.Double != nil { + return true + } + + return false +} + +// SetDouble gets a reference to the given float64 and assigns it to the Double field. +func (o *InlineObject3) SetDouble(v float64) { + o.Double = &v +} + +// GetString returns the String field if non-nil, zero value otherwise. +func (o *InlineObject3) GetString() string { + if o == nil || o.String == nil { + var ret string + return ret + } + return *o.String +} + +// GetStringOk returns a tuple with the String field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject3) GetStringOk() (string, bool) { + if o == nil || o.String == nil { + var ret string + return ret, false + } + return *o.String, true +} + +// HasString returns a boolean if a field has been set. +func (o *InlineObject3) HasString() bool { + if o != nil && o.String != nil { + return true + } + + return false +} + +// SetString gets a reference to the given string and assigns it to the String field. +func (o *InlineObject3) SetString(v string) { + o.String = &v +} + +// GetPatternWithoutDelimiter returns the PatternWithoutDelimiter field if non-nil, zero value otherwise. +func (o *InlineObject3) GetPatternWithoutDelimiter() string { + if o == nil || o.PatternWithoutDelimiter == nil { + var ret string + return ret + } + return *o.PatternWithoutDelimiter +} + +// GetPatternWithoutDelimiterOk returns a tuple with the PatternWithoutDelimiter field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject3) GetPatternWithoutDelimiterOk() (string, bool) { + if o == nil || o.PatternWithoutDelimiter == nil { + var ret string + return ret, false + } + return *o.PatternWithoutDelimiter, true +} + +// HasPatternWithoutDelimiter returns a boolean if a field has been set. +func (o *InlineObject3) HasPatternWithoutDelimiter() bool { + if o != nil && o.PatternWithoutDelimiter != nil { + return true + } + + return false +} + +// SetPatternWithoutDelimiter gets a reference to the given string and assigns it to the PatternWithoutDelimiter field. +func (o *InlineObject3) SetPatternWithoutDelimiter(v string) { + o.PatternWithoutDelimiter = &v +} + +// GetByte returns the Byte field if non-nil, zero value otherwise. +func (o *InlineObject3) GetByte() string { + if o == nil || o.Byte == nil { + var ret string + return ret + } + return *o.Byte +} + +// GetByteOk returns a tuple with the Byte field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject3) GetByteOk() (string, bool) { + if o == nil || o.Byte == nil { + var ret string + return ret, false + } + return *o.Byte, true +} + +// HasByte returns a boolean if a field has been set. +func (o *InlineObject3) HasByte() bool { + if o != nil && o.Byte != nil { + return true + } + + return false +} + +// SetByte gets a reference to the given string and assigns it to the Byte field. +func (o *InlineObject3) SetByte(v string) { + o.Byte = &v +} + +// GetBinary returns the Binary field if non-nil, zero value otherwise. +func (o *InlineObject3) GetBinary() *os.File { + if o == nil || o.Binary == nil { + var ret *os.File + return ret + } + return *o.Binary +} + +// GetBinaryOk returns a tuple with the Binary field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject3) GetBinaryOk() (*os.File, bool) { + if o == nil || o.Binary == nil { + var ret *os.File + return ret, false + } + return *o.Binary, true +} + +// HasBinary returns a boolean if a field has been set. +func (o *InlineObject3) HasBinary() bool { + if o != nil && o.Binary != nil { + return true + } + + return false +} + +// SetBinary gets a reference to the given *os.File and assigns it to the Binary field. +func (o *InlineObject3) SetBinary(v *os.File) { + o.Binary = &v +} + +// GetDate returns the Date field if non-nil, zero value otherwise. +func (o *InlineObject3) GetDate() string { + if o == nil || o.Date == nil { + var ret string + return ret + } + return *o.Date +} + +// GetDateOk returns a tuple with the Date field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject3) GetDateOk() (string, bool) { + if o == nil || o.Date == nil { + var ret string + return ret, false + } + return *o.Date, true +} + +// HasDate returns a boolean if a field has been set. +func (o *InlineObject3) HasDate() bool { + if o != nil && o.Date != nil { + return true + } + + return false +} + +// SetDate gets a reference to the given string and assigns it to the Date field. +func (o *InlineObject3) SetDate(v string) { + o.Date = &v +} + +// GetDateTime returns the DateTime field if non-nil, zero value otherwise. +func (o *InlineObject3) GetDateTime() time.Time { + if o == nil || o.DateTime == nil { + var ret time.Time + return ret + } + return *o.DateTime +} + +// GetDateTimeOk returns a tuple with the DateTime field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject3) GetDateTimeOk() (time.Time, bool) { + if o == nil || o.DateTime == nil { + var ret time.Time + return ret, false + } + return *o.DateTime, true +} + +// HasDateTime returns a boolean if a field has been set. +func (o *InlineObject3) HasDateTime() bool { + if o != nil && o.DateTime != nil { + return true + } + + return false +} + +// SetDateTime gets a reference to the given time.Time and assigns it to the DateTime field. +func (o *InlineObject3) SetDateTime(v time.Time) { + o.DateTime = &v +} + +// GetPassword returns the Password field if non-nil, zero value otherwise. +func (o *InlineObject3) GetPassword() string { + if o == nil || o.Password == nil { + var ret string + return ret + } + return *o.Password +} + +// GetPasswordOk returns a tuple with the Password field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject3) GetPasswordOk() (string, bool) { + if o == nil || o.Password == nil { + var ret string + return ret, false + } + return *o.Password, true +} + +// HasPassword returns a boolean if a field has been set. +func (o *InlineObject3) HasPassword() bool { + if o != nil && o.Password != nil { + return true + } + + return false +} + +// SetPassword gets a reference to the given string and assigns it to the Password field. +func (o *InlineObject3) SetPassword(v string) { + o.Password = &v +} + +// GetCallback returns the Callback field if non-nil, zero value otherwise. +func (o *InlineObject3) GetCallback() string { + if o == nil || o.Callback == nil { + var ret string + return ret + } + return *o.Callback +} + +// GetCallbackOk returns a tuple with the Callback field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject3) GetCallbackOk() (string, bool) { + if o == nil || o.Callback == nil { + var ret string + return ret, false + } + return *o.Callback, true +} + +// HasCallback returns a boolean if a field has been set. +func (o *InlineObject3) HasCallback() bool { + if o != nil && o.Callback != nil { + return true + } + + return false +} + +// SetCallback gets a reference to the given string and assigns it to the Callback field. +func (o *InlineObject3) SetCallback(v string) { + o.Callback = &v +} + + +func (o InlineObject3) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Integer != nil { + toSerialize["integer"] = o.Integer + } + if o.Int32 != nil { + toSerialize["int32"] = o.Int32 + } + if o.Int64 != nil { + toSerialize["int64"] = o.Int64 + } + if o.Number == nil { + return nil, errors.New("Number is required and not nullable, but was not set on InlineObject3") + } + if o.Number != nil { + toSerialize["number"] = o.Number + } + if o.Float != nil { + toSerialize["float"] = o.Float + } + if o.Double == nil { + return nil, errors.New("Double is required and not nullable, but was not set on InlineObject3") + } + if o.Double != nil { + toSerialize["double"] = o.Double + } + if o.String != nil { + toSerialize["string"] = o.String + } + if o.PatternWithoutDelimiter == nil { + return nil, errors.New("PatternWithoutDelimiter is required and not nullable, but was not set on InlineObject3") + } + if o.PatternWithoutDelimiter != nil { + toSerialize["pattern_without_delimiter"] = o.PatternWithoutDelimiter + } + if o.Byte == nil { + return nil, errors.New("Byte is required and not nullable, but was not set on InlineObject3") + } + if o.Byte != nil { + toSerialize["byte"] = o.Byte + } + if o.Binary != nil { + toSerialize["binary"] = o.Binary + } + if o.Date != nil { + toSerialize["date"] = o.Date + } + if o.DateTime != nil { + toSerialize["dateTime"] = o.DateTime + } + if o.Password != nil { + toSerialize["password"] = o.Password + } + if o.Callback != nil { + toSerialize["callback"] = o.Callback + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_4.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_4.go new file mode 100644 index 000000000000..b2662ea74836 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_4.go @@ -0,0 +1,109 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi +import ( + "encoding/json" + "errors" +) + +type InlineObject4 struct { + // field1 + Param *string `json:"param,omitempty"` + + // field2 + Param2 *string `json:"param2,omitempty"` + +} + +// GetParam returns the Param field if non-nil, zero value otherwise. +func (o *InlineObject4) GetParam() string { + if o == nil || o.Param == nil { + var ret string + return ret + } + return *o.Param +} + +// GetParamOk returns a tuple with the Param field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject4) GetParamOk() (string, bool) { + if o == nil || o.Param == nil { + var ret string + return ret, false + } + return *o.Param, true +} + +// HasParam returns a boolean if a field has been set. +func (o *InlineObject4) HasParam() bool { + if o != nil && o.Param != nil { + return true + } + + return false +} + +// SetParam gets a reference to the given string and assigns it to the Param field. +func (o *InlineObject4) SetParam(v string) { + o.Param = &v +} + +// GetParam2 returns the Param2 field if non-nil, zero value otherwise. +func (o *InlineObject4) GetParam2() string { + if o == nil || o.Param2 == nil { + var ret string + return ret + } + return *o.Param2 +} + +// GetParam2Ok returns a tuple with the Param2 field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject4) GetParam2Ok() (string, bool) { + if o == nil || o.Param2 == nil { + var ret string + return ret, false + } + return *o.Param2, true +} + +// HasParam2 returns a boolean if a field has been set. +func (o *InlineObject4) HasParam2() bool { + if o != nil && o.Param2 != nil { + return true + } + + return false +} + +// SetParam2 gets a reference to the given string and assigns it to the Param2 field. +func (o *InlineObject4) SetParam2(v string) { + o.Param2 = &v +} + + +func (o InlineObject4) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Param == nil { + return nil, errors.New("Param is required and not nullable, but was not set on InlineObject4") + } + if o.Param != nil { + toSerialize["param"] = o.Param + } + if o.Param2 == nil { + return nil, errors.New("Param2 is required and not nullable, but was not set on InlineObject4") + } + if o.Param2 != nil { + toSerialize["param2"] = o.Param2 + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_5.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_5.go new file mode 100644 index 000000000000..4c360a18e219 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_5.go @@ -0,0 +1,107 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi +import ( + "os" + "encoding/json" + "errors" +) + +type InlineObject5 struct { + // Additional data to pass to server + AdditionalMetadata *string `json:"additionalMetadata,omitempty"` + + // file to upload + RequiredFile **os.File `json:"requiredFile,omitempty"` + +} + +// GetAdditionalMetadata returns the AdditionalMetadata field if non-nil, zero value otherwise. +func (o *InlineObject5) GetAdditionalMetadata() string { + if o == nil || o.AdditionalMetadata == nil { + var ret string + return ret + } + return *o.AdditionalMetadata +} + +// GetAdditionalMetadataOk returns a tuple with the AdditionalMetadata field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject5) GetAdditionalMetadataOk() (string, bool) { + if o == nil || o.AdditionalMetadata == nil { + var ret string + return ret, false + } + return *o.AdditionalMetadata, true +} + +// HasAdditionalMetadata returns a boolean if a field has been set. +func (o *InlineObject5) HasAdditionalMetadata() bool { + if o != nil && o.AdditionalMetadata != nil { + return true + } + + return false +} + +// SetAdditionalMetadata gets a reference to the given string and assigns it to the AdditionalMetadata field. +func (o *InlineObject5) SetAdditionalMetadata(v string) { + o.AdditionalMetadata = &v +} + +// GetRequiredFile returns the RequiredFile field if non-nil, zero value otherwise. +func (o *InlineObject5) GetRequiredFile() *os.File { + if o == nil || o.RequiredFile == nil { + var ret *os.File + return ret + } + return *o.RequiredFile +} + +// GetRequiredFileOk returns a tuple with the RequiredFile field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject5) GetRequiredFileOk() (*os.File, bool) { + if o == nil || o.RequiredFile == nil { + var ret *os.File + return ret, false + } + return *o.RequiredFile, true +} + +// HasRequiredFile returns a boolean if a field has been set. +func (o *InlineObject5) HasRequiredFile() bool { + if o != nil && o.RequiredFile != nil { + return true + } + + return false +} + +// SetRequiredFile gets a reference to the given *os.File and assigns it to the RequiredFile field. +func (o *InlineObject5) SetRequiredFile(v *os.File) { + o.RequiredFile = &v +} + + +func (o InlineObject5) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.AdditionalMetadata != nil { + toSerialize["additionalMetadata"] = o.AdditionalMetadata + } + if o.RequiredFile == nil { + return nil, errors.New("RequiredFile is required and not nullable, but was not set on InlineObject5") + } + if o.RequiredFile != nil { + toSerialize["requiredFile"] = o.RequiredFile + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_response_default.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_response_default.go new file mode 100644 index 000000000000..ffb53594d7e9 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_response_default.go @@ -0,0 +1,62 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi +import ( + "encoding/json" +) + +type InlineResponseDefault struct { + String *Foo `json:"string,omitempty"` + +} + +// GetString returns the String field if non-nil, zero value otherwise. +func (o *InlineResponseDefault) GetString() Foo { + if o == nil || o.String == nil { + var ret Foo + return ret + } + return *o.String +} + +// GetStringOk returns a tuple with the String field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *InlineResponseDefault) GetStringOk() (Foo, bool) { + if o == nil || o.String == nil { + var ret Foo + return ret, false + } + return *o.String, true +} + +// HasString returns a boolean if a field has been set. +func (o *InlineResponseDefault) HasString() bool { + if o != nil && o.String != nil { + return true + } + + return false +} + +// SetString gets a reference to the given Foo and assigns it to the String field. +func (o *InlineResponseDefault) SetString(v Foo) { + o.String = &v +} + + +func (o InlineResponseDefault) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.String != nil { + toSerialize["string"] = o.String + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_list.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_list.go new file mode 100644 index 000000000000..ef31adf344ef --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_list.go @@ -0,0 +1,62 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi +import ( + "encoding/json" +) + +type List struct { + Var123List *string `json:"123-list,omitempty"` + +} + +// GetVar123List returns the Var123List field if non-nil, zero value otherwise. +func (o *List) GetVar123List() string { + if o == nil || o.Var123List == nil { + var ret string + return ret + } + return *o.Var123List +} + +// GetVar123ListOk returns a tuple with the Var123List field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *List) GetVar123ListOk() (string, bool) { + if o == nil || o.Var123List == nil { + var ret string + return ret, false + } + return *o.Var123List, true +} + +// HasVar123List returns a boolean if a field has been set. +func (o *List) HasVar123List() bool { + if o != nil && o.Var123List != nil { + return true + } + + return false +} + +// SetVar123List gets a reference to the given string and assigns it to the Var123List field. +func (o *List) SetVar123List(v string) { + o.Var123List = &v +} + + +func (o List) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Var123List != nil { + toSerialize["123-list"] = o.Var123List + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_map_test_.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_map_test_.go new file mode 100644 index 000000000000..e16f7b6e8c2d --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_map_test_.go @@ -0,0 +1,176 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi +import ( + "encoding/json" +) + +type MapTest struct { + MapMapOfString *map[string]map[string]string `json:"map_map_of_string,omitempty"` + + MapOfEnumString *map[string]string `json:"map_of_enum_string,omitempty"` + + DirectMap *map[string]bool `json:"direct_map,omitempty"` + + IndirectMap *map[string]bool `json:"indirect_map,omitempty"` + +} + +// GetMapMapOfString returns the MapMapOfString field if non-nil, zero value otherwise. +func (o *MapTest) GetMapMapOfString() map[string]map[string]string { + if o == nil || o.MapMapOfString == nil { + var ret map[string]map[string]string + return ret + } + return *o.MapMapOfString +} + +// GetMapMapOfStringOk returns a tuple with the MapMapOfString field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *MapTest) GetMapMapOfStringOk() (map[string]map[string]string, bool) { + if o == nil || o.MapMapOfString == nil { + var ret map[string]map[string]string + return ret, false + } + return *o.MapMapOfString, true +} + +// HasMapMapOfString returns a boolean if a field has been set. +func (o *MapTest) HasMapMapOfString() bool { + if o != nil && o.MapMapOfString != nil { + return true + } + + return false +} + +// SetMapMapOfString gets a reference to the given map[string]map[string]string and assigns it to the MapMapOfString field. +func (o *MapTest) SetMapMapOfString(v map[string]map[string]string) { + o.MapMapOfString = &v +} + +// GetMapOfEnumString returns the MapOfEnumString field if non-nil, zero value otherwise. +func (o *MapTest) GetMapOfEnumString() map[string]string { + if o == nil || o.MapOfEnumString == nil { + var ret map[string]string + return ret + } + return *o.MapOfEnumString +} + +// GetMapOfEnumStringOk returns a tuple with the MapOfEnumString field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *MapTest) GetMapOfEnumStringOk() (map[string]string, bool) { + if o == nil || o.MapOfEnumString == nil { + var ret map[string]string + return ret, false + } + return *o.MapOfEnumString, true +} + +// HasMapOfEnumString returns a boolean if a field has been set. +func (o *MapTest) HasMapOfEnumString() bool { + if o != nil && o.MapOfEnumString != nil { + return true + } + + return false +} + +// SetMapOfEnumString gets a reference to the given map[string]string and assigns it to the MapOfEnumString field. +func (o *MapTest) SetMapOfEnumString(v map[string]string) { + o.MapOfEnumString = &v +} + +// GetDirectMap returns the DirectMap field if non-nil, zero value otherwise. +func (o *MapTest) GetDirectMap() map[string]bool { + if o == nil || o.DirectMap == nil { + var ret map[string]bool + return ret + } + return *o.DirectMap +} + +// GetDirectMapOk returns a tuple with the DirectMap field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *MapTest) GetDirectMapOk() (map[string]bool, bool) { + if o == nil || o.DirectMap == nil { + var ret map[string]bool + return ret, false + } + return *o.DirectMap, true +} + +// HasDirectMap returns a boolean if a field has been set. +func (o *MapTest) HasDirectMap() bool { + if o != nil && o.DirectMap != nil { + return true + } + + return false +} + +// SetDirectMap gets a reference to the given map[string]bool and assigns it to the DirectMap field. +func (o *MapTest) SetDirectMap(v map[string]bool) { + o.DirectMap = &v +} + +// GetIndirectMap returns the IndirectMap field if non-nil, zero value otherwise. +func (o *MapTest) GetIndirectMap() map[string]bool { + if o == nil || o.IndirectMap == nil { + var ret map[string]bool + return ret + } + return *o.IndirectMap +} + +// GetIndirectMapOk returns a tuple with the IndirectMap field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *MapTest) GetIndirectMapOk() (map[string]bool, bool) { + if o == nil || o.IndirectMap == nil { + var ret map[string]bool + return ret, false + } + return *o.IndirectMap, true +} + +// HasIndirectMap returns a boolean if a field has been set. +func (o *MapTest) HasIndirectMap() bool { + if o != nil && o.IndirectMap != nil { + return true + } + + return false +} + +// SetIndirectMap gets a reference to the given map[string]bool and assigns it to the IndirectMap field. +func (o *MapTest) SetIndirectMap(v map[string]bool) { + o.IndirectMap = &v +} + + +func (o MapTest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.MapMapOfString != nil { + toSerialize["map_map_of_string"] = o.MapMapOfString + } + if o.MapOfEnumString != nil { + toSerialize["map_of_enum_string"] = o.MapOfEnumString + } + if o.DirectMap != nil { + toSerialize["direct_map"] = o.DirectMap + } + if o.IndirectMap != nil { + toSerialize["indirect_map"] = o.IndirectMap + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_mixed_properties_and_additional_properties_class.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_mixed_properties_and_additional_properties_class.go new file mode 100644 index 000000000000..711cf34125e0 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_mixed_properties_and_additional_properties_class.go @@ -0,0 +1,139 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi +import ( + "time" + "encoding/json" +) + +type MixedPropertiesAndAdditionalPropertiesClass struct { + Uuid *string `json:"uuid,omitempty"` + + DateTime *time.Time `json:"dateTime,omitempty"` + + Map *map[string]Animal `json:"map,omitempty"` + +} + +// GetUuid returns the Uuid field if non-nil, zero value otherwise. +func (o *MixedPropertiesAndAdditionalPropertiesClass) GetUuid() string { + if o == nil || o.Uuid == nil { + var ret string + return ret + } + return *o.Uuid +} + +// GetUuidOk returns a tuple with the Uuid field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *MixedPropertiesAndAdditionalPropertiesClass) GetUuidOk() (string, bool) { + if o == nil || o.Uuid == nil { + var ret string + return ret, false + } + return *o.Uuid, true +} + +// HasUuid returns a boolean if a field has been set. +func (o *MixedPropertiesAndAdditionalPropertiesClass) HasUuid() bool { + if o != nil && o.Uuid != nil { + return true + } + + return false +} + +// SetUuid gets a reference to the given string and assigns it to the Uuid field. +func (o *MixedPropertiesAndAdditionalPropertiesClass) SetUuid(v string) { + o.Uuid = &v +} + +// GetDateTime returns the DateTime field if non-nil, zero value otherwise. +func (o *MixedPropertiesAndAdditionalPropertiesClass) GetDateTime() time.Time { + if o == nil || o.DateTime == nil { + var ret time.Time + return ret + } + return *o.DateTime +} + +// GetDateTimeOk returns a tuple with the DateTime field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *MixedPropertiesAndAdditionalPropertiesClass) GetDateTimeOk() (time.Time, bool) { + if o == nil || o.DateTime == nil { + var ret time.Time + return ret, false + } + return *o.DateTime, true +} + +// HasDateTime returns a boolean if a field has been set. +func (o *MixedPropertiesAndAdditionalPropertiesClass) HasDateTime() bool { + if o != nil && o.DateTime != nil { + return true + } + + return false +} + +// SetDateTime gets a reference to the given time.Time and assigns it to the DateTime field. +func (o *MixedPropertiesAndAdditionalPropertiesClass) SetDateTime(v time.Time) { + o.DateTime = &v +} + +// GetMap returns the Map field if non-nil, zero value otherwise. +func (o *MixedPropertiesAndAdditionalPropertiesClass) GetMap() map[string]Animal { + if o == nil || o.Map == nil { + var ret map[string]Animal + return ret + } + return *o.Map +} + +// GetMapOk returns a tuple with the Map field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *MixedPropertiesAndAdditionalPropertiesClass) GetMapOk() (map[string]Animal, bool) { + if o == nil || o.Map == nil { + var ret map[string]Animal + return ret, false + } + return *o.Map, true +} + +// HasMap returns a boolean if a field has been set. +func (o *MixedPropertiesAndAdditionalPropertiesClass) HasMap() bool { + if o != nil && o.Map != nil { + return true + } + + return false +} + +// SetMap gets a reference to the given map[string]Animal and assigns it to the Map field. +func (o *MixedPropertiesAndAdditionalPropertiesClass) SetMap(v map[string]Animal) { + o.Map = &v +} + + +func (o MixedPropertiesAndAdditionalPropertiesClass) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Uuid != nil { + toSerialize["uuid"] = o.Uuid + } + if o.DateTime != nil { + toSerialize["dateTime"] = o.DateTime + } + if o.Map != nil { + toSerialize["map"] = o.Map + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_name.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_name.go new file mode 100644 index 000000000000..ff4220a7edfc --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_name.go @@ -0,0 +1,181 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi +import ( + "encoding/json" + "errors" +) + +// Model for testing model name same as property name +type Name struct { + Name *int32 `json:"name,omitempty"` + + SnakeCase *int32 `json:"snake_case,omitempty"` + + Property *string `json:"property,omitempty"` + + Var123Number *int32 `json:"123Number,omitempty"` + +} + +// GetName returns the Name field if non-nil, zero value otherwise. +func (o *Name) GetName() int32 { + if o == nil || o.Name == nil { + var ret int32 + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Name) GetNameOk() (int32, bool) { + if o == nil || o.Name == nil { + var ret int32 + return ret, false + } + return *o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Name) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given int32 and assigns it to the Name field. +func (o *Name) SetName(v int32) { + o.Name = &v +} + +// GetSnakeCase returns the SnakeCase field if non-nil, zero value otherwise. +func (o *Name) GetSnakeCase() int32 { + if o == nil || o.SnakeCase == nil { + var ret int32 + return ret + } + return *o.SnakeCase +} + +// GetSnakeCaseOk returns a tuple with the SnakeCase field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Name) GetSnakeCaseOk() (int32, bool) { + if o == nil || o.SnakeCase == nil { + var ret int32 + return ret, false + } + return *o.SnakeCase, true +} + +// HasSnakeCase returns a boolean if a field has been set. +func (o *Name) HasSnakeCase() bool { + if o != nil && o.SnakeCase != nil { + return true + } + + return false +} + +// SetSnakeCase gets a reference to the given int32 and assigns it to the SnakeCase field. +func (o *Name) SetSnakeCase(v int32) { + o.SnakeCase = &v +} + +// GetProperty returns the Property field if non-nil, zero value otherwise. +func (o *Name) GetProperty() string { + if o == nil || o.Property == nil { + var ret string + return ret + } + return *o.Property +} + +// GetPropertyOk returns a tuple with the Property field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Name) GetPropertyOk() (string, bool) { + if o == nil || o.Property == nil { + var ret string + return ret, false + } + return *o.Property, true +} + +// HasProperty returns a boolean if a field has been set. +func (o *Name) HasProperty() bool { + if o != nil && o.Property != nil { + return true + } + + return false +} + +// SetProperty gets a reference to the given string and assigns it to the Property field. +func (o *Name) SetProperty(v string) { + o.Property = &v +} + +// GetVar123Number returns the Var123Number field if non-nil, zero value otherwise. +func (o *Name) GetVar123Number() int32 { + if o == nil || o.Var123Number == nil { + var ret int32 + return ret + } + return *o.Var123Number +} + +// GetVar123NumberOk returns a tuple with the Var123Number field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Name) GetVar123NumberOk() (int32, bool) { + if o == nil || o.Var123Number == nil { + var ret int32 + return ret, false + } + return *o.Var123Number, true +} + +// HasVar123Number returns a boolean if a field has been set. +func (o *Name) HasVar123Number() bool { + if o != nil && o.Var123Number != nil { + return true + } + + return false +} + +// SetVar123Number gets a reference to the given int32 and assigns it to the Var123Number field. +func (o *Name) SetVar123Number(v int32) { + o.Var123Number = &v +} + + +func (o Name) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Name == nil { + return nil, errors.New("Name is required and not nullable, but was not set on Name") + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.SnakeCase != nil { + toSerialize["snake_case"] = o.SnakeCase + } + if o.Property != nil { + toSerialize["property"] = o.Property + } + if o.Var123Number != nil { + toSerialize["123Number"] = o.Var123Number + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_nullable_class.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_nullable_class.go new file mode 100644 index 000000000000..88b643823f63 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_nullable_class.go @@ -0,0 +1,591 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi +import ( + "time" + "encoding/json" +) + +type NullableClass struct { + IntegerProp *int32 `json:"integer_prop,omitempty"` + isExplicitNullIntegerProp bool `json:"-"` + NumberProp *float32 `json:"number_prop,omitempty"` + isExplicitNullNumberProp bool `json:"-"` + BooleanProp *bool `json:"boolean_prop,omitempty"` + isExplicitNullBooleanProp bool `json:"-"` + StringProp *string `json:"string_prop,omitempty"` + isExplicitNullStringProp bool `json:"-"` + DateProp *string `json:"date_prop,omitempty"` + isExplicitNullDateProp bool `json:"-"` + DatetimeProp *time.Time `json:"datetime_prop,omitempty"` + isExplicitNullDatetimeProp bool `json:"-"` + ArrayNullableProp *[]map[string]interface{} `json:"array_nullable_prop,omitempty"` + isExplicitNullArrayNullableProp bool `json:"-"` + ArrayAndItemsNullableProp *[]map[string]interface{} `json:"array_and_items_nullable_prop,omitempty"` + isExplicitNullArrayAndItemsNullableProp bool `json:"-"` + ArrayItemsNullable *[]map[string]interface{} `json:"array_items_nullable,omitempty"` + + ObjectNullableProp *map[string]map[string]interface{} `json:"object_nullable_prop,omitempty"` + isExplicitNullObjectNullableProp bool `json:"-"` + ObjectAndItemsNullableProp *map[string]map[string]interface{} `json:"object_and_items_nullable_prop,omitempty"` + isExplicitNullObjectAndItemsNullableProp bool `json:"-"` + ObjectItemsNullable *map[string]map[string]interface{} `json:"object_items_nullable,omitempty"` + +} + +// GetIntegerProp returns the IntegerProp field if non-nil, zero value otherwise. +func (o *NullableClass) GetIntegerProp() int32 { + if o == nil || o.IntegerProp == nil { + var ret int32 + return ret + } + return *o.IntegerProp +} + +// GetIntegerPropOk returns a tuple with the IntegerProp field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *NullableClass) GetIntegerPropOk() (int32, bool) { + if o == nil || o.IntegerProp == nil { + var ret int32 + return ret, false + } + return *o.IntegerProp, true +} + +// HasIntegerProp returns a boolean if a field has been set. +func (o *NullableClass) HasIntegerProp() bool { + if o != nil && o.IntegerProp != nil { + return true + } + + return false +} + +// SetIntegerProp gets a reference to the given int32 and assigns it to the IntegerProp field. +func (o *NullableClass) SetIntegerProp(v int32) { + o.IntegerProp = &v +} + +// SetIntegerPropExplicitNull (un)sets IntegerProp to be considered as explicit "null" value +// when serializing to JSON (pass true as argument to set this, false to unset) +// The IntegerProp value is set to nil even if false is passed +func (o *NullableClass) SetIntegerPropExplicitNull(b bool) { + o.IntegerProp = nil + o.isExplicitNullIntegerProp = b +} +// GetNumberProp returns the NumberProp field if non-nil, zero value otherwise. +func (o *NullableClass) GetNumberProp() float32 { + if o == nil || o.NumberProp == nil { + var ret float32 + return ret + } + return *o.NumberProp +} + +// GetNumberPropOk returns a tuple with the NumberProp field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *NullableClass) GetNumberPropOk() (float32, bool) { + if o == nil || o.NumberProp == nil { + var ret float32 + return ret, false + } + return *o.NumberProp, true +} + +// HasNumberProp returns a boolean if a field has been set. +func (o *NullableClass) HasNumberProp() bool { + if o != nil && o.NumberProp != nil { + return true + } + + return false +} + +// SetNumberProp gets a reference to the given float32 and assigns it to the NumberProp field. +func (o *NullableClass) SetNumberProp(v float32) { + o.NumberProp = &v +} + +// SetNumberPropExplicitNull (un)sets NumberProp to be considered as explicit "null" value +// when serializing to JSON (pass true as argument to set this, false to unset) +// The NumberProp value is set to nil even if false is passed +func (o *NullableClass) SetNumberPropExplicitNull(b bool) { + o.NumberProp = nil + o.isExplicitNullNumberProp = b +} +// GetBooleanProp returns the BooleanProp field if non-nil, zero value otherwise. +func (o *NullableClass) GetBooleanProp() bool { + if o == nil || o.BooleanProp == nil { + var ret bool + return ret + } + return *o.BooleanProp +} + +// GetBooleanPropOk returns a tuple with the BooleanProp field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *NullableClass) GetBooleanPropOk() (bool, bool) { + if o == nil || o.BooleanProp == nil { + var ret bool + return ret, false + } + return *o.BooleanProp, true +} + +// HasBooleanProp returns a boolean if a field has been set. +func (o *NullableClass) HasBooleanProp() bool { + if o != nil && o.BooleanProp != nil { + return true + } + + return false +} + +// SetBooleanProp gets a reference to the given bool and assigns it to the BooleanProp field. +func (o *NullableClass) SetBooleanProp(v bool) { + o.BooleanProp = &v +} + +// SetBooleanPropExplicitNull (un)sets BooleanProp to be considered as explicit "null" value +// when serializing to JSON (pass true as argument to set this, false to unset) +// The BooleanProp value is set to nil even if false is passed +func (o *NullableClass) SetBooleanPropExplicitNull(b bool) { + o.BooleanProp = nil + o.isExplicitNullBooleanProp = b +} +// GetStringProp returns the StringProp field if non-nil, zero value otherwise. +func (o *NullableClass) GetStringProp() string { + if o == nil || o.StringProp == nil { + var ret string + return ret + } + return *o.StringProp +} + +// GetStringPropOk returns a tuple with the StringProp field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *NullableClass) GetStringPropOk() (string, bool) { + if o == nil || o.StringProp == nil { + var ret string + return ret, false + } + return *o.StringProp, true +} + +// HasStringProp returns a boolean if a field has been set. +func (o *NullableClass) HasStringProp() bool { + if o != nil && o.StringProp != nil { + return true + } + + return false +} + +// SetStringProp gets a reference to the given string and assigns it to the StringProp field. +func (o *NullableClass) SetStringProp(v string) { + o.StringProp = &v +} + +// SetStringPropExplicitNull (un)sets StringProp to be considered as explicit "null" value +// when serializing to JSON (pass true as argument to set this, false to unset) +// The StringProp value is set to nil even if false is passed +func (o *NullableClass) SetStringPropExplicitNull(b bool) { + o.StringProp = nil + o.isExplicitNullStringProp = b +} +// GetDateProp returns the DateProp field if non-nil, zero value otherwise. +func (o *NullableClass) GetDateProp() string { + if o == nil || o.DateProp == nil { + var ret string + return ret + } + return *o.DateProp +} + +// GetDatePropOk returns a tuple with the DateProp field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *NullableClass) GetDatePropOk() (string, bool) { + if o == nil || o.DateProp == nil { + var ret string + return ret, false + } + return *o.DateProp, true +} + +// HasDateProp returns a boolean if a field has been set. +func (o *NullableClass) HasDateProp() bool { + if o != nil && o.DateProp != nil { + return true + } + + return false +} + +// SetDateProp gets a reference to the given string and assigns it to the DateProp field. +func (o *NullableClass) SetDateProp(v string) { + o.DateProp = &v +} + +// SetDatePropExplicitNull (un)sets DateProp to be considered as explicit "null" value +// when serializing to JSON (pass true as argument to set this, false to unset) +// The DateProp value is set to nil even if false is passed +func (o *NullableClass) SetDatePropExplicitNull(b bool) { + o.DateProp = nil + o.isExplicitNullDateProp = b +} +// GetDatetimeProp returns the DatetimeProp field if non-nil, zero value otherwise. +func (o *NullableClass) GetDatetimeProp() time.Time { + if o == nil || o.DatetimeProp == nil { + var ret time.Time + return ret + } + return *o.DatetimeProp +} + +// GetDatetimePropOk returns a tuple with the DatetimeProp field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *NullableClass) GetDatetimePropOk() (time.Time, bool) { + if o == nil || o.DatetimeProp == nil { + var ret time.Time + return ret, false + } + return *o.DatetimeProp, true +} + +// HasDatetimeProp returns a boolean if a field has been set. +func (o *NullableClass) HasDatetimeProp() bool { + if o != nil && o.DatetimeProp != nil { + return true + } + + return false +} + +// SetDatetimeProp gets a reference to the given time.Time and assigns it to the DatetimeProp field. +func (o *NullableClass) SetDatetimeProp(v time.Time) { + o.DatetimeProp = &v +} + +// SetDatetimePropExplicitNull (un)sets DatetimeProp to be considered as explicit "null" value +// when serializing to JSON (pass true as argument to set this, false to unset) +// The DatetimeProp value is set to nil even if false is passed +func (o *NullableClass) SetDatetimePropExplicitNull(b bool) { + o.DatetimeProp = nil + o.isExplicitNullDatetimeProp = b +} +// GetArrayNullableProp returns the ArrayNullableProp field if non-nil, zero value otherwise. +func (o *NullableClass) GetArrayNullableProp() []map[string]interface{} { + if o == nil || o.ArrayNullableProp == nil { + var ret []map[string]interface{} + return ret + } + return *o.ArrayNullableProp +} + +// GetArrayNullablePropOk returns a tuple with the ArrayNullableProp field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *NullableClass) GetArrayNullablePropOk() ([]map[string]interface{}, bool) { + if o == nil || o.ArrayNullableProp == nil { + var ret []map[string]interface{} + return ret, false + } + return *o.ArrayNullableProp, true +} + +// HasArrayNullableProp returns a boolean if a field has been set. +func (o *NullableClass) HasArrayNullableProp() bool { + if o != nil && o.ArrayNullableProp != nil { + return true + } + + return false +} + +// SetArrayNullableProp gets a reference to the given []map[string]interface{} and assigns it to the ArrayNullableProp field. +func (o *NullableClass) SetArrayNullableProp(v []map[string]interface{}) { + o.ArrayNullableProp = &v +} + +// SetArrayNullablePropExplicitNull (un)sets ArrayNullableProp to be considered as explicit "null" value +// when serializing to JSON (pass true as argument to set this, false to unset) +// The ArrayNullableProp value is set to nil even if false is passed +func (o *NullableClass) SetArrayNullablePropExplicitNull(b bool) { + o.ArrayNullableProp = nil + o.isExplicitNullArrayNullableProp = b +} +// GetArrayAndItemsNullableProp returns the ArrayAndItemsNullableProp field if non-nil, zero value otherwise. +func (o *NullableClass) GetArrayAndItemsNullableProp() []map[string]interface{} { + if o == nil || o.ArrayAndItemsNullableProp == nil { + var ret []map[string]interface{} + return ret + } + return *o.ArrayAndItemsNullableProp +} + +// GetArrayAndItemsNullablePropOk returns a tuple with the ArrayAndItemsNullableProp field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *NullableClass) GetArrayAndItemsNullablePropOk() ([]map[string]interface{}, bool) { + if o == nil || o.ArrayAndItemsNullableProp == nil { + var ret []map[string]interface{} + return ret, false + } + return *o.ArrayAndItemsNullableProp, true +} + +// HasArrayAndItemsNullableProp returns a boolean if a field has been set. +func (o *NullableClass) HasArrayAndItemsNullableProp() bool { + if o != nil && o.ArrayAndItemsNullableProp != nil { + return true + } + + return false +} + +// SetArrayAndItemsNullableProp gets a reference to the given []map[string]interface{} and assigns it to the ArrayAndItemsNullableProp field. +func (o *NullableClass) SetArrayAndItemsNullableProp(v []map[string]interface{}) { + o.ArrayAndItemsNullableProp = &v +} + +// SetArrayAndItemsNullablePropExplicitNull (un)sets ArrayAndItemsNullableProp to be considered as explicit "null" value +// when serializing to JSON (pass true as argument to set this, false to unset) +// The ArrayAndItemsNullableProp value is set to nil even if false is passed +func (o *NullableClass) SetArrayAndItemsNullablePropExplicitNull(b bool) { + o.ArrayAndItemsNullableProp = nil + o.isExplicitNullArrayAndItemsNullableProp = b +} +// GetArrayItemsNullable returns the ArrayItemsNullable field if non-nil, zero value otherwise. +func (o *NullableClass) GetArrayItemsNullable() []map[string]interface{} { + if o == nil || o.ArrayItemsNullable == nil { + var ret []map[string]interface{} + return ret + } + return *o.ArrayItemsNullable +} + +// GetArrayItemsNullableOk returns a tuple with the ArrayItemsNullable field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *NullableClass) GetArrayItemsNullableOk() ([]map[string]interface{}, bool) { + if o == nil || o.ArrayItemsNullable == nil { + var ret []map[string]interface{} + return ret, false + } + return *o.ArrayItemsNullable, true +} + +// HasArrayItemsNullable returns a boolean if a field has been set. +func (o *NullableClass) HasArrayItemsNullable() bool { + if o != nil && o.ArrayItemsNullable != nil { + return true + } + + return false +} + +// SetArrayItemsNullable gets a reference to the given []map[string]interface{} and assigns it to the ArrayItemsNullable field. +func (o *NullableClass) SetArrayItemsNullable(v []map[string]interface{}) { + o.ArrayItemsNullable = &v +} + +// GetObjectNullableProp returns the ObjectNullableProp field if non-nil, zero value otherwise. +func (o *NullableClass) GetObjectNullableProp() map[string]map[string]interface{} { + if o == nil || o.ObjectNullableProp == nil { + var ret map[string]map[string]interface{} + return ret + } + return *o.ObjectNullableProp +} + +// GetObjectNullablePropOk returns a tuple with the ObjectNullableProp field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *NullableClass) GetObjectNullablePropOk() (map[string]map[string]interface{}, bool) { + if o == nil || o.ObjectNullableProp == nil { + var ret map[string]map[string]interface{} + return ret, false + } + return *o.ObjectNullableProp, true +} + +// HasObjectNullableProp returns a boolean if a field has been set. +func (o *NullableClass) HasObjectNullableProp() bool { + if o != nil && o.ObjectNullableProp != nil { + return true + } + + return false +} + +// SetObjectNullableProp gets a reference to the given map[string]map[string]interface{} and assigns it to the ObjectNullableProp field. +func (o *NullableClass) SetObjectNullableProp(v map[string]map[string]interface{}) { + o.ObjectNullableProp = &v +} + +// SetObjectNullablePropExplicitNull (un)sets ObjectNullableProp to be considered as explicit "null" value +// when serializing to JSON (pass true as argument to set this, false to unset) +// The ObjectNullableProp value is set to nil even if false is passed +func (o *NullableClass) SetObjectNullablePropExplicitNull(b bool) { + o.ObjectNullableProp = nil + o.isExplicitNullObjectNullableProp = b +} +// GetObjectAndItemsNullableProp returns the ObjectAndItemsNullableProp field if non-nil, zero value otherwise. +func (o *NullableClass) GetObjectAndItemsNullableProp() map[string]map[string]interface{} { + if o == nil || o.ObjectAndItemsNullableProp == nil { + var ret map[string]map[string]interface{} + return ret + } + return *o.ObjectAndItemsNullableProp +} + +// GetObjectAndItemsNullablePropOk returns a tuple with the ObjectAndItemsNullableProp field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *NullableClass) GetObjectAndItemsNullablePropOk() (map[string]map[string]interface{}, bool) { + if o == nil || o.ObjectAndItemsNullableProp == nil { + var ret map[string]map[string]interface{} + return ret, false + } + return *o.ObjectAndItemsNullableProp, true +} + +// HasObjectAndItemsNullableProp returns a boolean if a field has been set. +func (o *NullableClass) HasObjectAndItemsNullableProp() bool { + if o != nil && o.ObjectAndItemsNullableProp != nil { + return true + } + + return false +} + +// SetObjectAndItemsNullableProp gets a reference to the given map[string]map[string]interface{} and assigns it to the ObjectAndItemsNullableProp field. +func (o *NullableClass) SetObjectAndItemsNullableProp(v map[string]map[string]interface{}) { + o.ObjectAndItemsNullableProp = &v +} + +// SetObjectAndItemsNullablePropExplicitNull (un)sets ObjectAndItemsNullableProp to be considered as explicit "null" value +// when serializing to JSON (pass true as argument to set this, false to unset) +// The ObjectAndItemsNullableProp value is set to nil even if false is passed +func (o *NullableClass) SetObjectAndItemsNullablePropExplicitNull(b bool) { + o.ObjectAndItemsNullableProp = nil + o.isExplicitNullObjectAndItemsNullableProp = b +} +// GetObjectItemsNullable returns the ObjectItemsNullable field if non-nil, zero value otherwise. +func (o *NullableClass) GetObjectItemsNullable() map[string]map[string]interface{} { + if o == nil || o.ObjectItemsNullable == nil { + var ret map[string]map[string]interface{} + return ret + } + return *o.ObjectItemsNullable +} + +// GetObjectItemsNullableOk returns a tuple with the ObjectItemsNullable field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *NullableClass) GetObjectItemsNullableOk() (map[string]map[string]interface{}, bool) { + if o == nil || o.ObjectItemsNullable == nil { + var ret map[string]map[string]interface{} + return ret, false + } + return *o.ObjectItemsNullable, true +} + +// HasObjectItemsNullable returns a boolean if a field has been set. +func (o *NullableClass) HasObjectItemsNullable() bool { + if o != nil && o.ObjectItemsNullable != nil { + return true + } + + return false +} + +// SetObjectItemsNullable gets a reference to the given map[string]map[string]interface{} and assigns it to the ObjectItemsNullable field. +func (o *NullableClass) SetObjectItemsNullable(v map[string]map[string]interface{}) { + o.ObjectItemsNullable = &v +} + + +func (o NullableClass) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.IntegerProp == nil { + if o.isExplicitNullIntegerProp { + toSerialize["integer_prop"] = o.IntegerProp + } + } else { + toSerialize["integer_prop"] = o.IntegerProp + } + if o.NumberProp == nil { + if o.isExplicitNullNumberProp { + toSerialize["number_prop"] = o.NumberProp + } + } else { + toSerialize["number_prop"] = o.NumberProp + } + if o.BooleanProp == nil { + if o.isExplicitNullBooleanProp { + toSerialize["boolean_prop"] = o.BooleanProp + } + } else { + toSerialize["boolean_prop"] = o.BooleanProp + } + if o.StringProp == nil { + if o.isExplicitNullStringProp { + toSerialize["string_prop"] = o.StringProp + } + } else { + toSerialize["string_prop"] = o.StringProp + } + if o.DateProp == nil { + if o.isExplicitNullDateProp { + toSerialize["date_prop"] = o.DateProp + } + } else { + toSerialize["date_prop"] = o.DateProp + } + if o.DatetimeProp == nil { + if o.isExplicitNullDatetimeProp { + toSerialize["datetime_prop"] = o.DatetimeProp + } + } else { + toSerialize["datetime_prop"] = o.DatetimeProp + } + if o.ArrayNullableProp == nil { + if o.isExplicitNullArrayNullableProp { + toSerialize["array_nullable_prop"] = o.ArrayNullableProp + } + } else { + toSerialize["array_nullable_prop"] = o.ArrayNullableProp + } + if o.ArrayAndItemsNullableProp == nil { + if o.isExplicitNullArrayAndItemsNullableProp { + toSerialize["array_and_items_nullable_prop"] = o.ArrayAndItemsNullableProp + } + } else { + toSerialize["array_and_items_nullable_prop"] = o.ArrayAndItemsNullableProp + } + if o.ArrayItemsNullable != nil { + toSerialize["array_items_nullable"] = o.ArrayItemsNullable + } + if o.ObjectNullableProp == nil { + if o.isExplicitNullObjectNullableProp { + toSerialize["object_nullable_prop"] = o.ObjectNullableProp + } + } else { + toSerialize["object_nullable_prop"] = o.ObjectNullableProp + } + if o.ObjectAndItemsNullableProp == nil { + if o.isExplicitNullObjectAndItemsNullableProp { + toSerialize["object_and_items_nullable_prop"] = o.ObjectAndItemsNullableProp + } + } else { + toSerialize["object_and_items_nullable_prop"] = o.ObjectAndItemsNullableProp + } + if o.ObjectItemsNullable != nil { + toSerialize["object_items_nullable"] = o.ObjectItemsNullable + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_number_only.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_number_only.go new file mode 100644 index 000000000000..f2b164065874 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_number_only.go @@ -0,0 +1,62 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi +import ( + "encoding/json" +) + +type NumberOnly struct { + JustNumber *float32 `json:"JustNumber,omitempty"` + +} + +// GetJustNumber returns the JustNumber field if non-nil, zero value otherwise. +func (o *NumberOnly) GetJustNumber() float32 { + if o == nil || o.JustNumber == nil { + var ret float32 + return ret + } + return *o.JustNumber +} + +// GetJustNumberOk returns a tuple with the JustNumber field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *NumberOnly) GetJustNumberOk() (float32, bool) { + if o == nil || o.JustNumber == nil { + var ret float32 + return ret, false + } + return *o.JustNumber, true +} + +// HasJustNumber returns a boolean if a field has been set. +func (o *NumberOnly) HasJustNumber() bool { + if o != nil && o.JustNumber != nil { + return true + } + + return false +} + +// SetJustNumber gets a reference to the given float32 and assigns it to the JustNumber field. +func (o *NumberOnly) SetJustNumber(v float32) { + o.JustNumber = &v +} + + +func (o NumberOnly) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.JustNumber != nil { + toSerialize["JustNumber"] = o.JustNumber + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_order.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_order.go new file mode 100644 index 000000000000..a0d59ac9ae78 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_order.go @@ -0,0 +1,254 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi +import ( + "time" + "encoding/json" +) + +type Order struct { + Id *int64 `json:"id,omitempty"` + + PetId *int64 `json:"petId,omitempty"` + + Quantity *int32 `json:"quantity,omitempty"` + + ShipDate *time.Time `json:"shipDate,omitempty"` + + // Order Status + Status *string `json:"status,omitempty"` + + Complete *bool `json:"complete,omitempty"` + +} + +// GetId returns the Id field if non-nil, zero value otherwise. +func (o *Order) GetId() int64 { + if o == nil || o.Id == nil { + var ret int64 + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Order) GetIdOk() (int64, bool) { + if o == nil || o.Id == nil { + var ret int64 + return ret, false + } + return *o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Order) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// SetId gets a reference to the given int64 and assigns it to the Id field. +func (o *Order) SetId(v int64) { + o.Id = &v +} + +// GetPetId returns the PetId field if non-nil, zero value otherwise. +func (o *Order) GetPetId() int64 { + if o == nil || o.PetId == nil { + var ret int64 + return ret + } + return *o.PetId +} + +// GetPetIdOk returns a tuple with the PetId field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Order) GetPetIdOk() (int64, bool) { + if o == nil || o.PetId == nil { + var ret int64 + return ret, false + } + return *o.PetId, true +} + +// HasPetId returns a boolean if a field has been set. +func (o *Order) HasPetId() bool { + if o != nil && o.PetId != nil { + return true + } + + return false +} + +// SetPetId gets a reference to the given int64 and assigns it to the PetId field. +func (o *Order) SetPetId(v int64) { + o.PetId = &v +} + +// GetQuantity returns the Quantity field if non-nil, zero value otherwise. +func (o *Order) GetQuantity() int32 { + if o == nil || o.Quantity == nil { + var ret int32 + return ret + } + return *o.Quantity +} + +// GetQuantityOk returns a tuple with the Quantity field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Order) GetQuantityOk() (int32, bool) { + if o == nil || o.Quantity == nil { + var ret int32 + return ret, false + } + return *o.Quantity, true +} + +// HasQuantity returns a boolean if a field has been set. +func (o *Order) HasQuantity() bool { + if o != nil && o.Quantity != nil { + return true + } + + return false +} + +// SetQuantity gets a reference to the given int32 and assigns it to the Quantity field. +func (o *Order) SetQuantity(v int32) { + o.Quantity = &v +} + +// GetShipDate returns the ShipDate field if non-nil, zero value otherwise. +func (o *Order) GetShipDate() time.Time { + if o == nil || o.ShipDate == nil { + var ret time.Time + return ret + } + return *o.ShipDate +} + +// GetShipDateOk returns a tuple with the ShipDate field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Order) GetShipDateOk() (time.Time, bool) { + if o == nil || o.ShipDate == nil { + var ret time.Time + return ret, false + } + return *o.ShipDate, true +} + +// HasShipDate returns a boolean if a field has been set. +func (o *Order) HasShipDate() bool { + if o != nil && o.ShipDate != nil { + return true + } + + return false +} + +// SetShipDate gets a reference to the given time.Time and assigns it to the ShipDate field. +func (o *Order) SetShipDate(v time.Time) { + o.ShipDate = &v +} + +// GetStatus returns the Status field if non-nil, zero value otherwise. +func (o *Order) GetStatus() string { + if o == nil || o.Status == nil { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Order) GetStatusOk() (string, bool) { + if o == nil || o.Status == nil { + var ret string + return ret, false + } + return *o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *Order) HasStatus() bool { + if o != nil && o.Status != nil { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *Order) SetStatus(v string) { + o.Status = &v +} + +// GetComplete returns the Complete field if non-nil, zero value otherwise. +func (o *Order) GetComplete() bool { + if o == nil || o.Complete == nil { + var ret bool + return ret + } + return *o.Complete +} + +// GetCompleteOk returns a tuple with the Complete field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Order) GetCompleteOk() (bool, bool) { + if o == nil || o.Complete == nil { + var ret bool + return ret, false + } + return *o.Complete, true +} + +// HasComplete returns a boolean if a field has been set. +func (o *Order) HasComplete() bool { + if o != nil && o.Complete != nil { + return true + } + + return false +} + +// SetComplete gets a reference to the given bool and assigns it to the Complete field. +func (o *Order) SetComplete(v bool) { + o.Complete = &v +} + + +func (o Order) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.PetId != nil { + toSerialize["petId"] = o.PetId + } + if o.Quantity != nil { + toSerialize["quantity"] = o.Quantity + } + if o.ShipDate != nil { + toSerialize["shipDate"] = o.ShipDate + } + if o.Status != nil { + toSerialize["status"] = o.Status + } + if o.Complete != nil { + toSerialize["complete"] = o.Complete + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_composite.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_composite.go new file mode 100644 index 000000000000..08897754ee9c --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_composite.go @@ -0,0 +1,138 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi +import ( + "encoding/json" +) + +type OuterComposite struct { + MyNumber *float32 `json:"my_number,omitempty"` + + MyString *string `json:"my_string,omitempty"` + + MyBoolean *bool `json:"my_boolean,omitempty"` + +} + +// GetMyNumber returns the MyNumber field if non-nil, zero value otherwise. +func (o *OuterComposite) GetMyNumber() float32 { + if o == nil || o.MyNumber == nil { + var ret float32 + return ret + } + return *o.MyNumber +} + +// GetMyNumberOk returns a tuple with the MyNumber field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *OuterComposite) GetMyNumberOk() (float32, bool) { + if o == nil || o.MyNumber == nil { + var ret float32 + return ret, false + } + return *o.MyNumber, true +} + +// HasMyNumber returns a boolean if a field has been set. +func (o *OuterComposite) HasMyNumber() bool { + if o != nil && o.MyNumber != nil { + return true + } + + return false +} + +// SetMyNumber gets a reference to the given float32 and assigns it to the MyNumber field. +func (o *OuterComposite) SetMyNumber(v float32) { + o.MyNumber = &v +} + +// GetMyString returns the MyString field if non-nil, zero value otherwise. +func (o *OuterComposite) GetMyString() string { + if o == nil || o.MyString == nil { + var ret string + return ret + } + return *o.MyString +} + +// GetMyStringOk returns a tuple with the MyString field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *OuterComposite) GetMyStringOk() (string, bool) { + if o == nil || o.MyString == nil { + var ret string + return ret, false + } + return *o.MyString, true +} + +// HasMyString returns a boolean if a field has been set. +func (o *OuterComposite) HasMyString() bool { + if o != nil && o.MyString != nil { + return true + } + + return false +} + +// SetMyString gets a reference to the given string and assigns it to the MyString field. +func (o *OuterComposite) SetMyString(v string) { + o.MyString = &v +} + +// GetMyBoolean returns the MyBoolean field if non-nil, zero value otherwise. +func (o *OuterComposite) GetMyBoolean() bool { + if o == nil || o.MyBoolean == nil { + var ret bool + return ret + } + return *o.MyBoolean +} + +// GetMyBooleanOk returns a tuple with the MyBoolean field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *OuterComposite) GetMyBooleanOk() (bool, bool) { + if o == nil || o.MyBoolean == nil { + var ret bool + return ret, false + } + return *o.MyBoolean, true +} + +// HasMyBoolean returns a boolean if a field has been set. +func (o *OuterComposite) HasMyBoolean() bool { + if o != nil && o.MyBoolean != nil { + return true + } + + return false +} + +// SetMyBoolean gets a reference to the given bool and assigns it to the MyBoolean field. +func (o *OuterComposite) SetMyBoolean(v bool) { + o.MyBoolean = &v +} + + +func (o OuterComposite) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.MyNumber != nil { + toSerialize["my_number"] = o.MyNumber + } + if o.MyString != nil { + toSerialize["my_string"] = o.MyString + } + if o.MyBoolean != nil { + toSerialize["my_boolean"] = o.MyBoolean + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum.go new file mode 100644 index 000000000000..1aecdabae2e7 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum.go @@ -0,0 +1,19 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi +type OuterEnum string + +// List of OuterEnum +const ( + PLACED OuterEnum = "placed" + APPROVED OuterEnum = "approved" + DELIVERED OuterEnum = "delivered" +) + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_default_value.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_default_value.go new file mode 100644 index 000000000000..3e32bb09d6de --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_default_value.go @@ -0,0 +1,19 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi +type OuterEnumDefaultValue string + +// List of OuterEnumDefaultValue +const ( + PLACED OuterEnumDefaultValue = "placed" + APPROVED OuterEnumDefaultValue = "approved" + DELIVERED OuterEnumDefaultValue = "delivered" +) + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_integer.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_integer.go new file mode 100644 index 000000000000..28665469a177 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_integer.go @@ -0,0 +1,19 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi +type OuterEnumInteger int32 + +// List of OuterEnumInteger +const ( + _0 OuterEnumInteger = "0" + _1 OuterEnumInteger = "1" + _2 OuterEnumInteger = "2" +) + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_integer_default_value.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_integer_default_value.go new file mode 100644 index 000000000000..355420496a13 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_integer_default_value.go @@ -0,0 +1,19 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi +type OuterEnumIntegerDefaultValue int32 + +// List of OuterEnumIntegerDefaultValue +const ( + _0 OuterEnumIntegerDefaultValue = "0" + _1 OuterEnumIntegerDefaultValue = "1" + _2 OuterEnumIntegerDefaultValue = "2" +) + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_pet.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_pet.go new file mode 100644 index 000000000000..1bb83e9f5525 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_pet.go @@ -0,0 +1,260 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi +import ( + "encoding/json" + "errors" +) + +type Pet struct { + Id *int64 `json:"id,omitempty"` + + Category *Category `json:"category,omitempty"` + + Name *string `json:"name,omitempty"` + + PhotoUrls *[]string `json:"photoUrls,omitempty"` + + Tags *[]Tag `json:"tags,omitempty"` + + // pet status in the store + Status *string `json:"status,omitempty"` + +} + +// GetId returns the Id field if non-nil, zero value otherwise. +func (o *Pet) GetId() int64 { + if o == nil || o.Id == nil { + var ret int64 + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Pet) GetIdOk() (int64, bool) { + if o == nil || o.Id == nil { + var ret int64 + return ret, false + } + return *o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Pet) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// SetId gets a reference to the given int64 and assigns it to the Id field. +func (o *Pet) SetId(v int64) { + o.Id = &v +} + +// GetCategory returns the Category field if non-nil, zero value otherwise. +func (o *Pet) GetCategory() Category { + if o == nil || o.Category == nil { + var ret Category + return ret + } + return *o.Category +} + +// GetCategoryOk returns a tuple with the Category field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Pet) GetCategoryOk() (Category, bool) { + if o == nil || o.Category == nil { + var ret Category + return ret, false + } + return *o.Category, true +} + +// HasCategory returns a boolean if a field has been set. +func (o *Pet) HasCategory() bool { + if o != nil && o.Category != nil { + return true + } + + return false +} + +// SetCategory gets a reference to the given Category and assigns it to the Category field. +func (o *Pet) SetCategory(v Category) { + o.Category = &v +} + +// GetName returns the Name field if non-nil, zero value otherwise. +func (o *Pet) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Pet) GetNameOk() (string, bool) { + if o == nil || o.Name == nil { + var ret string + return ret, false + } + return *o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Pet) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *Pet) SetName(v string) { + o.Name = &v +} + +// GetPhotoUrls returns the PhotoUrls field if non-nil, zero value otherwise. +func (o *Pet) GetPhotoUrls() []string { + if o == nil || o.PhotoUrls == nil { + var ret []string + return ret + } + return *o.PhotoUrls +} + +// GetPhotoUrlsOk returns a tuple with the PhotoUrls field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Pet) GetPhotoUrlsOk() ([]string, bool) { + if o == nil || o.PhotoUrls == nil { + var ret []string + return ret, false + } + return *o.PhotoUrls, true +} + +// HasPhotoUrls returns a boolean if a field has been set. +func (o *Pet) HasPhotoUrls() bool { + if o != nil && o.PhotoUrls != nil { + return true + } + + return false +} + +// SetPhotoUrls gets a reference to the given []string and assigns it to the PhotoUrls field. +func (o *Pet) SetPhotoUrls(v []string) { + o.PhotoUrls = &v +} + +// GetTags returns the Tags field if non-nil, zero value otherwise. +func (o *Pet) GetTags() []Tag { + if o == nil || o.Tags == nil { + var ret []Tag + return ret + } + return *o.Tags +} + +// GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Pet) GetTagsOk() ([]Tag, bool) { + if o == nil || o.Tags == nil { + var ret []Tag + return ret, false + } + return *o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *Pet) HasTags() bool { + if o != nil && o.Tags != nil { + return true + } + + return false +} + +// SetTags gets a reference to the given []Tag and assigns it to the Tags field. +func (o *Pet) SetTags(v []Tag) { + o.Tags = &v +} + +// GetStatus returns the Status field if non-nil, zero value otherwise. +func (o *Pet) GetStatus() string { + if o == nil || o.Status == nil { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Pet) GetStatusOk() (string, bool) { + if o == nil || o.Status == nil { + var ret string + return ret, false + } + return *o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *Pet) HasStatus() bool { + if o != nil && o.Status != nil { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *Pet) SetStatus(v string) { + o.Status = &v +} + + +func (o Pet) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Category != nil { + toSerialize["category"] = o.Category + } + if o.Name == nil { + return nil, errors.New("Name is required and not nullable, but was not set on Pet") + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.PhotoUrls == nil { + return nil, errors.New("PhotoUrls is required and not nullable, but was not set on Pet") + } + if o.PhotoUrls != nil { + toSerialize["photoUrls"] = o.PhotoUrls + } + if o.Tags != nil { + toSerialize["tags"] = o.Tags + } + if o.Status != nil { + toSerialize["status"] = o.Status + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_read_only_first.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_read_only_first.go new file mode 100644 index 000000000000..3a8d02f52ed7 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_read_only_first.go @@ -0,0 +1,100 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi +import ( + "encoding/json" +) + +type ReadOnlyFirst struct { + Bar *string `json:"bar,omitempty"` + + Baz *string `json:"baz,omitempty"` + +} + +// GetBar returns the Bar field if non-nil, zero value otherwise. +func (o *ReadOnlyFirst) GetBar() string { + if o == nil || o.Bar == nil { + var ret string + return ret + } + return *o.Bar +} + +// GetBarOk returns a tuple with the Bar field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *ReadOnlyFirst) GetBarOk() (string, bool) { + if o == nil || o.Bar == nil { + var ret string + return ret, false + } + return *o.Bar, true +} + +// HasBar returns a boolean if a field has been set. +func (o *ReadOnlyFirst) HasBar() bool { + if o != nil && o.Bar != nil { + return true + } + + return false +} + +// SetBar gets a reference to the given string and assigns it to the Bar field. +func (o *ReadOnlyFirst) SetBar(v string) { + o.Bar = &v +} + +// GetBaz returns the Baz field if non-nil, zero value otherwise. +func (o *ReadOnlyFirst) GetBaz() string { + if o == nil || o.Baz == nil { + var ret string + return ret + } + return *o.Baz +} + +// GetBazOk returns a tuple with the Baz field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *ReadOnlyFirst) GetBazOk() (string, bool) { + if o == nil || o.Baz == nil { + var ret string + return ret, false + } + return *o.Baz, true +} + +// HasBaz returns a boolean if a field has been set. +func (o *ReadOnlyFirst) HasBaz() bool { + if o != nil && o.Baz != nil { + return true + } + + return false +} + +// SetBaz gets a reference to the given string and assigns it to the Baz field. +func (o *ReadOnlyFirst) SetBaz(v string) { + o.Baz = &v +} + + +func (o ReadOnlyFirst) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Bar != nil { + toSerialize["bar"] = o.Bar + } + if o.Baz != nil { + toSerialize["baz"] = o.Baz + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_return.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_return.go new file mode 100644 index 000000000000..acfa57798ac0 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_return.go @@ -0,0 +1,63 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi +import ( + "encoding/json" +) + +// Model for testing reserved words +type Return struct { + Return *int32 `json:"return,omitempty"` + +} + +// GetReturn returns the Return field if non-nil, zero value otherwise. +func (o *Return) GetReturn() int32 { + if o == nil || o.Return == nil { + var ret int32 + return ret + } + return *o.Return +} + +// GetReturnOk returns a tuple with the Return field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Return) GetReturnOk() (int32, bool) { + if o == nil || o.Return == nil { + var ret int32 + return ret, false + } + return *o.Return, true +} + +// HasReturn returns a boolean if a field has been set. +func (o *Return) HasReturn() bool { + if o != nil && o.Return != nil { + return true + } + + return false +} + +// SetReturn gets a reference to the given int32 and assigns it to the Return field. +func (o *Return) SetReturn(v int32) { + o.Return = &v +} + + +func (o Return) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Return != nil { + toSerialize["return"] = o.Return + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_tag.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_tag.go new file mode 100644 index 000000000000..4106428c76e5 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_tag.go @@ -0,0 +1,100 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi +import ( + "encoding/json" +) + +type Tag struct { + Id *int64 `json:"id,omitempty"` + + Name *string `json:"name,omitempty"` + +} + +// GetId returns the Id field if non-nil, zero value otherwise. +func (o *Tag) GetId() int64 { + if o == nil || o.Id == nil { + var ret int64 + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Tag) GetIdOk() (int64, bool) { + if o == nil || o.Id == nil { + var ret int64 + return ret, false + } + return *o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Tag) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// SetId gets a reference to the given int64 and assigns it to the Id field. +func (o *Tag) SetId(v int64) { + o.Id = &v +} + +// GetName returns the Name field if non-nil, zero value otherwise. +func (o *Tag) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Tag) GetNameOk() (string, bool) { + if o == nil || o.Name == nil { + var ret string + return ret, false + } + return *o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Tag) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *Tag) SetName(v string) { + o.Name = &v +} + + +func (o Tag) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_user.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_user.go new file mode 100644 index 000000000000..dc4105b9aaff --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_user.go @@ -0,0 +1,329 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi +import ( + "encoding/json" +) + +type User struct { + Id *int64 `json:"id,omitempty"` + + Username *string `json:"username,omitempty"` + + FirstName *string `json:"firstName,omitempty"` + + LastName *string `json:"lastName,omitempty"` + + Email *string `json:"email,omitempty"` + + Password *string `json:"password,omitempty"` + + Phone *string `json:"phone,omitempty"` + + // User Status + UserStatus *int32 `json:"userStatus,omitempty"` + +} + +// GetId returns the Id field if non-nil, zero value otherwise. +func (o *User) GetId() int64 { + if o == nil || o.Id == nil { + var ret int64 + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *User) GetIdOk() (int64, bool) { + if o == nil || o.Id == nil { + var ret int64 + return ret, false + } + return *o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *User) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// SetId gets a reference to the given int64 and assigns it to the Id field. +func (o *User) SetId(v int64) { + o.Id = &v +} + +// GetUsername returns the Username field if non-nil, zero value otherwise. +func (o *User) GetUsername() string { + if o == nil || o.Username == nil { + var ret string + return ret + } + return *o.Username +} + +// GetUsernameOk returns a tuple with the Username field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *User) GetUsernameOk() (string, bool) { + if o == nil || o.Username == nil { + var ret string + return ret, false + } + return *o.Username, true +} + +// HasUsername returns a boolean if a field has been set. +func (o *User) HasUsername() bool { + if o != nil && o.Username != nil { + return true + } + + return false +} + +// SetUsername gets a reference to the given string and assigns it to the Username field. +func (o *User) SetUsername(v string) { + o.Username = &v +} + +// GetFirstName returns the FirstName field if non-nil, zero value otherwise. +func (o *User) GetFirstName() string { + if o == nil || o.FirstName == nil { + var ret string + return ret + } + return *o.FirstName +} + +// GetFirstNameOk returns a tuple with the FirstName field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *User) GetFirstNameOk() (string, bool) { + if o == nil || o.FirstName == nil { + var ret string + return ret, false + } + return *o.FirstName, true +} + +// HasFirstName returns a boolean if a field has been set. +func (o *User) HasFirstName() bool { + if o != nil && o.FirstName != nil { + return true + } + + return false +} + +// SetFirstName gets a reference to the given string and assigns it to the FirstName field. +func (o *User) SetFirstName(v string) { + o.FirstName = &v +} + +// GetLastName returns the LastName field if non-nil, zero value otherwise. +func (o *User) GetLastName() string { + if o == nil || o.LastName == nil { + var ret string + return ret + } + return *o.LastName +} + +// GetLastNameOk returns a tuple with the LastName field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *User) GetLastNameOk() (string, bool) { + if o == nil || o.LastName == nil { + var ret string + return ret, false + } + return *o.LastName, true +} + +// HasLastName returns a boolean if a field has been set. +func (o *User) HasLastName() bool { + if o != nil && o.LastName != nil { + return true + } + + return false +} + +// SetLastName gets a reference to the given string and assigns it to the LastName field. +func (o *User) SetLastName(v string) { + o.LastName = &v +} + +// GetEmail returns the Email field if non-nil, zero value otherwise. +func (o *User) GetEmail() string { + if o == nil || o.Email == nil { + var ret string + return ret + } + return *o.Email +} + +// GetEmailOk returns a tuple with the Email field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *User) GetEmailOk() (string, bool) { + if o == nil || o.Email == nil { + var ret string + return ret, false + } + return *o.Email, true +} + +// HasEmail returns a boolean if a field has been set. +func (o *User) HasEmail() bool { + if o != nil && o.Email != nil { + return true + } + + return false +} + +// SetEmail gets a reference to the given string and assigns it to the Email field. +func (o *User) SetEmail(v string) { + o.Email = &v +} + +// GetPassword returns the Password field if non-nil, zero value otherwise. +func (o *User) GetPassword() string { + if o == nil || o.Password == nil { + var ret string + return ret + } + return *o.Password +} + +// GetPasswordOk returns a tuple with the Password field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *User) GetPasswordOk() (string, bool) { + if o == nil || o.Password == nil { + var ret string + return ret, false + } + return *o.Password, true +} + +// HasPassword returns a boolean if a field has been set. +func (o *User) HasPassword() bool { + if o != nil && o.Password != nil { + return true + } + + return false +} + +// SetPassword gets a reference to the given string and assigns it to the Password field. +func (o *User) SetPassword(v string) { + o.Password = &v +} + +// GetPhone returns the Phone field if non-nil, zero value otherwise. +func (o *User) GetPhone() string { + if o == nil || o.Phone == nil { + var ret string + return ret + } + return *o.Phone +} + +// GetPhoneOk returns a tuple with the Phone field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *User) GetPhoneOk() (string, bool) { + if o == nil || o.Phone == nil { + var ret string + return ret, false + } + return *o.Phone, true +} + +// HasPhone returns a boolean if a field has been set. +func (o *User) HasPhone() bool { + if o != nil && o.Phone != nil { + return true + } + + return false +} + +// SetPhone gets a reference to the given string and assigns it to the Phone field. +func (o *User) SetPhone(v string) { + o.Phone = &v +} + +// GetUserStatus returns the UserStatus field if non-nil, zero value otherwise. +func (o *User) GetUserStatus() int32 { + if o == nil || o.UserStatus == nil { + var ret int32 + return ret + } + return *o.UserStatus +} + +// GetUserStatusOk returns a tuple with the UserStatus field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *User) GetUserStatusOk() (int32, bool) { + if o == nil || o.UserStatus == nil { + var ret int32 + return ret, false + } + return *o.UserStatus, true +} + +// HasUserStatus returns a boolean if a field has been set. +func (o *User) HasUserStatus() bool { + if o != nil && o.UserStatus != nil { + return true + } + + return false +} + +// SetUserStatus gets a reference to the given int32 and assigns it to the UserStatus field. +func (o *User) SetUserStatus(v int32) { + o.UserStatus = &v +} + + +func (o User) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Username != nil { + toSerialize["username"] = o.Username + } + if o.FirstName != nil { + toSerialize["firstName"] = o.FirstName + } + if o.LastName != nil { + toSerialize["lastName"] = o.LastName + } + if o.Email != nil { + toSerialize["email"] = o.Email + } + if o.Password != nil { + toSerialize["password"] = o.Password + } + if o.Phone != nil { + toSerialize["phone"] = o.Phone + } + if o.UserStatus != nil { + toSerialize["userStatus"] = o.UserStatus + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/response.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/response.go new file mode 100644 index 000000000000..81948d05a3f2 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/response.go @@ -0,0 +1,43 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi + +import ( + "net/http" +) + +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/utils.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/utils.go new file mode 100644 index 000000000000..f5916b755a23 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/utils.go @@ -0,0 +1,39 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi + +import "time" + +// PtrBool is a helper routine that returns a pointer to given integer value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat is a helper routine that returns a pointer to given float value. +func PtrFloat(v float32) *float32 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } \ No newline at end of file diff --git a/samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/VERSION b/samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/VERSION index 479c313e87b9..83a328a9227e 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.3-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml b/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml index 260820910aff..95b487afebfc 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml +++ b/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml @@ -1682,6 +1682,7 @@ components: - placed - approved - delivered + nullable: true type: string OuterEnumInteger: enum: diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/EnumTest.md b/samples/openapi3/client/petstore/go/go-petstore/docs/EnumTest.md index 1fe92c432dc9..1a9a600a18a4 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/EnumTest.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/EnumTest.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **EnumStringRequired** | **string** | | **EnumInteger** | **int32** | | [optional] **EnumNumber** | **float64** | | [optional] -**OuterEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] +**OuterEnum** | Pointer to [**OuterEnum**](OuterEnum.md) | | [optional] **OuterEnumInteger** | [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional] **OuterEnumDefaultValue** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] **OuterEnumIntegerDefaultValue** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_enum_test_.go b/samples/openapi3/client/petstore/go/go-petstore/model_enum_test_.go index 04a822aa6c88..5388b937e8b1 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_enum_test_.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_enum_test_.go @@ -14,7 +14,7 @@ type EnumTest struct { EnumStringRequired string `json:"enum_string_required"` EnumInteger int32 `json:"enum_integer,omitempty"` EnumNumber float64 `json:"enum_number,omitempty"` - OuterEnum OuterEnum `json:"outerEnum,omitempty"` + OuterEnum *OuterEnum `json:"outerEnum,omitempty"` OuterEnumInteger OuterEnumInteger `json:"outerEnumInteger,omitempty"` OuterEnumDefaultValue OuterEnumDefaultValue `json:"outerEnumDefaultValue,omitempty"` OuterEnumIntegerDefaultValue OuterEnumIntegerDefaultValue `json:"outerEnumIntegerDefaultValue,omitempty"` diff --git a/samples/openapi3/client/petstore/javascript-es6/.babelrc b/samples/openapi3/client/petstore/javascript-es6/.babelrc index 67b369ed370c..c73df9d50b49 100644 --- a/samples/openapi3/client/petstore/javascript-es6/.babelrc +++ b/samples/openapi3/client/petstore/javascript-es6/.babelrc @@ -1,3 +1,33 @@ { - "presets": ["env", "stage-0"] + "presets": [ + "@babel/preset-env" + ], + "plugins": [ + "@babel/plugin-syntax-dynamic-import", + "@babel/plugin-syntax-import-meta", + "@babel/plugin-proposal-class-properties", + "@babel/plugin-proposal-json-strings", + [ + "@babel/plugin-proposal-decorators", + { + "legacy": true + } + ], + "@babel/plugin-proposal-function-sent", + "@babel/plugin-proposal-export-namespace-from", + "@babel/plugin-proposal-numeric-separator", + "@babel/plugin-proposal-throw-expressions", + "@babel/plugin-proposal-export-default-from", + "@babel/plugin-proposal-logical-assignment-operators", + "@babel/plugin-proposal-optional-chaining", + [ + "@babel/plugin-proposal-pipeline-operator", + { + "proposal": "minimal" + } + ], + "@babel/plugin-proposal-nullish-coalescing-operator", + "@babel/plugin-proposal-do-expressions", + "@babel/plugin-proposal-function-bind" + ] } diff --git a/samples/openapi3/client/petstore/javascript-es6/.openapi-generator/VERSION b/samples/openapi3/client/petstore/javascript-es6/.openapi-generator/VERSION index 479c313e87b9..83a328a9227e 100644 --- a/samples/openapi3/client/petstore/javascript-es6/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/javascript-es6/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.3-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/javascript-es6/docs/OuterEnumInteger.md b/samples/openapi3/client/petstore/javascript-es6/docs/OuterEnumInteger.md index 224989a0e6c7..6da70cb782a8 100644 --- a/samples/openapi3/client/petstore/javascript-es6/docs/OuterEnumInteger.md +++ b/samples/openapi3/client/petstore/javascript-es6/docs/OuterEnumInteger.md @@ -3,10 +3,10 @@ ## Enum -* `0` (value: `0`) +* `NUMBER_0` (value: `0`) -* `1` (value: `1`) +* `NUMBER_1` (value: `1`) -* `2` (value: `2`) +* `NUMBER_2` (value: `2`) diff --git a/samples/openapi3/client/petstore/javascript-es6/docs/OuterEnumIntegerDefaultValue.md b/samples/openapi3/client/petstore/javascript-es6/docs/OuterEnumIntegerDefaultValue.md index fffd3f8f315a..836191fcc47c 100644 --- a/samples/openapi3/client/petstore/javascript-es6/docs/OuterEnumIntegerDefaultValue.md +++ b/samples/openapi3/client/petstore/javascript-es6/docs/OuterEnumIntegerDefaultValue.md @@ -3,10 +3,10 @@ ## Enum -* `0` (value: `0`) +* `NUMBER_0` (value: `0`) -* `1` (value: `1`) +* `NUMBER_1` (value: `1`) -* `2` (value: `2`) +* `NUMBER_2` (value: `2`) diff --git a/samples/openapi3/client/petstore/javascript-es6/package.json b/samples/openapi3/client/petstore/javascript-es6/package.json index 94455e4a69a7..6a738bcf3385 100644 --- a/samples/openapi3/client/petstore/javascript-es6/package.json +++ b/samples/openapi3/client/petstore/javascript-es6/package.json @@ -7,19 +7,35 @@ "scripts": { "build": "babel src -d dist", "prepack": "npm run build", - "test": "mocha --compilers js:babel-core/register --recursive" + "test": "mocha --compilers js:@babel/register --recursive" }, "browser": { "fs": false }, "dependencies": { - "babel-cli": "^6.26.0", + "@babel/cli": "^7.0.0", "superagent": "3.7.0" }, "devDependencies": { - "babel-core": "6.26.0", - "babel-preset-env": "^1.6.1", - "babel-preset-stage-0": "^6.24.1", + "@babel/core": "^7.0.0", + "@babel/plugin-proposal-class-properties": "^7.0.0", + "@babel/plugin-proposal-decorators": "^7.0.0", + "@babel/plugin-proposal-do-expressions": "^7.0.0", + "@babel/plugin-proposal-export-default-from": "^7.0.0", + "@babel/plugin-proposal-export-namespace-from": "^7.0.0", + "@babel/plugin-proposal-function-bind": "^7.0.0", + "@babel/plugin-proposal-function-sent": "^7.0.0", + "@babel/plugin-proposal-json-strings": "^7.0.0", + "@babel/plugin-proposal-logical-assignment-operators": "^7.0.0", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.0.0", + "@babel/plugin-proposal-numeric-separator": "^7.0.0", + "@babel/plugin-proposal-optional-chaining": "^7.0.0", + "@babel/plugin-proposal-pipeline-operator": "^7.0.0", + "@babel/plugin-proposal-throw-expressions": "^7.0.0", + "@babel/plugin-syntax-dynamic-import": "^7.0.0", + "@babel/plugin-syntax-import-meta": "^7.0.0", + "@babel/preset-env": "^7.0.0", + "@babel/register": "^7.0.0", "expect.js": "^0.3.1", "mocha": "^5.2.0", "sinon": "^7.2.0" diff --git a/samples/openapi3/client/petstore/javascript-es6/src/model/OuterEnumInteger.js b/samples/openapi3/client/petstore/javascript-es6/src/model/OuterEnumInteger.js index b6fc29568a02..9e9b692cab68 100644 --- a/samples/openapi3/client/petstore/javascript-es6/src/model/OuterEnumInteger.js +++ b/samples/openapi3/client/petstore/javascript-es6/src/model/OuterEnumInteger.js @@ -23,21 +23,21 @@ export default class OuterEnumInteger { * value: 0 * @const */ - "0" = 0; + "NUMBER_0" = 0; /** * value: 1 * @const */ - "1" = 1; + "NUMBER_1" = 1; /** * value: 2 * @const */ - "2" = 2; + "NUMBER_2" = 2; diff --git a/samples/openapi3/client/petstore/javascript-es6/src/model/OuterEnumIntegerDefaultValue.js b/samples/openapi3/client/petstore/javascript-es6/src/model/OuterEnumIntegerDefaultValue.js index 86a9d6b9467e..e9cad67baf8f 100644 --- a/samples/openapi3/client/petstore/javascript-es6/src/model/OuterEnumIntegerDefaultValue.js +++ b/samples/openapi3/client/petstore/javascript-es6/src/model/OuterEnumIntegerDefaultValue.js @@ -23,21 +23,21 @@ export default class OuterEnumIntegerDefaultValue { * value: 0 * @const */ - "0" = 0; + "NUMBER_0" = 0; /** * value: 1 * @const */ - "1" = 1; + "NUMBER_1" = 1; /** * value: 2 * @const */ - "2" = 2; + "NUMBER_2" = 2; diff --git a/samples/openapi3/client/petstore/kotlin/.openapi-generator/VERSION b/samples/openapi3/client/petstore/kotlin/.openapi-generator/VERSION index afa636560641..83a328a9227e 100644 --- a/samples/openapi3/client/petstore/kotlin/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/kotlin/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin/README.md b/samples/openapi3/client/petstore/kotlin/README.md index d4d33f303f13..ba4fd0e27621 100644 --- a/samples/openapi3/client/petstore/kotlin/README.md +++ b/samples/openapi3/client/petstore/kotlin/README.md @@ -2,8 +2,8 @@ ## Requires -* Kotlin 1.1.2 -* Gradle 3.3 +* Kotlin 1.3.31 +* Gradle 4.9 ## Build @@ -85,10 +85,12 @@ Class | Method | HTTP request | Description - [org.openapitools.client.models.ArrayTest](docs/ArrayTest.md) - [org.openapitools.client.models.Capitalization](docs/Capitalization.md) - [org.openapitools.client.models.Cat](docs/Cat.md) + - [org.openapitools.client.models.CatAllOf](docs/CatAllOf.md) - [org.openapitools.client.models.Category](docs/Category.md) - [org.openapitools.client.models.ClassModel](docs/ClassModel.md) - [org.openapitools.client.models.Client](docs/Client.md) - [org.openapitools.client.models.Dog](docs/Dog.md) + - [org.openapitools.client.models.DogAllOf](docs/DogAllOf.md) - [org.openapitools.client.models.EnumArrays](docs/EnumArrays.md) - [org.openapitools.client.models.EnumClass](docs/EnumClass.md) - [org.openapitools.client.models.EnumTest](docs/EnumTest.md) @@ -109,6 +111,7 @@ Class | Method | HTTP request | Description - [org.openapitools.client.models.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - [org.openapitools.client.models.Model200Response](docs/Model200Response.md) - [org.openapitools.client.models.Name](docs/Name.md) + - [org.openapitools.client.models.NullableClass](docs/NullableClass.md) - [org.openapitools.client.models.NumberOnly](docs/NumberOnly.md) - [org.openapitools.client.models.Order](docs/Order.md) - [org.openapitools.client.models.OuterComposite](docs/OuterComposite.md) diff --git a/samples/openapi3/client/petstore/kotlin/build.gradle b/samples/openapi3/client/petstore/kotlin/build.gradle index 8668dab3a7e6..2f5e3642794f 100644 --- a/samples/openapi3/client/petstore/kotlin/build.gradle +++ b/samples/openapi3/client/petstore/kotlin/build.gradle @@ -1,13 +1,13 @@ group 'org.openapitools' version '1.0.0' -task wrapper(type: Wrapper) { - gradleVersion = '3.3' +wrapper { + gradleVersion = '4.9' distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" } buildscript { - ext.kotlin_version = '1.1.2' + ext.kotlin_version = '1.3.31' repositories { mavenCentral() @@ -23,11 +23,15 @@ repositories { mavenCentral() } +test { + useJUnitPlatform() +} + dependencies { - compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version" - compile "com.squareup.moshi:moshi-kotlin:1.5.0" - compile "com.squareup.moshi:moshi-adapters:1.5.0" - compile "com.squareup.okhttp3:okhttp:3.8.0" - compile "org.threeten:threetenbp:1.3.6" - testCompile "io.kotlintest:kotlintest:2.0.2" + compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" + compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" + compile "com.squareup.moshi:moshi-kotlin:1.8.0" + compile "com.squareup.moshi:moshi-adapters:1.8.0" + compile "com.squareup.okhttp3:okhttp:3.14.2" + testImplementation "io.kotlintest:kotlintest-runner-junit5:3.1.0" } diff --git a/samples/openapi3/client/petstore/kotlin/docs/CatAllOf.md b/samples/openapi3/client/petstore/kotlin/docs/CatAllOf.md new file mode 100644 index 000000000000..fb8883197a18 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin/docs/CatAllOf.md @@ -0,0 +1,10 @@ + +# CatAllOf + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**declawed** | **kotlin.Boolean** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin/docs/DogAllOf.md b/samples/openapi3/client/petstore/kotlin/docs/DogAllOf.md new file mode 100644 index 000000000000..6b14d5e9147d --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin/docs/DogAllOf.md @@ -0,0 +1,10 @@ + +# DogAllOf + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**breed** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin/docs/FakeApi.md b/samples/openapi3/client/petstore/kotlin/docs/FakeApi.md index 52d0b1f0fb9c..9bf7eeef2ac9 100644 --- a/samples/openapi3/client/petstore/kotlin/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/kotlin/docs/FakeApi.md @@ -324,7 +324,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **query** | **kotlin.String**| | [default to null] + **query** | **kotlin.String**| | **user** | [**User**](User.md)| | ### Return type @@ -412,7 +412,7 @@ val int64 : kotlin.Long = 789 // kotlin.Long | None val float : kotlin.Float = 3.4 // kotlin.Float | None val string : kotlin.String = string_example // kotlin.String | None val binary : java.io.File = BINARY_DATA_HERE // java.io.File | None -val date : java.time.LocalDateTime = 2013-10-20 // java.time.LocalDateTime | None +val date : java.time.LocalDate = 2013-10-20 // java.time.LocalDate | None val dateTime : java.time.LocalDateTime = 2013-10-20T19:20:30+01:00 // java.time.LocalDateTime | None val password : kotlin.String = password_example // kotlin.String | None val paramCallback : kotlin.String = paramCallback_example // kotlin.String | None @@ -431,20 +431,20 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **number** | **java.math.BigDecimal**| None | [default to null] - **double** | **kotlin.Double**| None | [default to null] - **patternWithoutDelimiter** | **kotlin.String**| None | [default to null] - **byte** | **kotlin.ByteArray**| None | [default to null] - **integer** | **kotlin.Int**| None | [optional] [default to null] - **int32** | **kotlin.Int**| None | [optional] [default to null] - **int64** | **kotlin.Long**| None | [optional] [default to null] - **float** | **kotlin.Float**| None | [optional] [default to null] - **string** | **kotlin.String**| None | [optional] [default to null] - **binary** | **java.io.File**| None | [optional] [default to null] - **date** | **java.time.LocalDateTime**| None | [optional] [default to null] - **dateTime** | **java.time.LocalDateTime**| None | [optional] [default to null] - **password** | **kotlin.String**| None | [optional] [default to null] - **paramCallback** | **kotlin.String**| None | [optional] [default to null] + **number** | **java.math.BigDecimal**| None | + **double** | **kotlin.Double**| None | + **patternWithoutDelimiter** | **kotlin.String**| None | + **byte** | **kotlin.ByteArray**| None | + **integer** | **kotlin.Int**| None | [optional] + **int32** | **kotlin.Int**| None | [optional] + **int64** | **kotlin.Long**| None | [optional] + **float** | **kotlin.Float**| None | [optional] + **string** | **kotlin.String**| None | [optional] + **binary** | **java.io.File**| None | [optional] + **date** | **java.time.LocalDate**| None | [optional] + **dateTime** | **java.time.LocalDateTime**| None | [optional] + **password** | **kotlin.String**| None | [optional] + **paramCallback** | **kotlin.String**| None | [optional] ### Return type @@ -497,14 +497,14 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **enumHeaderStringArray** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Header parameter enum test (string array) | [optional] [default to null] [enum: >, $] - **enumHeaderString** | **kotlin.String**| Header parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] - **enumQueryStringArray** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Query parameter enum test (string array) | [optional] [default to null] [enum: >, $] - **enumQueryString** | **kotlin.String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] - **enumQueryInteger** | **kotlin.Int**| Query parameter enum test (double) | [optional] [default to null] [enum: 1, -2] - **enumQueryDouble** | **kotlin.Double**| Query parameter enum test (double) | [optional] [default to null] [enum: 1.1, -1.2] - **enumFormStringArray** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Form parameter enum test (string array) | [optional] [default to $] [enum: >, $] - **enumFormString** | **kotlin.String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] + **enumHeaderStringArray** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Header parameter enum test (string array) | [optional] [enum: >, $] + **enumHeaderString** | **kotlin.String**| Header parameter enum test (string) | [optional] [default to '-efg'] [enum: _abc, -efg, (xyz)] + **enumQueryStringArray** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Query parameter enum test (string array) | [optional] [enum: >, $] + **enumQueryString** | **kotlin.String**| Query parameter enum test (string) | [optional] [default to '-efg'] [enum: _abc, -efg, (xyz)] + **enumQueryInteger** | **kotlin.Int**| Query parameter enum test (double) | [optional] [enum: 1, -2] + **enumQueryDouble** | **kotlin.Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] + **enumFormStringArray** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Form parameter enum test (string array) | [optional] [default to '$'] [enum: >, $] + **enumFormString** | **kotlin.String**| Form parameter enum test (string) | [optional] [default to '-efg'] [enum: _abc, -efg, (xyz)] ### Return type @@ -555,12 +555,12 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **requiredStringGroup** | **kotlin.Int**| Required String in group parameters | [default to null] - **requiredBooleanGroup** | **kotlin.Boolean**| Required Boolean in group parameters | [default to null] - **requiredInt64Group** | **kotlin.Long**| Required Integer in group parameters | [default to null] - **stringGroup** | **kotlin.Int**| String in group parameters | [optional] [default to null] - **booleanGroup** | **kotlin.Boolean**| Boolean in group parameters | [optional] [default to null] - **int64Group** | **kotlin.Long**| Integer in group parameters | [optional] [default to null] + **requiredStringGroup** | **kotlin.Int**| Required String in group parameters | + **requiredBooleanGroup** | **kotlin.Boolean**| Required Boolean in group parameters | + **requiredInt64Group** | **kotlin.Long**| Required Integer in group parameters | + **stringGroup** | **kotlin.Int**| String in group parameters | [optional] + **booleanGroup** | **kotlin.Boolean**| Boolean in group parameters | [optional] + **int64Group** | **kotlin.Long**| Integer in group parameters | [optional] ### Return type @@ -649,8 +649,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **param** | **kotlin.String**| field1 | [default to null] - **param2** | **kotlin.String**| field2 | [default to null] + **param** | **kotlin.String**| field1 | + **param2** | **kotlin.String**| field2 | ### Return type diff --git a/samples/openapi3/client/petstore/kotlin/docs/FormatTest.md b/samples/openapi3/client/petstore/kotlin/docs/FormatTest.md index 337ef846e22e..9a339982e00b 100644 --- a/samples/openapi3/client/petstore/kotlin/docs/FormatTest.md +++ b/samples/openapi3/client/petstore/kotlin/docs/FormatTest.md @@ -13,7 +13,7 @@ Name | Type | Description | Notes **string** | **kotlin.String** | | [optional] **byte** | **kotlin.ByteArray** | | **binary** | [**java.io.File**](java.io.File.md) | | [optional] -**date** | [**java.time.LocalDateTime**](java.time.LocalDateTime.md) | | +**date** | [**java.time.LocalDate**](java.time.LocalDate.md) | | **dateTime** | [**java.time.LocalDateTime**](java.time.LocalDateTime.md) | | [optional] **uuid** | [**java.util.UUID**](java.util.UUID.md) | | [optional] **password** | **kotlin.String** | | diff --git a/samples/openapi3/client/petstore/kotlin/docs/InlineObject3.md b/samples/openapi3/client/petstore/kotlin/docs/InlineObject3.md index f9478db66a41..e709b0e1b89a 100644 --- a/samples/openapi3/client/petstore/kotlin/docs/InlineObject3.md +++ b/samples/openapi3/client/petstore/kotlin/docs/InlineObject3.md @@ -14,7 +14,7 @@ Name | Type | Description | Notes **patternWithoutDelimiter** | **kotlin.String** | None | **byte** | **kotlin.ByteArray** | None | **binary** | [**java.io.File**](java.io.File.md) | None | [optional] -**date** | [**java.time.LocalDateTime**](java.time.LocalDateTime.md) | None | [optional] +**date** | [**java.time.LocalDate**](java.time.LocalDate.md) | None | [optional] **dateTime** | [**java.time.LocalDateTime**](java.time.LocalDateTime.md) | None | [optional] **password** | **kotlin.String** | None | [optional] **callback** | **kotlin.String** | None | [optional] diff --git a/samples/openapi3/client/petstore/kotlin/docs/List.md b/samples/openapi3/client/petstore/kotlin/docs/List.md index f426d541a409..13a09a4c4141 100644 --- a/samples/openapi3/client/petstore/kotlin/docs/List.md +++ b/samples/openapi3/client/petstore/kotlin/docs/List.md @@ -4,7 +4,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**`123list`** | **kotlin.String** | | [optional] +**`123minusList`** | **kotlin.String** | | [optional] diff --git a/samples/openapi3/client/petstore/kotlin/docs/NullableClass.md b/samples/openapi3/client/petstore/kotlin/docs/NullableClass.md new file mode 100644 index 000000000000..6b15b13fc9b3 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin/docs/NullableClass.md @@ -0,0 +1,21 @@ + +# NullableClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integerProp** | **kotlin.Int** | | [optional] +**numberProp** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional] +**booleanProp** | **kotlin.Boolean** | | [optional] +**stringProp** | **kotlin.String** | | [optional] +**dateProp** | [**java.time.LocalDate**](java.time.LocalDate.md) | | [optional] +**datetimeProp** | [**java.time.LocalDateTime**](java.time.LocalDateTime.md) | | [optional] +**arrayNullableProp** | [**kotlin.Array<kotlin.Any>**](kotlin.Any.md) | | [optional] +**arrayAndItemsNullableProp** | [**kotlin.Array<kotlin.Any>**](kotlin.Any.md) | | [optional] +**arrayItemsNullable** | [**kotlin.Array<kotlin.Any>**](kotlin.Any.md) | | [optional] +**objectNullableProp** | [**kotlin.collections.Map<kotlin.String, kotlin.Any>**](kotlin.Any.md) | | [optional] +**objectAndItemsNullableProp** | [**kotlin.collections.Map<kotlin.String, kotlin.Any>**](kotlin.Any.md) | | [optional] +**objectItemsNullable** | [**kotlin.collections.Map<kotlin.String, kotlin.Any>**](kotlin.Any.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin/docs/PetApi.md b/samples/openapi3/client/petstore/kotlin/docs/PetApi.md index da2cf27282c5..e578e8ead78f 100644 --- a/samples/openapi3/client/petstore/kotlin/docs/PetApi.md +++ b/samples/openapi3/client/petstore/kotlin/docs/PetApi.md @@ -89,8 +89,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| Pet id to delete | [default to null] - **apiKey** | **kotlin.String**| | [optional] [default to null] + **petId** | **kotlin.Long**| Pet id to delete | + **apiKey** | **kotlin.String**| | [optional] ### Return type @@ -137,7 +137,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **status** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [default to null] [enum: available, pending, sold] + **status** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] ### Return type @@ -184,7 +184,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tags** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Tags to filter by | [default to null] + **tags** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Tags to filter by | ### Return type @@ -231,7 +231,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to return | [default to null] + **petId** | **kotlin.Long**| ID of pet to return | ### Return type @@ -321,9 +321,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet that needs to be updated | [default to null] - **name** | **kotlin.String**| Updated name of the pet | [optional] [default to null] - **status** | **kotlin.String**| Updated status of the pet | [optional] [default to null] + **petId** | **kotlin.Long**| ID of pet that needs to be updated | + **name** | **kotlin.String**| Updated name of the pet | [optional] + **status** | **kotlin.String**| Updated status of the pet | [optional] ### Return type @@ -370,9 +370,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to update | [default to null] - **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] [default to null] - **file** | **java.io.File**| file to upload | [optional] [default to null] + **petId** | **kotlin.Long**| ID of pet to update | + **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] + **file** | **java.io.File**| file to upload | [optional] ### Return type @@ -419,9 +419,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to update | [default to null] - **requiredFile** | **java.io.File**| file to upload | [default to null] - **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] [default to null] + **petId** | **kotlin.Long**| ID of pet to update | + **requiredFile** | **java.io.File**| file to upload | + **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] ### Return type diff --git a/samples/openapi3/client/petstore/kotlin/docs/SpecialModelName.md b/samples/openapi3/client/petstore/kotlin/docs/SpecialModelName.md index 03cfa9b444b8..282649449d96 100644 --- a/samples/openapi3/client/petstore/kotlin/docs/SpecialModelName.md +++ b/samples/openapi3/client/petstore/kotlin/docs/SpecialModelName.md @@ -4,7 +4,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**`$specialPropertyName`** | **kotlin.Long** | | [optional] +**dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket** | **kotlin.Long** | | [optional] diff --git a/samples/openapi3/client/petstore/kotlin/docs/StoreApi.md b/samples/openapi3/client/petstore/kotlin/docs/StoreApi.md index 4735a7dc3dca..30afad846ff8 100644 --- a/samples/openapi3/client/petstore/kotlin/docs/StoreApi.md +++ b/samples/openapi3/client/petstore/kotlin/docs/StoreApi.md @@ -41,7 +41,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.String**| ID of the order that needs to be deleted | [default to null] + **orderId** | **kotlin.String**| ID of the order that needs to be deleted | ### Return type @@ -131,7 +131,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | [default to null] + **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | ### Return type diff --git a/samples/openapi3/client/petstore/kotlin/docs/UserApi.md b/samples/openapi3/client/petstore/kotlin/docs/UserApi.md index 9451997ed630..dbf78e81eb22 100644 --- a/samples/openapi3/client/petstore/kotlin/docs/UserApi.md +++ b/samples/openapi3/client/petstore/kotlin/docs/UserApi.md @@ -89,7 +89,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**kotlin.Array<User>**](kotlin.Array.md)| List of user object | + **user** | [**kotlin.Array<User>**](User.md)| List of user object | ### Return type @@ -133,7 +133,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**kotlin.Array<User>**](kotlin.Array.md)| List of user object | + **user** | [**kotlin.Array<User>**](User.md)| List of user object | ### Return type @@ -179,7 +179,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be deleted | [default to null] + **username** | **kotlin.String**| The name that needs to be deleted | ### Return type @@ -224,7 +224,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | [default to null] + **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | ### Return type @@ -270,8 +270,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The user name for login | [default to null] - **password** | **kotlin.String**| The password for login in clear text | [default to null] + **username** | **kotlin.String**| The user name for login | + **password** | **kotlin.String**| The password for login in clear text | ### Return type @@ -358,7 +358,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| name that need to be deleted | [default to null] + **username** | **kotlin.String**| name that need to be deleted | **user** | [**User**](User.md)| Updated user object | ### Return type diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt index 0b2a7ce3c071..5079cdf61aa6 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,7 +13,17 @@ package org.openapitools.client.apis import org.openapitools.client.models.Client -import org.openapitools.client.infrastructure.* +import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ClientException +import org.openapitools.client.infrastructure.ClientError +import org.openapitools.client.infrastructure.ServerException +import org.openapitools.client.infrastructure.ServerError +import org.openapitools.client.infrastructure.MultiValueMap +import org.openapitools.client.infrastructure.RequestConfig +import org.openapitools.client.infrastructure.RequestMethod +import org.openapitools.client.infrastructure.ResponseType +import org.openapitools.client.infrastructure.Success +import org.openapitools.client.infrastructure.toMultiValue class AnotherFakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : ApiClient(basePath) { @@ -27,7 +37,7 @@ class AnotherFakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2 fun call123testSpecialTags(client: Client) : Client { val localVariableBody: kotlin.Any? = client val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.PATCH, "/another-fake/dummy", @@ -45,7 +55,6 @@ class AnotherFakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2 ResponseType.Redirection -> TODO() ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt index 932f57beca8e..73e12e59ab1b 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,7 +13,17 @@ package org.openapitools.client.apis import org.openapitools.client.models.InlineResponseDefault -import org.openapitools.client.infrastructure.* +import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ClientException +import org.openapitools.client.infrastructure.ClientError +import org.openapitools.client.infrastructure.ServerException +import org.openapitools.client.infrastructure.ServerError +import org.openapitools.client.infrastructure.MultiValueMap +import org.openapitools.client.infrastructure.RequestConfig +import org.openapitools.client.infrastructure.RequestMethod +import org.openapitools.client.infrastructure.ResponseType +import org.openapitools.client.infrastructure.Success +import org.openapitools.client.infrastructure.toMultiValue class DefaultApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : ApiClient(basePath) { @@ -26,7 +36,7 @@ class DefaultApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : fun fooGet() : InlineResponseDefault { val localVariableBody: kotlin.Any? = null val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.GET, "/foo", @@ -44,7 +54,6 @@ class DefaultApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : ResponseType.Redirection -> TODO() ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt index 89785dfbbee4..b493a0282e25 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -17,7 +17,17 @@ import org.openapitools.client.models.HealthCheckResult import org.openapitools.client.models.OuterComposite import org.openapitools.client.models.User -import org.openapitools.client.infrastructure.* +import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ClientException +import org.openapitools.client.infrastructure.ClientError +import org.openapitools.client.infrastructure.ServerException +import org.openapitools.client.infrastructure.ServerError +import org.openapitools.client.infrastructure.MultiValueMap +import org.openapitools.client.infrastructure.RequestConfig +import org.openapitools.client.infrastructure.RequestMethod +import org.openapitools.client.infrastructure.ResponseType +import org.openapitools.client.infrastructure.Success +import org.openapitools.client.infrastructure.toMultiValue class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : ApiClient(basePath) { @@ -30,7 +40,7 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap fun fakeHealthGet() : HealthCheckResult { val localVariableBody: kotlin.Any? = null val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.GET, "/fake/health", @@ -48,7 +58,6 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap ResponseType.Redirection -> TODO() ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -59,10 +68,10 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap * @return kotlin.Boolean */ @Suppress("UNCHECKED_CAST") - fun fakeOuterBooleanSerialize(body: kotlin.Boolean) : kotlin.Boolean { + fun fakeOuterBooleanSerialize(body: kotlin.Boolean?) : kotlin.Boolean { val localVariableBody: kotlin.Any? = body val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.POST, "/fake/outer/boolean", @@ -80,7 +89,6 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap ResponseType.Redirection -> TODO() ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -91,10 +99,10 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap * @return OuterComposite */ @Suppress("UNCHECKED_CAST") - fun fakeOuterCompositeSerialize(outerComposite: OuterComposite) : OuterComposite { + fun fakeOuterCompositeSerialize(outerComposite: OuterComposite?) : OuterComposite { val localVariableBody: kotlin.Any? = outerComposite val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.POST, "/fake/outer/composite", @@ -112,7 +120,6 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap ResponseType.Redirection -> TODO() ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -123,10 +130,10 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap * @return java.math.BigDecimal */ @Suppress("UNCHECKED_CAST") - fun fakeOuterNumberSerialize(body: java.math.BigDecimal) : java.math.BigDecimal { + fun fakeOuterNumberSerialize(body: java.math.BigDecimal?) : java.math.BigDecimal { val localVariableBody: kotlin.Any? = body val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.POST, "/fake/outer/number", @@ -144,7 +151,6 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap ResponseType.Redirection -> TODO() ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -155,10 +161,10 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap * @return kotlin.String */ @Suppress("UNCHECKED_CAST") - fun fakeOuterStringSerialize(body: kotlin.String) : kotlin.String { + fun fakeOuterStringSerialize(body: kotlin.String?) : kotlin.String { val localVariableBody: kotlin.Any? = body val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.POST, "/fake/outer/string", @@ -176,7 +182,6 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap ResponseType.Redirection -> TODO() ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -189,7 +194,7 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap fun testBodyWithFileSchema(fileSchemaTestClass: FileSchemaTestClass) : Unit { val localVariableBody: kotlin.Any? = fileSchemaTestClass val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.PUT, "/fake/body-with-file-schema", @@ -207,7 +212,6 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap ResponseType.Redirection -> TODO() ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -221,7 +225,7 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap fun testBodyWithQueryParams(query: kotlin.String, user: User) : Unit { val localVariableBody: kotlin.Any? = user val localVariableQuery: MultiValueMap = mapOf("query" to listOf("$query")) - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.PUT, "/fake/body-with-query-params", @@ -239,7 +243,6 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap ResponseType.Redirection -> TODO() ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -253,7 +256,7 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap fun testClientModel(client: Client) : Client { val localVariableBody: kotlin.Any? = client val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.PATCH, "/fake", @@ -271,7 +274,6 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap ResponseType.Redirection -> TODO() ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -282,22 +284,22 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap * @param double None * @param patternWithoutDelimiter None * @param byte None - * @param integer None (optional, default to null) - * @param int32 None (optional, default to null) - * @param int64 None (optional, default to null) - * @param float None (optional, default to null) - * @param string None (optional, default to null) - * @param binary None (optional, default to null) - * @param date None (optional, default to null) - * @param dateTime None (optional, default to null) - * @param password None (optional, default to null) - * @param paramCallback None (optional, default to null) + * @param integer None (optional) + * @param int32 None (optional) + * @param int64 None (optional) + * @param float None (optional) + * @param string None (optional) + * @param binary None (optional) + * @param date None (optional) + * @param dateTime None (optional) + * @param password None (optional) + * @param paramCallback None (optional) * @return void */ - fun testEndpointParameters(number: java.math.BigDecimal, double: kotlin.Double, patternWithoutDelimiter: kotlin.String, byte: kotlin.ByteArray, integer: kotlin.Int, int32: kotlin.Int, int64: kotlin.Long, float: kotlin.Float, string: kotlin.String, binary: java.io.File, date: java.time.LocalDateTime, dateTime: java.time.LocalDateTime, password: kotlin.String, paramCallback: kotlin.String) : Unit { + fun testEndpointParameters(number: java.math.BigDecimal, double: kotlin.Double, patternWithoutDelimiter: kotlin.String, byte: kotlin.ByteArray, integer: kotlin.Int?, int32: kotlin.Int?, int64: kotlin.Long?, float: kotlin.Float?, string: kotlin.String?, binary: java.io.File?, date: java.time.LocalDate?, dateTime: java.time.LocalDateTime?, password: kotlin.String?, paramCallback: kotlin.String?) : Unit { val localVariableBody: kotlin.Any? = mapOf("integer" to "$integer", "int32" to "$int32", "int64" to "$int64", "number" to "$number", "float" to "$float", "double" to "$double", "string" to "$string", "pattern_without_delimiter" to "$patternWithoutDelimiter", "byte" to "$byte", "binary" to "$binary", "date" to "$date", "dateTime" to "$dateTime", "password" to "$password", "callback" to "$paramCallback") val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf("Content-Type" to "multipart/form-data") + val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "") val localVariableConfig = RequestConfig( RequestMethod.POST, "/fake", @@ -315,27 +317,26 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap ResponseType.Redirection -> TODO() ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } /** * To test enum parameters * To test enum parameters - * @param enumHeaderStringArray Header parameter enum test (string array) (optional, default to null) - * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) - * @param enumQueryStringArray Query parameter enum test (string array) (optional, default to null) - * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) - * @param enumQueryInteger Query parameter enum test (double) (optional, default to null) - * @param enumQueryDouble Query parameter enum test (double) (optional, default to null) - * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) - * @param enumFormString Form parameter enum test (string) (optional, default to -efg) + * @param enumHeaderStringArray Header parameter enum test (string array) (optional) + * @param enumHeaderString Header parameter enum test (string) (optional, default to '-efg') + * @param enumQueryStringArray Query parameter enum test (string array) (optional) + * @param enumQueryString Query parameter enum test (string) (optional, default to '-efg') + * @param enumQueryInteger Query parameter enum test (double) (optional) + * @param enumQueryDouble Query parameter enum test (double) (optional) + * @param enumFormStringArray Form parameter enum test (string array) (optional, default to '$') + * @param enumFormString Form parameter enum test (string) (optional, default to '-efg') * @return void */ - fun testEnumParameters(enumHeaderStringArray: kotlin.Array, enumHeaderString: kotlin.String, enumQueryStringArray: kotlin.Array, enumQueryString: kotlin.String, enumQueryInteger: kotlin.Int, enumQueryDouble: kotlin.Double, enumFormStringArray: kotlin.Array, enumFormString: kotlin.String) : Unit { + fun testEnumParameters(enumHeaderStringArray: kotlin.Array?, enumHeaderString: kotlin.String?, enumQueryStringArray: kotlin.Array?, enumQueryString: kotlin.String?, enumQueryInteger: kotlin.Int?, enumQueryDouble: kotlin.Double?, enumFormStringArray: kotlin.Array?, enumFormString: kotlin.String?) : Unit { val localVariableBody: kotlin.Any? = mapOf("enum_form_string_array" to "$enumFormStringArray", "enum_form_string" to "$enumFormString") - val localVariableQuery: MultiValueMap = mapOf("enum_query_string_array" to toMultiValue(enumQueryStringArray.toList(), "multi"), "enum_query_string" to listOf("$enumQueryString"), "enum_query_integer" to listOf("$enumQueryInteger"), "enum_query_double" to listOf("$enumQueryDouble")) - val localVariableHeaders: kotlin.collections.Map = mapOf("Content-Type" to "multipart/form-data", "enum_header_string_array" to enumHeaderStringArray.joinToString(separator = collectionDelimiter("csv")), "enum_header_string" to enumHeaderString.toString()) + val localVariableQuery: MultiValueMap = mapOf("enumQueryStringArray" to toMultiValue(enumQueryStringArray.toList(), "multi"), "enumQueryString" to listOf("$enumQueryString"), "enumQueryInteger" to listOf("$enumQueryInteger"), "enumQueryDouble" to listOf("$enumQueryDouble")) + val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "", "enum_header_string_array" to enumHeaderStringArray.joinToString(separator = collectionDelimiter("csv")), "enum_header_string" to enumHeaderString.toString()) val localVariableConfig = RequestConfig( RequestMethod.GET, "/fake", @@ -353,7 +354,6 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap ResponseType.Redirection -> TODO() ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -363,15 +363,15 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap * @param requiredStringGroup Required String in group parameters * @param requiredBooleanGroup Required Boolean in group parameters * @param requiredInt64Group Required Integer in group parameters - * @param stringGroup String in group parameters (optional, default to null) - * @param booleanGroup Boolean in group parameters (optional, default to null) - * @param int64Group Integer in group parameters (optional, default to null) + * @param stringGroup String in group parameters (optional) + * @param booleanGroup Boolean in group parameters (optional) + * @param int64Group Integer in group parameters (optional) * @return void */ - fun testGroupParameters(requiredStringGroup: kotlin.Int, requiredBooleanGroup: kotlin.Boolean, requiredInt64Group: kotlin.Long, stringGroup: kotlin.Int, booleanGroup: kotlin.Boolean, int64Group: kotlin.Long) : Unit { + fun testGroupParameters(requiredStringGroup: kotlin.Int, requiredBooleanGroup: kotlin.Boolean, requiredInt64Group: kotlin.Long, stringGroup: kotlin.Int?, booleanGroup: kotlin.Boolean?, int64Group: kotlin.Long?) : Unit { val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mapOf("required_string_group" to listOf("$requiredStringGroup"), "required_int64_group" to listOf("$requiredInt64Group"), "string_group" to listOf("$stringGroup"), "int64_group" to listOf("$int64Group")) - val localVariableHeaders: kotlin.collections.Map = mapOf("required_boolean_group" to requiredBooleanGroup.toString(), "boolean_group" to booleanGroup.toString()) + val localVariableQuery: MultiValueMap = mapOf("requiredStringGroup" to listOf("$requiredStringGroup"), "requiredInt64Group" to listOf("$requiredInt64Group"), "stringGroup" to listOf("$stringGroup"), "int64Group" to listOf("$int64Group")) + val localVariableHeaders: MutableMap = mutableMapOf("required_boolean_group" to requiredBooleanGroup.toString(), "boolean_group" to booleanGroup.toString()) val localVariableConfig = RequestConfig( RequestMethod.DELETE, "/fake", @@ -389,7 +389,6 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap ResponseType.Redirection -> TODO() ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -402,7 +401,7 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap fun testInlineAdditionalProperties(requestBody: kotlin.collections.Map) : Unit { val localVariableBody: kotlin.Any? = requestBody val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.POST, "/fake/inline-additionalProperties", @@ -420,7 +419,6 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap ResponseType.Redirection -> TODO() ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -434,7 +432,7 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap fun testJsonFormData(param: kotlin.String, param2: kotlin.String) : Unit { val localVariableBody: kotlin.Any? = mapOf("param" to "$param", "param2" to "$param2") val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf("Content-Type" to "multipart/form-data") + val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "") val localVariableConfig = RequestConfig( RequestMethod.GET, "/fake/jsonFormData", @@ -452,7 +450,6 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap ResponseType.Redirection -> TODO() ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt index f2cdcae77dfc..3d5e0162ee7f 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,7 +13,17 @@ package org.openapitools.client.apis import org.openapitools.client.models.Client -import org.openapitools.client.infrastructure.* +import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ClientException +import org.openapitools.client.infrastructure.ClientError +import org.openapitools.client.infrastructure.ServerException +import org.openapitools.client.infrastructure.ServerError +import org.openapitools.client.infrastructure.MultiValueMap +import org.openapitools.client.infrastructure.RequestConfig +import org.openapitools.client.infrastructure.RequestMethod +import org.openapitools.client.infrastructure.ResponseType +import org.openapitools.client.infrastructure.Success +import org.openapitools.client.infrastructure.toMultiValue class FakeClassnameTags123Api(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : ApiClient(basePath) { @@ -27,7 +37,7 @@ class FakeClassnameTags123Api(basePath: kotlin.String = "http://petstore.swagger fun testClassname(client: Client) : Client { val localVariableBody: kotlin.Any? = client val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.PATCH, "/fake_classname_test", @@ -45,7 +55,6 @@ class FakeClassnameTags123Api(basePath: kotlin.String = "http://petstore.swagger ResponseType.Redirection -> TODO() ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 129807a602fa..1652bcba5d5c 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -14,7 +14,17 @@ package org.openapitools.client.apis import org.openapitools.client.models.ApiResponse import org.openapitools.client.models.Pet -import org.openapitools.client.infrastructure.* +import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ClientException +import org.openapitools.client.infrastructure.ClientError +import org.openapitools.client.infrastructure.ServerException +import org.openapitools.client.infrastructure.ServerError +import org.openapitools.client.infrastructure.MultiValueMap +import org.openapitools.client.infrastructure.RequestConfig +import org.openapitools.client.infrastructure.RequestMethod +import org.openapitools.client.infrastructure.ResponseType +import org.openapitools.client.infrastructure.Success +import org.openapitools.client.infrastructure.toMultiValue class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : ApiClient(basePath) { @@ -27,7 +37,7 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api fun addPet(pet: Pet) : Unit { val localVariableBody: kotlin.Any? = pet val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.POST, "/pet", @@ -45,7 +55,6 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api ResponseType.Redirection -> TODO() ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -53,13 +62,13 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api * Deletes a pet * * @param petId Pet id to delete - * @param apiKey (optional, default to null) + * @param apiKey (optional) * @return void */ - fun deletePet(petId: kotlin.Long, apiKey: kotlin.String) : Unit { + fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { val localVariableBody: kotlin.Any? = null val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf("api_key" to apiKey.toString()) + val localVariableHeaders: MutableMap = mutableMapOf("api_key" to apiKey.toString()) val localVariableConfig = RequestConfig( RequestMethod.DELETE, "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), @@ -77,7 +86,6 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api ResponseType.Redirection -> TODO() ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -91,7 +99,7 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api fun findPetsByStatus(status: kotlin.Array) : kotlin.Array { val localVariableBody: kotlin.Any? = null val localVariableQuery: MultiValueMap = mapOf("status" to toMultiValue(status.toList(), "csv")) - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.GET, "/pet/findByStatus", @@ -109,7 +117,6 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api ResponseType.Redirection -> TODO() ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -123,7 +130,7 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api fun findPetsByTags(tags: kotlin.Array) : kotlin.Array { val localVariableBody: kotlin.Any? = null val localVariableQuery: MultiValueMap = mapOf("tags" to toMultiValue(tags.toList(), "csv")) - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.GET, "/pet/findByTags", @@ -141,7 +148,6 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api ResponseType.Redirection -> TODO() ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -155,7 +161,7 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api fun getPetById(petId: kotlin.Long) : Pet { val localVariableBody: kotlin.Any? = null val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.GET, "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), @@ -173,7 +179,6 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api ResponseType.Redirection -> TODO() ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -186,7 +191,7 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api fun updatePet(pet: Pet) : Unit { val localVariableBody: kotlin.Any? = pet val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.PUT, "/pet", @@ -204,7 +209,6 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api ResponseType.Redirection -> TODO() ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -212,14 +216,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api * Updates a pet in the store with form data * * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet (optional, default to null) - * @param status Updated status of the pet (optional, default to null) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) * @return void */ - fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String, status: kotlin.String) : Unit { + fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { val localVariableBody: kotlin.Any? = mapOf("name" to "$name", "status" to "$status") val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf("Content-Type" to "multipart/form-data") + val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "") val localVariableConfig = RequestConfig( RequestMethod.POST, "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), @@ -237,7 +241,6 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api ResponseType.Redirection -> TODO() ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -245,15 +248,15 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api * uploads an image * * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server (optional, default to null) - * @param file file to upload (optional, default to null) + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) * @return ApiResponse */ @Suppress("UNCHECKED_CAST") - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String, file: java.io.File) : ApiResponse { + fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { val localVariableBody: kotlin.Any? = mapOf("additionalMetadata" to "$additionalMetadata", "file" to "$file") val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf("Content-Type" to "multipart/form-data") + val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "") val localVariableConfig = RequestConfig( RequestMethod.POST, "/pet/{petId}/uploadImage".replace("{"+"petId"+"}", "$petId"), @@ -271,7 +274,6 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api ResponseType.Redirection -> TODO() ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -280,14 +282,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api * * @param petId ID of pet to update * @param requiredFile file to upload - * @param additionalMetadata Additional data to pass to server (optional, default to null) + * @param additionalMetadata Additional data to pass to server (optional) * @return ApiResponse */ @Suppress("UNCHECKED_CAST") - fun uploadFileWithRequiredFile(petId: kotlin.Long, requiredFile: java.io.File, additionalMetadata: kotlin.String) : ApiResponse { + fun uploadFileWithRequiredFile(petId: kotlin.Long, requiredFile: java.io.File, additionalMetadata: kotlin.String?) : ApiResponse { val localVariableBody: kotlin.Any? = mapOf("additionalMetadata" to "$additionalMetadata", "requiredFile" to "$requiredFile") val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf("Content-Type" to "multipart/form-data") + val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "") val localVariableConfig = RequestConfig( RequestMethod.POST, "/fake/{petId}/uploadImageWithRequiredFile".replace("{"+"petId"+"}", "$petId"), @@ -305,7 +307,6 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api ResponseType.Redirection -> TODO() ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index cee8ac6865a7..59d3822c0bab 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,7 +13,17 @@ package org.openapitools.client.apis import org.openapitools.client.models.Order -import org.openapitools.client.infrastructure.* +import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ClientException +import org.openapitools.client.infrastructure.ClientError +import org.openapitools.client.infrastructure.ServerException +import org.openapitools.client.infrastructure.ServerError +import org.openapitools.client.infrastructure.MultiValueMap +import org.openapitools.client.infrastructure.RequestConfig +import org.openapitools.client.infrastructure.RequestMethod +import org.openapitools.client.infrastructure.ResponseType +import org.openapitools.client.infrastructure.Success +import org.openapitools.client.infrastructure.toMultiValue class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : ApiClient(basePath) { @@ -26,7 +36,7 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : A fun deleteOrder(orderId: kotlin.String) : Unit { val localVariableBody: kotlin.Any? = null val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.DELETE, "/store/order/{order_id}".replace("{"+"order_id"+"}", "$orderId"), @@ -44,7 +54,6 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : A ResponseType.Redirection -> TODO() ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -57,7 +66,7 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : A fun getInventory() : kotlin.collections.Map { val localVariableBody: kotlin.Any? = null val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.GET, "/store/inventory", @@ -75,7 +84,6 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : A ResponseType.Redirection -> TODO() ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -89,7 +97,7 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : A fun getOrderById(orderId: kotlin.Long) : Order { val localVariableBody: kotlin.Any? = null val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.GET, "/store/order/{order_id}".replace("{"+"order_id"+"}", "$orderId"), @@ -107,7 +115,6 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : A ResponseType.Redirection -> TODO() ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -121,7 +128,7 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : A fun placeOrder(order: Order) : Order { val localVariableBody: kotlin.Any? = order val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.POST, "/store/order", @@ -139,7 +146,6 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : A ResponseType.Redirection -> TODO() ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index ef9fd3880f9b..471513225886 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,7 +13,17 @@ package org.openapitools.client.apis import org.openapitools.client.models.User -import org.openapitools.client.infrastructure.* +import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ClientException +import org.openapitools.client.infrastructure.ClientError +import org.openapitools.client.infrastructure.ServerException +import org.openapitools.client.infrastructure.ServerError +import org.openapitools.client.infrastructure.MultiValueMap +import org.openapitools.client.infrastructure.RequestConfig +import org.openapitools.client.infrastructure.RequestMethod +import org.openapitools.client.infrastructure.ResponseType +import org.openapitools.client.infrastructure.Success +import org.openapitools.client.infrastructure.toMultiValue class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : ApiClient(basePath) { @@ -26,7 +36,7 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap fun createUser(user: User) : Unit { val localVariableBody: kotlin.Any? = user val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.POST, "/user", @@ -44,7 +54,6 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap ResponseType.Redirection -> TODO() ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -57,7 +66,7 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap fun createUsersWithArrayInput(user: kotlin.Array) : Unit { val localVariableBody: kotlin.Any? = user val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.POST, "/user/createWithArray", @@ -75,7 +84,6 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap ResponseType.Redirection -> TODO() ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -88,7 +96,7 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap fun createUsersWithListInput(user: kotlin.Array) : Unit { val localVariableBody: kotlin.Any? = user val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.POST, "/user/createWithList", @@ -106,7 +114,6 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap ResponseType.Redirection -> TODO() ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -119,7 +126,7 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap fun deleteUser(username: kotlin.String) : Unit { val localVariableBody: kotlin.Any? = null val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.DELETE, "/user/{username}".replace("{"+"username"+"}", "$username"), @@ -137,7 +144,6 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap ResponseType.Redirection -> TODO() ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -151,7 +157,7 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap fun getUserByName(username: kotlin.String) : User { val localVariableBody: kotlin.Any? = null val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.GET, "/user/{username}".replace("{"+"username"+"}", "$username"), @@ -169,7 +175,6 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap ResponseType.Redirection -> TODO() ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -184,7 +189,7 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { val localVariableBody: kotlin.Any? = null val localVariableQuery: MultiValueMap = mapOf("username" to listOf("$username"), "password" to listOf("$password")) - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.GET, "/user/login", @@ -202,7 +207,6 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap ResponseType.Redirection -> TODO() ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -214,7 +218,7 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap fun logoutUser() : Unit { val localVariableBody: kotlin.Any? = null val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.GET, "/user/logout", @@ -232,7 +236,6 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap ResponseType.Redirection -> TODO() ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } @@ -246,7 +249,7 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap fun updateUser(username: kotlin.String, user: User) : Unit { val localVariableBody: kotlin.Any? = user val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() + val localVariableHeaders: MutableMap = mutableMapOf() val localVariableConfig = RequestConfig( RequestMethod.PUT, "/user/{username}".replace("{"+"username"+"}", "$username"), @@ -264,7 +267,6 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap ResponseType.Redirection -> TODO() ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") } } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 9e79028a90b1..c9107fcb0857 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -1,11 +1,13 @@ package org.openapitools.client.infrastructure -import com.squareup.moshi.FromJson -import com.squareup.moshi.Moshi -import com.squareup.moshi.ToJson -import okhttp3.* +import okhttp3.OkHttpClient +import okhttp3.RequestBody +import okhttp3.MediaType +import okhttp3.FormBody +import okhttp3.HttpUrl +import okhttp3.ResponseBody +import okhttp3.Request import java.io.File -import java.util.* open class ApiClient(val baseUrl: String) { companion object { @@ -13,74 +15,75 @@ open class ApiClient(val baseUrl: String) { protected const val Accept = "Accept" protected const val JsonMediaType = "application/json" protected const val FormDataMediaType = "multipart/form-data" + protected const val FormUrlEncMediaType = "application/x-www-form-urlencoded" protected const val XmlMediaType = "application/xml" @JvmStatic - val client by lazy { + val client: OkHttpClient by lazy { builder.build() } @JvmStatic val builder: OkHttpClient.Builder = OkHttpClient.Builder() - - @JvmStatic - var defaultHeaders: Map by ApplicationDelegates.setOnce(mapOf(ContentType to JsonMediaType, Accept to JsonMediaType)) - - @JvmStatic - val jsonHeaders: Map = mapOf(ContentType to JsonMediaType, Accept to JsonMediaType) } protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = - when { - content is File -> RequestBody.create( - MediaType.parse(mediaType), content - ) - mediaType == FormDataMediaType -> { - var builder = FormBody.Builder() - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { key, value -> - builder = builder.add(key, value) - } - builder.build() - } - mediaType == JsonMediaType -> RequestBody.create( - MediaType.parse(mediaType), Serializer.moshi.adapter(T::class.java).toJson(content) - ) - mediaType == XmlMediaType -> TODO("xml not currently supported.") - // TODO: this should be extended with other serializers - else -> TODO("requestBody currently only supports JSON body and File body.") - } + when { + content is File -> RequestBody.create( + MediaType.parse(mediaType), content + ) + mediaType == FormDataMediaType || mediaType == FormUrlEncMediaType -> { + FormBody.Builder().apply { + // content's type *must* be Map + @Suppress("UNCHECKED_CAST") + (content as Map).forEach { (key, value) -> + add(key, value) + } + }.build() + } + mediaType == JsonMediaType -> RequestBody.create( + MediaType.parse(mediaType), Serializer.moshi.adapter(T::class.java).toJson(content) + ) + mediaType == XmlMediaType -> TODO("xml not currently supported.") + // TODO: this should be extended with other serializers + else -> TODO("requestBody currently only supports JSON body and File body.") + } - protected inline fun responseBody(body: ResponseBody?, mediaType: String = JsonMediaType): T? { - if(body == null) return null + protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { + if(body == null) { + return null + } + val bodyContent = body.string() + if (bodyContent.isEmpty()) { + return null + } return when(mediaType) { - JsonMediaType -> Moshi.Builder().add(object { - @ToJson - fun toJson(uuid: UUID) = uuid.toString() - @FromJson - fun fromJson(s: String) = UUID.fromString(s) - }) - .add(ByteArrayAdapter()) - .build().adapter(T::class.java).fromJson(body.source()) - else -> TODO() + JsonMediaType -> Serializer.moshi.adapter(T::class.java).fromJson(bodyContent) + else -> TODO("responseBody currently only supports JSON body.") } } protected inline fun request(requestConfig: RequestConfig, body : Any? = null): ApiInfrastructureResponse { val httpUrl = HttpUrl.parse(baseUrl) ?: throw IllegalStateException("baseUrl is invalid.") - var urlBuilder = httpUrl.newBuilder() - .addPathSegments(requestConfig.path.trimStart('/')) - - requestConfig.query.forEach { query -> - query.value.forEach { queryValue -> - urlBuilder = urlBuilder.addQueryParameter(query.key, queryValue) - } + val url = httpUrl.newBuilder() + .addPathSegments(requestConfig.path.trimStart('/')) + .apply { + requestConfig.query.forEach { query -> + query.value.forEach { queryValue -> + addQueryParameter(query.key, queryValue) + } + } + }.build() + + // take content-type/accept from spec or set to default (application/json) if not defined + if (requestConfig.headers[ContentType].isNullOrEmpty()) { + requestConfig.headers[ContentType] = JsonMediaType } - - val url = urlBuilder.build() - val headers = requestConfig.headers + defaultHeaders + if (requestConfig.headers[Accept].isNullOrEmpty()) { + requestConfig.headers[Accept] = JsonMediaType + } + val headers = requestConfig.headers if(headers[ContentType] ?: "" == "") { throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") @@ -90,11 +93,10 @@ open class ApiClient(val baseUrl: String) { throw kotlin.IllegalStateException("Missing Accept header. This is required.") } - // TODO: support multiple contentType,accept options here. + // TODO: support multiple contentType options here. val contentType = (headers[ContentType] as String).substringBefore(";").toLowerCase() - val accept = (headers[Accept] as String).substringBefore(";").toLowerCase() - var request : Request.Builder = when (requestConfig.method) { + val request = when (requestConfig.method) { RequestMethod.DELETE -> Request.Builder().url(url).delete() RequestMethod.GET -> Request.Builder().url(url) RequestMethod.HEAD -> Request.Builder().url(url).head() @@ -102,12 +104,12 @@ open class ApiClient(val baseUrl: String) { RequestMethod.PUT -> Request.Builder().url(url).put(requestBody(body, contentType)) RequestMethod.POST -> Request.Builder().url(url).post(requestBody(body, contentType)) RequestMethod.OPTIONS -> Request.Builder().url(url).method("OPTIONS", null) - } - - headers.forEach { header -> request = request.addHeader(header.key, header.value) } + }.apply { + headers.forEach { header -> addHeader(header.key, header.value) } + }.build() - val realRequest = request.build() - val response = client.newCall(realRequest).execute() + val response = client.newCall(request).execute() + val accept = response.header(ContentType)?.substringBefore(";")?.toLowerCase() // TODO: handle specific mapping types. e.g. Map> when { @@ -138,4 +140,4 @@ open class ApiClient(val baseUrl: String) { ) } } -} \ No newline at end of file +} diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt new file mode 100644 index 000000000000..b2e1654479a0 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt @@ -0,0 +1,19 @@ +package org.openapitools.client.infrastructure + +import com.squareup.moshi.FromJson +import com.squareup.moshi.ToJson +import java.time.LocalDate +import java.time.format.DateTimeFormatter + +class LocalDateAdapter { + @ToJson + fun toJson(value: LocalDate): String { + return DateTimeFormatter.ISO_LOCAL_DATE.format(value) + } + + @FromJson + fun fromJson(value: String): LocalDate { + return LocalDate.parse(value, DateTimeFormatter.ISO_LOCAL_DATE) + } + +} diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt new file mode 100644 index 000000000000..e082db94811d --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt @@ -0,0 +1,19 @@ +package org.openapitools.client.infrastructure + +import com.squareup.moshi.FromJson +import com.squareup.moshi.ToJson +import java.time.LocalDateTime +import java.time.format.DateTimeFormatter + +class LocalDateTimeAdapter { + @ToJson + fun toJson(value: LocalDateTime): String { + return DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(value) + } + + @FromJson + fun fromJson(value: String): LocalDateTime { + return LocalDateTime.parse(value, DateTimeFormatter.ISO_LOCAL_DATE_TIME) + } + +} diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt index 86e2dadf9a81..53e689237d71 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt @@ -11,6 +11,6 @@ package org.openapitools.client.infrastructure data class RequestConfig( val method: RequestMethod, val path: String, - val headers: Map = mapOf(), + val headers: MutableMap = mutableMapOf(), val query: Map> = mapOf() ) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt index cf3fe8203d5b..7c5a353e0f7f 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt @@ -1,14 +1,18 @@ package org.openapitools.client.infrastructure -import com.squareup.moshi.KotlinJsonAdapterFactory import com.squareup.moshi.Moshi -import com.squareup.moshi.Rfc3339DateJsonAdapter -import java.util.* +import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter +import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory +import java.util.Date object Serializer { @JvmStatic val moshi: Moshi = Moshi.Builder() - .add(KotlinJsonAdapterFactory()) .add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe()) + .add(LocalDateTimeAdapter()) + .add(LocalDateAdapter()) + .add(UUIDAdapter()) + .add(ByteArrayAdapter()) + .add(KotlinJsonAdapterFactory()) .build() } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt new file mode 100644 index 000000000000..a4a44cc18b73 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt @@ -0,0 +1,13 @@ +package org.openapitools.client.infrastructure + +import com.squareup.moshi.FromJson +import com.squareup.moshi.ToJson +import java.util.UUID + +class UUIDAdapter { + @ToJson + fun toJson(uuid: UUID) = uuid.toString() + + @FromJson + fun fromJson(s: String) = UUID.fromString(s) +} diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt index f5baace226b2..ad9d5f84c576 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,13 +12,16 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * * @param mapProperty * @param mapOfMapProperty */ data class AdditionalPropertiesClass ( + @Json(name = "map_property") val mapProperty: kotlin.collections.Map? = null, + @Json(name = "map_of_map_property") val mapOfMapProperty: kotlin.collections.Map>? = null ) { diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Animal.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Animal.kt index 7b24a5575cc3..655306a7e897 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Animal.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Animal.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,13 +12,16 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * * @param className * @param color */ data class Animal ( + @Json(name = "className") val className: kotlin.String, + @Json(name = "color") val color: kotlin.String? = null ) { diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt index e63d35308de4..f79e529c2fc1 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,6 +12,7 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * * @param code @@ -19,8 +20,11 @@ package org.openapitools.client.models * @param message */ data class ApiResponse ( + @Json(name = "code") val code: kotlin.Int? = null, + @Json(name = "type") val type: kotlin.String? = null, + @Json(name = "message") val message: kotlin.String? = null ) { diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt index eeaf6870d43d..3be01f40411f 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,11 +12,13 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * * @param arrayArrayNumber */ data class ArrayOfArrayOfNumberOnly ( + @Json(name = "ArrayArrayNumber") val arrayArrayNumber: kotlin.Array>? = null ) { diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt index a936cbfb37aa..d4d24cd34edb 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,11 +12,13 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * * @param arrayNumber */ data class ArrayOfNumberOnly ( + @Json(name = "ArrayNumber") val arrayNumber: kotlin.Array? = null ) { diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayTest.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayTest.kt index 4f3ac37d99b3..51fd93eec0e9 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayTest.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayTest.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,6 +13,7 @@ package org.openapitools.client.models import org.openapitools.client.models.ReadOnlyFirst +import com.squareup.moshi.Json /** * * @param arrayOfString @@ -20,8 +21,11 @@ import org.openapitools.client.models.ReadOnlyFirst * @param arrayArrayOfModel */ data class ArrayTest ( + @Json(name = "array_of_string") val arrayOfString: kotlin.Array? = null, + @Json(name = "array_array_of_integer") val arrayArrayOfInteger: kotlin.Array>? = null, + @Json(name = "array_array_of_model") val arrayArrayOfModel: kotlin.Array>? = null ) { diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Capitalization.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Capitalization.kt index 2d4717e2f83b..ec12c128324d 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Capitalization.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Capitalization.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,6 +12,7 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * * @param smallCamel @@ -22,12 +23,18 @@ package org.openapitools.client.models * @param ATT_NAME Name of the pet */ data class Capitalization ( + @Json(name = "smallCamel") val smallCamel: kotlin.String? = null, + @Json(name = "CapitalCamel") val capitalCamel: kotlin.String? = null, + @Json(name = "small_Snake") val smallSnake: kotlin.String? = null, + @Json(name = "Capital_Snake") val capitalSnake: kotlin.String? = null, + @Json(name = "SCA_ETH_Flow_Points") val scAETHFlowPoints: kotlin.String? = null, /* Name of the pet */ + @Json(name = "ATT_NAME") val ATT_NAME: kotlin.String? = null ) { diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Cat.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Cat.kt index 92d95e6ac522..f7fc445d9efe 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Cat.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Cat.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,14 +12,19 @@ package org.openapitools.client.models import org.openapitools.client.models.Animal +import org.openapitools.client.models.CatAllOf +import com.squareup.moshi.Json /** * * @param declawed */ data class Cat ( + @Json(name = "className") val className: kotlin.String, + @Json(name = "declawed") val declawed: kotlin.Boolean? = null, + @Json(name = "color") val color: kotlin.String? = null ) { diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/CatAllOf.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/CatAllOf.kt new file mode 100644 index 000000000000..c20830cfc990 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/CatAllOf.kt @@ -0,0 +1,26 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.squareup.moshi.Json +/** + * + * @param declawed + */ +data class CatAllOf ( + @Json(name = "declawed") + val declawed: kotlin.Boolean? = null +) { + +} + diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt index 1d8c9699b5dd..637d8f39fdb9 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,13 +12,16 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * * @param id * @param name */ data class Category ( + @Json(name = "name") val name: kotlin.String, + @Json(name = "id") val id: kotlin.Long? = null ) { diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ClassModel.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ClassModel.kt index 556f5db0ee26..92425fba5640 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ClassModel.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ClassModel.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,11 +12,13 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * Model for testing model with \"_class\" property * @param propertyClass */ data class ClassModel ( + @Json(name = "_class") val propertyClass: kotlin.String? = null ) { diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Client.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Client.kt index dca68a1d2908..656eff708d20 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Client.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Client.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,11 +12,13 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * * @param client */ data class Client ( + @Json(name = "client") val client: kotlin.String? = null ) { diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Dog.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Dog.kt index 6da240f947e9..6f194f25a802 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Dog.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Dog.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,14 +12,19 @@ package org.openapitools.client.models import org.openapitools.client.models.Animal +import org.openapitools.client.models.DogAllOf +import com.squareup.moshi.Json /** * * @param breed */ data class Dog ( + @Json(name = "className") val className: kotlin.String, + @Json(name = "breed") val breed: kotlin.String? = null, + @Json(name = "color") val color: kotlin.String? = null ) { diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/DogAllOf.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/DogAllOf.kt new file mode 100644 index 000000000000..fab37948f8cc --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/DogAllOf.kt @@ -0,0 +1,26 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.squareup.moshi.Json +/** + * + * @param breed + */ +data class DogAllOf ( + @Json(name = "breed") + val breed: kotlin.String? = null +) { + +} + diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumArrays.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumArrays.kt index ee1d36cee63d..d791eb136eb8 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumArrays.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumArrays.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -19,7 +19,9 @@ import com.squareup.moshi.Json * @param arrayEnum */ data class EnumArrays ( + @Json(name = "just_symbol") val justSymbol: EnumArrays.JustSymbol? = null, + @Json(name = "array_enum") val arrayEnum: EnumArrays.ArrayEnum? = null ) { @@ -29,9 +31,11 @@ data class EnumArrays ( */ enum class JustSymbol(val value: kotlin.String){ - @Json(name = ">=") greaterThanEqual(">="), + @Json(name = ">=") + greaterThanEqual(">="), - @Json(name = "$") dollar("$"); + @Json(name = "$") + dollar("$"); } @@ -41,9 +45,11 @@ data class EnumArrays ( */ enum class ArrayEnum(val value: kotlin.Array<kotlin.String>){ - @Json(name = "fish") fish("fish"), + @Json(name = "fish") + fish("fish"), - @Json(name = "crab") crab("crab"); + @Json(name = "crab") + crab("crab"); } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumClass.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumClass.kt index 64030e0d5391..089f8037e31f 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumClass.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumClass.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,11 +20,14 @@ import com.squareup.moshi.Json */ enum class EnumClass(val value: kotlin.String){ - @Json(name = "_abc") abc("_abc"), + @Json(name = "_abc") + abc("_abc"), - @Json(name = "-efg") minusEfg("-efg"), + @Json(name = "-efg") + minusEfg("-efg"), - @Json(name = "(xyz)") leftParenthesisXyzRightParenthesis("(xyz)"); + @Json(name = "(xyz)") + leftParenthesisXyzRightParenthesis("(xyz)"); } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumTest.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumTest.kt index a124fce06693..59cd40f659e4 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumTest.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumTest.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -29,13 +29,21 @@ import com.squareup.moshi.Json * @param outerEnumIntegerDefaultValue */ data class EnumTest ( + @Json(name = "enum_string_required") val enumStringRequired: EnumTest.EnumStringRequired, + @Json(name = "enum_string") val enumString: EnumTest.EnumString? = null, + @Json(name = "enum_integer") val enumInteger: EnumTest.EnumInteger? = null, + @Json(name = "enum_number") val enumNumber: EnumTest.EnumNumber? = null, + @Json(name = "outerEnum") val outerEnum: OuterEnum? = null, + @Json(name = "outerEnumInteger") val outerEnumInteger: OuterEnumInteger? = null, + @Json(name = "outerEnumDefaultValue") val outerEnumDefaultValue: OuterEnumDefaultValue? = null, + @Json(name = "outerEnumIntegerDefaultValue") val outerEnumIntegerDefaultValue: OuterEnumIntegerDefaultValue? = null ) { @@ -45,11 +53,14 @@ data class EnumTest ( */ enum class EnumString(val value: kotlin.String){ - @Json(name = "UPPER") uPPER("UPPER"), + @Json(name = "UPPER") + uPPER("UPPER"), - @Json(name = "lower") lower("lower"), + @Json(name = "lower") + lower("lower"), - @Json(name = "") eMPTY(""); + @Json(name = "") + eMPTY(""); } @@ -59,11 +70,14 @@ data class EnumTest ( */ enum class EnumStringRequired(val value: kotlin.String){ - @Json(name = "UPPER") uPPER("UPPER"), + @Json(name = "UPPER") + uPPER("UPPER"), - @Json(name = "lower") lower("lower"), + @Json(name = "lower") + lower("lower"), - @Json(name = "") eMPTY(""); + @Json(name = "") + eMPTY(""); } @@ -73,9 +87,11 @@ data class EnumTest ( */ enum class EnumInteger(val value: kotlin.Int){ - @Json(name = 1) _1(1), + @Json(name = 1) + _1(1), - @Json(name = -1) minus1(-1); + @Json(name = -1) + minus1(-1); } @@ -85,9 +101,11 @@ data class EnumTest ( */ enum class EnumNumber(val value: kotlin.Double){ - @Json(name = 1.1) _1period1(1.1), + @Json(name = 1.1) + _1period1(1.1), - @Json(name = -1.2) minus1Period2(-1.2); + @Json(name = -1.2) + minus1Period2(-1.2); } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt index ecece52046d5..003bc5c6b692 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,13 +12,16 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * * @param file * @param files */ data class FileSchemaTestClass ( + @Json(name = "file") val file: java.io.File? = null, + @Json(name = "files") val files: kotlin.Array? = null ) { diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Foo.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Foo.kt index 90a3d1e54081..40d0f465db31 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Foo.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Foo.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,11 +12,13 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * * @param bar */ data class Foo ( + @Json(name = "bar") val bar: kotlin.String? = null ) { diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FormatTest.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FormatTest.kt index 14817038f577..79c8dc6968e8 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FormatTest.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FormatTest.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,6 +12,7 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * * @param integer @@ -31,22 +32,37 @@ package org.openapitools.client.models * @param patternWithDigitsAndDelimiter A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. */ data class FormatTest ( + @Json(name = "number") val number: java.math.BigDecimal, + @Json(name = "byte") val byte: kotlin.ByteArray, - val date: java.time.LocalDateTime, + @Json(name = "date") + val date: java.time.LocalDate, + @Json(name = "password") val password: kotlin.String, + @Json(name = "integer") val integer: kotlin.Int? = null, + @Json(name = "int32") val int32: kotlin.Int? = null, + @Json(name = "int64") val int64: kotlin.Long? = null, + @Json(name = "float") val float: kotlin.Float? = null, + @Json(name = "double") val double: kotlin.Double? = null, + @Json(name = "string") val string: kotlin.String? = null, + @Json(name = "binary") val binary: java.io.File? = null, + @Json(name = "dateTime") val dateTime: java.time.LocalDateTime? = null, + @Json(name = "uuid") val uuid: java.util.UUID? = null, /* A string that is a 10 digit number. Can have leading zeros. */ + @Json(name = "pattern_with_digits") val patternWithDigits: kotlin.String? = null, /* A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. */ + @Json(name = "pattern_with_digits_and_delimiter") val patternWithDigitsAndDelimiter: kotlin.String? = null ) { diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt index fc05361d3ec7..2fae92679874 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,13 +12,16 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * * @param bar * @param foo */ data class HasOnlyReadOnly ( + @Json(name = "bar") val bar: kotlin.String? = null, + @Json(name = "foo") val foo: kotlin.String? = null ) { diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt index d8f7ec1fb8ab..f0466b799b49 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,11 +12,13 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. * @param nullableMessage */ data class HealthCheckResult ( + @Json(name = "NullableMessage") val nullableMessage: kotlin.String? = null ) { diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject.kt index c11ccb2405ae..53a7082ac0ac 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,6 +12,7 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * * @param name Updated name of the pet @@ -19,8 +20,10 @@ package org.openapitools.client.models */ data class InlineObject ( /* Updated name of the pet */ + @Json(name = "name") val name: kotlin.String? = null, /* Updated status of the pet */ + @Json(name = "status") val status: kotlin.String? = null ) { diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt index 645734260b8c..0917219b4ef5 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,6 +12,7 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * * @param additionalMetadata Additional data to pass to server @@ -19,8 +20,10 @@ package org.openapitools.client.models */ data class InlineObject1 ( /* Additional data to pass to server */ + @Json(name = "additionalMetadata") val additionalMetadata: kotlin.String? = null, /* file to upload */ + @Json(name = "file") val file: java.io.File? = null ) { diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt index 1e08e6011720..989561cbeb60 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,8 +20,10 @@ import com.squareup.moshi.Json */ data class InlineObject2 ( /* Form parameter enum test (string array) */ + @Json(name = "enum_form_string_array") val enumFormStringArray: InlineObject2.EnumFormStringArray? = null, /* Form parameter enum test (string) */ + @Json(name = "enum_form_string") val enumFormString: InlineObject2.EnumFormString? = null ) { @@ -31,9 +33,11 @@ data class InlineObject2 ( */ enum class EnumFormStringArray(val value: kotlin.Array<kotlin.String>){ - @Json(name = ">") greaterThan(">"), + @Json(name = ">") + greaterThan(">"), - @Json(name = "$") dollar("$"); + @Json(name = "$") + dollar("$"); } @@ -43,11 +47,14 @@ data class InlineObject2 ( */ enum class EnumFormString(val value: kotlin.String){ - @Json(name = "_abc") abc("_abc"), + @Json(name = "_abc") + abc("_abc"), - @Json(name = "-efg") minusEfg("-efg"), + @Json(name = "-efg") + minusEfg("-efg"), - @Json(name = "(xyz)") leftParenthesisXyzRightParenthesis("(xyz)"); + @Json(name = "(xyz)") + leftParenthesisXyzRightParenthesis("(xyz)"); } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject3.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject3.kt index a3a0c0c9465d..4ade49136757 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject3.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject3.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,6 +12,7 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * * @param integer None @@ -31,32 +32,46 @@ package org.openapitools.client.models */ data class InlineObject3 ( /* None */ + @Json(name = "number") val number: java.math.BigDecimal, /* None */ + @Json(name = "double") val double: kotlin.Double, /* None */ + @Json(name = "pattern_without_delimiter") val patternWithoutDelimiter: kotlin.String, /* None */ + @Json(name = "byte") val byte: kotlin.ByteArray, /* None */ + @Json(name = "integer") val integer: kotlin.Int? = null, /* None */ + @Json(name = "int32") val int32: kotlin.Int? = null, /* None */ + @Json(name = "int64") val int64: kotlin.Long? = null, /* None */ + @Json(name = "float") val float: kotlin.Float? = null, /* None */ + @Json(name = "string") val string: kotlin.String? = null, /* None */ + @Json(name = "binary") val binary: java.io.File? = null, /* None */ - val date: java.time.LocalDateTime? = null, + @Json(name = "date") + val date: java.time.LocalDate? = null, /* None */ + @Json(name = "dateTime") val dateTime: java.time.LocalDateTime? = null, /* None */ + @Json(name = "password") val password: kotlin.String? = null, /* None */ + @Json(name = "callback") val callback: kotlin.String? = null ) { diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject4.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject4.kt index 091288caa5b1..91b9c2a9cdf2 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject4.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject4.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,6 +12,7 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * * @param param field1 @@ -19,8 +20,10 @@ package org.openapitools.client.models */ data class InlineObject4 ( /* field1 */ + @Json(name = "param") val param: kotlin.String, /* field2 */ + @Json(name = "param2") val param2: kotlin.String ) { diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject5.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject5.kt index 7dd6bf7ae298..f058f58c4441 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject5.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject5.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,6 +12,7 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * * @param additionalMetadata Additional data to pass to server @@ -19,8 +20,10 @@ package org.openapitools.client.models */ data class InlineObject5 ( /* file to upload */ + @Json(name = "requiredFile") val requiredFile: java.io.File, /* Additional data to pass to server */ + @Json(name = "additionalMetadata") val additionalMetadata: kotlin.String? = null ) { diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt index 5eb84f603fd1..ea862cef739c 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,11 +13,13 @@ package org.openapitools.client.models import org.openapitools.client.models.Foo +import com.squareup.moshi.Json /** * * @param string */ data class InlineResponseDefault ( + @Json(name = "string") val string: Foo? = null ) { diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/List.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/List.kt index 14b0b3615d67..533fb21cc80b 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/List.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/List.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,12 +12,14 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * - * @param `123list` + * @param `123minusList` */ data class List ( - val `123list`: kotlin.String? = null + @Json(name = "123-list") + val `123minusList`: kotlin.String? = null ) { } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/MapTest.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/MapTest.kt index 7e6815200183..bde64f1b11c0 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/MapTest.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/MapTest.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -21,9 +21,13 @@ import com.squareup.moshi.Json * @param indirectMap */ data class MapTest ( + @Json(name = "map_map_of_string") val mapMapOfString: kotlin.collections.Map>? = null, + @Json(name = "map_of_enum_string") val mapOfEnumString: MapTest.MapOfEnumString? = null, + @Json(name = "direct_map") val directMap: kotlin.collections.Map? = null, + @Json(name = "indirect_map") val indirectMap: kotlin.collections.Map? = null ) { @@ -33,9 +37,11 @@ data class MapTest ( */ enum class MapOfEnumString(val value: kotlin.collections.Map<kotlin.String, kotlin.String>){ - @Json(name = "UPPER") uPPER("UPPER"), + @Json(name = "UPPER") + uPPER("UPPER"), - @Json(name = "lower") lower("lower"); + @Json(name = "lower") + lower("lower"); } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt index 74559242c8ba..63bf58d8b93c 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,6 +13,7 @@ package org.openapitools.client.models import org.openapitools.client.models.Animal +import com.squareup.moshi.Json /** * * @param uuid @@ -20,8 +21,11 @@ import org.openapitools.client.models.Animal * @param map */ data class MixedPropertiesAndAdditionalPropertiesClass ( + @Json(name = "uuid") val uuid: java.util.UUID? = null, + @Json(name = "dateTime") val dateTime: java.time.LocalDateTime? = null, + @Json(name = "map") val map: kotlin.collections.Map? = null ) { diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Model200Response.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Model200Response.kt index 579aa048b059..42c48fa7fd1c 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Model200Response.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Model200Response.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,13 +12,16 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * Model for testing model name starting with number * @param name * @param propertyClass */ data class Model200Response ( + @Json(name = "name") val name: kotlin.Int? = null, + @Json(name = "class") val propertyClass: kotlin.String? = null ) { diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Name.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Name.kt index b181422f4ce5..d46b4b1c5112 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Name.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Name.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,6 +12,7 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * Model for testing model name same as property name * @param name @@ -20,9 +21,13 @@ package org.openapitools.client.models * @param `123number` */ data class Name ( + @Json(name = "name") val name: kotlin.Int, + @Json(name = "snake_case") val snakeCase: kotlin.Int? = null, + @Json(name = "property") val property: kotlin.String? = null, + @Json(name = "123Number") val `123number`: kotlin.Int? = null ) { diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/NullableClass.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/NullableClass.kt new file mode 100644 index 000000000000..4b75b41a9d75 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/NullableClass.kt @@ -0,0 +1,59 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.squareup.moshi.Json +/** + * + * @param integerProp + * @param numberProp + * @param booleanProp + * @param stringProp + * @param dateProp + * @param datetimeProp + * @param arrayNullableProp + * @param arrayAndItemsNullableProp + * @param arrayItemsNullable + * @param objectNullableProp + * @param objectAndItemsNullableProp + * @param objectItemsNullable + */ +data class NullableClass ( + @Json(name = "integer_prop") + val integerProp: kotlin.Int? = null, + @Json(name = "number_prop") + val numberProp: java.math.BigDecimal? = null, + @Json(name = "boolean_prop") + val booleanProp: kotlin.Boolean? = null, + @Json(name = "string_prop") + val stringProp: kotlin.String? = null, + @Json(name = "date_prop") + val dateProp: java.time.LocalDate? = null, + @Json(name = "datetime_prop") + val datetimeProp: java.time.LocalDateTime? = null, + @Json(name = "array_nullable_prop") + val arrayNullableProp: kotlin.Array? = null, + @Json(name = "array_and_items_nullable_prop") + val arrayAndItemsNullableProp: kotlin.Array? = null, + @Json(name = "array_items_nullable") + val arrayItemsNullable: kotlin.Array? = null, + @Json(name = "object_nullable_prop") + val objectNullableProp: kotlin.collections.Map? = null, + @Json(name = "object_and_items_nullable_prop") + val objectAndItemsNullableProp: kotlin.collections.Map? = null, + @Json(name = "object_items_nullable") + val objectItemsNullable: kotlin.collections.Map? = null +) { + +} + diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/NumberOnly.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/NumberOnly.kt index b49d4f28e6c7..c8126af08483 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/NumberOnly.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/NumberOnly.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,11 +12,13 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * * @param justNumber */ data class NumberOnly ( + @Json(name = "JustNumber") val justNumber: java.math.BigDecimal? = null ) { diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt index 2950a7445511..296d77047cc5 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -23,12 +23,18 @@ import com.squareup.moshi.Json * @param complete */ data class Order ( + @Json(name = "id") val id: kotlin.Long? = null, + @Json(name = "petId") val petId: kotlin.Long? = null, + @Json(name = "quantity") val quantity: kotlin.Int? = null, + @Json(name = "shipDate") val shipDate: java.time.LocalDateTime? = null, /* Order Status */ + @Json(name = "status") val status: Order.Status? = null, + @Json(name = "complete") val complete: kotlin.Boolean? = null ) { @@ -38,11 +44,14 @@ data class Order ( */ enum class Status(val value: kotlin.String){ - @Json(name = "placed") placed("placed"), + @Json(name = "placed") + placed("placed"), - @Json(name = "approved") approved("approved"), + @Json(name = "approved") + approved("approved"), - @Json(name = "delivered") delivered("delivered"); + @Json(name = "delivered") + delivered("delivered"); } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterComposite.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterComposite.kt index 20b318928773..a0bc846a09b9 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterComposite.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterComposite.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,6 +12,7 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * * @param myNumber @@ -19,8 +20,11 @@ package org.openapitools.client.models * @param myBoolean */ data class OuterComposite ( + @Json(name = "my_number") val myNumber: java.math.BigDecimal? = null, + @Json(name = "my_string") val myString: kotlin.String? = null, + @Json(name = "my_boolean") val myBoolean: kotlin.Boolean? = null ) { diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnum.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnum.kt index 22f42f500ec5..bd3b936859ff 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnum.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnum.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,11 +20,14 @@ import com.squareup.moshi.Json */ enum class OuterEnum(val value: kotlin.String){ - @Json(name = "placed") placed("placed"), + @Json(name = "placed") + placed("placed"), - @Json(name = "approved") approved("approved"), + @Json(name = "approved") + approved("approved"), - @Json(name = "delivered") delivered("delivered"); + @Json(name = "delivered") + delivered("delivered"); } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt index 12a377491392..48a990701be6 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,11 +20,14 @@ import com.squareup.moshi.Json */ enum class OuterEnumDefaultValue(val value: kotlin.String){ - @Json(name = "placed") placed("placed"), + @Json(name = "placed") + placed("placed"), - @Json(name = "approved") approved("approved"), + @Json(name = "approved") + approved("approved"), - @Json(name = "delivered") delivered("delivered"); + @Json(name = "delivered") + delivered("delivered"); } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumInteger.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumInteger.kt index 0e61152c6d99..cbaa42709a8f 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumInteger.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumInteger.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,11 +20,14 @@ import com.squareup.moshi.Json */ enum class OuterEnumInteger(val value: kotlin.Int){ - @Json(name = "0") _0(0), + @Json(name = "0") + _0(0), - @Json(name = "1") _1(1), + @Json(name = "1") + _1(1), - @Json(name = "2") _2(2); + @Json(name = "2") + _2(2); } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt index b5592bd85700..348b303d6cdf 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,11 +20,14 @@ import com.squareup.moshi.Json */ enum class OuterEnumIntegerDefaultValue(val value: kotlin.Int){ - @Json(name = "0") _0(0), + @Json(name = "0") + _0(0), - @Json(name = "1") _1(1), + @Json(name = "1") + _1(1), - @Json(name = "2") _2(2); + @Json(name = "2") + _2(2); } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt index 4c3ee418894f..5adf5a0e5f3a 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -25,12 +25,18 @@ import com.squareup.moshi.Json * @param status pet status in the store */ data class Pet ( + @Json(name = "name") val name: kotlin.String, + @Json(name = "photoUrls") val photoUrls: kotlin.Array, + @Json(name = "id") val id: kotlin.Long? = null, + @Json(name = "category") val category: Category? = null, + @Json(name = "tags") val tags: kotlin.Array? = null, /* pet status in the store */ + @Json(name = "status") val status: Pet.Status? = null ) { @@ -40,11 +46,14 @@ data class Pet ( */ enum class Status(val value: kotlin.String){ - @Json(name = "available") available("available"), + @Json(name = "available") + available("available"), - @Json(name = "pending") pending("pending"), + @Json(name = "pending") + pending("pending"), - @Json(name = "sold") sold("sold"); + @Json(name = "sold") + sold("sold"); } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt index b923cebdc882..b47c5617c837 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,13 +12,16 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * * @param bar * @param baz */ data class ReadOnlyFirst ( + @Json(name = "bar") val bar: kotlin.String? = null, + @Json(name = "baz") val baz: kotlin.String? = null ) { diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Return.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Return.kt index f258953c49fb..59a24cd83518 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Return.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Return.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,11 +12,13 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * Model for testing reserved words * @param `return` */ data class Return ( + @Json(name = "return") val `return`: kotlin.Int? = null ) { diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt index 47688614c787..2768460ff671 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,12 +12,14 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * - * @param `$specialPropertyName` + * @param dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket */ data class SpecialModelname ( - val `$specialPropertyName`: kotlin.Long? = null + @Json(name = "$special[property.name]") + val dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket: kotlin.Long? = null ) { } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt index 8e3bc218e1b1..bb7bf2ec0730 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,13 +12,16 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * * @param id * @param name */ data class Tag ( + @Json(name = "id") val id: kotlin.Long? = null, + @Json(name = "name") val name: kotlin.String? = null ) { diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt index 2c77d12201f7..d0384bc2069d 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt @@ -2,7 +2,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,6 +12,7 @@ package org.openapitools.client.models +import com.squareup.moshi.Json /** * * @param id @@ -24,14 +25,22 @@ package org.openapitools.client.models * @param userStatus User Status */ data class User ( + @Json(name = "id") val id: kotlin.Long? = null, + @Json(name = "username") val username: kotlin.String? = null, + @Json(name = "firstName") val firstName: kotlin.String? = null, + @Json(name = "lastName") val lastName: kotlin.String? = null, + @Json(name = "email") val email: kotlin.String? = null, + @Json(name = "password") val password: kotlin.String? = null, + @Json(name = "phone") val phone: kotlin.String? = null, /* User Status */ + @Json(name = "userStatus") val userStatus: kotlin.Int? = null ) { diff --git a/samples/openapi3/client/petstore/ocaml/.openapi-generator-ignore b/samples/openapi3/client/petstore/ocaml/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/openapi3/client/petstore/ocaml/.openapi-generator/VERSION b/samples/openapi3/client/petstore/ocaml/.openapi-generator/VERSION new file mode 100644 index 000000000000..83a328a9227e --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/.openapi-generator/VERSION @@ -0,0 +1 @@ +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/ocaml/README.md b/samples/openapi3/client/petstore/ocaml/README.md new file mode 100644 index 000000000000..ff5f4a86e591 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/README.md @@ -0,0 +1,27 @@ +# +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \\" \\ + +This OCaml package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: 1.0.0 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.OCamlClientCodegen + +## Requirements. + +OCaml 4.x + +## Installation + +Please run the following commands to build the package `petstore_client`: + +```sh +opam install ppx_deriving_yojson cohttp ppx_deriving cohttp-lwt-unix +eval $(opam env) +dune build +``` + +## Getting Started + +TODO + diff --git a/samples/openapi3/client/petstore/ocaml/dune b/samples/openapi3/client/petstore/ocaml/dune new file mode 100644 index 000000000000..ed1c4d90e3df --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/dune @@ -0,0 +1,9 @@ +(include_subdirs unqualified) +(library + (name petstore_client) + (public_name petstore_client) + (flags (:standard -w -27)) + (libraries str cohttp-lwt-unix lwt yojson ppx_deriving_yojson.runtime) + (preprocess (pps ppx_deriving_yojson ppx_deriving.std)) + (wrapped true) +) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/ocaml/dune-project b/samples/openapi3/client/petstore/ocaml/dune-project new file mode 100644 index 000000000000..79d86e3c901a --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/dune-project @@ -0,0 +1,2 @@ +(lang dune 1.10) +(name petstore_client) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/ocaml/petstore_client.opam b/samples/openapi3/client/petstore/ocaml/petstore_client.opam new file mode 100644 index 000000000000..3c3603c2f14c --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/petstore_client.opam @@ -0,0 +1,15 @@ +opam-version: "2.0" +name: "petstore_client" +version: "1.0.0" +synopsis: "" +description: """ +Longer description +""" +maintainer: "Name " +authors: "Name " +license: "" +homepage: "" +bug-reports: "" +dev-repo: "" +depends: [ "ocaml" "ocamlfind" ] +build: ["dune" "build" "-p" name] \ No newline at end of file diff --git a/samples/openapi3/client/petstore/ocaml/src/apis/another_fake_api.ml b/samples/openapi3/client/petstore/ocaml/src/apis/another_fake_api.ml new file mode 100644 index 000000000000..43e14ad98b3c --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/apis/another_fake_api.ml @@ -0,0 +1,15 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +let call_123_test_special_tags client_t = + let open Lwt in + let uri = Request.build_uri "/another-fake/dummy" in + let headers = Request.default_headers in + let body = Request.write_json_body Client.to_yojson client_t in + Cohttp_lwt_unix.Client.call `PATCH uri ~headers ~body >>= fun (resp, body) -> + Request.read_json_body_as (JsonSupport.unwrap Client.of_yojson) resp body + diff --git a/samples/openapi3/client/petstore/ocaml/src/apis/another_fake_api.mli b/samples/openapi3/client/petstore/ocaml/src/apis/another_fake_api.mli new file mode 100644 index 000000000000..2b93c08e959f --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/apis/another_fake_api.mli @@ -0,0 +1,8 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +val call_123_test_special_tags : Client.t -> Client.t Lwt.t diff --git a/samples/openapi3/client/petstore/ocaml/src/apis/default_api.ml b/samples/openapi3/client/petstore/ocaml/src/apis/default_api.ml new file mode 100644 index 000000000000..f220c4ba5984 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/apis/default_api.ml @@ -0,0 +1,14 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +let foo_get () = + let open Lwt in + let uri = Request.build_uri "/foo" in + let headers = Request.default_headers in + Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> + Request.read_json_body_as (JsonSupport.unwrap Inline_response_default.of_yojson) resp body + diff --git a/samples/openapi3/client/petstore/ocaml/src/apis/default_api.mli b/samples/openapi3/client/petstore/ocaml/src/apis/default_api.mli new file mode 100644 index 000000000000..f1392d7621c2 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/apis/default_api.mli @@ -0,0 +1,8 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +val foo_get : unit -> Inline_response_default.t Lwt.t diff --git a/samples/openapi3/client/petstore/ocaml/src/apis/fake_api.ml b/samples/openapi3/client/petstore/ocaml/src/apis/fake_api.ml new file mode 100644 index 000000000000..2031b43b01d6 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/apis/fake_api.ml @@ -0,0 +1,143 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +let fake_health_get () = + let open Lwt in + let uri = Request.build_uri "/fake/health" in + let headers = Request.default_headers in + Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> + Request.read_json_body_as (JsonSupport.unwrap Health_check_result.of_yojson) resp body + +let fake_outer_boolean_serialize body = + let open Lwt in + let uri = Request.build_uri "/fake/outer/boolean" in + let headers = Request.default_headers in + let body = Request.write_json_body JsonSupport.of_bool body in + Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> + Request.read_json_body_as (JsonSupport.to_bool) resp body + +let fake_outer_composite_serialize outer_composite_t = + let open Lwt in + let uri = Request.build_uri "/fake/outer/composite" in + let headers = Request.default_headers in + let body = Request.write_json_body Outer_composite.to_yojson outer_composite_t in + Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> + Request.read_json_body_as (JsonSupport.unwrap Outer_composite.of_yojson) resp body + +let fake_outer_number_serialize body = + let open Lwt in + let uri = Request.build_uri "/fake/outer/number" in + let headers = Request.default_headers in + let body = Request.write_json_body JsonSupport.of_float body in + Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> + Request.read_json_body_as (JsonSupport.to_float) resp body + +let fake_outer_string_serialize body = + let open Lwt in + let uri = Request.build_uri "/fake/outer/string" in + let headers = Request.default_headers in + let body = Request.write_json_body JsonSupport.of_string body in + Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> + Request.read_json_body_as (JsonSupport.to_string) resp body + +let test_body_with_file_schema file_schema_test_class_t = + let open Lwt in + let uri = Request.build_uri "/fake/body-with-file-schema" in + let headers = Request.default_headers in + let body = Request.write_json_body File_schema_test_class.to_yojson file_schema_test_class_t in + Cohttp_lwt_unix.Client.call `PUT uri ~headers ~body >>= fun (resp, body) -> + Request.handle_unit_response resp + +let test_body_with_query_params query user_t = + let open Lwt in + let uri = Request.build_uri "/fake/body-with-query-params" in + let headers = Request.default_headers in + let uri = Uri.add_query_param' uri ("query", query) in + let body = Request.write_json_body User.to_yojson user_t in + Cohttp_lwt_unix.Client.call `PUT uri ~headers ~body >>= fun (resp, body) -> + Request.handle_unit_response resp + +let test_client_model client_t = + let open Lwt in + let uri = Request.build_uri "/fake" in + let headers = Request.default_headers in + let body = Request.write_json_body Client.to_yojson client_t in + Cohttp_lwt_unix.Client.call `PATCH uri ~headers ~body >>= fun (resp, body) -> + Request.read_json_body_as (JsonSupport.unwrap Client.of_yojson) resp body + +let test_endpoint_parameters number double pattern_without_delimiter byte integer int32 int64 float string binary date date_time password callback = + let open Lwt in + let uri = Request.build_uri "/fake" in + let headers = Request.default_headers in + let body = Request.init_form_encoded_body () in + let body = Request.add_form_encoded_body_param body ("integer", Int32.to_string integer) in + let body = Request.add_form_encoded_body_param body ("int32", Int32.to_string int32) in + let body = Request.add_form_encoded_body_param body ("int64", Int64.to_string int64) in + let body = Request.add_form_encoded_body_param body ("number", string_of_float number) in + let body = Request.add_form_encoded_body_param body ("float", string_of_float float) in + let body = Request.add_form_encoded_body_param body ("double", string_of_float double) in + let body = Request.add_form_encoded_body_param body ("string", string) in + let body = Request.add_form_encoded_body_param body ("pattern_without_delimiter", pattern_without_delimiter) in + let body = Request.add_form_encoded_body_param body ("byte", Bytes.to_string byte) in + let body = Request.add_form_encoded_body_param body ("binary", binary) in + let body = Request.add_form_encoded_body_param body ("date", date) in + let body = Request.add_form_encoded_body_param body ("date_time", date_time) in + let body = Request.add_form_encoded_body_param body ("password", password) in + let body = Request.add_form_encoded_body_param body ("callback", callback) in + let body = Request.finalize_form_encoded_body body in + Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> + Request.handle_unit_response resp + +let test_enum_parameters enum_header_string_array enum_header_string enum_query_string_array enum_query_string enum_query_integer enum_query_double enum_form_string_array enum_form_string = + let open Lwt in + let uri = Request.build_uri "/fake" in + let headers = Request.default_headers in + let headers = Cohttp.Header.add_multi headers "enum_header_string_array" (List.map Enums.show_enum_form_string_array enum_header_string_array) in + let headers = Cohttp.Header.add headers "enum_header_string" (Enums.show_enumclass enum_header_string) in + let uri = Uri.add_query_param uri ("enum_query_string_array", List.map Enums.show_enum_form_string_array enum_query_string_array) in + let uri = Uri.add_query_param' uri ("enum_query_string", Enums.show_enumclass enum_query_string) in + let uri = Uri.add_query_param' uri ("enum_query_integer", Enums.show_enum_query_integer enum_query_integer) in + let uri = Uri.add_query_param' uri ("enum_query_double", Enums.show_enum_number enum_query_double) in + let body = Request.init_form_encoded_body () in + let body = Request.add_form_encoded_body_params body ("enum_form_string_array", List.map Enums.show_enum_form_string_array enum_form_string_array) in + let body = Request.add_form_encoded_body_param body ("enum_form_string", Enums.show_enumclass enum_form_string) in + let body = Request.finalize_form_encoded_body body in + Cohttp_lwt_unix.Client.call `GET uri ~headers ~body >>= fun (resp, body) -> + Request.handle_unit_response resp + +let test_group_parameters required_string_group required_boolean_group required_int64_group string_group boolean_group int64_group = + let open Lwt in + let uri = Request.build_uri "/fake" in + let headers = Request.default_headers in + let headers = Cohttp.Header.add headers "required_boolean_group" (string_of_bool required_boolean_group) in + let headers = Cohttp.Header.add headers "boolean_group" (string_of_bool boolean_group) in + let uri = Uri.add_query_param' uri ("required_string_group", Int32.to_string required_string_group) in + let uri = Uri.add_query_param' uri ("required_int64_group", Int64.to_string required_int64_group) in + let uri = Uri.add_query_param' uri ("string_group", Int32.to_string string_group) in + let uri = Uri.add_query_param' uri ("int64_group", Int64.to_string int64_group) in + Cohttp_lwt_unix.Client.call `DELETE uri ~headers >>= fun (resp, body) -> + Request.handle_unit_response resp + +let test_inline_additional_properties request_body = + let open Lwt in + let uri = Request.build_uri "/fake/inline-additionalProperties" in + let headers = Request.default_headers in + let body = Request.write_json_body (JsonSupport.of_map_of JsonSupport.of_string) request_body in + Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> + Request.handle_unit_response resp + +let test_json_form_data param param2 = + let open Lwt in + let uri = Request.build_uri "/fake/jsonFormData" in + let headers = Request.default_headers in + let body = Request.init_form_encoded_body () in + let body = Request.add_form_encoded_body_param body ("param", param) in + let body = Request.add_form_encoded_body_param body ("param2", param2) in + let body = Request.finalize_form_encoded_body body in + Cohttp_lwt_unix.Client.call `GET uri ~headers ~body >>= fun (resp, body) -> + Request.handle_unit_response resp + diff --git a/samples/openapi3/client/petstore/ocaml/src/apis/fake_api.mli b/samples/openapi3/client/petstore/ocaml/src/apis/fake_api.mli new file mode 100644 index 000000000000..7d5910f1af7c --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/apis/fake_api.mli @@ -0,0 +1,20 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +val fake_health_get : unit -> Health_check_result.t Lwt.t +val fake_outer_boolean_serialize : bool -> bool Lwt.t +val fake_outer_composite_serialize : Outer_composite.t -> Outer_composite.t Lwt.t +val fake_outer_number_serialize : float -> float Lwt.t +val fake_outer_string_serialize : string -> string Lwt.t +val test_body_with_file_schema : File_schema_test_class.t -> unit Lwt.t +val test_body_with_query_params : string -> User.t -> unit Lwt.t +val test_client_model : Client.t -> Client.t Lwt.t +val test_endpoint_parameters : float -> float -> string -> bytes -> int32 -> int32 -> int64 -> float -> string -> string -> string -> string -> string -> string -> unit Lwt.t +val test_enum_parameters : Enums.enum_form_string_array list -> Enums.enumclass -> Enums.enum_form_string_array list -> Enums.enumclass -> Enums.enum_query_integer -> Enums.enum_number -> Enums.enum_form_string_array list -> Enums.enumclass -> unit Lwt.t +val test_group_parameters : int32 -> bool -> int64 -> int32 -> bool -> int64 -> unit Lwt.t +val test_inline_additional_properties : (string * string) list -> unit Lwt.t +val test_json_form_data : string -> string -> unit Lwt.t diff --git a/samples/openapi3/client/petstore/ocaml/src/apis/fake_classname_tags123_api.ml b/samples/openapi3/client/petstore/ocaml/src/apis/fake_classname_tags123_api.ml new file mode 100644 index 000000000000..25820ff55140 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/apis/fake_classname_tags123_api.ml @@ -0,0 +1,16 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +let test_classname client_t = + let open Lwt in + let uri = Request.build_uri "/fake_classname_test" in + let headers = Request.default_headers in + let uri = Uri.add_query_param' uri ("api_key_query", Request.api_key) in + let body = Request.write_json_body Client.to_yojson client_t in + Cohttp_lwt_unix.Client.call `PATCH uri ~headers ~body >>= fun (resp, body) -> + Request.read_json_body_as (JsonSupport.unwrap Client.of_yojson) resp body + diff --git a/samples/openapi3/client/petstore/ocaml/src/apis/fake_classname_tags123_api.mli b/samples/openapi3/client/petstore/ocaml/src/apis/fake_classname_tags123_api.mli new file mode 100644 index 000000000000..85059985bbe4 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/apis/fake_classname_tags123_api.mli @@ -0,0 +1,8 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +val test_classname : Client.t -> Client.t Lwt.t diff --git a/samples/openapi3/client/petstore/ocaml/src/apis/pet_api.ml b/samples/openapi3/client/petstore/ocaml/src/apis/pet_api.ml new file mode 100644 index 000000000000..38a9372ec801 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/apis/pet_api.ml @@ -0,0 +1,92 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +let add_pet pet_t = + let open Lwt in + let uri = Request.build_uri "/pet" in + let headers = Request.default_headers in + let body = Request.write_json_body Pet.to_yojson pet_t in + Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> + Request.handle_unit_response resp + +let delete_pet pet_id api_key = + let open Lwt in + let uri = Request.build_uri "/pet/{petId}" in + let headers = Request.default_headers in + let headers = Cohttp.Header.add headers "api_key" (api_key) in + let uri = Request.replace_path_param uri "petId" (Int64.to_string pet_id) in + Cohttp_lwt_unix.Client.call `DELETE uri ~headers >>= fun (resp, body) -> + Request.handle_unit_response resp + +let find_pets_by_status status = + let open Lwt in + let uri = Request.build_uri "/pet/findByStatus" in + let headers = Request.default_headers in + let uri = Uri.add_query_param uri ("status", List.map Enums.show_pet_status status) in + Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> + Request.read_json_body_as_list_of (JsonSupport.unwrap Pet.of_yojson) resp body + +let find_pets_by_tags tags = + let open Lwt in + let uri = Request.build_uri "/pet/findByTags" in + let headers = Request.default_headers in + let uri = Uri.add_query_param uri ("tags", tags) in + Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> + Request.read_json_body_as_list_of (JsonSupport.unwrap Pet.of_yojson) resp body + +let get_pet_by_id pet_id = + let open Lwt in + let uri = Request.build_uri "/pet/{petId}" in + let headers = Request.default_headers in + let uri = Request.replace_path_param uri "petId" (Int64.to_string pet_id) in + Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> + Request.read_json_body_as (JsonSupport.unwrap Pet.of_yojson) resp body + +let update_pet pet_t = + let open Lwt in + let uri = Request.build_uri "/pet" in + let headers = Request.default_headers in + let body = Request.write_json_body Pet.to_yojson pet_t in + Cohttp_lwt_unix.Client.call `PUT uri ~headers ~body >>= fun (resp, body) -> + Request.handle_unit_response resp + +let update_pet_with_form pet_id name status = + let open Lwt in + let uri = Request.build_uri "/pet/{petId}" in + let headers = Request.default_headers in + let uri = Request.replace_path_param uri "petId" (Int64.to_string pet_id) in + let body = Request.init_form_encoded_body () in + let body = Request.add_form_encoded_body_param body ("name", name) in + let body = Request.add_form_encoded_body_param body ("status", status) in + let body = Request.finalize_form_encoded_body body in + Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> + Request.handle_unit_response resp + +let upload_file pet_id additional_metadata file = + let open Lwt in + let uri = Request.build_uri "/pet/{petId}/uploadImage" in + let headers = Request.default_headers in + let uri = Request.replace_path_param uri "petId" (Int64.to_string pet_id) in + let body = Request.init_form_encoded_body () in + let body = Request.add_form_encoded_body_param body ("additional_metadata", additional_metadata) in + let body = Request.add_form_encoded_body_param body ("file", file) in + let body = Request.finalize_form_encoded_body body in + Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> + Request.read_json_body_as (JsonSupport.unwrap Api_response.of_yojson) resp body + +let upload_file_with_required_file pet_id required_file additional_metadata = + let open Lwt in + let uri = Request.build_uri "/fake/{petId}/uploadImageWithRequiredFile" in + let headers = Request.default_headers in + let uri = Request.replace_path_param uri "petId" (Int64.to_string pet_id) in + let body = Request.init_form_encoded_body () in + let body = Request.add_form_encoded_body_param body ("additional_metadata", additional_metadata) in + let body = Request.add_form_encoded_body_param body ("required_file", required_file) in + let body = Request.finalize_form_encoded_body body in + Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> + Request.read_json_body_as (JsonSupport.unwrap Api_response.of_yojson) resp body + diff --git a/samples/openapi3/client/petstore/ocaml/src/apis/pet_api.mli b/samples/openapi3/client/petstore/ocaml/src/apis/pet_api.mli new file mode 100644 index 000000000000..a1036b6c3c79 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/apis/pet_api.mli @@ -0,0 +1,16 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +val add_pet : Pet.t -> unit Lwt.t +val delete_pet : int64 -> string -> unit Lwt.t +val find_pets_by_status : Enums.pet_status list -> Pet.t list Lwt.t +val find_pets_by_tags : string list -> Pet.t list Lwt.t +val get_pet_by_id : int64 -> Pet.t Lwt.t +val update_pet : Pet.t -> unit Lwt.t +val update_pet_with_form : int64 -> string -> string -> unit Lwt.t +val upload_file : int64 -> string -> string -> Api_response.t Lwt.t +val upload_file_with_required_file : int64 -> string -> string -> Api_response.t Lwt.t diff --git a/samples/openapi3/client/petstore/ocaml/src/apis/store_api.ml b/samples/openapi3/client/petstore/ocaml/src/apis/store_api.ml new file mode 100644 index 000000000000..be35955e4e4b --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/apis/store_api.ml @@ -0,0 +1,38 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +let delete_order order_id = + let open Lwt in + let uri = Request.build_uri "/store/order/{order_id}" in + let headers = Request.default_headers in + let uri = Request.replace_path_param uri "order_id" (order_id) in + Cohttp_lwt_unix.Client.call `DELETE uri ~headers >>= fun (resp, body) -> + Request.handle_unit_response resp + +let get_inventory () = + let open Lwt in + let uri = Request.build_uri "/store/inventory" in + let headers = Request.default_headers in + Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> + Request.read_json_body_as_map_of (JsonSupport.to_int32) resp body + +let get_order_by_id order_id = + let open Lwt in + let uri = Request.build_uri "/store/order/{order_id}" in + let headers = Request.default_headers in + let uri = Request.replace_path_param uri "order_id" (Int64.to_string order_id) in + Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> + Request.read_json_body_as (JsonSupport.unwrap Order.of_yojson) resp body + +let place_order order_t = + let open Lwt in + let uri = Request.build_uri "/store/order" in + let headers = Request.default_headers in + let body = Request.write_json_body Order.to_yojson order_t in + Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> + Request.read_json_body_as (JsonSupport.unwrap Order.of_yojson) resp body + diff --git a/samples/openapi3/client/petstore/ocaml/src/apis/store_api.mli b/samples/openapi3/client/petstore/ocaml/src/apis/store_api.mli new file mode 100644 index 000000000000..bc3c93eb494c --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/apis/store_api.mli @@ -0,0 +1,11 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +val delete_order : string -> unit Lwt.t +val get_inventory : unit -> (string * int32) list Lwt.t +val get_order_by_id : int64 -> Order.t Lwt.t +val place_order : Order.t -> Order.t Lwt.t diff --git a/samples/openapi3/client/petstore/ocaml/src/apis/user_api.ml b/samples/openapi3/client/petstore/ocaml/src/apis/user_api.ml new file mode 100644 index 000000000000..1cb43382da51 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/apis/user_api.ml @@ -0,0 +1,72 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +let create_user user_t = + let open Lwt in + let uri = Request.build_uri "/user" in + let headers = Request.default_headers in + let body = Request.write_json_body User.to_yojson user_t in + Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> + Request.handle_unit_response resp + +let create_users_with_array_input user = + let open Lwt in + let uri = Request.build_uri "/user/createWithArray" in + let headers = Request.default_headers in + let body = Request.write_json_body (JsonSupport.of_list_of User.to_yojson) user in + Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> + Request.handle_unit_response resp + +let create_users_with_list_input user = + let open Lwt in + let uri = Request.build_uri "/user/createWithList" in + let headers = Request.default_headers in + let body = Request.write_json_body (JsonSupport.of_list_of User.to_yojson) user in + Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> + Request.handle_unit_response resp + +let delete_user username = + let open Lwt in + let uri = Request.build_uri "/user/{username}" in + let headers = Request.default_headers in + let uri = Request.replace_path_param uri "username" (username) in + Cohttp_lwt_unix.Client.call `DELETE uri ~headers >>= fun (resp, body) -> + Request.handle_unit_response resp + +let get_user_by_name username = + let open Lwt in + let uri = Request.build_uri "/user/{username}" in + let headers = Request.default_headers in + let uri = Request.replace_path_param uri "username" (username) in + Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> + Request.read_json_body_as (JsonSupport.unwrap User.of_yojson) resp body + +let login_user username password = + let open Lwt in + let uri = Request.build_uri "/user/login" in + let headers = Request.default_headers in + let uri = Uri.add_query_param' uri ("username", username) in + let uri = Uri.add_query_param' uri ("password", password) in + Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> + Request.read_json_body_as (JsonSupport.to_string) resp body + +let logout_user () = + let open Lwt in + let uri = Request.build_uri "/user/logout" in + let headers = Request.default_headers in + Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> + Request.handle_unit_response resp + +let update_user username user_t = + let open Lwt in + let uri = Request.build_uri "/user/{username}" in + let headers = Request.default_headers in + let uri = Request.replace_path_param uri "username" (username) in + let body = Request.write_json_body User.to_yojson user_t in + Cohttp_lwt_unix.Client.call `PUT uri ~headers ~body >>= fun (resp, body) -> + Request.handle_unit_response resp + diff --git a/samples/openapi3/client/petstore/ocaml/src/apis/user_api.mli b/samples/openapi3/client/petstore/ocaml/src/apis/user_api.mli new file mode 100644 index 000000000000..5191a2ea41bb --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/apis/user_api.mli @@ -0,0 +1,15 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +val create_user : User.t -> unit Lwt.t +val create_users_with_array_input : User.t list -> unit Lwt.t +val create_users_with_list_input : User.t list -> unit Lwt.t +val delete_user : string -> unit Lwt.t +val get_user_by_name : string -> User.t Lwt.t +val login_user : string -> string -> string Lwt.t +val logout_user : unit -> unit Lwt.t +val update_user : string -> User.t -> unit Lwt.t diff --git a/samples/openapi3/client/petstore/ocaml/src/models/additional_properties_class.ml b/samples/openapi3/client/petstore/ocaml/src/models/additional_properties_class.ml new file mode 100644 index 000000000000..8e5f7b075f93 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/additional_properties_class.ml @@ -0,0 +1,17 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + map_property: (string * string) list; + map_of_map_property: (string * (string * string) list) list; +} [@@deriving yojson, show ];; + +let create () : t = { + map_property = []; + map_of_map_property = []; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/animal.ml b/samples/openapi3/client/petstore/ocaml/src/models/animal.ml new file mode 100644 index 000000000000..4501b0c3fe92 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/animal.ml @@ -0,0 +1,17 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + class_name: string; + color: string option [@default None]; +} [@@deriving yojson, show ];; + +let create (class_name : string) : t = { + class_name = class_name; + color = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/api_response.ml b/samples/openapi3/client/petstore/ocaml/src/models/api_response.ml new file mode 100644 index 000000000000..75bfdd68d1f3 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/api_response.ml @@ -0,0 +1,19 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + code: int32 option [@default None]; + _type: string option [@default None]; + message: string option [@default None]; +} [@@deriving yojson, show ];; + +let create () : t = { + code = None; + _type = None; + message = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/array_of_array_of_number_only.ml b/samples/openapi3/client/petstore/ocaml/src/models/array_of_array_of_number_only.ml new file mode 100644 index 000000000000..2204bac4b6c1 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/array_of_array_of_number_only.ml @@ -0,0 +1,15 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + array_array_number: float list list; +} [@@deriving yojson, show ];; + +let create () : t = { + array_array_number = []; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/array_of_number_only.ml b/samples/openapi3/client/petstore/ocaml/src/models/array_of_number_only.ml new file mode 100644 index 000000000000..3708294193e2 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/array_of_number_only.ml @@ -0,0 +1,15 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + array_number: float list; +} [@@deriving yojson, show ];; + +let create () : t = { + array_number = []; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/array_test.ml b/samples/openapi3/client/petstore/ocaml/src/models/array_test.ml new file mode 100644 index 000000000000..6198edd88a64 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/array_test.ml @@ -0,0 +1,19 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + array_of_string: string list; + array_array_of_integer: int64 list list; + array_array_of_model: Read_only_first.t list list; +} [@@deriving yojson, show ];; + +let create () : t = { + array_of_string = []; + array_array_of_integer = []; + array_array_of_model = []; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/capitalization.ml b/samples/openapi3/client/petstore/ocaml/src/models/capitalization.ml new file mode 100644 index 000000000000..05cb9436cf60 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/capitalization.ml @@ -0,0 +1,26 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + small_camel: string option [@default None]; + capital_camel: string option [@default None]; + small_snake: string option [@default None]; + capital_snake: string option [@default None]; + sca_eth_flow_points: string option [@default None]; + (* Name of the pet *) + att_name: string option [@default None]; +} [@@deriving yojson, show ];; + +let create () : t = { + small_camel = None; + capital_camel = None; + small_snake = None; + capital_snake = None; + sca_eth_flow_points = None; + att_name = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/cat.ml b/samples/openapi3/client/petstore/ocaml/src/models/cat.ml new file mode 100644 index 000000000000..463b8ce00da7 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/cat.ml @@ -0,0 +1,19 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + class_name: string; + color: string option [@default None]; + declawed: bool option [@default None]; +} [@@deriving yojson, show ];; + +let create (class_name : string) : t = { + class_name = class_name; + color = None; + declawed = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/cat_all_of.ml b/samples/openapi3/client/petstore/ocaml/src/models/cat_all_of.ml new file mode 100644 index 000000000000..f1ebca323b3a --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/cat_all_of.ml @@ -0,0 +1,15 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + declawed: bool option [@default None]; +} [@@deriving yojson, show ];; + +let create () : t = { + declawed = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/category.ml b/samples/openapi3/client/petstore/ocaml/src/models/category.ml new file mode 100644 index 000000000000..632b3e2dc2dd --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/category.ml @@ -0,0 +1,17 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + id: int64 option [@default None]; + name: string; +} [@@deriving yojson, show ];; + +let create (name : string) : t = { + id = None; + name = name; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/class_model.ml b/samples/openapi3/client/petstore/ocaml/src/models/class_model.ml new file mode 100644 index 000000000000..2b5f84dc013d --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/class_model.ml @@ -0,0 +1,17 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + * Schema Class_model.t : Model for testing model with \\"_class\\" property + *) + +type t = { + _class: string option [@default None]; +} [@@deriving yojson, show ];; + +(** Model for testing model with \\"_class\\" property *) +let create () : t = { + _class = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/client.ml b/samples/openapi3/client/petstore/ocaml/src/models/client.ml new file mode 100644 index 000000000000..1869f4d2e77c --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/client.ml @@ -0,0 +1,15 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + client: string option [@default None]; +} [@@deriving yojson, show ];; + +let create () : t = { + client = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/dog.ml b/samples/openapi3/client/petstore/ocaml/src/models/dog.ml new file mode 100644 index 000000000000..5fb573492053 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/dog.ml @@ -0,0 +1,19 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + class_name: string; + color: string option [@default None]; + breed: string option [@default None]; +} [@@deriving yojson, show ];; + +let create (class_name : string) : t = { + class_name = class_name; + color = None; + breed = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/dog_all_of.ml b/samples/openapi3/client/petstore/ocaml/src/models/dog_all_of.ml new file mode 100644 index 000000000000..dc1fe9f43313 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/dog_all_of.ml @@ -0,0 +1,15 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + breed: string option [@default None]; +} [@@deriving yojson, show ];; + +let create () : t = { + breed = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/enum_arrays.ml b/samples/openapi3/client/petstore/ocaml/src/models/enum_arrays.ml new file mode 100644 index 000000000000..e6720042e362 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/enum_arrays.ml @@ -0,0 +1,17 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + just_symbol: Enums.just_symbol option [@default None]; + array_enum: Enums.array_enum list; +} [@@deriving yojson, show ];; + +let create () : t = { + just_symbol = None; + array_enum = []; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/enum_test.ml b/samples/openapi3/client/petstore/ocaml/src/models/enum_test.ml new file mode 100644 index 000000000000..4be833234e9d --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/enum_test.ml @@ -0,0 +1,29 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + enum_string: Enums.enum_string option [@default None]; + enum_string_required: Enums.enum_string; + enum_integer: Enums.enum_integer option [@default None]; + enum_number: Enums.enum_number option [@default None]; + outer_enum: Enums.status option [@default None]; + outer_enum_integer: Enums.outerenuminteger option [@default None]; + outer_enum_default_value: Enums.status option [@default None]; + outer_enum_integer_default_value: Enums.outerenuminteger option [@default None]; +} [@@deriving yojson, show ];; + +let create (enum_string_required : Enums.enum_string) : t = { + enum_string = None; + enum_string_required = enum_string_required; + enum_integer = None; + enum_number = None; + outer_enum = None; + outer_enum_integer = None; + outer_enum_default_value = None; + outer_enum_integer_default_value = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/file.ml b/samples/openapi3/client/petstore/ocaml/src/models/file.ml new file mode 100644 index 000000000000..15d82a963362 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/file.ml @@ -0,0 +1,18 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + * Schema File.t : Must be named `File` for test. + *) + +type t = { + (* Test capitalization *) + source_uri: string option [@default None]; +} [@@deriving yojson, show ];; + +(** Must be named `File` for test. *) +let create () : t = { + source_uri = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/file_schema_test_class.ml b/samples/openapi3/client/petstore/ocaml/src/models/file_schema_test_class.ml new file mode 100644 index 000000000000..a0b37e42d95b --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/file_schema_test_class.ml @@ -0,0 +1,17 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + file: File.t option [@default None]; + files: File.t list; +} [@@deriving yojson, show ];; + +let create () : t = { + file = None; + files = []; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/foo.ml b/samples/openapi3/client/petstore/ocaml/src/models/foo.ml new file mode 100644 index 000000000000..9235a58473b9 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/foo.ml @@ -0,0 +1,15 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + bar: string option [@default None]; +} [@@deriving yojson, show ];; + +let create () : t = { + bar = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/format_test.ml b/samples/openapi3/client/petstore/ocaml/src/models/format_test.ml new file mode 100644 index 000000000000..f97f995882a3 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/format_test.ml @@ -0,0 +1,45 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + integer: int32 option [@default None]; + int32: int32 option [@default None]; + int64: int64 option [@default None]; + number: float; + float: float option [@default None]; + double: float option [@default None]; + string: string option [@default None]; + byte: bytes; + binary: string option [@default None]; + date: string; + date_time: string option [@default None]; + uuid: string option [@default None]; + password: string; + (* A string that is a 10 digit number. Can have leading zeros. *) + pattern_with_digits: string option [@default None]; + (* A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. *) + pattern_with_digits_and_delimiter: string option [@default None]; +} [@@deriving yojson, show ];; + +let create (number : float) (byte : bytes) (date : string) (password : string) : t = { + integer = None; + int32 = None; + int64 = None; + number = number; + float = None; + double = None; + string = None; + byte = byte; + binary = None; + date = date; + date_time = None; + uuid = None; + password = password; + pattern_with_digits = None; + pattern_with_digits_and_delimiter = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/has_only_read_only.ml b/samples/openapi3/client/petstore/ocaml/src/models/has_only_read_only.ml new file mode 100644 index 000000000000..b2c932999728 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/has_only_read_only.ml @@ -0,0 +1,17 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + bar: string option [@default None]; + foo: string option [@default None]; +} [@@deriving yojson, show ];; + +let create () : t = { + bar = None; + foo = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/health_check_result.ml b/samples/openapi3/client/petstore/ocaml/src/models/health_check_result.ml new file mode 100644 index 000000000000..ed7da9f41892 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/health_check_result.ml @@ -0,0 +1,17 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + * Schema Health_check_result.t : Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + *) + +type t = { + nullable_message: string option [@default None]; +} [@@deriving yojson, show ];; + +(** Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. *) +let create () : t = { + nullable_message = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/inline_object.ml b/samples/openapi3/client/petstore/ocaml/src/models/inline_object.ml new file mode 100644 index 000000000000..8ccb9092bc43 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/inline_object.ml @@ -0,0 +1,19 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + (* Updated name of the pet *) + name: string option [@default None]; + (* Updated status of the pet *) + status: string option [@default None]; +} [@@deriving yojson, show ];; + +let create () : t = { + name = None; + status = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/inline_object_1.ml b/samples/openapi3/client/petstore/ocaml/src/models/inline_object_1.ml new file mode 100644 index 000000000000..b41cb8d1274a --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/inline_object_1.ml @@ -0,0 +1,19 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + (* Additional data to pass to server *) + additional_metadata: string option [@default None]; + (* file to upload *) + file: string option [@default None]; +} [@@deriving yojson, show ];; + +let create () : t = { + additional_metadata = None; + file = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/inline_object_2.ml b/samples/openapi3/client/petstore/ocaml/src/models/inline_object_2.ml new file mode 100644 index 000000000000..bae5e45bdd4a --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/inline_object_2.ml @@ -0,0 +1,19 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + (* Form parameter enum test (string array) *) + enum_form_string_array: Enums.enum_form_string_array list; + (* Form parameter enum test (string) *) + enum_form_string: Enums.enumclass[@default -efg] option [@default None]; +} [@@deriving yojson, show ];; + +let create () : t = { + enum_form_string_array = []; + enum_form_string = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/inline_object_3.ml b/samples/openapi3/client/petstore/ocaml/src/models/inline_object_3.ml new file mode 100644 index 000000000000..4c208dd26b30 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/inline_object_3.ml @@ -0,0 +1,55 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + (* None *) + integer: int32 option [@default None]; + (* None *) + int32: int32 option [@default None]; + (* None *) + int64: int64 option [@default None]; + (* None *) + number: float; + (* None *) + float: float option [@default None]; + (* None *) + double: float; + (* None *) + string: string option [@default None]; + (* None *) + pattern_without_delimiter: string; + (* None *) + byte: bytes; + (* None *) + binary: string option [@default None]; + (* None *) + date: string option [@default None]; + (* None *) + date_time: string option [@default None]; + (* None *) + password: string option [@default None]; + (* None *) + callback: string option [@default None]; +} [@@deriving yojson, show ];; + +let create (number : float) (double : float) (pattern_without_delimiter : string) (byte : bytes) : t = { + integer = None; + int32 = None; + int64 = None; + number = number; + float = None; + double = double; + string = None; + pattern_without_delimiter = pattern_without_delimiter; + byte = byte; + binary = None; + date = None; + date_time = None; + password = None; + callback = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/inline_object_4.ml b/samples/openapi3/client/petstore/ocaml/src/models/inline_object_4.ml new file mode 100644 index 000000000000..1291f3285edd --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/inline_object_4.ml @@ -0,0 +1,19 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + (* field1 *) + param: string; + (* field2 *) + param2: string; +} [@@deriving yojson, show ];; + +let create (param : string) (param2 : string) : t = { + param = param; + param2 = param2; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/inline_object_5.ml b/samples/openapi3/client/petstore/ocaml/src/models/inline_object_5.ml new file mode 100644 index 000000000000..565d45476808 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/inline_object_5.ml @@ -0,0 +1,19 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + (* Additional data to pass to server *) + additional_metadata: string option [@default None]; + (* file to upload *) + required_file: string; +} [@@deriving yojson, show ];; + +let create (required_file : string) : t = { + additional_metadata = None; + required_file = required_file; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/inline_response_default.ml b/samples/openapi3/client/petstore/ocaml/src/models/inline_response_default.ml new file mode 100644 index 000000000000..b252687ea6d9 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/inline_response_default.ml @@ -0,0 +1,15 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + string: Foo.t option [@default None]; +} [@@deriving yojson, show ];; + +let create () : t = { + string = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/map_test.ml b/samples/openapi3/client/petstore/ocaml/src/models/map_test.ml new file mode 100644 index 000000000000..1a9620eb4381 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/map_test.ml @@ -0,0 +1,21 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + map_map_of_string: (string * (string * string) list) list; + map_of_enum_string: (string * Enums.map_of_enum_string) list; + direct_map: (string * bool) list; + indirect_map: (string * bool) list; +} [@@deriving yojson, show ];; + +let create () : t = { + map_map_of_string = []; + map_of_enum_string = []; + direct_map = []; + indirect_map = []; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/mixed_properties_and_additional_properties_class.ml b/samples/openapi3/client/petstore/ocaml/src/models/mixed_properties_and_additional_properties_class.ml new file mode 100644 index 000000000000..c0293cc24575 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/mixed_properties_and_additional_properties_class.ml @@ -0,0 +1,19 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + uuid: string option [@default None]; + date_time: string option [@default None]; + map: (string * Animal.t) list; +} [@@deriving yojson, show ];; + +let create () : t = { + uuid = None; + date_time = None; + map = []; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/model_200_response.ml b/samples/openapi3/client/petstore/ocaml/src/models/model_200_response.ml new file mode 100644 index 000000000000..f35b0071f474 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/model_200_response.ml @@ -0,0 +1,19 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + * Schema Model_200_response.t : Model for testing model name starting with number + *) + +type t = { + name: int32 option [@default None]; + _class: string option [@default None]; +} [@@deriving yojson, show ];; + +(** Model for testing model name starting with number *) +let create () : t = { + name = None; + _class = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/model__special_model_name_.ml b/samples/openapi3/client/petstore/ocaml/src/models/model__special_model_name_.ml new file mode 100644 index 000000000000..d25a7603dbda --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/model__special_model_name_.ml @@ -0,0 +1,15 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + special_property_name: int64 option [@default None]; +} [@@deriving yojson, show ];; + +let create () : t = { + special_property_name = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/name.ml b/samples/openapi3/client/petstore/ocaml/src/models/name.ml new file mode 100644 index 000000000000..5bcd9672e51d --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/name.ml @@ -0,0 +1,23 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + * Schema Name.t : Model for testing model name same as property name + *) + +type t = { + name: int32; + snake_case: int32 option [@default None]; + property: string option [@default None]; + var_123_number: int32 option [@default None]; +} [@@deriving yojson, show ];; + +(** Model for testing model name same as property name *) +let create (name : int32) : t = { + name = name; + snake_case = None; + property = None; + var_123_number = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/nullable_class.ml b/samples/openapi3/client/petstore/ocaml/src/models/nullable_class.ml new file mode 100644 index 000000000000..e69710ec82e1 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/nullable_class.ml @@ -0,0 +1,37 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + integer_prop: int32 option [@default None]; + number_prop: float option [@default None]; + boolean_prop: bool option [@default None]; + string_prop: string option [@default None]; + date_prop: string option [@default None]; + datetime_prop: string option [@default None]; + array_nullable_prop: Yojson.Safe.t list; + array_and_items_nullable_prop: Yojson.Safe.t list; + array_items_nullable: Yojson.Safe.t list; + object_nullable_prop: (string * Yojson.Safe.t) list; + object_and_items_nullable_prop: (string * Yojson.Safe.t) list; + object_items_nullable: (string * Yojson.Safe.t) list; +} [@@deriving yojson, show ];; + +let create () : t = { + integer_prop = None; + number_prop = None; + boolean_prop = None; + string_prop = None; + date_prop = None; + datetime_prop = None; + array_nullable_prop = []; + array_and_items_nullable_prop = []; + array_items_nullable = []; + object_nullable_prop = []; + object_and_items_nullable_prop = []; + object_items_nullable = []; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/number_only.ml b/samples/openapi3/client/petstore/ocaml/src/models/number_only.ml new file mode 100644 index 000000000000..dcc3118f2d59 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/number_only.ml @@ -0,0 +1,15 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + just_number: float option [@default None]; +} [@@deriving yojson, show ];; + +let create () : t = { + just_number = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/order.ml b/samples/openapi3/client/petstore/ocaml/src/models/order.ml new file mode 100644 index 000000000000..437082dacefc --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/order.ml @@ -0,0 +1,26 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + id: int64 option [@default None]; + pet_id: int64 option [@default None]; + quantity: int32 option [@default None]; + ship_date: string option [@default None]; + (* Order Status *) + status: Enums.status option [@default None]; + complete: bool option [@default None]; +} [@@deriving yojson, show ];; + +let create () : t = { + id = None; + pet_id = None; + quantity = None; + ship_date = None; + status = None; + complete = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/outer_composite.ml b/samples/openapi3/client/petstore/ocaml/src/models/outer_composite.ml new file mode 100644 index 000000000000..c181d749c1f9 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/outer_composite.ml @@ -0,0 +1,19 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + my_number: float option [@default None]; + my_string: string option [@default None]; + my_boolean: bool option [@default None]; +} [@@deriving yojson, show ];; + +let create () : t = { + my_number = None; + my_string = None; + my_boolean = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/pet.ml b/samples/openapi3/client/petstore/ocaml/src/models/pet.ml new file mode 100644 index 000000000000..83b355e39afd --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/pet.ml @@ -0,0 +1,26 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + id: int64 option [@default None]; + category: Category.t option [@default None]; + name: string; + photo_urls: string list; + tags: Tag.t list; + (* pet status in the store *) + status: Enums.pet_status option [@default None]; +} [@@deriving yojson, show ];; + +let create (name : string) (photo_urls : string list) : t = { + id = None; + category = None; + name = name; + photo_urls = photo_urls; + tags = []; + status = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/read_only_first.ml b/samples/openapi3/client/petstore/ocaml/src/models/read_only_first.ml new file mode 100644 index 000000000000..58b6bb799805 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/read_only_first.ml @@ -0,0 +1,17 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + bar: string option [@default None]; + baz: string option [@default None]; +} [@@deriving yojson, show ];; + +let create () : t = { + bar = None; + baz = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/return.ml b/samples/openapi3/client/petstore/ocaml/src/models/return.ml new file mode 100644 index 000000000000..e97da73a7e03 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/return.ml @@ -0,0 +1,17 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + * Schema Return.t : Model for testing reserved words + *) + +type t = { + return: int32 option [@default None]; +} [@@deriving yojson, show ];; + +(** Model for testing reserved words *) +let create () : t = { + return = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/tag.ml b/samples/openapi3/client/petstore/ocaml/src/models/tag.ml new file mode 100644 index 000000000000..2a5c5847ff86 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/tag.ml @@ -0,0 +1,17 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + id: int64 option [@default None]; + name: string option [@default None]; +} [@@deriving yojson, show ];; + +let create () : t = { + id = None; + name = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/user.ml b/samples/openapi3/client/petstore/ocaml/src/models/user.ml new file mode 100644 index 000000000000..3f682436382a --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/user.ml @@ -0,0 +1,30 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + id: int64 option [@default None]; + username: string option [@default None]; + first_name: string option [@default None]; + last_name: string option [@default None]; + email: string option [@default None]; + password: string option [@default None]; + phone: string option [@default None]; + (* User Status *) + user_status: int32 option [@default None]; +} [@@deriving yojson, show ];; + +let create () : t = { + id = None; + username = None; + first_name = None; + last_name = None; + email = None; + password = None; + phone = None; + user_status = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/support/enums.ml b/samples/openapi3/client/petstore/ocaml/src/support/enums.ml new file mode 100644 index 000000000000..e44a8b784bfc --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/support/enums.ml @@ -0,0 +1,142 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type outerenuminteger = [ +| `_0 [@printer fun fmt _ -> Format.pp_print_string fmt "0"] [@name "0"] +| `_1 [@printer fun fmt _ -> Format.pp_print_string fmt "1"] [@name "1"] +| `_2 [@printer fun fmt _ -> Format.pp_print_string fmt "2"] [@name "2"] +] [@@deriving yojson, show { with_path = false }];; + +let outerenuminteger_of_yojson json = outerenuminteger_of_yojson (`List [json]) +let outerenuminteger_to_yojson e = + match outerenuminteger_to_yojson e with + | `List [json] -> json + | json -> json + +type status = [ +| `Placed [@printer fun fmt _ -> Format.pp_print_string fmt "placed"] [@name "placed"] +| `Approved [@printer fun fmt _ -> Format.pp_print_string fmt "approved"] [@name "approved"] +| `Delivered [@printer fun fmt _ -> Format.pp_print_string fmt "delivered"] [@name "delivered"] +] [@@deriving yojson, show { with_path = false }];; + +let status_of_yojson json = status_of_yojson (`List [json]) +let status_to_yojson e = + match status_to_yojson e with + | `List [json] -> json + | json -> json + +type enum_query_integer = [ +| `_1 [@printer fun fmt _ -> Format.pp_print_string fmt "1"] [@name "1"] +| `Minus2 [@printer fun fmt _ -> Format.pp_print_string fmt "-2"] [@name "-2"] +] [@@deriving yojson, show { with_path = false }];; + +let enum_query_integer_of_yojson json = enum_query_integer_of_yojson (`List [json]) +let enum_query_integer_to_yojson e = + match enum_query_integer_to_yojson e with + | `List [json] -> json + | json -> json + +type enum_form_string_array = [ +| `Greater_Than [@printer fun fmt _ -> Format.pp_print_string fmt ">"] [@name ">"] +| `Dollar [@printer fun fmt _ -> Format.pp_print_string fmt "$"] [@name "$"] +] [@@deriving yojson, show { with_path = false }];; + +let enum_form_string_array_of_yojson json = enum_form_string_array_of_yojson (`List [json]) +let enum_form_string_array_to_yojson e = + match enum_form_string_array_to_yojson e with + | `List [json] -> json + | json -> json + +type enum_number = [ +| `_1Period1 [@printer fun fmt _ -> Format.pp_print_string fmt "1.1"] [@name "1.1"] +| `Minus1Period2 [@printer fun fmt _ -> Format.pp_print_string fmt "-1.2"] [@name "-1.2"] +] [@@deriving yojson, show { with_path = false }];; + +let enum_number_of_yojson json = enum_number_of_yojson (`List [json]) +let enum_number_to_yojson e = + match enum_number_to_yojson e with + | `List [json] -> json + | json -> json + +type map_of_enum_string = [ +| `UPPER [@printer fun fmt _ -> Format.pp_print_string fmt "UPPER"] [@name "UPPER"] +| `Lower [@printer fun fmt _ -> Format.pp_print_string fmt "lower"] [@name "lower"] +] [@@deriving yojson, show { with_path = false }];; + +let map_of_enum_string_of_yojson json = map_of_enum_string_of_yojson (`List [json]) +let map_of_enum_string_to_yojson e = + match map_of_enum_string_to_yojson e with + | `List [json] -> json + | json -> json + +type enum_integer = [ +| `_1 [@printer fun fmt _ -> Format.pp_print_string fmt "1"] [@name "1"] +| `Minus1 [@printer fun fmt _ -> Format.pp_print_string fmt "-1"] [@name "-1"] +] [@@deriving yojson, show { with_path = false }];; + +let enum_integer_of_yojson json = enum_integer_of_yojson (`List [json]) +let enum_integer_to_yojson e = + match enum_integer_to_yojson e with + | `List [json] -> json + | json -> json + +type just_symbol = [ +| `Greater_ThanEqual [@printer fun fmt _ -> Format.pp_print_string fmt ">="] [@name ">="] +| `Dollar [@printer fun fmt _ -> Format.pp_print_string fmt "$"] [@name "$"] +] [@@deriving yojson, show { with_path = false }];; + +let just_symbol_of_yojson json = just_symbol_of_yojson (`List [json]) +let just_symbol_to_yojson e = + match just_symbol_to_yojson e with + | `List [json] -> json + | json -> json + +type array_enum = [ +| `Fish [@printer fun fmt _ -> Format.pp_print_string fmt "fish"] [@name "fish"] +| `Crab [@printer fun fmt _ -> Format.pp_print_string fmt "crab"] [@name "crab"] +] [@@deriving yojson, show { with_path = false }];; + +let array_enum_of_yojson json = array_enum_of_yojson (`List [json]) +let array_enum_to_yojson e = + match array_enum_to_yojson e with + | `List [json] -> json + | json -> json + +type pet_status = [ +| `Available [@printer fun fmt _ -> Format.pp_print_string fmt "available"] [@name "available"] +| `Pending [@printer fun fmt _ -> Format.pp_print_string fmt "pending"] [@name "pending"] +| `Sold [@printer fun fmt _ -> Format.pp_print_string fmt "sold"] [@name "sold"] +] [@@deriving yojson, show { with_path = false }];; + +let pet_status_of_yojson json = pet_status_of_yojson (`List [json]) +let pet_status_to_yojson e = + match pet_status_to_yojson e with + | `List [json] -> json + | json -> json + +type enumclass = [ +| `Underscoreabc [@printer fun fmt _ -> Format.pp_print_string fmt "_abc"] [@name "_abc"] +| `Minusefg [@printer fun fmt _ -> Format.pp_print_string fmt "-efg"] [@name "-efg"] +| `Left_ParenthesisxyzRight_Parenthesis [@printer fun fmt _ -> Format.pp_print_string fmt "(xyz)"] [@name "(xyz)"] +] [@@deriving yojson, show { with_path = false }];; + +let enumclass_of_yojson json = enumclass_of_yojson (`List [json]) +let enumclass_to_yojson e = + match enumclass_to_yojson e with + | `List [json] -> json + | json -> json + +type enum_string = [ +| `UPPER [@printer fun fmt _ -> Format.pp_print_string fmt "UPPER"] [@name "UPPER"] +| `Lower [@printer fun fmt _ -> Format.pp_print_string fmt "lower"] [@name "lower"] +] [@@deriving yojson, show { with_path = false }];; + +let enum_string_of_yojson json = enum_string_of_yojson (`List [json]) +let enum_string_to_yojson e = + match enum_string_to_yojson e with + | `List [json] -> json + | json -> json diff --git a/samples/openapi3/client/petstore/ocaml/src/support/jsonSupport.ml b/samples/openapi3/client/petstore/ocaml/src/support/jsonSupport.ml new file mode 100644 index 000000000000..4b0fac77545a --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/support/jsonSupport.ml @@ -0,0 +1,55 @@ +open Ppx_deriving_yojson_runtime + +let unwrap to_json json = + match to_json json with + | Result.Ok json -> json + | Result.Error s -> failwith s + +let to_int json = + match json with + | `Int x -> x + | `Intlit s -> int_of_string s + | _ -> failwith "JsonSupport.to_int" + +let to_bool json = + match json with + | `Bool x -> x + | _ -> failwith "JsonSupport.to_bool" + +let to_float json = + match json with + | `Float x -> x + | _ -> failwith "JsonSupport.to_float" + +let to_string json = + match json with + | `String s -> s + | _ -> failwith "JsonSupport.to_string" + +let to_int32 json : int32 = + match json with + | `Int x -> Int32.of_int x + | `Intlit s -> Int32.of_string s + | _ -> failwith "JsonSupport.to_int32" + +let to_int64 json : int64 = + match json with + | `Int x -> Int64.of_int x + | `Intlit s -> Int64.of_string s + | _ -> failwith "JsonSupport.to_int64" + +let of_int x = `Int x + +let of_bool b = `Bool b + +let of_float x = `Float x + +let of_string s = `String s + +let of_int32 x = `Intlit (Int32.to_string x) + +let of_int64 x = `Intlit (Int64.to_string x) + +let of_list_of of_f l = `List (List.map of_f l) + +let of_map_of of_f l = `Assoc (List.map (fun (k, v) -> (k, of_f v)) l) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/ocaml/src/support/request.ml b/samples/openapi3/client/petstore/ocaml/src/support/request.ml new file mode 100644 index 000000000000..909b9aa52cff --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/support/request.ml @@ -0,0 +1,48 @@ +let api_key = "" +let base_url = "http://petstore.swagger.io:80/v2" +let default_headers = Cohttp.Header.init_with "Content-Type" "application/json" + +let build_uri operation_path = Uri.of_string (base_url ^ operation_path) +let write_json_body to_json payload = + to_json payload |> Yojson.Safe.to_string ~std:true |> Cohttp_lwt.Body.of_string + +let handle_response resp on_success_handler = + match Cohttp_lwt.Response.status resp with + | #Cohttp.Code.success_status -> on_success_handler () + | s -> failwith ("Server responded with status " ^ Cohttp.Code.(reason_phrase_of_code (code_of_status s))) + +let handle_unit_response resp = handle_response resp (fun () -> Lwt.return ()) + +let read_json_body resp body = + handle_response resp (fun () -> + (Lwt.(Cohttp_lwt.Body.to_string body >|= Yojson.Safe.from_string))) + +let read_json_body_as of_json resp body = + Lwt.(read_json_body resp body >|= of_json) + +let read_json_body_as_list resp body = + Lwt.(read_json_body resp body >|= Yojson.Safe.Util.to_list) + +let read_json_body_as_list_of of_json resp body = + Lwt.(read_json_body_as_list resp body >|= List.map of_json) + +let read_json_body_as_map_of of_json resp body = + Lwt.(read_json_body resp body >|= Yojson.Safe.Util.to_assoc >|= List.map (fun (s, v) -> (s, of_json v))) + +let replace_path_param uri param_name param_value = + let regexp = Str.regexp (Str.quote ("{" ^ param_name ^ "}")) in + let path = Str.global_replace regexp param_value (Uri.path uri) in + Uri.with_path uri path + +let init_form_encoded_body () = "" + +let add_form_encoded_body_param params (paramName, paramValue) = + let new_param_enc = Printf.sprintf {|%s=%s|} (Uri.pct_encode paramName) (Uri.pct_encode paramValue) in + if params = "" + then new_param_enc + else Printf.sprintf {|%s&%s|} params new_param_enc + +let add_form_encoded_body_params params (paramName, new_params) = + add_form_encoded_body_param params (paramName, String.concat "," new_params) + +let finalize_form_encoded_body body = Cohttp_lwt.Body.of_string body diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumInteger.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumInteger.php index 3d43c34ad302..14f91bb853b3 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumInteger.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumInteger.php @@ -43,9 +43,9 @@ class OuterEnumInteger /** * Possible values of this enum */ - const 0 = 0; - const 1 = 1; - const 2 = 2; + const NUMBER_0 = 0; + const NUMBER_1 = 1; + const NUMBER_2 = 2; /** * Gets allowable values of the enum @@ -54,9 +54,9 @@ class OuterEnumInteger public static function getAllowableEnumValues() { return [ - self::0, - self::1, - self::2, + self::NUMBER_0, + self::NUMBER_1, + self::NUMBER_2, ]; } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumIntegerDefaultValue.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumIntegerDefaultValue.php index 13e453068484..029d8b5d5d04 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumIntegerDefaultValue.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumIntegerDefaultValue.php @@ -43,9 +43,9 @@ class OuterEnumIntegerDefaultValue /** * Possible values of this enum */ - const 0 = 0; - const 1 = 1; - const 2 = 2; + const NUMBER_0 = 0; + const NUMBER_1 = 1; + const NUMBER_2 = 2; /** * Gets allowable values of the enum @@ -54,9 +54,9 @@ class OuterEnumIntegerDefaultValue public static function getAllowableEnumValues() { return [ - self::0, - self::1, - self::2, + self::NUMBER_0, + self::NUMBER_1, + self::NUMBER_2, ]; } } diff --git a/samples/openapi3/server/petstore/go-api-server/.openapi-generator/VERSION b/samples/openapi3/server/petstore/go-api-server/.openapi-generator/VERSION index afa636560641..83a328a9227e 100644 --- a/samples/openapi3/server/petstore/go-api-server/.openapi-generator/VERSION +++ b/samples/openapi3/server/petstore/go-api-server/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/server/petstore/go-api-server/go/README.md b/samples/openapi3/server/petstore/go-api-server/README.md similarity index 100% rename from samples/openapi3/server/petstore/go-api-server/go/README.md rename to samples/openapi3/server/petstore/go-api-server/README.md diff --git a/samples/openapi3/server/petstore/go-api-server/api/openapi.yaml b/samples/openapi3/server/petstore/go-api-server/api/openapi.yaml index 2cd94b385f37..95b487afebfc 100644 --- a/samples/openapi3/server/petstore/go-api-server/api/openapi.yaml +++ b/samples/openapi3/server/petstore/go-api-server/api/openapi.yaml @@ -130,7 +130,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + description: Multiple tags can be provided with comma separated strings. Use + tag1, tag2, tag3 for testing. operationId: findPetsByTags parameters: - description: Tags to filter by @@ -350,7 +351,8 @@ paths: - store /store/order/{order_id}: delete: - description: For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + description: For valid response try integer IDs with value < 1000. Anything + above 1000 or nonintegers will generate API errors operationId: deleteOrder parameters: - description: ID of the order that needs to be deleted @@ -370,7 +372,8 @@ paths: tags: - store get: - description: For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generated exceptions operationId: getOrderById parameters: - description: ID of pet that needs to be fetched @@ -604,7 +607,6 @@ paths: name: required_string_group required: true schema: - format: int32 type: integer style: form - description: Required Boolean in group parameters @@ -630,7 +632,6 @@ paths: name: string_group required: false schema: - format: int32 type: integer style: form - description: Boolean in group parameters @@ -803,7 +804,6 @@ paths: properties: integer: description: None - format: int32 maximum: 100 minimum: 10 type: integer @@ -1045,7 +1045,8 @@ paths: - $another-fake? /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema named `File`. + description: For this test, the body for this request much reference a schema + named `File`. operationId: testBodyWithFileSchema requestBody: content: @@ -1368,7 +1369,6 @@ components: property: type: string 123Number: - format: int32 readOnly: true type: integer required: @@ -1393,17 +1393,11 @@ components: Dog: allOf: - $ref: '#/components/schemas/Animal' - - properties: - breed: - type: string - type: object + - $ref: '#/components/schemas/Dog_allOf' Cat: allOf: - $ref: '#/components/schemas/Animal' - - properties: - declawed: - type: boolean - type: object + - $ref: '#/components/schemas/Cat_allOf' Animal: discriminator: propertyName: className @@ -1423,7 +1417,6 @@ components: format_test: properties: integer: - format: int32 maximum: 100 minimum: 10 type: integer @@ -1478,7 +1471,8 @@ components: pattern: ^\d{10}$ type: string pattern_with_digits_and_delimiter: - description: A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + description: A string starting with 'image_' (case insensitive) and one + to three digits following i.e. Image_01. pattern: /^image_\d{1,3}$/i type: string required: @@ -1625,6 +1619,7 @@ components: indirect_map: additionalProperties: type: boolean + type: object type: object ArrayTest: properties: @@ -1687,13 +1682,13 @@ components: - placed - approved - delivered + nullable: true type: string OuterEnumInteger: enum: - 0 - 1 - 2 - format: int32 type: integer OuterEnumDefaultValue: default: placed @@ -1708,7 +1703,6 @@ components: - 0 - 1 - 2 - format: int32 type: integer OuterComposite: example: @@ -1734,6 +1728,7 @@ components: StringBooleanMap: additionalProperties: type: boolean + type: object FileSchemaTestClass: example: file: @@ -1766,7 +1761,8 @@ components: xml: name: $special[model.name] HealthCheckResult: - description: Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + description: Just a string to inform instance is up and running. Make it nullable + in hope to get it as pointer in generated model. example: NullableMessage: NullableMessage properties: @@ -1774,6 +1770,64 @@ components: nullable: true type: string type: object + NullableClass: + additionalProperties: + nullable: true + type: object + properties: + integer_prop: + nullable: true + type: integer + number_prop: + nullable: true + type: number + boolean_prop: + nullable: true + type: boolean + string_prop: + nullable: true + type: string + date_prop: + format: date + nullable: true + type: string + datetime_prop: + format: date-time + nullable: true + type: string + array_nullable_prop: + items: + type: object + nullable: true + type: array + array_and_items_nullable_prop: + items: + nullable: true + type: object + nullable: true + type: array + array_items_nullable: + items: + nullable: true + type: object + type: array + object_nullable_prop: + additionalProperties: + type: object + nullable: true + type: object + object_and_items_nullable_prop: + additionalProperties: + nullable: true + type: object + nullable: true + type: object + object_items_nullable: + additionalProperties: + nullable: true + type: object + type: object + type: object inline_response_default: example: string: @@ -1824,7 +1878,6 @@ components: properties: integer: description: None - format: int32 maximum: 100 minimum: 10 type: integer @@ -1917,6 +1970,14 @@ components: required: - requiredFile type: object + Dog_allOf: + properties: + breed: + type: string + Cat_allOf: + properties: + declawed: + type: boolean securitySchemes: petstore_auth: flows: diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_cat_all_of.go b/samples/openapi3/server/petstore/go-api-server/go/model_cat_all_of.go new file mode 100644 index 000000000000..312c33895f8d --- /dev/null +++ b/samples/openapi3/server/petstore/go-api-server/go/model_cat_all_of.go @@ -0,0 +1,15 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package petstoreserver + +type CatAllOf struct { + + Declawed bool `json:"declawed,omitempty"` +} diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_dog_all_of.go b/samples/openapi3/server/petstore/go-api-server/go/model_dog_all_of.go new file mode 100644 index 000000000000..a36b96b1a0cb --- /dev/null +++ b/samples/openapi3/server/petstore/go-api-server/go/model_dog_all_of.go @@ -0,0 +1,15 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package petstoreserver + +type DogAllOf struct { + + Breed string `json:"breed,omitempty"` +} diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_enum_test_.go b/samples/openapi3/server/petstore/go-api-server/go/model_enum_test_.go index 01b52e667f4f..7822fd4e9d4a 100644 --- a/samples/openapi3/server/petstore/go-api-server/go/model_enum_test_.go +++ b/samples/openapi3/server/petstore/go-api-server/go/model_enum_test_.go @@ -19,7 +19,7 @@ type EnumTest struct { EnumNumber float64 `json:"enum_number,omitempty"` - OuterEnum OuterEnum `json:"outerEnum,omitempty"` + OuterEnum *OuterEnum `json:"outerEnum,omitempty"` OuterEnumInteger OuterEnumInteger `json:"outerEnumInteger,omitempty"` diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_nullable_class.go b/samples/openapi3/server/petstore/go-api-server/go/model_nullable_class.go new file mode 100644 index 000000000000..ba2aa1f86cfa --- /dev/null +++ b/samples/openapi3/server/petstore/go-api-server/go/model_nullable_class.go @@ -0,0 +1,41 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package petstoreserver + +import ( + "time" +) + +type NullableClass struct { + + IntegerProp *int32 `json:"integer_prop,omitempty"` + + NumberProp *float32 `json:"number_prop,omitempty"` + + BooleanProp *bool `json:"boolean_prop,omitempty"` + + StringProp *string `json:"string_prop,omitempty"` + + DateProp *string `json:"date_prop,omitempty"` + + DatetimeProp *time.Time `json:"datetime_prop,omitempty"` + + ArrayNullableProp *[]map[string]interface{} `json:"array_nullable_prop,omitempty"` + + ArrayAndItemsNullableProp *[]map[string]interface{} `json:"array_and_items_nullable_prop,omitempty"` + + ArrayItemsNullable []map[string]interface{} `json:"array_items_nullable,omitempty"` + + ObjectNullableProp *map[string]map[string]interface{} `json:"object_nullable_prop,omitempty"` + + ObjectAndItemsNullableProp *map[string]map[string]interface{} `json:"object_and_items_nullable_prop,omitempty"` + + ObjectItemsNullable map[string]map[string]interface{} `json:"object_items_nullable,omitempty"` +} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/.openapi-generator/VERSION b/samples/openapi3/server/petstore/go-gin-api-server/.openapi-generator/VERSION index afa636560641..83a328a9227e 100644 --- a/samples/openapi3/server/petstore/go-gin-api-server/.openapi-generator/VERSION +++ b/samples/openapi3/server/petstore/go-gin-api-server/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/server/petstore/go-gin-api-server/api/openapi.yaml b/samples/openapi3/server/petstore/go-gin-api-server/api/openapi.yaml index 2cd94b385f37..95b487afebfc 100644 --- a/samples/openapi3/server/petstore/go-gin-api-server/api/openapi.yaml +++ b/samples/openapi3/server/petstore/go-gin-api-server/api/openapi.yaml @@ -130,7 +130,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + description: Multiple tags can be provided with comma separated strings. Use + tag1, tag2, tag3 for testing. operationId: findPetsByTags parameters: - description: Tags to filter by @@ -350,7 +351,8 @@ paths: - store /store/order/{order_id}: delete: - description: For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + description: For valid response try integer IDs with value < 1000. Anything + above 1000 or nonintegers will generate API errors operationId: deleteOrder parameters: - description: ID of the order that needs to be deleted @@ -370,7 +372,8 @@ paths: tags: - store get: - description: For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generated exceptions operationId: getOrderById parameters: - description: ID of pet that needs to be fetched @@ -604,7 +607,6 @@ paths: name: required_string_group required: true schema: - format: int32 type: integer style: form - description: Required Boolean in group parameters @@ -630,7 +632,6 @@ paths: name: string_group required: false schema: - format: int32 type: integer style: form - description: Boolean in group parameters @@ -803,7 +804,6 @@ paths: properties: integer: description: None - format: int32 maximum: 100 minimum: 10 type: integer @@ -1045,7 +1045,8 @@ paths: - $another-fake? /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema named `File`. + description: For this test, the body for this request much reference a schema + named `File`. operationId: testBodyWithFileSchema requestBody: content: @@ -1368,7 +1369,6 @@ components: property: type: string 123Number: - format: int32 readOnly: true type: integer required: @@ -1393,17 +1393,11 @@ components: Dog: allOf: - $ref: '#/components/schemas/Animal' - - properties: - breed: - type: string - type: object + - $ref: '#/components/schemas/Dog_allOf' Cat: allOf: - $ref: '#/components/schemas/Animal' - - properties: - declawed: - type: boolean - type: object + - $ref: '#/components/schemas/Cat_allOf' Animal: discriminator: propertyName: className @@ -1423,7 +1417,6 @@ components: format_test: properties: integer: - format: int32 maximum: 100 minimum: 10 type: integer @@ -1478,7 +1471,8 @@ components: pattern: ^\d{10}$ type: string pattern_with_digits_and_delimiter: - description: A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + description: A string starting with 'image_' (case insensitive) and one + to three digits following i.e. Image_01. pattern: /^image_\d{1,3}$/i type: string required: @@ -1625,6 +1619,7 @@ components: indirect_map: additionalProperties: type: boolean + type: object type: object ArrayTest: properties: @@ -1687,13 +1682,13 @@ components: - placed - approved - delivered + nullable: true type: string OuterEnumInteger: enum: - 0 - 1 - 2 - format: int32 type: integer OuterEnumDefaultValue: default: placed @@ -1708,7 +1703,6 @@ components: - 0 - 1 - 2 - format: int32 type: integer OuterComposite: example: @@ -1734,6 +1728,7 @@ components: StringBooleanMap: additionalProperties: type: boolean + type: object FileSchemaTestClass: example: file: @@ -1766,7 +1761,8 @@ components: xml: name: $special[model.name] HealthCheckResult: - description: Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + description: Just a string to inform instance is up and running. Make it nullable + in hope to get it as pointer in generated model. example: NullableMessage: NullableMessage properties: @@ -1774,6 +1770,64 @@ components: nullable: true type: string type: object + NullableClass: + additionalProperties: + nullable: true + type: object + properties: + integer_prop: + nullable: true + type: integer + number_prop: + nullable: true + type: number + boolean_prop: + nullable: true + type: boolean + string_prop: + nullable: true + type: string + date_prop: + format: date + nullable: true + type: string + datetime_prop: + format: date-time + nullable: true + type: string + array_nullable_prop: + items: + type: object + nullable: true + type: array + array_and_items_nullable_prop: + items: + nullable: true + type: object + nullable: true + type: array + array_items_nullable: + items: + nullable: true + type: object + type: array + object_nullable_prop: + additionalProperties: + type: object + nullable: true + type: object + object_and_items_nullable_prop: + additionalProperties: + nullable: true + type: object + nullable: true + type: object + object_items_nullable: + additionalProperties: + nullable: true + type: object + type: object + type: object inline_response_default: example: string: @@ -1824,7 +1878,6 @@ components: properties: integer: description: None - format: int32 maximum: 100 minimum: 10 type: integer @@ -1917,6 +1970,14 @@ components: required: - requiredFile type: object + Dog_allOf: + properties: + breed: + type: string + Cat_allOf: + properties: + declawed: + type: boolean securitySchemes: petstore_auth: flows: diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_cat_all_of.go b/samples/openapi3/server/petstore/go-gin-api-server/go/model_cat_all_of.go new file mode 100644 index 000000000000..312c33895f8d --- /dev/null +++ b/samples/openapi3/server/petstore/go-gin-api-server/go/model_cat_all_of.go @@ -0,0 +1,15 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package petstoreserver + +type CatAllOf struct { + + Declawed bool `json:"declawed,omitempty"` +} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_dog_all_of.go b/samples/openapi3/server/petstore/go-gin-api-server/go/model_dog_all_of.go new file mode 100644 index 000000000000..a36b96b1a0cb --- /dev/null +++ b/samples/openapi3/server/petstore/go-gin-api-server/go/model_dog_all_of.go @@ -0,0 +1,15 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package petstoreserver + +type DogAllOf struct { + + Breed string `json:"breed,omitempty"` +} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_enum_test_.go b/samples/openapi3/server/petstore/go-gin-api-server/go/model_enum_test_.go index 01b52e667f4f..7822fd4e9d4a 100644 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/model_enum_test_.go +++ b/samples/openapi3/server/petstore/go-gin-api-server/go/model_enum_test_.go @@ -19,7 +19,7 @@ type EnumTest struct { EnumNumber float64 `json:"enum_number,omitempty"` - OuterEnum OuterEnum `json:"outerEnum,omitempty"` + OuterEnum *OuterEnum `json:"outerEnum,omitempty"` OuterEnumInteger OuterEnumInteger `json:"outerEnumInteger,omitempty"` diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_nullable_class.go b/samples/openapi3/server/petstore/go-gin-api-server/go/model_nullable_class.go new file mode 100644 index 000000000000..ba2aa1f86cfa --- /dev/null +++ b/samples/openapi3/server/petstore/go-gin-api-server/go/model_nullable_class.go @@ -0,0 +1,41 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package petstoreserver + +import ( + "time" +) + +type NullableClass struct { + + IntegerProp *int32 `json:"integer_prop,omitempty"` + + NumberProp *float32 `json:"number_prop,omitempty"` + + BooleanProp *bool `json:"boolean_prop,omitempty"` + + StringProp *string `json:"string_prop,omitempty"` + + DateProp *string `json:"date_prop,omitempty"` + + DatetimeProp *time.Time `json:"datetime_prop,omitempty"` + + ArrayNullableProp *[]map[string]interface{} `json:"array_nullable_prop,omitempty"` + + ArrayAndItemsNullableProp *[]map[string]interface{} `json:"array_and_items_nullable_prop,omitempty"` + + ArrayItemsNullable []map[string]interface{} `json:"array_items_nullable,omitempty"` + + ObjectNullableProp *map[string]map[string]interface{} `json:"object_nullable_prop,omitempty"` + + ObjectAndItemsNullableProp *map[string]map[string]interface{} `json:"object_and_items_nullable_prop,omitempty"` + + ObjectItemsNullable map[string]map[string]interface{} `json:"object_items_nullable,omitempty"` +} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/routers.go b/samples/openapi3/server/petstore/go-gin-api-server/go/routers.go index fd73305ca41a..d8c6615b8c74 100644 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/routers.go +++ b/samples/openapi3/server/petstore/go-gin-api-server/go/routers.go @@ -11,7 +11,6 @@ package petstoreserver import ( "net/http" - "strings" "github.com/gin-gonic/gin" ) @@ -36,13 +35,13 @@ func NewRouter() *gin.Engine { router := gin.Default() for _, route := range routes { switch route.Method { - case "GET": + case http.MethodGet: router.GET(route.Pattern, route.HandlerFunc) - case "POST": + case http.MethodPost: router.POST(route.Pattern, route.HandlerFunc) - case "PUT": + case http.MethodPut: router.PUT(route.Pattern, route.HandlerFunc) - case "DELETE": + case http.MethodDelete: router.DELETE(route.Pattern, route.HandlerFunc) } } @@ -58,266 +57,266 @@ func Index(c *gin.Context) { var routes = Routes{ { "Index", - "GET", + http.MethodGet, "/v2/", Index, }, { "Call123TestSpecialTags", - strings.ToUpper("Patch"), + http.MethodPatch, "/v2/another-fake/dummy", Call123TestSpecialTags, }, { "FooGet", - strings.ToUpper("Get"), + http.MethodGet, "/v2/foo", FooGet, }, { "FakeHealthGet", - strings.ToUpper("Get"), + http.MethodGet, "/v2/fake/health", FakeHealthGet, }, { "FakeOuterBooleanSerialize", - strings.ToUpper("Post"), + http.MethodPost, "/v2/fake/outer/boolean", FakeOuterBooleanSerialize, }, { "FakeOuterCompositeSerialize", - strings.ToUpper("Post"), + http.MethodPost, "/v2/fake/outer/composite", FakeOuterCompositeSerialize, }, { "FakeOuterNumberSerialize", - strings.ToUpper("Post"), + http.MethodPost, "/v2/fake/outer/number", FakeOuterNumberSerialize, }, { "FakeOuterStringSerialize", - strings.ToUpper("Post"), + http.MethodPost, "/v2/fake/outer/string", FakeOuterStringSerialize, }, { "TestBodyWithFileSchema", - strings.ToUpper("Put"), + http.MethodPut, "/v2/fake/body-with-file-schema", TestBodyWithFileSchema, }, { "TestBodyWithQueryParams", - strings.ToUpper("Put"), + http.MethodPut, "/v2/fake/body-with-query-params", TestBodyWithQueryParams, }, { "TestClientModel", - strings.ToUpper("Patch"), + http.MethodPatch, "/v2/fake", TestClientModel, }, { "TestEndpointParameters", - strings.ToUpper("Post"), + http.MethodPost, "/v2/fake", TestEndpointParameters, }, { "TestEnumParameters", - strings.ToUpper("Get"), + http.MethodGet, "/v2/fake", TestEnumParameters, }, { "TestGroupParameters", - strings.ToUpper("Delete"), + http.MethodDelete, "/v2/fake", TestGroupParameters, }, { "TestInlineAdditionalProperties", - strings.ToUpper("Post"), + http.MethodPost, "/v2/fake/inline-additionalProperties", TestInlineAdditionalProperties, }, { "TestJsonFormData", - strings.ToUpper("Get"), + http.MethodGet, "/v2/fake/jsonFormData", TestJsonFormData, }, { "TestClassname", - strings.ToUpper("Patch"), + http.MethodPatch, "/v2/fake_classname_test", TestClassname, }, { "AddPet", - strings.ToUpper("Post"), + http.MethodPost, "/v2/pet", AddPet, }, { "DeletePet", - strings.ToUpper("Delete"), + http.MethodDelete, "/v2/pet/:petId", DeletePet, }, { "FindPetsByStatus", - strings.ToUpper("Get"), + http.MethodGet, "/v2/pet/findByStatus", FindPetsByStatus, }, { "FindPetsByTags", - strings.ToUpper("Get"), + http.MethodGet, "/v2/pet/findByTags", FindPetsByTags, }, { "GetPetById", - strings.ToUpper("Get"), + http.MethodGet, "/v2/pet/:petId", GetPetById, }, { "UpdatePet", - strings.ToUpper("Put"), + http.MethodPut, "/v2/pet", UpdatePet, }, { "UpdatePetWithForm", - strings.ToUpper("Post"), + http.MethodPost, "/v2/pet/:petId", UpdatePetWithForm, }, { "UploadFile", - strings.ToUpper("Post"), + http.MethodPost, "/v2/pet/:petId/uploadImage", UploadFile, }, { "UploadFileWithRequiredFile", - strings.ToUpper("Post"), + http.MethodPost, "/v2/fake/:petId/uploadImageWithRequiredFile", UploadFileWithRequiredFile, }, { "DeleteOrder", - strings.ToUpper("Delete"), + http.MethodDelete, "/v2/store/order/:order_id", DeleteOrder, }, { "GetInventory", - strings.ToUpper("Get"), + http.MethodGet, "/v2/store/inventory", GetInventory, }, { "GetOrderById", - strings.ToUpper("Get"), + http.MethodGet, "/v2/store/order/:order_id", GetOrderById, }, { "PlaceOrder", - strings.ToUpper("Post"), + http.MethodPost, "/v2/store/order", PlaceOrder, }, { "CreateUser", - strings.ToUpper("Post"), + http.MethodPost, "/v2/user", CreateUser, }, { "CreateUsersWithArrayInput", - strings.ToUpper("Post"), + http.MethodPost, "/v2/user/createWithArray", CreateUsersWithArrayInput, }, { "CreateUsersWithListInput", - strings.ToUpper("Post"), + http.MethodPost, "/v2/user/createWithList", CreateUsersWithListInput, }, { "DeleteUser", - strings.ToUpper("Delete"), + http.MethodDelete, "/v2/user/:username", DeleteUser, }, { "GetUserByName", - strings.ToUpper("Get"), + http.MethodGet, "/v2/user/:username", GetUserByName, }, { "LoginUser", - strings.ToUpper("Get"), + http.MethodGet, "/v2/user/login", LoginUser, }, { "LogoutUser", - strings.ToUpper("Get"), + http.MethodGet, "/v2/user/logout", LogoutUser, }, { "UpdateUser", - strings.ToUpper("Put"), + http.MethodPut, "/v2/user/:username", UpdateUser, }, diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION b/samples/openapi3/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION index 06b5019af3f4..83a328a9227e 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.1-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/build.gradle.kts b/samples/openapi3/server/petstore/kotlin-springboot-reactive/build.gradle.kts index f62d3f33c8d1..f4561be14beb 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/build.gradle.kts +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/build.gradle.kts @@ -43,9 +43,11 @@ dependencies { compile("com.fasterxml.jackson.dataformat:jackson-dataformat-xml") compile("com.fasterxml.jackson.module:jackson-module-kotlin") + testCompile("org.jetbrains.kotlin:kotlin-test-junit5") testCompile("org.springframework.boot:spring-boot-starter-test") { exclude(module = "junit") } + testCompile("org.jetbrains.kotlinx:kotlinx-coroutines-test:$kotlinxCoroutinesVersion") } repositories { diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/pom.xml b/samples/openapi3/server/petstore/kotlin-springboot-reactive/pom.xml index 1932017d4bfb..b0a954d47075 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/pom.xml +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/pom.xml @@ -96,6 +96,12 @@ swagger-annotations 1.5.21 + + + com.google.code.findbugs + jsr305 + 3.0.2 + com.fasterxml.jackson.dataformat jackson-dataformat-yaml @@ -117,6 +123,12 @@ javax.validation validation-api + + org.jetbrains.kotlin + kotlin-test-junit5 + 1.3.31 + test + diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApi.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApi.kt index 29de43b1a020..3c5f068d9fb8 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApi.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApi.kt @@ -45,142 +45,142 @@ import kotlin.collections.Map class PetApiController(@Autowired(required = true) val service: PetApiService) { @ApiOperation( - value = "Add a new pet to the store", - nickname = "addPet", - notes = "", - authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) + value = "Add a new pet to the store", + nickname = "addPet", + notes = "", + authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( - value = [ApiResponse(code = 405, message = "Invalid input")]) + value = [ApiResponse(code = 405, message = "Invalid input")]) @RequestMapping( - value = ["/pet"], - consumes = ["application/json", "application/xml"], - method = [RequestMethod.POST]) + value = ["/pet"], + consumes = ["application/json", "application/xml"], + method = [RequestMethod.POST]) suspend fun addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody pet: Pet ): ResponseEntity { - return ResponseEntity(service.addPet(pet), HttpStatus.OK) + return ResponseEntity(service.addPet(pet), HttpStatus.valueOf(405)) } @ApiOperation( - value = "Deletes a pet", - nickname = "deletePet", - notes = "", - authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) + value = "Deletes a pet", + nickname = "deletePet", + notes = "", + authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( - value = [ApiResponse(code = 400, message = "Invalid pet value")]) + value = [ApiResponse(code = 400, message = "Invalid pet value")]) @RequestMapping( - value = ["/pet/{petId}"], - method = [RequestMethod.DELETE]) - suspend fun deletePet(@ApiParam(value = "Pet id to delete", required=true) @PathVariable("petId") petId: Long -,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) apiKey: String? + value = ["/pet/{petId}"], + method = [RequestMethod.DELETE]) + suspend fun deletePet(@ApiParam(value = "Pet id to delete", required=true) @PathVariable("petId") petId: kotlin.Long +,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) apiKey: kotlin.String? ): ResponseEntity { - return ResponseEntity(service.deletePet(petId, apiKey), HttpStatus.OK) + return ResponseEntity(service.deletePet(petId, apiKey), HttpStatus.valueOf(400)) } @ApiOperation( - value = "Finds Pets by status", - nickname = "findPetsByStatus", - notes = "Multiple status values can be provided with comma separated strings", - response = Pet::class, - responseContainer = "List", - authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "read:pets", description = "read your pets")])]) + value = "Finds Pets by status", + nickname = "findPetsByStatus", + notes = "Multiple status values can be provided with comma separated strings", + response = Pet::class, + responseContainer = "List", + authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class, responseContainer = "List"),ApiResponse(code = 400, message = "Invalid status value")]) + value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class, responseContainer = "List"),ApiResponse(code = 400, message = "Invalid status value")]) @RequestMapping( - value = ["/pet/findByStatus"], - produces = ["application/xml", "application/json"], - method = [RequestMethod.GET]) - fun findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) status: List + value = ["/pet/findByStatus"], + produces = ["application/xml", "application/json"], + method = [RequestMethod.GET]) + fun findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) status: kotlin.collections.List ): ResponseEntity> { - return ResponseEntity(service.findPetsByStatus(status), HttpStatus.OK) + return ResponseEntity(service.findPetsByStatus(status), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Finds Pets by tags", - nickname = "findPetsByTags", - notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", - response = Pet::class, - responseContainer = "List", - authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "read:pets", description = "read your pets")])]) + value = "Finds Pets by tags", + nickname = "findPetsByTags", + notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", + response = Pet::class, + responseContainer = "List", + authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class, responseContainer = "List"),ApiResponse(code = 400, message = "Invalid tag value")]) + value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class, responseContainer = "List"),ApiResponse(code = 400, message = "Invalid tag value")]) @RequestMapping( - value = ["/pet/findByTags"], - produces = ["application/xml", "application/json"], - method = [RequestMethod.GET]) - fun findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) tags: List -,@ApiParam(value = "Maximum number of items to return") @Valid @RequestParam(value = "maxCount", required = false) maxCount: Int? + value = ["/pet/findByTags"], + produces = ["application/xml", "application/json"], + method = [RequestMethod.GET]) + fun findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) tags: kotlin.collections.List +,@ApiParam(value = "Maximum number of items to return") @Valid @RequestParam(value = "maxCount", required = false) maxCount: kotlin.Int? ): ResponseEntity> { - return ResponseEntity(service.findPetsByTags(tags, maxCount), HttpStatus.OK) + return ResponseEntity(service.findPetsByTags(tags, maxCount), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Find pet by ID", - nickname = "getPetById", - notes = "Returns a single pet", - response = Pet::class, - authorizations = [Authorization(value = "api_key")]) + value = "Find pet by ID", + nickname = "getPetById", + notes = "Returns a single pet", + response = Pet::class, + authorizations = [Authorization(value = "api_key")]) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class),ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Pet not found")]) + value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class),ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Pet not found")]) @RequestMapping( - value = ["/pet/{petId}"], - produces = ["application/xml", "application/json"], - method = [RequestMethod.GET]) - suspend fun getPetById(@ApiParam(value = "ID of pet to return", required=true) @PathVariable("petId") petId: Long + value = ["/pet/{petId}"], + produces = ["application/xml", "application/json"], + method = [RequestMethod.GET]) + suspend fun getPetById(@ApiParam(value = "ID of pet to return", required=true) @PathVariable("petId") petId: kotlin.Long ): ResponseEntity { - return ResponseEntity(service.getPetById(petId), HttpStatus.OK) + return ResponseEntity(service.getPetById(petId), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Update an existing pet", - nickname = "updatePet", - notes = "", - authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) + value = "Update an existing pet", + nickname = "updatePet", + notes = "", + authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( - value = [ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Pet not found"),ApiResponse(code = 405, message = "Validation exception")]) + value = [ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Pet not found"),ApiResponse(code = 405, message = "Validation exception")]) @RequestMapping( - value = ["/pet"], - consumes = ["application/json", "application/xml"], - method = [RequestMethod.PUT]) + value = ["/pet"], + consumes = ["application/json", "application/xml"], + method = [RequestMethod.PUT]) suspend fun updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody pet: Pet ): ResponseEntity { - return ResponseEntity(service.updatePet(pet), HttpStatus.OK) + return ResponseEntity(service.updatePet(pet), HttpStatus.valueOf(400)) } @ApiOperation( - value = "Updates a pet in the store with form data", - nickname = "updatePetWithForm", - notes = "", - authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) + value = "Updates a pet in the store with form data", + nickname = "updatePetWithForm", + notes = "", + authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( - value = [ApiResponse(code = 405, message = "Invalid input")]) + value = [ApiResponse(code = 405, message = "Invalid input")]) @RequestMapping( - value = ["/pet/{petId}"], - consumes = ["application/x-www-form-urlencoded"], - method = [RequestMethod.POST]) - suspend fun updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required=true) @PathVariable("petId") petId: Long -,@ApiParam(value = "Updated name of the pet") @RequestParam(value="name", required=false) name: String? -,@ApiParam(value = "Updated status of the pet") @RequestParam(value="status", required=false) status: String? + value = ["/pet/{petId}"], + consumes = ["application/x-www-form-urlencoded"], + method = [RequestMethod.POST]) + suspend fun updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required=true) @PathVariable("petId") petId: kotlin.Long +,@ApiParam(value = "Updated name of the pet") @RequestParam(value="name", required=false) name: kotlin.String? +,@ApiParam(value = "Updated status of the pet") @RequestParam(value="status", required=false) status: kotlin.String? ): ResponseEntity { - return ResponseEntity(service.updatePetWithForm(petId, name, status), HttpStatus.OK) + return ResponseEntity(service.updatePetWithForm(petId, name, status), HttpStatus.valueOf(405)) } @ApiOperation( - value = "uploads an image", - nickname = "uploadFile", - notes = "", - response = ModelApiResponse::class, - authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) + value = "uploads an image", + nickname = "uploadFile", + notes = "", + response = ModelApiResponse::class, + authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse::class)]) + value = [ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse::class)]) @RequestMapping( - value = ["/pet/{petId}/uploadImage"], - produces = ["application/json"], - consumes = ["multipart/form-data"], - method = [RequestMethod.POST]) - suspend fun uploadFile(@ApiParam(value = "ID of pet to update", required=true) @PathVariable("petId") petId: Long -,@ApiParam(value = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) additionalMetadata: String? + value = ["/pet/{petId}/uploadImage"], + produces = ["application/json"], + consumes = ["multipart/form-data"], + method = [RequestMethod.POST]) + suspend fun uploadFile(@ApiParam(value = "ID of pet to update", required=true) @PathVariable("petId") petId: kotlin.Long +,@ApiParam(value = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) additionalMetadata: kotlin.String? ,@ApiParam(value = "file detail") @Valid @RequestPart("file") file: org.springframework.core.io.Resource? ): ResponseEntity { - return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.OK) + return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.valueOf(200)) } } diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiService.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiService.kt index 2bd53b2a56d2..840b98205f74 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiService.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiService.kt @@ -7,17 +7,17 @@ interface PetApiService { suspend fun addPet(pet: Pet): Unit - suspend fun deletePet(petId: Long, apiKey: String?): Unit + suspend fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?): Unit - fun findPetsByStatus(status: List): Flow + fun findPetsByStatus(status: kotlin.collections.List): Flow - fun findPetsByTags(tags: List, maxCount: Int?): Flow + fun findPetsByTags(tags: kotlin.collections.List, maxCount: kotlin.Int?): Flow - suspend fun getPetById(petId: Long): Pet + suspend fun getPetById(petId: kotlin.Long): Pet suspend fun updatePet(pet: Pet): Unit - suspend fun updatePetWithForm(petId: Long, name: String?, status: String?): Unit + suspend fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?): Unit - suspend fun uploadFile(petId: Long, additionalMetadata: String?, file: org.springframework.core.io.Resource?): ModelApiResponse + suspend fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse } diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt index 009f039d8600..c77f932af9ad 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt @@ -11,19 +11,19 @@ class PetApiServiceImpl : PetApiService { TODO("Implement me") } - override suspend fun deletePet(petId: Long, apiKey: String?): Unit { + override suspend fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?): Unit { TODO("Implement me") } - override fun findPetsByStatus(status: List): Flow { + override fun findPetsByStatus(status: kotlin.collections.List): Flow { TODO("Implement me") } - override fun findPetsByTags(tags: List, maxCount: Int?): Flow { + override fun findPetsByTags(tags: kotlin.collections.List, maxCount: kotlin.Int?): Flow { TODO("Implement me") } - override suspend fun getPetById(petId: Long): Pet { + override suspend fun getPetById(petId: kotlin.Long): Pet { TODO("Implement me") } @@ -31,11 +31,11 @@ class PetApiServiceImpl : PetApiService { TODO("Implement me") } - override suspend fun updatePetWithForm(petId: Long, name: String?, status: String?): Unit { + override suspend fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?): Unit { TODO("Implement me") } - override suspend fun uploadFile(petId: Long, additionalMetadata: String?, file: org.springframework.core.io.Resource?): ModelApiResponse { + override suspend fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse { TODO("Implement me") } } diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApi.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApi.kt index 2ee42a772334..9bbe9fa4665f 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApi.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApi.kt @@ -44,66 +44,66 @@ import kotlin.collections.Map class StoreApiController(@Autowired(required = true) val service: StoreApiService) { @ApiOperation( - value = "Delete purchase order by ID", - nickname = "deleteOrder", - notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors") + value = "Delete purchase order by ID", + nickname = "deleteOrder", + notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors") @ApiResponses( - value = [ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Order not found")]) + value = [ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Order not found")]) @RequestMapping( - value = ["/store/order/{orderId}"], - method = [RequestMethod.DELETE]) - suspend fun deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required=true) @PathVariable("orderId") orderId: String + value = ["/store/order/{orderId}"], + method = [RequestMethod.DELETE]) + suspend fun deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required=true) @PathVariable("orderId") orderId: kotlin.String ): ResponseEntity { - return ResponseEntity(service.deleteOrder(orderId), HttpStatus.OK) + return ResponseEntity(service.deleteOrder(orderId), HttpStatus.valueOf(400)) } @ApiOperation( - value = "Returns pet inventories by status", - nickname = "getInventory", - notes = "Returns a map of status codes to quantities", - response = Int::class, - responseContainer = "Map", - authorizations = [Authorization(value = "api_key")]) + value = "Returns pet inventories by status", + nickname = "getInventory", + notes = "Returns a map of status codes to quantities", + response = kotlin.Int::class, + responseContainer = "Map", + authorizations = [Authorization(value = "api_key")]) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation", response = Map::class, responseContainer = "Map")]) + value = [ApiResponse(code = 200, message = "successful operation", response = kotlin.collections.Map::class, responseContainer = "Map")]) @RequestMapping( - value = ["/store/inventory"], - produces = ["application/json"], - method = [RequestMethod.GET]) - suspend fun getInventory(): ResponseEntity> { - return ResponseEntity(service.getInventory(), HttpStatus.OK) + value = ["/store/inventory"], + produces = ["application/json"], + method = [RequestMethod.GET]) + suspend fun getInventory(): ResponseEntity> { + return ResponseEntity(service.getInventory(), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Find purchase order by ID", - nickname = "getOrderById", - notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", - response = Order::class) + value = "Find purchase order by ID", + nickname = "getOrderById", + notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", + response = Order::class) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation", response = Order::class),ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Order not found")]) + value = [ApiResponse(code = 200, message = "successful operation", response = Order::class),ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Order not found")]) @RequestMapping( - value = ["/store/order/{orderId}"], - produces = ["application/xml", "application/json"], - method = [RequestMethod.GET]) - suspend fun getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required=true) @PathVariable("orderId") orderId: Long + value = ["/store/order/{orderId}"], + produces = ["application/xml", "application/json"], + method = [RequestMethod.GET]) + suspend fun getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required=true) @PathVariable("orderId") orderId: kotlin.Long ): ResponseEntity { - return ResponseEntity(service.getOrderById(orderId), HttpStatus.OK) + return ResponseEntity(service.getOrderById(orderId), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Place an order for a pet", - nickname = "placeOrder", - notes = "", - response = Order::class) + value = "Place an order for a pet", + nickname = "placeOrder", + notes = "", + response = Order::class) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation", response = Order::class),ApiResponse(code = 400, message = "Invalid Order")]) + value = [ApiResponse(code = 200, message = "successful operation", response = Order::class),ApiResponse(code = 400, message = "Invalid Order")]) @RequestMapping( - value = ["/store/order"], - produces = ["application/xml", "application/json"], - consumes = ["application/json"], - method = [RequestMethod.POST]) + value = ["/store/order"], + produces = ["application/xml", "application/json"], + consumes = ["application/json"], + method = [RequestMethod.POST]) suspend fun placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody order: Order ): ResponseEntity { - return ResponseEntity(service.placeOrder(order), HttpStatus.OK) + return ResponseEntity(service.placeOrder(order), HttpStatus.valueOf(200)) } } diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApiService.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApiService.kt index 84dc28370548..89393699d392 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApiService.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApiService.kt @@ -4,11 +4,11 @@ import org.openapitools.model.Order import kotlinx.coroutines.flow.Flow; interface StoreApiService { - suspend fun deleteOrder(orderId: String): Unit + suspend fun deleteOrder(orderId: kotlin.String): Unit - suspend fun getInventory(): Map + suspend fun getInventory(): Map - suspend fun getOrderById(orderId: Long): Order + suspend fun getOrderById(orderId: kotlin.Long): Order suspend fun placeOrder(order: Order): Order } diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApiServiceImpl.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApiServiceImpl.kt index f29e7e08c2e5..52fc3ff57c0c 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApiServiceImpl.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApiServiceImpl.kt @@ -6,15 +6,15 @@ import org.springframework.stereotype.Service @Service class StoreApiServiceImpl : StoreApiService { - override suspend fun deleteOrder(orderId: String): Unit { + override suspend fun deleteOrder(orderId: kotlin.String): Unit { TODO("Implement me") } - override suspend fun getInventory(): Map { + override suspend fun getInventory(): Map { TODO("Implement me") } - override suspend fun getOrderById(orderId: Long): Order { + override suspend fun getOrderById(orderId: kotlin.Long): Order { TODO("Implement me") } diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApi.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApi.kt index 1aed45eebdda..0a0c2492d32e 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApi.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApi.kt @@ -44,129 +44,129 @@ import kotlin.collections.Map class UserApiController(@Autowired(required = true) val service: UserApiService) { @ApiOperation( - value = "Create user", - nickname = "createUser", - notes = "This can only be done by the logged in user.", - authorizations = [Authorization(value = "auth_cookie")]) + value = "Create user", + nickname = "createUser", + notes = "This can only be done by the logged in user.", + authorizations = [Authorization(value = "auth_cookie")]) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation")]) + value = [ApiResponse(code = 200, message = "successful operation")]) @RequestMapping( - value = ["/user"], - consumes = ["application/json"], - method = [RequestMethod.POST]) + value = ["/user"], + consumes = ["application/json"], + method = [RequestMethod.POST]) suspend fun createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody user: User ): ResponseEntity { - return ResponseEntity(service.createUser(user), HttpStatus.OK) + return ResponseEntity(service.createUser(user), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Creates list of users with given input array", - nickname = "createUsersWithArrayInput", - notes = "", - authorizations = [Authorization(value = "auth_cookie")]) + value = "Creates list of users with given input array", + nickname = "createUsersWithArrayInput", + notes = "", + authorizations = [Authorization(value = "auth_cookie")]) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation")]) + value = [ApiResponse(code = 200, message = "successful operation")]) @RequestMapping( - value = ["/user/createWithArray"], - consumes = ["application/json"], - method = [RequestMethod.POST]) + value = ["/user/createWithArray"], + consumes = ["application/json"], + method = [RequestMethod.POST]) suspend fun createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody user: Flow ): ResponseEntity { - return ResponseEntity(service.createUsersWithArrayInput(user), HttpStatus.OK) + return ResponseEntity(service.createUsersWithArrayInput(user), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Creates list of users with given input array", - nickname = "createUsersWithListInput", - notes = "", - authorizations = [Authorization(value = "auth_cookie")]) + value = "Creates list of users with given input array", + nickname = "createUsersWithListInput", + notes = "", + authorizations = [Authorization(value = "auth_cookie")]) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation")]) + value = [ApiResponse(code = 200, message = "successful operation")]) @RequestMapping( - value = ["/user/createWithList"], - consumes = ["application/json"], - method = [RequestMethod.POST]) + value = ["/user/createWithList"], + consumes = ["application/json"], + method = [RequestMethod.POST]) suspend fun createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody user: Flow ): ResponseEntity { - return ResponseEntity(service.createUsersWithListInput(user), HttpStatus.OK) + return ResponseEntity(service.createUsersWithListInput(user), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Delete user", - nickname = "deleteUser", - notes = "This can only be done by the logged in user.", - authorizations = [Authorization(value = "auth_cookie")]) + value = "Delete user", + nickname = "deleteUser", + notes = "This can only be done by the logged in user.", + authorizations = [Authorization(value = "auth_cookie")]) @ApiResponses( - value = [ApiResponse(code = 400, message = "Invalid username supplied"),ApiResponse(code = 404, message = "User not found")]) + value = [ApiResponse(code = 400, message = "Invalid username supplied"),ApiResponse(code = 404, message = "User not found")]) @RequestMapping( - value = ["/user/{username}"], - method = [RequestMethod.DELETE]) - suspend fun deleteUser(@ApiParam(value = "The name that needs to be deleted", required=true) @PathVariable("username") username: String + value = ["/user/{username}"], + method = [RequestMethod.DELETE]) + suspend fun deleteUser(@ApiParam(value = "The name that needs to be deleted", required=true) @PathVariable("username") username: kotlin.String ): ResponseEntity { - return ResponseEntity(service.deleteUser(username), HttpStatus.OK) + return ResponseEntity(service.deleteUser(username), HttpStatus.valueOf(400)) } @ApiOperation( - value = "Get user by user name", - nickname = "getUserByName", - notes = "", - response = User::class) + value = "Get user by user name", + nickname = "getUserByName", + notes = "", + response = User::class) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation", response = User::class),ApiResponse(code = 400, message = "Invalid username supplied"),ApiResponse(code = 404, message = "User not found")]) + value = [ApiResponse(code = 200, message = "successful operation", response = User::class),ApiResponse(code = 400, message = "Invalid username supplied"),ApiResponse(code = 404, message = "User not found")]) @RequestMapping( - value = ["/user/{username}"], - produces = ["application/xml", "application/json"], - method = [RequestMethod.GET]) - suspend fun getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required=true) @PathVariable("username") username: String + value = ["/user/{username}"], + produces = ["application/xml", "application/json"], + method = [RequestMethod.GET]) + suspend fun getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required=true) @PathVariable("username") username: kotlin.String ): ResponseEntity { - return ResponseEntity(service.getUserByName(username), HttpStatus.OK) + return ResponseEntity(service.getUserByName(username), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Logs user into the system", - nickname = "loginUser", - notes = "", - response = String::class) + value = "Logs user into the system", + nickname = "loginUser", + notes = "", + response = kotlin.String::class) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation", response = String::class),ApiResponse(code = 400, message = "Invalid username/password supplied")]) + value = [ApiResponse(code = 200, message = "successful operation", response = kotlin.String::class),ApiResponse(code = 400, message = "Invalid username/password supplied")]) @RequestMapping( - value = ["/user/login"], - produces = ["application/xml", "application/json"], - method = [RequestMethod.GET]) - suspend fun loginUser(@NotNull @Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) username: String -,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) password: String -): ResponseEntity { - return ResponseEntity(service.loginUser(username, password), HttpStatus.OK) + value = ["/user/login"], + produces = ["application/xml", "application/json"], + method = [RequestMethod.GET]) + suspend fun loginUser(@NotNull @Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) username: kotlin.String +,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) password: kotlin.String +): ResponseEntity { + return ResponseEntity(service.loginUser(username, password), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Logs out current logged in user session", - nickname = "logoutUser", - notes = "", - authorizations = [Authorization(value = "auth_cookie")]) + value = "Logs out current logged in user session", + nickname = "logoutUser", + notes = "", + authorizations = [Authorization(value = "auth_cookie")]) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation")]) + value = [ApiResponse(code = 200, message = "successful operation")]) @RequestMapping( - value = ["/user/logout"], - method = [RequestMethod.GET]) + value = ["/user/logout"], + method = [RequestMethod.GET]) suspend fun logoutUser(): ResponseEntity { - return ResponseEntity(service.logoutUser(), HttpStatus.OK) + return ResponseEntity(service.logoutUser(), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Updated user", - nickname = "updateUser", - notes = "This can only be done by the logged in user.", - authorizations = [Authorization(value = "auth_cookie")]) + value = "Updated user", + nickname = "updateUser", + notes = "This can only be done by the logged in user.", + authorizations = [Authorization(value = "auth_cookie")]) @ApiResponses( - value = [ApiResponse(code = 400, message = "Invalid user supplied"),ApiResponse(code = 404, message = "User not found")]) + value = [ApiResponse(code = 400, message = "Invalid user supplied"),ApiResponse(code = 404, message = "User not found")]) @RequestMapping( - value = ["/user/{username}"], - consumes = ["application/json"], - method = [RequestMethod.PUT]) - suspend fun updateUser(@ApiParam(value = "name that need to be deleted", required=true) @PathVariable("username") username: String + value = ["/user/{username}"], + consumes = ["application/json"], + method = [RequestMethod.PUT]) + suspend fun updateUser(@ApiParam(value = "name that need to be deleted", required=true) @PathVariable("username") username: kotlin.String ,@ApiParam(value = "Updated user object" ,required=true ) @Valid @RequestBody user: User ): ResponseEntity { - return ResponseEntity(service.updateUser(username, user), HttpStatus.OK) + return ResponseEntity(service.updateUser(username, user), HttpStatus.valueOf(400)) } } diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApiService.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApiService.kt index 999ae4f4074e..43dd4b0a384f 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApiService.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApiService.kt @@ -10,13 +10,13 @@ interface UserApiService { suspend fun createUsersWithListInput(user: Flow): Unit - suspend fun deleteUser(username: String): Unit + suspend fun deleteUser(username: kotlin.String): Unit - suspend fun getUserByName(username: String): User + suspend fun getUserByName(username: kotlin.String): User - suspend fun loginUser(username: String, password: String): String + suspend fun loginUser(username: kotlin.String, password: kotlin.String): kotlin.String suspend fun logoutUser(): Unit - suspend fun updateUser(username: String, user: User): Unit + suspend fun updateUser(username: kotlin.String, user: User): Unit } diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApiServiceImpl.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApiServiceImpl.kt index 8872d309e4db..251bd927749f 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApiServiceImpl.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApiServiceImpl.kt @@ -18,15 +18,15 @@ class UserApiServiceImpl : UserApiService { TODO("Implement me") } - override suspend fun deleteUser(username: String): Unit { + override suspend fun deleteUser(username: kotlin.String): Unit { TODO("Implement me") } - override suspend fun getUserByName(username: String): User { + override suspend fun getUserByName(username: kotlin.String): User { TODO("Implement me") } - override suspend fun loginUser(username: String, password: String): String { + override suspend fun loginUser(username: kotlin.String, password: kotlin.String): kotlin.String { TODO("Implement me") } @@ -34,7 +34,7 @@ class UserApiServiceImpl : UserApiService { TODO("Implement me") } - override suspend fun updateUser(username: String, user: User): Unit { + override suspend fun updateUser(username: kotlin.String, user: User): Unit { TODO("Implement me") } } diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Category.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Category.kt index e042a7f997c3..4be27d19748b 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Category.kt @@ -19,10 +19,10 @@ import io.swagger.annotations.ApiModelProperty data class Category ( @ApiModelProperty(example = "null", value = "") - @JsonProperty("id") val id: Long? = null, + @JsonProperty("id") val id: kotlin.Long? = null, @get:Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @ApiModelProperty(example = "null", value = "") - @JsonProperty("name") val name: String? = null + @JsonProperty("name") val name: kotlin.String? = null ) { } diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/InlineObject.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/InlineObject.kt index e998bc995ce4..ee034530c638 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/InlineObject.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/InlineObject.kt @@ -19,10 +19,10 @@ import io.swagger.annotations.ApiModelProperty data class InlineObject ( @ApiModelProperty(example = "null", value = "Updated name of the pet") - @JsonProperty("name") val name: String? = null, + @JsonProperty("name") val name: kotlin.String? = null, @ApiModelProperty(example = "null", value = "Updated status of the pet") - @JsonProperty("status") val status: String? = null + @JsonProperty("status") val status: kotlin.String? = null ) { } diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/InlineObject1.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/InlineObject1.kt index d29578fd0c09..a289d8c05f79 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/InlineObject1.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/InlineObject1.kt @@ -19,7 +19,7 @@ import io.swagger.annotations.ApiModelProperty data class InlineObject1 ( @ApiModelProperty(example = "null", value = "Additional data to pass to server") - @JsonProperty("additionalMetadata") val additionalMetadata: String? = null, + @JsonProperty("additionalMetadata") val additionalMetadata: kotlin.String? = null, @ApiModelProperty(example = "null", value = "file to upload") @JsonProperty("file") val file: org.springframework.core.io.Resource? = null diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index 2f844a9c3565..0e86b28e937d 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -20,13 +20,13 @@ import io.swagger.annotations.ApiModelProperty data class ModelApiResponse ( @ApiModelProperty(example = "null", value = "") - @JsonProperty("code") val code: Int? = null, + @JsonProperty("code") val code: kotlin.Int? = null, @ApiModelProperty(example = "null", value = "") - @JsonProperty("type") val type: String? = null, + @JsonProperty("type") val type: kotlin.String? = null, @ApiModelProperty(example = "null", value = "") - @JsonProperty("message") val message: String? = null + @JsonProperty("message") val message: kotlin.String? = null ) { } diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Order.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Order.kt index e20d850491fa..08726893f7d3 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Order.kt @@ -24,13 +24,13 @@ import io.swagger.annotations.ApiModelProperty data class Order ( @ApiModelProperty(example = "null", value = "") - @JsonProperty("id") val id: Long? = null, + @JsonProperty("id") val id: kotlin.Long? = null, @ApiModelProperty(example = "null", value = "") - @JsonProperty("petId") val petId: Long? = null, + @JsonProperty("petId") val petId: kotlin.Long? = null, @ApiModelProperty(example = "null", value = "") - @JsonProperty("quantity") val quantity: Int? = null, + @JsonProperty("quantity") val quantity: kotlin.Int? = null, @ApiModelProperty(example = "null", value = "") @JsonProperty("shipDate") val shipDate: java.time.OffsetDateTime? = null, @@ -39,14 +39,14 @@ data class Order ( @JsonProperty("status") val status: Order.Status? = null, @ApiModelProperty(example = "null", value = "") - @JsonProperty("complete") val complete: Boolean? = null + @JsonProperty("complete") val complete: kotlin.Boolean? = null ) { /** * Order Status * Values: placed,approved,delivered */ - enum class Status(val value: String) { + enum class Status(val value: kotlin.String) { @JsonProperty("placed") placed("placed"), diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Pet.kt index 9e054ac22f73..4a2e9d26cb95 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Pet.kt @@ -27,20 +27,20 @@ data class Pet ( @get:NotNull @ApiModelProperty(example = "doggie", required = true, value = "") - @JsonProperty("name") val name: String, + @JsonProperty("name") val name: kotlin.String, @get:NotNull @ApiModelProperty(example = "null", required = true, value = "") - @JsonProperty("photoUrls") val photoUrls: List, + @JsonProperty("photoUrls") val photoUrls: kotlin.collections.List, @ApiModelProperty(example = "null", value = "") - @JsonProperty("id") val id: Long? = null, + @JsonProperty("id") val id: kotlin.Long? = null, @ApiModelProperty(example = "null", value = "") @JsonProperty("category") val category: Category? = null, @ApiModelProperty(example = "null", value = "") - @JsonProperty("tags") val tags: List? = null, + @JsonProperty("tags") val tags: kotlin.collections.List? = null, @ApiModelProperty(example = "null", value = "pet status in the store") @JsonProperty("status") val status: Pet.Status? = null @@ -50,7 +50,7 @@ data class Pet ( * pet status in the store * Values: available,pending,sold */ - enum class Status(val value: String) { + enum class Status(val value: kotlin.String) { @JsonProperty("available") available("available"), diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Tag.kt index 40ef1b9a86b7..df04dcd035dc 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Tag.kt @@ -19,10 +19,10 @@ import io.swagger.annotations.ApiModelProperty data class Tag ( @ApiModelProperty(example = "null", value = "") - @JsonProperty("id") val id: Long? = null, + @JsonProperty("id") val id: kotlin.Long? = null, @ApiModelProperty(example = "null", value = "") - @JsonProperty("name") val name: String? = null + @JsonProperty("name") val name: kotlin.String? = null ) { } diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/User.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/User.kt index 95fe12aa467b..619b2e7c2c3a 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/User.kt @@ -25,28 +25,28 @@ import io.swagger.annotations.ApiModelProperty data class User ( @ApiModelProperty(example = "null", value = "") - @JsonProperty("id") val id: Long? = null, + @JsonProperty("id") val id: kotlin.Long? = null, @ApiModelProperty(example = "null", value = "") - @JsonProperty("username") val username: String? = null, + @JsonProperty("username") val username: kotlin.String? = null, @ApiModelProperty(example = "null", value = "") - @JsonProperty("firstName") val firstName: String? = null, + @JsonProperty("firstName") val firstName: kotlin.String? = null, @ApiModelProperty(example = "null", value = "") - @JsonProperty("lastName") val lastName: String? = null, + @JsonProperty("lastName") val lastName: kotlin.String? = null, @ApiModelProperty(example = "null", value = "") - @JsonProperty("email") val email: String? = null, + @JsonProperty("email") val email: kotlin.String? = null, @ApiModelProperty(example = "null", value = "") - @JsonProperty("password") val password: String? = null, + @JsonProperty("password") val password: kotlin.String? = null, @ApiModelProperty(example = "null", value = "") - @JsonProperty("phone") val phone: String? = null, + @JsonProperty("phone") val phone: kotlin.String? = null, @ApiModelProperty(example = "null", value = "User Status") - @JsonProperty("userStatus") val userStatus: Int? = null + @JsonProperty("userStatus") val userStatus: kotlin.Int? = null ) { } diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/test/kotlin/org/openapitools/api/PetApiTest.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/test/kotlin/org/openapitools/api/PetApiTest.kt new file mode 100644 index 000000000000..4ccf1df1c9df --- /dev/null +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/test/kotlin/org/openapitools/api/PetApiTest.kt @@ -0,0 +1,151 @@ +package org.openapitools.api + +import org.openapitools.model.ModelApiResponse +import org.openapitools.model.Pet +import org.junit.jupiter.api.Test + +import kotlinx.coroutines.flow.Flow; +import kotlinx.coroutines.test.runBlockingTest +import org.springframework.http.ResponseEntity + +class PetApiTest { + + private val service: PetApiService = PetApiServiceImpl() + private val api: PetApiController = PetApiController(service) + + + /** + * Add a new pet to the store + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun addPetTest() = runBlockingTest { + val pet:Pet? = null + val response: ResponseEntity = api.addPet(pet!!) + + // TODO: test validations + } + + /** + * Deletes a pet + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun deletePetTest() = runBlockingTest { + val petId:kotlin.Long? = null + val apiKey:kotlin.String? = null + val response: ResponseEntity = api.deletePet(petId!!, apiKey!!) + + // TODO: test validations + } + + /** + * Finds Pets by status + * + * Multiple status values can be provided with comma separated strings + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun findPetsByStatusTest() = runBlockingTest { + val status:kotlin.collections.List? = null + val response: ResponseEntity> = api.findPetsByStatus(status!!) + + // TODO: test validations + } + + /** + * Finds Pets by tags + * + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun findPetsByTagsTest() = runBlockingTest { + val tags:kotlin.collections.List? = null + val maxCount:kotlin.Int? = null + val response: ResponseEntity> = api.findPetsByTags(tags!!, maxCount!!) + + // TODO: test validations + } + + /** + * Find pet by ID + * + * Returns a single pet + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun getPetByIdTest() = runBlockingTest { + val petId:kotlin.Long? = null + val response: ResponseEntity = api.getPetById(petId!!) + + // TODO: test validations + } + + /** + * Update an existing pet + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun updatePetTest() = runBlockingTest { + val pet:Pet? = null + val response: ResponseEntity = api.updatePet(pet!!) + + // TODO: test validations + } + + /** + * Updates a pet in the store with form data + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun updatePetWithFormTest() = runBlockingTest { + val petId:kotlin.Long? = null + val name:kotlin.String? = null + val status:kotlin.String? = null + val response: ResponseEntity = api.updatePetWithForm(petId!!, name!!, status!!) + + // TODO: test validations + } + + /** + * uploads an image + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun uploadFileTest() = runBlockingTest { + val petId:kotlin.Long? = null + val additionalMetadata:kotlin.String? = null + val file:org.springframework.core.io.Resource? = null + val response: ResponseEntity = api.uploadFile(petId!!, additionalMetadata!!, file!!) + + // TODO: test validations + } + +} diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/test/kotlin/org/openapitools/api/StoreApiTest.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/test/kotlin/org/openapitools/api/StoreApiTest.kt new file mode 100644 index 000000000000..b084fe87b493 --- /dev/null +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/test/kotlin/org/openapitools/api/StoreApiTest.kt @@ -0,0 +1,79 @@ +package org.openapitools.api + +import org.openapitools.model.Order +import org.junit.jupiter.api.Test + +import kotlinx.coroutines.flow.Flow; +import kotlinx.coroutines.test.runBlockingTest +import org.springframework.http.ResponseEntity + +class StoreApiTest { + + private val service: StoreApiService = StoreApiServiceImpl() + private val api: StoreApiController = StoreApiController(service) + + + /** + * Delete purchase order by ID + * + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun deleteOrderTest() = runBlockingTest { + val orderId:kotlin.String? = null + val response: ResponseEntity = api.deleteOrder(orderId!!) + + // TODO: test validations + } + + /** + * Returns pet inventories by status + * + * Returns a map of status codes to quantities + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun getInventoryTest() = runBlockingTest { + val response: ResponseEntity> = api.getInventory() + + // TODO: test validations + } + + /** + * Find purchase order by ID + * + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun getOrderByIdTest() = runBlockingTest { + val orderId:kotlin.Long? = null + val response: ResponseEntity = api.getOrderById(orderId!!) + + // TODO: test validations + } + + /** + * Place an order for a pet + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun placeOrderTest() = runBlockingTest { + val order:Order? = null + val response: ResponseEntity = api.placeOrder(order!!) + + // TODO: test validations + } + +} diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/test/kotlin/org/openapitools/api/UserApiTest.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/test/kotlin/org/openapitools/api/UserApiTest.kt new file mode 100644 index 000000000000..03d1eb70a7c4 --- /dev/null +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/test/kotlin/org/openapitools/api/UserApiTest.kt @@ -0,0 +1,145 @@ +package org.openapitools.api + +import org.openapitools.model.User +import org.junit.jupiter.api.Test + +import kotlinx.coroutines.flow.Flow; +import kotlinx.coroutines.test.runBlockingTest +import org.springframework.http.ResponseEntity + +class UserApiTest { + + private val service: UserApiService = UserApiServiceImpl() + private val api: UserApiController = UserApiController(service) + + + /** + * Create user + * + * This can only be done by the logged in user. + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun createUserTest() = runBlockingTest { + val user:User? = null + val response: ResponseEntity = api.createUser(user!!) + + // TODO: test validations + } + + /** + * Creates list of users with given input array + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun createUsersWithArrayInputTest() = runBlockingTest { + val user:kotlin.collections.List? = null + val response: ResponseEntity = api.createUsersWithArrayInput(user!!) + + // TODO: test validations + } + + /** + * Creates list of users with given input array + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun createUsersWithListInputTest() = runBlockingTest { + val user:kotlin.collections.List? = null + val response: ResponseEntity = api.createUsersWithListInput(user!!) + + // TODO: test validations + } + + /** + * Delete user + * + * This can only be done by the logged in user. + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun deleteUserTest() = runBlockingTest { + val username:kotlin.String? = null + val response: ResponseEntity = api.deleteUser(username!!) + + // TODO: test validations + } + + /** + * Get user by user name + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun getUserByNameTest() = runBlockingTest { + val username:kotlin.String? = null + val response: ResponseEntity = api.getUserByName(username!!) + + // TODO: test validations + } + + /** + * Logs user into the system + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun loginUserTest() = runBlockingTest { + val username:kotlin.String? = null + val password:kotlin.String? = null + val response: ResponseEntity = api.loginUser(username!!, password!!) + + // TODO: test validations + } + + /** + * Logs out current logged in user session + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun logoutUserTest() = runBlockingTest { + val response: ResponseEntity = api.logoutUser() + + // TODO: test validations + } + + /** + * Updated user + * + * This can only be done by the logged in user. + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun updateUserTest() = runBlockingTest { + val username:kotlin.String? = null + val user:User? = null + val response: ResponseEntity = api.updateUser(username!!, user!!) + + // TODO: test validations + } + +} diff --git a/samples/openapi3/server/petstore/kotlin-springboot/.openapi-generator/VERSION b/samples/openapi3/server/petstore/kotlin-springboot/.openapi-generator/VERSION index 06b5019af3f4..83a328a9227e 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/.openapi-generator/VERSION +++ b/samples/openapi3/server/petstore/kotlin-springboot/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.1-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/server/petstore/kotlin-springboot/pom.xml b/samples/openapi3/server/petstore/kotlin-springboot/pom.xml index 10720393bf09..38491e8939c5 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/pom.xml +++ b/samples/openapi3/server/petstore/kotlin-springboot/pom.xml @@ -86,6 +86,12 @@ swagger-annotations 1.5.21 + + + com.google.code.findbugs + jsr305 + 3.0.2 + com.fasterxml.jackson.dataformat jackson-dataformat-yaml diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApi.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApi.kt index 7b397708c7aa..c17fa992e902 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApi.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApi.kt @@ -44,142 +44,142 @@ import kotlin.collections.Map class PetApiController(@Autowired(required = true) val service: PetApiService) { @ApiOperation( - value = "Add a new pet to the store", - nickname = "addPet", - notes = "", - authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) + value = "Add a new pet to the store", + nickname = "addPet", + notes = "", + authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( - value = [ApiResponse(code = 405, message = "Invalid input")]) + value = [ApiResponse(code = 405, message = "Invalid input")]) @RequestMapping( - value = ["/pet"], - consumes = ["application/json", "application/xml"], - method = [RequestMethod.POST]) + value = ["/pet"], + consumes = ["application/json", "application/xml"], + method = [RequestMethod.POST]) fun addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody pet: Pet ): ResponseEntity { - return ResponseEntity(service.addPet(pet), HttpStatus.OK) + return ResponseEntity(service.addPet(pet), HttpStatus.valueOf(405)) } @ApiOperation( - value = "Deletes a pet", - nickname = "deletePet", - notes = "", - authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) + value = "Deletes a pet", + nickname = "deletePet", + notes = "", + authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( - value = [ApiResponse(code = 400, message = "Invalid pet value")]) + value = [ApiResponse(code = 400, message = "Invalid pet value")]) @RequestMapping( - value = ["/pet/{petId}"], - method = [RequestMethod.DELETE]) + value = ["/pet/{petId}"], + method = [RequestMethod.DELETE]) fun deletePet(@ApiParam(value = "Pet id to delete", required=true) @PathVariable("petId") petId: kotlin.Long ,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) apiKey: kotlin.String? ): ResponseEntity { - return ResponseEntity(service.deletePet(petId, apiKey), HttpStatus.OK) + return ResponseEntity(service.deletePet(petId, apiKey), HttpStatus.valueOf(400)) } @ApiOperation( - value = "Finds Pets by status", - nickname = "findPetsByStatus", - notes = "Multiple status values can be provided with comma separated strings", - response = Pet::class, - responseContainer = "List", - authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "read:pets", description = "read your pets")])]) + value = "Finds Pets by status", + nickname = "findPetsByStatus", + notes = "Multiple status values can be provided with comma separated strings", + response = Pet::class, + responseContainer = "List", + authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class, responseContainer = "List"),ApiResponse(code = 400, message = "Invalid status value")]) + value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class, responseContainer = "List"),ApiResponse(code = 400, message = "Invalid status value")]) @RequestMapping( - value = ["/pet/findByStatus"], - produces = ["application/xml", "application/json"], - method = [RequestMethod.GET]) + value = ["/pet/findByStatus"], + produces = ["application/xml", "application/json"], + method = [RequestMethod.GET]) fun findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) status: kotlin.collections.List ): ResponseEntity> { - return ResponseEntity(service.findPetsByStatus(status), HttpStatus.OK) + return ResponseEntity(service.findPetsByStatus(status), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Finds Pets by tags", - nickname = "findPetsByTags", - notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", - response = Pet::class, - responseContainer = "List", - authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "read:pets", description = "read your pets")])]) + value = "Finds Pets by tags", + nickname = "findPetsByTags", + notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", + response = Pet::class, + responseContainer = "List", + authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class, responseContainer = "List"),ApiResponse(code = 400, message = "Invalid tag value")]) + value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class, responseContainer = "List"),ApiResponse(code = 400, message = "Invalid tag value")]) @RequestMapping( - value = ["/pet/findByTags"], - produces = ["application/xml", "application/json"], - method = [RequestMethod.GET]) + value = ["/pet/findByTags"], + produces = ["application/xml", "application/json"], + method = [RequestMethod.GET]) fun findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) tags: kotlin.collections.List ,@ApiParam(value = "Maximum number of items to return") @Valid @RequestParam(value = "maxCount", required = false) maxCount: kotlin.Int? ): ResponseEntity> { - return ResponseEntity(service.findPetsByTags(tags, maxCount), HttpStatus.OK) + return ResponseEntity(service.findPetsByTags(tags, maxCount), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Find pet by ID", - nickname = "getPetById", - notes = "Returns a single pet", - response = Pet::class, - authorizations = [Authorization(value = "api_key")]) + value = "Find pet by ID", + nickname = "getPetById", + notes = "Returns a single pet", + response = Pet::class, + authorizations = [Authorization(value = "api_key")]) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class),ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Pet not found")]) + value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class),ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Pet not found")]) @RequestMapping( - value = ["/pet/{petId}"], - produces = ["application/xml", "application/json"], - method = [RequestMethod.GET]) + value = ["/pet/{petId}"], + produces = ["application/xml", "application/json"], + method = [RequestMethod.GET]) fun getPetById(@ApiParam(value = "ID of pet to return", required=true) @PathVariable("petId") petId: kotlin.Long ): ResponseEntity { - return ResponseEntity(service.getPetById(petId), HttpStatus.OK) + return ResponseEntity(service.getPetById(petId), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Update an existing pet", - nickname = "updatePet", - notes = "", - authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) + value = "Update an existing pet", + nickname = "updatePet", + notes = "", + authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( - value = [ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Pet not found"),ApiResponse(code = 405, message = "Validation exception")]) + value = [ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Pet not found"),ApiResponse(code = 405, message = "Validation exception")]) @RequestMapping( - value = ["/pet"], - consumes = ["application/json", "application/xml"], - method = [RequestMethod.PUT]) + value = ["/pet"], + consumes = ["application/json", "application/xml"], + method = [RequestMethod.PUT]) fun updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody pet: Pet ): ResponseEntity { - return ResponseEntity(service.updatePet(pet), HttpStatus.OK) + return ResponseEntity(service.updatePet(pet), HttpStatus.valueOf(400)) } @ApiOperation( - value = "Updates a pet in the store with form data", - nickname = "updatePetWithForm", - notes = "", - authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) + value = "Updates a pet in the store with form data", + nickname = "updatePetWithForm", + notes = "", + authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( - value = [ApiResponse(code = 405, message = "Invalid input")]) + value = [ApiResponse(code = 405, message = "Invalid input")]) @RequestMapping( - value = ["/pet/{petId}"], - consumes = ["application/x-www-form-urlencoded"], - method = [RequestMethod.POST]) + value = ["/pet/{petId}"], + consumes = ["application/x-www-form-urlencoded"], + method = [RequestMethod.POST]) fun updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required=true) @PathVariable("petId") petId: kotlin.Long ,@ApiParam(value = "Updated name of the pet") @RequestParam(value="name", required=false) name: kotlin.String? ,@ApiParam(value = "Updated status of the pet") @RequestParam(value="status", required=false) status: kotlin.String? ): ResponseEntity { - return ResponseEntity(service.updatePetWithForm(petId, name, status), HttpStatus.OK) + return ResponseEntity(service.updatePetWithForm(petId, name, status), HttpStatus.valueOf(405)) } @ApiOperation( - value = "uploads an image", - nickname = "uploadFile", - notes = "", - response = ModelApiResponse::class, - authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) + value = "uploads an image", + nickname = "uploadFile", + notes = "", + response = ModelApiResponse::class, + authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse::class)]) + value = [ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse::class)]) @RequestMapping( - value = ["/pet/{petId}/uploadImage"], - produces = ["application/json"], - consumes = ["multipart/form-data"], - method = [RequestMethod.POST]) + value = ["/pet/{petId}/uploadImage"], + produces = ["application/json"], + consumes = ["multipart/form-data"], + method = [RequestMethod.POST]) fun uploadFile(@ApiParam(value = "ID of pet to update", required=true) @PathVariable("petId") petId: kotlin.Long ,@ApiParam(value = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) additionalMetadata: kotlin.String? ,@ApiParam(value = "file detail") @Valid @RequestPart("file") file: org.springframework.core.io.Resource? ): ResponseEntity { - return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.OK) + return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.valueOf(200)) } } diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApi.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApi.kt index 16104fb0d22b..435631042e40 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApi.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApi.kt @@ -43,66 +43,66 @@ import kotlin.collections.Map class StoreApiController(@Autowired(required = true) val service: StoreApiService) { @ApiOperation( - value = "Delete purchase order by ID", - nickname = "deleteOrder", - notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors") + value = "Delete purchase order by ID", + nickname = "deleteOrder", + notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors") @ApiResponses( - value = [ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Order not found")]) + value = [ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Order not found")]) @RequestMapping( - value = ["/store/order/{orderId}"], - method = [RequestMethod.DELETE]) + value = ["/store/order/{orderId}"], + method = [RequestMethod.DELETE]) fun deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required=true) @PathVariable("orderId") orderId: kotlin.String ): ResponseEntity { - return ResponseEntity(service.deleteOrder(orderId), HttpStatus.OK) + return ResponseEntity(service.deleteOrder(orderId), HttpStatus.valueOf(400)) } @ApiOperation( - value = "Returns pet inventories by status", - nickname = "getInventory", - notes = "Returns a map of status codes to quantities", - response = kotlin.Int::class, - responseContainer = "Map", - authorizations = [Authorization(value = "api_key")]) + value = "Returns pet inventories by status", + nickname = "getInventory", + notes = "Returns a map of status codes to quantities", + response = kotlin.Int::class, + responseContainer = "Map", + authorizations = [Authorization(value = "api_key")]) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation", response = kotlin.collections.Map::class, responseContainer = "Map")]) + value = [ApiResponse(code = 200, message = "successful operation", response = kotlin.collections.Map::class, responseContainer = "Map")]) @RequestMapping( - value = ["/store/inventory"], - produces = ["application/json"], - method = [RequestMethod.GET]) + value = ["/store/inventory"], + produces = ["application/json"], + method = [RequestMethod.GET]) fun getInventory(): ResponseEntity> { - return ResponseEntity(service.getInventory(), HttpStatus.OK) + return ResponseEntity(service.getInventory(), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Find purchase order by ID", - nickname = "getOrderById", - notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", - response = Order::class) + value = "Find purchase order by ID", + nickname = "getOrderById", + notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", + response = Order::class) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation", response = Order::class),ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Order not found")]) + value = [ApiResponse(code = 200, message = "successful operation", response = Order::class),ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Order not found")]) @RequestMapping( - value = ["/store/order/{orderId}"], - produces = ["application/xml", "application/json"], - method = [RequestMethod.GET]) + value = ["/store/order/{orderId}"], + produces = ["application/xml", "application/json"], + method = [RequestMethod.GET]) fun getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required=true) @PathVariable("orderId") orderId: kotlin.Long ): ResponseEntity { - return ResponseEntity(service.getOrderById(orderId), HttpStatus.OK) + return ResponseEntity(service.getOrderById(orderId), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Place an order for a pet", - nickname = "placeOrder", - notes = "", - response = Order::class) + value = "Place an order for a pet", + nickname = "placeOrder", + notes = "", + response = Order::class) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation", response = Order::class),ApiResponse(code = 400, message = "Invalid Order")]) + value = [ApiResponse(code = 200, message = "successful operation", response = Order::class),ApiResponse(code = 400, message = "Invalid Order")]) @RequestMapping( - value = ["/store/order"], - produces = ["application/xml", "application/json"], - consumes = ["application/json"], - method = [RequestMethod.POST]) + value = ["/store/order"], + produces = ["application/xml", "application/json"], + consumes = ["application/json"], + method = [RequestMethod.POST]) fun placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody order: Order ): ResponseEntity { - return ResponseEntity(service.placeOrder(order), HttpStatus.OK) + return ResponseEntity(service.placeOrder(order), HttpStatus.valueOf(200)) } } diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApi.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApi.kt index bd7583274b52..f1f7d6eba455 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApi.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApi.kt @@ -43,129 +43,129 @@ import kotlin.collections.Map class UserApiController(@Autowired(required = true) val service: UserApiService) { @ApiOperation( - value = "Create user", - nickname = "createUser", - notes = "This can only be done by the logged in user.", - authorizations = [Authorization(value = "auth_cookie")]) + value = "Create user", + nickname = "createUser", + notes = "This can only be done by the logged in user.", + authorizations = [Authorization(value = "auth_cookie")]) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation")]) + value = [ApiResponse(code = 200, message = "successful operation")]) @RequestMapping( - value = ["/user"], - consumes = ["application/json"], - method = [RequestMethod.POST]) + value = ["/user"], + consumes = ["application/json"], + method = [RequestMethod.POST]) fun createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody user: User ): ResponseEntity { - return ResponseEntity(service.createUser(user), HttpStatus.OK) + return ResponseEntity(service.createUser(user), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Creates list of users with given input array", - nickname = "createUsersWithArrayInput", - notes = "", - authorizations = [Authorization(value = "auth_cookie")]) + value = "Creates list of users with given input array", + nickname = "createUsersWithArrayInput", + notes = "", + authorizations = [Authorization(value = "auth_cookie")]) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation")]) + value = [ApiResponse(code = 200, message = "successful operation")]) @RequestMapping( - value = ["/user/createWithArray"], - consumes = ["application/json"], - method = [RequestMethod.POST]) + value = ["/user/createWithArray"], + consumes = ["application/json"], + method = [RequestMethod.POST]) fun createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody user: kotlin.collections.List ): ResponseEntity { - return ResponseEntity(service.createUsersWithArrayInput(user), HttpStatus.OK) + return ResponseEntity(service.createUsersWithArrayInput(user), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Creates list of users with given input array", - nickname = "createUsersWithListInput", - notes = "", - authorizations = [Authorization(value = "auth_cookie")]) + value = "Creates list of users with given input array", + nickname = "createUsersWithListInput", + notes = "", + authorizations = [Authorization(value = "auth_cookie")]) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation")]) + value = [ApiResponse(code = 200, message = "successful operation")]) @RequestMapping( - value = ["/user/createWithList"], - consumes = ["application/json"], - method = [RequestMethod.POST]) + value = ["/user/createWithList"], + consumes = ["application/json"], + method = [RequestMethod.POST]) fun createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody user: kotlin.collections.List ): ResponseEntity { - return ResponseEntity(service.createUsersWithListInput(user), HttpStatus.OK) + return ResponseEntity(service.createUsersWithListInput(user), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Delete user", - nickname = "deleteUser", - notes = "This can only be done by the logged in user.", - authorizations = [Authorization(value = "auth_cookie")]) + value = "Delete user", + nickname = "deleteUser", + notes = "This can only be done by the logged in user.", + authorizations = [Authorization(value = "auth_cookie")]) @ApiResponses( - value = [ApiResponse(code = 400, message = "Invalid username supplied"),ApiResponse(code = 404, message = "User not found")]) + value = [ApiResponse(code = 400, message = "Invalid username supplied"),ApiResponse(code = 404, message = "User not found")]) @RequestMapping( - value = ["/user/{username}"], - method = [RequestMethod.DELETE]) + value = ["/user/{username}"], + method = [RequestMethod.DELETE]) fun deleteUser(@ApiParam(value = "The name that needs to be deleted", required=true) @PathVariable("username") username: kotlin.String ): ResponseEntity { - return ResponseEntity(service.deleteUser(username), HttpStatus.OK) + return ResponseEntity(service.deleteUser(username), HttpStatus.valueOf(400)) } @ApiOperation( - value = "Get user by user name", - nickname = "getUserByName", - notes = "", - response = User::class) + value = "Get user by user name", + nickname = "getUserByName", + notes = "", + response = User::class) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation", response = User::class),ApiResponse(code = 400, message = "Invalid username supplied"),ApiResponse(code = 404, message = "User not found")]) + value = [ApiResponse(code = 200, message = "successful operation", response = User::class),ApiResponse(code = 400, message = "Invalid username supplied"),ApiResponse(code = 404, message = "User not found")]) @RequestMapping( - value = ["/user/{username}"], - produces = ["application/xml", "application/json"], - method = [RequestMethod.GET]) + value = ["/user/{username}"], + produces = ["application/xml", "application/json"], + method = [RequestMethod.GET]) fun getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required=true) @PathVariable("username") username: kotlin.String ): ResponseEntity { - return ResponseEntity(service.getUserByName(username), HttpStatus.OK) + return ResponseEntity(service.getUserByName(username), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Logs user into the system", - nickname = "loginUser", - notes = "", - response = kotlin.String::class) + value = "Logs user into the system", + nickname = "loginUser", + notes = "", + response = kotlin.String::class) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation", response = kotlin.String::class),ApiResponse(code = 400, message = "Invalid username/password supplied")]) + value = [ApiResponse(code = 200, message = "successful operation", response = kotlin.String::class),ApiResponse(code = 400, message = "Invalid username/password supplied")]) @RequestMapping( - value = ["/user/login"], - produces = ["application/xml", "application/json"], - method = [RequestMethod.GET]) + value = ["/user/login"], + produces = ["application/xml", "application/json"], + method = [RequestMethod.GET]) fun loginUser(@NotNull @Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) username: kotlin.String ,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) password: kotlin.String ): ResponseEntity { - return ResponseEntity(service.loginUser(username, password), HttpStatus.OK) + return ResponseEntity(service.loginUser(username, password), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Logs out current logged in user session", - nickname = "logoutUser", - notes = "", - authorizations = [Authorization(value = "auth_cookie")]) + value = "Logs out current logged in user session", + nickname = "logoutUser", + notes = "", + authorizations = [Authorization(value = "auth_cookie")]) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation")]) + value = [ApiResponse(code = 200, message = "successful operation")]) @RequestMapping( - value = ["/user/logout"], - method = [RequestMethod.GET]) + value = ["/user/logout"], + method = [RequestMethod.GET]) fun logoutUser(): ResponseEntity { - return ResponseEntity(service.logoutUser(), HttpStatus.OK) + return ResponseEntity(service.logoutUser(), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Updated user", - nickname = "updateUser", - notes = "This can only be done by the logged in user.", - authorizations = [Authorization(value = "auth_cookie")]) + value = "Updated user", + nickname = "updateUser", + notes = "This can only be done by the logged in user.", + authorizations = [Authorization(value = "auth_cookie")]) @ApiResponses( - value = [ApiResponse(code = 400, message = "Invalid user supplied"),ApiResponse(code = 404, message = "User not found")]) + value = [ApiResponse(code = 400, message = "Invalid user supplied"),ApiResponse(code = 404, message = "User not found")]) @RequestMapping( - value = ["/user/{username}"], - consumes = ["application/json"], - method = [RequestMethod.PUT]) + value = ["/user/{username}"], + consumes = ["application/json"], + method = [RequestMethod.PUT]) fun updateUser(@ApiParam(value = "name that need to be deleted", required=true) @PathVariable("username") username: kotlin.String ,@ApiParam(value = "Updated user object" ,required=true ) @Valid @RequestBody user: User ): ResponseEntity { - return ResponseEntity(service.updateUser(username, user), HttpStatus.OK) + return ResponseEntity(service.updateUser(username, user), HttpStatus.valueOf(400)) } } diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/PetApiTest.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/PetApiTest.kt new file mode 100644 index 000000000000..7afc861c2a4c --- /dev/null +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/PetApiTest.kt @@ -0,0 +1,149 @@ +package org.openapitools.api + +import org.openapitools.model.ModelApiResponse +import org.openapitools.model.Pet +import org.junit.jupiter.api.Test + +import org.springframework.http.ResponseEntity + +class PetApiTest { + + private val service: PetApiService = PetApiServiceImpl() + private val api: PetApiController = PetApiController(service) + + + /** + * Add a new pet to the store + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun addPetTest() { + val pet:Pet? = null + val response: ResponseEntity = api.addPet(pet!!) + + // TODO: test validations + } + + /** + * Deletes a pet + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun deletePetTest() { + val petId:kotlin.Long? = null + val apiKey:kotlin.String? = null + val response: ResponseEntity = api.deletePet(petId!!, apiKey!!) + + // TODO: test validations + } + + /** + * Finds Pets by status + * + * Multiple status values can be provided with comma separated strings + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun findPetsByStatusTest() { + val status:kotlin.collections.List? = null + val response: ResponseEntity> = api.findPetsByStatus(status!!) + + // TODO: test validations + } + + /** + * Finds Pets by tags + * + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun findPetsByTagsTest() { + val tags:kotlin.collections.List? = null + val maxCount:kotlin.Int? = null + val response: ResponseEntity> = api.findPetsByTags(tags!!, maxCount!!) + + // TODO: test validations + } + + /** + * Find pet by ID + * + * Returns a single pet + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun getPetByIdTest() { + val petId:kotlin.Long? = null + val response: ResponseEntity = api.getPetById(petId!!) + + // TODO: test validations + } + + /** + * Update an existing pet + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun updatePetTest() { + val pet:Pet? = null + val response: ResponseEntity = api.updatePet(pet!!) + + // TODO: test validations + } + + /** + * Updates a pet in the store with form data + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun updatePetWithFormTest() { + val petId:kotlin.Long? = null + val name:kotlin.String? = null + val status:kotlin.String? = null + val response: ResponseEntity = api.updatePetWithForm(petId!!, name!!, status!!) + + // TODO: test validations + } + + /** + * uploads an image + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun uploadFileTest() { + val petId:kotlin.Long? = null + val additionalMetadata:kotlin.String? = null + val file:org.springframework.core.io.Resource? = null + val response: ResponseEntity = api.uploadFile(petId!!, additionalMetadata!!, file!!) + + // TODO: test validations + } + +} diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/StoreApiTest.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/StoreApiTest.kt new file mode 100644 index 000000000000..423f98d297f6 --- /dev/null +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/StoreApiTest.kt @@ -0,0 +1,77 @@ +package org.openapitools.api + +import org.openapitools.model.Order +import org.junit.jupiter.api.Test + +import org.springframework.http.ResponseEntity + +class StoreApiTest { + + private val service: StoreApiService = StoreApiServiceImpl() + private val api: StoreApiController = StoreApiController(service) + + + /** + * Delete purchase order by ID + * + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun deleteOrderTest() { + val orderId:kotlin.String? = null + val response: ResponseEntity = api.deleteOrder(orderId!!) + + // TODO: test validations + } + + /** + * Returns pet inventories by status + * + * Returns a map of status codes to quantities + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun getInventoryTest() { + val response: ResponseEntity> = api.getInventory() + + // TODO: test validations + } + + /** + * Find purchase order by ID + * + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun getOrderByIdTest() { + val orderId:kotlin.Long? = null + val response: ResponseEntity = api.getOrderById(orderId!!) + + // TODO: test validations + } + + /** + * Place an order for a pet + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun placeOrderTest() { + val order:Order? = null + val response: ResponseEntity = api.placeOrder(order!!) + + // TODO: test validations + } + +} diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/UserApiTest.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/UserApiTest.kt new file mode 100644 index 000000000000..033b9efd6114 --- /dev/null +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/UserApiTest.kt @@ -0,0 +1,143 @@ +package org.openapitools.api + +import org.openapitools.model.User +import org.junit.jupiter.api.Test + +import org.springframework.http.ResponseEntity + +class UserApiTest { + + private val service: UserApiService = UserApiServiceImpl() + private val api: UserApiController = UserApiController(service) + + + /** + * Create user + * + * This can only be done by the logged in user. + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun createUserTest() { + val user:User? = null + val response: ResponseEntity = api.createUser(user!!) + + // TODO: test validations + } + + /** + * Creates list of users with given input array + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun createUsersWithArrayInputTest() { + val user:kotlin.collections.List? = null + val response: ResponseEntity = api.createUsersWithArrayInput(user!!) + + // TODO: test validations + } + + /** + * Creates list of users with given input array + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun createUsersWithListInputTest() { + val user:kotlin.collections.List? = null + val response: ResponseEntity = api.createUsersWithListInput(user!!) + + // TODO: test validations + } + + /** + * Delete user + * + * This can only be done by the logged in user. + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun deleteUserTest() { + val username:kotlin.String? = null + val response: ResponseEntity = api.deleteUser(username!!) + + // TODO: test validations + } + + /** + * Get user by user name + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun getUserByNameTest() { + val username:kotlin.String? = null + val response: ResponseEntity = api.getUserByName(username!!) + + // TODO: test validations + } + + /** + * Logs user into the system + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun loginUserTest() { + val username:kotlin.String? = null + val password:kotlin.String? = null + val response: ResponseEntity = api.loginUser(username!!, password!!) + + // TODO: test validations + } + + /** + * Logs out current logged in user session + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun logoutUserTest() { + val response: ResponseEntity = api.logoutUser() + + // TODO: test validations + } + + /** + * Updated user + * + * This can only be done by the logged in user. + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun updateUserTest() { + val username:kotlin.String? = null + val user:User? = null + val response: ResponseEntity = api.updateUser(username!!, user!!) + + // TODO: test validations + } + +} diff --git a/samples/openapi3/server/petstore/php-ze-ph/.openapi-generator/VERSION b/samples/openapi3/server/petstore/php-ze-ph/.openapi-generator/VERSION index afa636560641..83a328a9227e 100644 --- a/samples/openapi3/server/petstore/php-ze-ph/.openapi-generator/VERSION +++ b/samples/openapi3/server/petstore/php-ze-ph/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/server/petstore/php-ze-ph/src/App/DTO/CatAllOf.php b/samples/openapi3/server/petstore/php-ze-ph/src/App/DTO/CatAllOf.php new file mode 100644 index 000000000000..4c84469cb06b --- /dev/null +++ b/samples/openapi3/server/petstore/php-ze-ph/src/App/DTO/CatAllOf.php @@ -0,0 +1,18 @@ + [DataMember(Name="complete", EmitDefaultValue=false)] - public bool? Complete { get; set; } + public bool? Complete { get; set; } = false; /// /// Returns the string presentation of the object diff --git a/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION b/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION index 479c313e87b9..83a328a9227e 100644 --- a/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION +++ b/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.3-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/cpp-pistache/api/PetApi.cpp b/samples/server/petstore/cpp-pistache/api/PetApi.cpp index 32d47377c657..5cf1c7ba29dc 100644 --- a/samples/server/petstore/cpp-pistache/api/PetApi.cpp +++ b/samples/server/petstore/cpp-pistache/api/PetApi.cpp @@ -49,11 +49,11 @@ void PetApi::add_pet_handler(const Pistache::Rest::Request &request, Pistache::H // Getting the body param - Pet body; + Pet pet; try { - nlohmann::json::parse(request.body()).get_to(body); - this->add_pet(body, response); + nlohmann::json::parse(request.body()).get_to(pet); + this->add_pet(pet, response); } catch (nlohmann::detail::exception &e) { //send a 400 error response.send(Pistache::Http::Code::Bad_Request, e.what()); @@ -121,9 +121,17 @@ void PetApi::find_pets_by_tags_handler(const Pistache::Rest::Request &request, P tags = Pistache::Some(value); } } + auto maxCountQuery = request.query().get("maxCount"); + Pistache::Optional maxCount; + if(!maxCountQuery.isEmpty()){ + int32_t value; + if(fromStringValue(maxCountQuery.get(), value)){ + maxCount = Pistache::Some(value); + } + } try { - this->find_pets_by_tags(tags, response); + this->find_pets_by_tags(tags, maxCount, response); } catch (nlohmann::detail::exception &e) { //send a 400 error response.send(Pistache::Http::Code::Bad_Request, e.what()); @@ -156,11 +164,11 @@ void PetApi::update_pet_handler(const Pistache::Rest::Request &request, Pistache // Getting the body param - Pet body; + Pet pet; try { - nlohmann::json::parse(request.body()).get_to(body); - this->update_pet(body, response); + nlohmann::json::parse(request.body()).get_to(pet); + this->update_pet(pet, response); } catch (nlohmann::detail::exception &e) { //send a 400 error response.send(Pistache::Http::Code::Bad_Request, e.what()); diff --git a/samples/server/petstore/cpp-pistache/api/PetApi.h b/samples/server/petstore/cpp-pistache/api/PetApi.h index d991d13abaed..2d0483fe5bea 100644 --- a/samples/server/petstore/cpp-pistache/api/PetApi.h +++ b/samples/server/petstore/cpp-pistache/api/PetApi.h @@ -65,8 +65,8 @@ class PetApi { /// /// /// - /// Pet object that needs to be added to the store - virtual void add_pet(const Pet &body, Pistache::Http::ResponseWriter &response) = 0; + /// Pet object that needs to be added to the store + virtual void add_pet(const Pet &pet, Pistache::Http::ResponseWriter &response) = 0; /// /// Deletes a pet @@ -94,7 +94,8 @@ class PetApi { /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. /// /// Tags to filter by - virtual void find_pets_by_tags(const Pistache::Optional> &tags, Pistache::Http::ResponseWriter &response) = 0; + /// Maximum number of items to return (optional, default to 0) + virtual void find_pets_by_tags(const Pistache::Optional> &tags, const Pistache::Optional &maxCount, Pistache::Http::ResponseWriter &response) = 0; /// /// Find pet by ID @@ -111,8 +112,8 @@ class PetApi { /// /// /// - /// Pet object that needs to be added to the store - virtual void update_pet(const Pet &body, Pistache::Http::ResponseWriter &response) = 0; + /// Pet object that needs to be added to the store + virtual void update_pet(const Pet &pet, Pistache::Http::ResponseWriter &response) = 0; /// /// Updates a pet in the store with form data diff --git a/samples/server/petstore/cpp-pistache/api/StoreApi.cpp b/samples/server/petstore/cpp-pistache/api/StoreApi.cpp index d1133877736a..8ebe6e027b28 100644 --- a/samples/server/petstore/cpp-pistache/api/StoreApi.cpp +++ b/samples/server/petstore/cpp-pistache/api/StoreApi.cpp @@ -94,11 +94,11 @@ void StoreApi::place_order_handler(const Pistache::Rest::Request &request, Pista // Getting the body param - Order body; + Order order; try { - nlohmann::json::parse(request.body()).get_to(body); - this->place_order(body, response); + nlohmann::json::parse(request.body()).get_to(order); + this->place_order(order, response); } catch (nlohmann::detail::exception &e) { //send a 400 error response.send(Pistache::Http::Code::Bad_Request, e.what()); diff --git a/samples/server/petstore/cpp-pistache/api/StoreApi.h b/samples/server/petstore/cpp-pistache/api/StoreApi.h index f69875c4678d..9c11a8304b2f 100644 --- a/samples/server/petstore/cpp-pistache/api/StoreApi.h +++ b/samples/server/petstore/cpp-pistache/api/StoreApi.h @@ -87,8 +87,8 @@ class StoreApi { /// /// /// - /// order placed for purchasing the pet - virtual void place_order(const Order &body, Pistache::Http::ResponseWriter &response) = 0; + /// order placed for purchasing the pet + virtual void place_order(const Order &order, Pistache::Http::ResponseWriter &response) = 0; }; diff --git a/samples/server/petstore/cpp-pistache/api/UserApi.cpp b/samples/server/petstore/cpp-pistache/api/UserApi.cpp index 51889d55043b..18a0c034da4e 100644 --- a/samples/server/petstore/cpp-pistache/api/UserApi.cpp +++ b/samples/server/petstore/cpp-pistache/api/UserApi.cpp @@ -49,11 +49,11 @@ void UserApi::create_user_handler(const Pistache::Rest::Request &request, Pistac // Getting the body param - User body; + User user; try { - nlohmann::json::parse(request.body()).get_to(body); - this->create_user(body, response); + nlohmann::json::parse(request.body()).get_to(user); + this->create_user(user, response); } catch (nlohmann::detail::exception &e) { //send a 400 error response.send(Pistache::Http::Code::Bad_Request, e.what()); @@ -68,11 +68,11 @@ void UserApi::create_user_handler(const Pistache::Rest::Request &request, Pistac void UserApi::create_users_with_array_input_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { // Getting the body param - std::vector body; + std::vector user; try { - nlohmann::json::parse(request.body()).get_to(body); - this->create_users_with_array_input(body, response); + nlohmann::json::parse(request.body()).get_to(user); + this->create_users_with_array_input(user, response); } catch (nlohmann::detail::exception &e) { //send a 400 error response.send(Pistache::Http::Code::Bad_Request, e.what()); @@ -87,11 +87,11 @@ void UserApi::create_users_with_array_input_handler(const Pistache::Rest::Reques void UserApi::create_users_with_list_input_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { // Getting the body param - std::vector body; + std::vector user; try { - nlohmann::json::parse(request.body()).get_to(body); - this->create_users_with_list_input(body, response); + nlohmann::json::parse(request.body()).get_to(user); + this->create_users_with_list_input(user, response); } catch (nlohmann::detail::exception &e) { //send a 400 error response.send(Pistache::Http::Code::Bad_Request, e.what()); @@ -191,11 +191,11 @@ void UserApi::update_user_handler(const Pistache::Rest::Request &request, Pistac // Getting the body param - User body; + User user; try { - nlohmann::json::parse(request.body()).get_to(body); - this->update_user(username, body, response); + nlohmann::json::parse(request.body()).get_to(user); + this->update_user(username, user, response); } catch (nlohmann::detail::exception &e) { //send a 400 error response.send(Pistache::Http::Code::Bad_Request, e.what()); diff --git a/samples/server/petstore/cpp-pistache/api/UserApi.h b/samples/server/petstore/cpp-pistache/api/UserApi.h index 6c589979dbc9..a03c24a7f2bd 100644 --- a/samples/server/petstore/cpp-pistache/api/UserApi.h +++ b/samples/server/petstore/cpp-pistache/api/UserApi.h @@ -65,8 +65,8 @@ class UserApi { /// /// This can only be done by the logged in user. /// - /// Created user object - virtual void create_user(const User &body, Pistache::Http::ResponseWriter &response) = 0; + /// Created user object + virtual void create_user(const User &user, Pistache::Http::ResponseWriter &response) = 0; /// /// Creates list of users with given input array @@ -74,8 +74,8 @@ class UserApi { /// /// /// - /// List of user object - virtual void create_users_with_array_input(const std::vector &body, Pistache::Http::ResponseWriter &response) = 0; + /// List of user object + virtual void create_users_with_array_input(const std::vector &user, Pistache::Http::ResponseWriter &response) = 0; /// /// Creates list of users with given input array @@ -83,8 +83,8 @@ class UserApi { /// /// /// - /// List of user object - virtual void create_users_with_list_input(const std::vector &body, Pistache::Http::ResponseWriter &response) = 0; + /// List of user object + virtual void create_users_with_list_input(const std::vector &user, Pistache::Http::ResponseWriter &response) = 0; /// /// Delete user @@ -129,8 +129,8 @@ class UserApi { /// This can only be done by the logged in user. /// /// name that need to be deleted - /// Updated user object - virtual void update_user(const std::string &username, const User &body, Pistache::Http::ResponseWriter &response) = 0; + /// Updated user object + virtual void update_user(const std::string &username, const User &user, Pistache::Http::ResponseWriter &response) = 0; }; diff --git a/samples/server/petstore/cpp-pistache/impl/PetApiImpl.cpp b/samples/server/petstore/cpp-pistache/impl/PetApiImpl.cpp index 778117a18bbe..8ff5705ef0a2 100644 --- a/samples/server/petstore/cpp-pistache/impl/PetApiImpl.cpp +++ b/samples/server/petstore/cpp-pistache/impl/PetApiImpl.cpp @@ -23,7 +23,7 @@ PetApiImpl::PetApiImpl(std::shared_ptr rtr) : PetApi(rtr) { } -void PetApiImpl::add_pet(const Pet &body, Pistache::Http::ResponseWriter &response) { +void PetApiImpl::add_pet(const Pet &pet, Pistache::Http::ResponseWriter &response) { response.send(Pistache::Http::Code::Ok, "Do some magic\n"); } void PetApiImpl::delete_pet(const int64_t &petId, const Pistache::Optional &apiKey, Pistache::Http::ResponseWriter &response) { @@ -32,13 +32,13 @@ void PetApiImpl::delete_pet(const int64_t &petId, const Pistache::Optional> &status, Pistache::Http::ResponseWriter &response) { response.send(Pistache::Http::Code::Ok, "Do some magic\n"); } -void PetApiImpl::find_pets_by_tags(const Pistache::Optional> &tags, Pistache::Http::ResponseWriter &response) { +void PetApiImpl::find_pets_by_tags(const Pistache::Optional> &tags, const Pistache::Optional &maxCount, Pistache::Http::ResponseWriter &response) { response.send(Pistache::Http::Code::Ok, "Do some magic\n"); } void PetApiImpl::get_pet_by_id(const int64_t &petId, Pistache::Http::ResponseWriter &response) { response.send(Pistache::Http::Code::Ok, "Do some magic\n"); } -void PetApiImpl::update_pet(const Pet &body, Pistache::Http::ResponseWriter &response) { +void PetApiImpl::update_pet(const Pet &pet, Pistache::Http::ResponseWriter &response) { response.send(Pistache::Http::Code::Ok, "Do some magic\n"); } void PetApiImpl::update_pet_with_form(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter &response){ diff --git a/samples/server/petstore/cpp-pistache/impl/PetApiImpl.h b/samples/server/petstore/cpp-pistache/impl/PetApiImpl.h index 9e9f3d145baf..788f1be74624 100644 --- a/samples/server/petstore/cpp-pistache/impl/PetApiImpl.h +++ b/samples/server/petstore/cpp-pistache/impl/PetApiImpl.h @@ -45,12 +45,12 @@ class PetApiImpl : public org::openapitools::server::api::PetApi { PetApiImpl(std::shared_ptr); ~PetApiImpl() {} - void add_pet(const Pet &body, Pistache::Http::ResponseWriter &response); + void add_pet(const Pet &pet, Pistache::Http::ResponseWriter &response); void delete_pet(const int64_t &petId, const Pistache::Optional &apiKey, Pistache::Http::ResponseWriter &response); void find_pets_by_status(const Pistache::Optional> &status, Pistache::Http::ResponseWriter &response); - void find_pets_by_tags(const Pistache::Optional> &tags, Pistache::Http::ResponseWriter &response); + void find_pets_by_tags(const Pistache::Optional> &tags, const Pistache::Optional &maxCount, Pistache::Http::ResponseWriter &response); void get_pet_by_id(const int64_t &petId, Pistache::Http::ResponseWriter &response); - void update_pet(const Pet &body, Pistache::Http::ResponseWriter &response); + void update_pet(const Pet &pet, Pistache::Http::ResponseWriter &response); void update_pet_with_form(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter &response); void upload_file(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter &response); diff --git a/samples/server/petstore/cpp-pistache/impl/StoreApiImpl.cpp b/samples/server/petstore/cpp-pistache/impl/StoreApiImpl.cpp index ef164eb0543e..221c99be9b0c 100644 --- a/samples/server/petstore/cpp-pistache/impl/StoreApiImpl.cpp +++ b/samples/server/petstore/cpp-pistache/impl/StoreApiImpl.cpp @@ -32,7 +32,7 @@ void StoreApiImpl::get_inventory(Pistache::Http::ResponseWriter &response) { void StoreApiImpl::get_order_by_id(const int64_t &orderId, Pistache::Http::ResponseWriter &response) { response.send(Pistache::Http::Code::Ok, "Do some magic\n"); } -void StoreApiImpl::place_order(const Order &body, Pistache::Http::ResponseWriter &response) { +void StoreApiImpl::place_order(const Order &order, Pistache::Http::ResponseWriter &response) { response.send(Pistache::Http::Code::Ok, "Do some magic\n"); } diff --git a/samples/server/petstore/cpp-pistache/impl/StoreApiImpl.h b/samples/server/petstore/cpp-pistache/impl/StoreApiImpl.h index c99372463184..502afe0f3471 100644 --- a/samples/server/petstore/cpp-pistache/impl/StoreApiImpl.h +++ b/samples/server/petstore/cpp-pistache/impl/StoreApiImpl.h @@ -48,7 +48,7 @@ class StoreApiImpl : public org::openapitools::server::api::StoreApi { void delete_order(const std::string &orderId, Pistache::Http::ResponseWriter &response); void get_inventory(Pistache::Http::ResponseWriter &response); void get_order_by_id(const int64_t &orderId, Pistache::Http::ResponseWriter &response); - void place_order(const Order &body, Pistache::Http::ResponseWriter &response); + void place_order(const Order &order, Pistache::Http::ResponseWriter &response); }; diff --git a/samples/server/petstore/cpp-pistache/impl/UserApiImpl.cpp b/samples/server/petstore/cpp-pistache/impl/UserApiImpl.cpp index 7163a560bd77..08b417c1c73c 100644 --- a/samples/server/petstore/cpp-pistache/impl/UserApiImpl.cpp +++ b/samples/server/petstore/cpp-pistache/impl/UserApiImpl.cpp @@ -23,13 +23,13 @@ UserApiImpl::UserApiImpl(std::shared_ptr rtr) : UserApi(rtr) { } -void UserApiImpl::create_user(const User &body, Pistache::Http::ResponseWriter &response) { +void UserApiImpl::create_user(const User &user, Pistache::Http::ResponseWriter &response) { response.send(Pistache::Http::Code::Ok, "Do some magic\n"); } -void UserApiImpl::create_users_with_array_input(const std::vector &body, Pistache::Http::ResponseWriter &response) { +void UserApiImpl::create_users_with_array_input(const std::vector &user, Pistache::Http::ResponseWriter &response) { response.send(Pistache::Http::Code::Ok, "Do some magic\n"); } -void UserApiImpl::create_users_with_list_input(const std::vector &body, Pistache::Http::ResponseWriter &response) { +void UserApiImpl::create_users_with_list_input(const std::vector &user, Pistache::Http::ResponseWriter &response) { response.send(Pistache::Http::Code::Ok, "Do some magic\n"); } void UserApiImpl::delete_user(const std::string &username, Pistache::Http::ResponseWriter &response) { @@ -44,7 +44,7 @@ void UserApiImpl::login_user(const Pistache::Optional &username, co void UserApiImpl::logout_user(Pistache::Http::ResponseWriter &response) { response.send(Pistache::Http::Code::Ok, "Do some magic\n"); } -void UserApiImpl::update_user(const std::string &username, const User &body, Pistache::Http::ResponseWriter &response) { +void UserApiImpl::update_user(const std::string &username, const User &user, Pistache::Http::ResponseWriter &response) { response.send(Pistache::Http::Code::Ok, "Do some magic\n"); } diff --git a/samples/server/petstore/cpp-pistache/impl/UserApiImpl.h b/samples/server/petstore/cpp-pistache/impl/UserApiImpl.h index 8f22c4998894..748581ed3648 100644 --- a/samples/server/petstore/cpp-pistache/impl/UserApiImpl.h +++ b/samples/server/petstore/cpp-pistache/impl/UserApiImpl.h @@ -45,14 +45,14 @@ class UserApiImpl : public org::openapitools::server::api::UserApi { UserApiImpl(std::shared_ptr); ~UserApiImpl() {} - void create_user(const User &body, Pistache::Http::ResponseWriter &response); - void create_users_with_array_input(const std::vector &body, Pistache::Http::ResponseWriter &response); - void create_users_with_list_input(const std::vector &body, Pistache::Http::ResponseWriter &response); + void create_user(const User &user, Pistache::Http::ResponseWriter &response); + void create_users_with_array_input(const std::vector &user, Pistache::Http::ResponseWriter &response); + void create_users_with_list_input(const std::vector &user, Pistache::Http::ResponseWriter &response); void delete_user(const std::string &username, Pistache::Http::ResponseWriter &response); void get_user_by_name(const std::string &username, Pistache::Http::ResponseWriter &response); void login_user(const Pistache::Optional &username, const Pistache::Optional &password, Pistache::Http::ResponseWriter &response); void logout_user(Pistache::Http::ResponseWriter &response); - void update_user(const std::string &username, const User &body, Pistache::Http::ResponseWriter &response); + void update_user(const std::string &username, const User &user, Pistache::Http::ResponseWriter &response); }; diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/.openapi-generator-ignore b/samples/server/petstore/cpp-qt5-qhttpengine-server/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/.openapi-generator/VERSION b/samples/server/petstore/cpp-qt5-qhttpengine-server/.openapi-generator/VERSION new file mode 100644 index 000000000000..83a328a9227e --- /dev/null +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/.openapi-generator/VERSION @@ -0,0 +1 @@ +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/cpp-restbed/.openapi-generator/VERSION b/samples/server/petstore/cpp-restbed/.openapi-generator/VERSION index 06b5019af3f4..83a328a9227e 100644 --- a/samples/server/petstore/cpp-restbed/.openapi-generator/VERSION +++ b/samples/server/petstore/cpp-restbed/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.1-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/cpp-restbed/api/PetApi.cpp b/samples/server/petstore/cpp-restbed/api/PetApi.cpp index fb5612d1fcf1..95e04091b51f 100644 --- a/samples/server/petstore/cpp-restbed/api/PetApi.cpp +++ b/samples/server/petstore/cpp-restbed/api/PetApi.cpp @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ @@ -111,7 +111,7 @@ void PetApiPetResource::POST_method_handler(const std::shared_ptr( - std::vector const & + std::vector const &, int32_t const & )> handler) { handler_GET_ = std::move(handler); } @@ -374,6 +374,7 @@ void PetApiPetFindByTagsResource::GET_method_handler(const std::shared_ptrget_query_parameter("maxCount", 0); // Change the value of this variable to the appropriate response before sending the response @@ -383,7 +384,7 @@ void PetApiPetFindByTagsResource::GET_method_handler(const std::shared_ptr( - std::vector const & + std::vector const &, int32_t const & )> handler ); private: std::function( - std::vector const & + std::vector const &, int32_t const & )> handler_GET_; }; diff --git a/samples/server/petstore/cpp-restbed/api/StoreApi.cpp b/samples/server/petstore/cpp-restbed/api/StoreApi.cpp index 8d381eab26e7..1969777af343 100644 --- a/samples/server/petstore/cpp-restbed/api/StoreApi.cpp +++ b/samples/server/petstore/cpp-restbed/api/StoreApi.cpp @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ @@ -240,7 +240,7 @@ void StoreApiStoreOrderResource::POST_method_handler(const std::shared_ptrset_header("Set-Cookie", ""); // Change second param to your header value // Description: calls per hour allowed by the user session->set_header("X-Rate-Limit", ""); // Change second param to your header value // Description: date in UTC when toekn expires diff --git a/samples/server/petstore/cpp-restbed/api/UserApi.h b/samples/server/petstore/cpp-restbed/api/UserApi.h index 0750da000fb0..1819016145ce 100644 --- a/samples/server/petstore/cpp-restbed/api/UserApi.h +++ b/samples/server/petstore/cpp-restbed/api/UserApi.h @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/cpp-restbed/model/ApiResponse.cpp b/samples/server/petstore/cpp-restbed/model/ApiResponse.cpp index 15bf9dd81701..9e099239a42e 100644 --- a/samples/server/petstore/cpp-restbed/model/ApiResponse.cpp +++ b/samples/server/petstore/cpp-restbed/model/ApiResponse.cpp @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/cpp-restbed/model/ApiResponse.h b/samples/server/petstore/cpp-restbed/model/ApiResponse.h index f0c0a9034d85..52ebc3058419 100644 --- a/samples/server/petstore/cpp-restbed/model/ApiResponse.h +++ b/samples/server/petstore/cpp-restbed/model/ApiResponse.h @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/cpp-restbed/model/Category.cpp b/samples/server/petstore/cpp-restbed/model/Category.cpp index eca17e71bd5f..521664a574ae 100644 --- a/samples/server/petstore/cpp-restbed/model/Category.cpp +++ b/samples/server/petstore/cpp-restbed/model/Category.cpp @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/cpp-restbed/model/Category.h b/samples/server/petstore/cpp-restbed/model/Category.h index 1dd7a111e027..31560b711544 100644 --- a/samples/server/petstore/cpp-restbed/model/Category.h +++ b/samples/server/petstore/cpp-restbed/model/Category.h @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/cpp-restbed/model/Inline_object.cpp b/samples/server/petstore/cpp-restbed/model/Inline_object.cpp new file mode 100644 index 000000000000..39b752a2e0ff --- /dev/null +++ b/samples/server/petstore/cpp-restbed/model/Inline_object.cpp @@ -0,0 +1,82 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "Inline_object.h" + +#include +#include +#include +#include + +using boost::property_tree::ptree; +using boost::property_tree::read_json; +using boost::property_tree::write_json; + +namespace org { +namespace openapitools { +namespace server { +namespace model { + +Inline_object::Inline_object() +{ + m_Name = ""; + m_Status = ""; + +} + +Inline_object::~Inline_object() +{ +} + +std::string Inline_object::toJsonString() +{ + std::stringstream ss; + ptree pt; + pt.put("Name", m_Name); + pt.put("Status", m_Status); + write_json(ss, pt, false); + return ss.str(); +} + +void Inline_object::fromJsonString(std::string const& jsonString) +{ + std::stringstream ss(jsonString); + ptree pt; + read_json(ss,pt); + m_Name = pt.get("Name", ""); + m_Status = pt.get("Status", ""); +} + +std::string Inline_object::getName() const +{ + return m_Name; +} +void Inline_object::setName(std::string value) +{ + m_Name = value; +} +std::string Inline_object::getStatus() const +{ + return m_Status; +} +void Inline_object::setStatus(std::string value) +{ + m_Status = value; +} + +} +} +} +} + diff --git a/samples/server/petstore/cpp-restbed/model/Inline_object.h b/samples/server/petstore/cpp-restbed/model/Inline_object.h new file mode 100644 index 000000000000..e5034ee66793 --- /dev/null +++ b/samples/server/petstore/cpp-restbed/model/Inline_object.h @@ -0,0 +1,68 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * Inline_object.h + * + * + */ + +#ifndef Inline_object_H_ +#define Inline_object_H_ + + + +#include +#include + +namespace org { +namespace openapitools { +namespace server { +namespace model { + +/// +/// +/// +class Inline_object +{ +public: + Inline_object(); + virtual ~Inline_object(); + + std::string toJsonString(); + void fromJsonString(std::string const& jsonString); + + ///////////////////////////////////////////// + /// Inline_object members + + /// + /// Updated name of the pet + /// + std::string getName() const; + void setName(std::string value); + /// + /// Updated status of the pet + /// + std::string getStatus() const; + void setStatus(std::string value); + +protected: + std::string m_Name; + std::string m_Status; +}; + +} +} +} +} + +#endif /* Inline_object_H_ */ diff --git a/samples/server/petstore/cpp-restbed/model/Inline_object_1.cpp b/samples/server/petstore/cpp-restbed/model/Inline_object_1.cpp new file mode 100644 index 000000000000..25230d760e7b --- /dev/null +++ b/samples/server/petstore/cpp-restbed/model/Inline_object_1.cpp @@ -0,0 +1,79 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "Inline_object_1.h" + +#include +#include +#include +#include + +using boost::property_tree::ptree; +using boost::property_tree::read_json; +using boost::property_tree::write_json; + +namespace org { +namespace openapitools { +namespace server { +namespace model { + +Inline_object_1::Inline_object_1() +{ + m_AdditionalMetadata = ""; + +} + +Inline_object_1::~Inline_object_1() +{ +} + +std::string Inline_object_1::toJsonString() +{ + std::stringstream ss; + ptree pt; + pt.put("AdditionalMetadata", m_AdditionalMetadata); + write_json(ss, pt, false); + return ss.str(); +} + +void Inline_object_1::fromJsonString(std::string const& jsonString) +{ + std::stringstream ss(jsonString); + ptree pt; + read_json(ss,pt); + m_AdditionalMetadata = pt.get("AdditionalMetadata", ""); +} + +std::string Inline_object_1::getAdditionalMetadata() const +{ + return m_AdditionalMetadata; +} +void Inline_object_1::setAdditionalMetadata(std::string value) +{ + m_AdditionalMetadata = value; +} +std::string Inline_object_1::getFile() const +{ + return m_file; +} +void Inline_object_1::setFile(std::string value) +{ + m_file = value; +} + +} +} +} +} + diff --git a/samples/server/petstore/cpp-restbed/model/Inline_object_1.h b/samples/server/petstore/cpp-restbed/model/Inline_object_1.h new file mode 100644 index 000000000000..763fbbb58a02 --- /dev/null +++ b/samples/server/petstore/cpp-restbed/model/Inline_object_1.h @@ -0,0 +1,68 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * Inline_object_1.h + * + * + */ + +#ifndef Inline_object_1_H_ +#define Inline_object_1_H_ + + + +#include +#include + +namespace org { +namespace openapitools { +namespace server { +namespace model { + +/// +/// +/// +class Inline_object_1 +{ +public: + Inline_object_1(); + virtual ~Inline_object_1(); + + std::string toJsonString(); + void fromJsonString(std::string const& jsonString); + + ///////////////////////////////////////////// + /// Inline_object_1 members + + /// + /// Additional data to pass to server + /// + std::string getAdditionalMetadata() const; + void setAdditionalMetadata(std::string value); + /// + /// file to upload + /// + std::string getFile() const; + void setFile(std::string value); + +protected: + std::string m_AdditionalMetadata; + std::string m_file; +}; + +} +} +} +} + +#endif /* Inline_object_1_H_ */ diff --git a/samples/server/petstore/cpp-restbed/model/Order.cpp b/samples/server/petstore/cpp-restbed/model/Order.cpp index 835d6787dcb9..1e024c872928 100644 --- a/samples/server/petstore/cpp-restbed/model/Order.cpp +++ b/samples/server/petstore/cpp-restbed/model/Order.cpp @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/cpp-restbed/model/Order.h b/samples/server/petstore/cpp-restbed/model/Order.h index ad2dcab33194..2890ce671e81 100644 --- a/samples/server/petstore/cpp-restbed/model/Order.h +++ b/samples/server/petstore/cpp-restbed/model/Order.h @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/cpp-restbed/model/Pet.cpp b/samples/server/petstore/cpp-restbed/model/Pet.cpp index cd4b8a5b0514..c35d2b11e5d3 100644 --- a/samples/server/petstore/cpp-restbed/model/Pet.cpp +++ b/samples/server/petstore/cpp-restbed/model/Pet.cpp @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/cpp-restbed/model/Pet.h b/samples/server/petstore/cpp-restbed/model/Pet.h index eeda96ced075..4d1f6bbb1ca3 100644 --- a/samples/server/petstore/cpp-restbed/model/Pet.h +++ b/samples/server/petstore/cpp-restbed/model/Pet.h @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/cpp-restbed/model/Tag.cpp b/samples/server/petstore/cpp-restbed/model/Tag.cpp index 55b77ea7b9ec..21cb869ae955 100644 --- a/samples/server/petstore/cpp-restbed/model/Tag.cpp +++ b/samples/server/petstore/cpp-restbed/model/Tag.cpp @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/cpp-restbed/model/Tag.h b/samples/server/petstore/cpp-restbed/model/Tag.h index f1fa71239206..e6ccc7cfc9eb 100644 --- a/samples/server/petstore/cpp-restbed/model/Tag.h +++ b/samples/server/petstore/cpp-restbed/model/Tag.h @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/cpp-restbed/model/User.cpp b/samples/server/petstore/cpp-restbed/model/User.cpp index 805306a5d7aa..ef59c6071d64 100644 --- a/samples/server/petstore/cpp-restbed/model/User.cpp +++ b/samples/server/petstore/cpp-restbed/model/User.cpp @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/cpp-restbed/model/User.h b/samples/server/petstore/cpp-restbed/model/User.h index f2792886c9b2..2bc44dc35405 100644 --- a/samples/server/petstore/cpp-restbed/model/User.h +++ b/samples/server/petstore/cpp-restbed/model/User.h @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/erlang-server/.openapi-generator/VERSION b/samples/server/petstore/erlang-server/.openapi-generator/VERSION index afa636560641..83a328a9227e 100644 --- a/samples/server/petstore/erlang-server/.openapi-generator/VERSION +++ b/samples/server/petstore/erlang-server/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/erlang-server/priv/openapi.json b/samples/server/petstore/erlang-server/priv/openapi.json index a0a4803cd077..3e5e97f6f483 100644 --- a/samples/server/petstore/erlang-server/priv/openapi.json +++ b/samples/server/petstore/erlang-server/priv/openapi.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.1", + "openapi" : "3.0.0", "info" : { "title" : "OpenAPI Petstore", "description" : "This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.", @@ -9,6 +9,10 @@ }, "version" : "1.0.0" }, + "externalDocs" : { + "description" : "Find out more about Swagger", + "url" : "http://swagger.io" + }, "servers" : [ { "url" : "http://petstore.swagger.io/v2" } ], @@ -29,70 +33,38 @@ "summary" : "Update an existing pet", "operationId" : "updatePet", "requestBody" : { - "description" : "Pet object that needs to be added to the store", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Pet" - } - }, - "application/xml" : { - "schema" : { - "$ref" : "#/components/schemas/Pet" - } - } - }, - "required" : true + "$ref" : "#/components/requestBodies/Pet" }, "responses" : { "400" : { - "description" : "Invalid ID supplied", - "content" : { } + "description" : "Invalid ID supplied" }, "404" : { - "description" : "Pet not found", - "content" : { } + "description" : "Pet not found" }, "405" : { - "description" : "Validation exception", - "content" : { } + "description" : "Validation exception" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] - } ], - "x-codegen-request-body-name" : "body" + } ] }, "post" : { "tags" : [ "pet" ], "summary" : "Add a new pet to the store", "operationId" : "addPet", "requestBody" : { - "description" : "Pet object that needs to be added to the store", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Pet" - } - }, - "application/xml" : { - "schema" : { - "$ref" : "#/components/schemas/Pet" - } - } - }, - "required" : true + "$ref" : "#/components/requestBodies/Pet" }, "responses" : { "405" : { - "description" : "Invalid input", - "content" : { } + "description" : "Invalid input" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] - } ], - "x-codegen-request-body-name" : "body" + } ] } }, "/pet/findByStatus" : { @@ -140,12 +112,11 @@ } }, "400" : { - "description" : "Invalid status value", - "content" : { } + "description" : "Invalid status value" } }, "security" : [ { - "petstore_auth" : [ "write:pets", "read:pets" ] + "petstore_auth" : [ "read:pets" ] } ] } }, @@ -168,6 +139,17 @@ "type" : "string" } } + }, { + "name" : "maxCount", + "in" : "query", + "description" : "Maximum number of items to return", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "integer", + "format" : "int32" + } } ], "responses" : { "200" : { @@ -192,13 +174,12 @@ } }, "400" : { - "description" : "Invalid tag value", - "content" : { } + "description" : "Invalid tag value" } }, "deprecated" : true, "security" : [ { - "petstore_auth" : [ "write:pets", "read:pets" ] + "petstore_auth" : [ "read:pets" ] } ] } }, @@ -213,6 +194,8 @@ "in" : "path", "description" : "ID of pet to return", "required" : true, + "style" : "simple", + "explode" : false, "schema" : { "type" : "integer", "format" : "int64" @@ -235,12 +218,10 @@ } }, "400" : { - "description" : "Invalid ID supplied", - "content" : { } + "description" : "Invalid ID supplied" }, "404" : { - "description" : "Pet not found", - "content" : { } + "description" : "Pet not found" } }, "security" : [ { @@ -256,6 +237,8 @@ "in" : "path", "description" : "ID of pet that needs to be updated", "required" : true, + "style" : "simple", + "explode" : false, "schema" : { "type" : "integer", "format" : "int64" @@ -265,6 +248,7 @@ "content" : { "application/x-www-form-urlencoded" : { "schema" : { + "type" : "object", "properties" : { "name" : { "type" : "string", @@ -277,12 +261,12 @@ } } } - } + }, + "$ref" : "#/components/requestBodies/inline_object" }, "responses" : { "405" : { - "description" : "Invalid input", - "content" : { } + "description" : "Invalid input" } }, "security" : [ { @@ -296,6 +280,9 @@ "parameters" : [ { "name" : "api_key", "in" : "header", + "required" : false, + "style" : "simple", + "explode" : false, "schema" : { "type" : "string" } @@ -304,6 +291,8 @@ "in" : "path", "description" : "Pet id to delete", "required" : true, + "style" : "simple", + "explode" : false, "schema" : { "type" : "integer", "format" : "int64" @@ -311,8 +300,7 @@ } ], "responses" : { "400" : { - "description" : "Invalid pet value", - "content" : { } + "description" : "Invalid pet value" } }, "security" : [ { @@ -330,6 +318,8 @@ "in" : "path", "description" : "ID of pet to update", "required" : true, + "style" : "simple", + "explode" : false, "schema" : { "type" : "integer", "format" : "int64" @@ -339,6 +329,7 @@ "content" : { "multipart/form-data" : { "schema" : { + "type" : "object", "properties" : { "additionalMetadata" : { "type" : "string", @@ -352,7 +343,8 @@ } } } - } + }, + "$ref" : "#/components/requestBodies/inline_object_1" }, "responses" : { "200" : { @@ -406,7 +398,7 @@ "requestBody" : { "description" : "order placed for purchasing the pet", "content" : { - "*/*" : { + "application/json" : { "schema" : { "$ref" : "#/components/schemas/Order" } @@ -431,11 +423,9 @@ } }, "400" : { - "description" : "Invalid Order", - "content" : { } + "description" : "Invalid Order" } - }, - "x-codegen-request-body-name" : "body" + } } }, "/store/order/{orderId}" : { @@ -449,6 +439,8 @@ "in" : "path", "description" : "ID of pet that needs to be fetched", "required" : true, + "style" : "simple", + "explode" : false, "schema" : { "maximum" : 5, "minimum" : 1, @@ -473,12 +465,10 @@ } }, "400" : { - "description" : "Invalid ID supplied", - "content" : { } + "description" : "Invalid ID supplied" }, "404" : { - "description" : "Order not found", - "content" : { } + "description" : "Order not found" } } }, @@ -492,18 +482,18 @@ "in" : "path", "description" : "ID of the order that needs to be deleted", "required" : true, + "style" : "simple", + "explode" : false, "schema" : { "type" : "string" } } ], "responses" : { "400" : { - "description" : "Invalid ID supplied", - "content" : { } + "description" : "Invalid ID supplied" }, "404" : { - "description" : "Order not found", - "content" : { } + "description" : "Order not found" } } } @@ -517,7 +507,7 @@ "requestBody" : { "description" : "Created user object", "content" : { - "*/*" : { + "application/json" : { "schema" : { "$ref" : "#/components/schemas/User" } @@ -527,11 +517,12 @@ }, "responses" : { "default" : { - "description" : "successful operation", - "content" : { } + "description" : "successful operation" } }, - "x-codegen-request-body-name" : "body" + "security" : [ { + "auth_cookie" : [ ] + } ] } }, "/user/createWithArray" : { @@ -540,26 +531,16 @@ "summary" : "Creates list of users with given input array", "operationId" : "createUsersWithArrayInput", "requestBody" : { - "description" : "List of user object", - "content" : { - "*/*" : { - "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/User" - } - } - } - }, - "required" : true + "$ref" : "#/components/requestBodies/UserArray" }, "responses" : { "default" : { - "description" : "successful operation", - "content" : { } + "description" : "successful operation" } }, - "x-codegen-request-body-name" : "body" + "security" : [ { + "auth_cookie" : [ ] + } ] } }, "/user/createWithList" : { @@ -568,26 +549,16 @@ "summary" : "Creates list of users with given input array", "operationId" : "createUsersWithListInput", "requestBody" : { - "description" : "List of user object", - "content" : { - "*/*" : { - "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/User" - } - } - } - }, - "required" : true + "$ref" : "#/components/requestBodies/UserArray" }, "responses" : { "default" : { - "description" : "successful operation", - "content" : { } + "description" : "successful operation" } }, - "x-codegen-request-body-name" : "body" + "security" : [ { + "auth_cookie" : [ ] + } ] } }, "/user/login" : { @@ -600,7 +571,10 @@ "in" : "query", "description" : "The user name for login", "required" : true, + "style" : "form", + "explode" : true, "schema" : { + "pattern" : "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$", "type" : "string" } }, { @@ -608,6 +582,8 @@ "in" : "query", "description" : "The password for login in clear text", "required" : true, + "style" : "form", + "explode" : true, "schema" : { "type" : "string" } @@ -616,8 +592,19 @@ "200" : { "description" : "successful operation", "headers" : { + "Set-Cookie" : { + "description" : "Cookie authentication key for use with the `auth_cookie` apiKey authentication.", + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string", + "example" : "AUTH_KEY=abcde12345; Path=/; HttpOnly" + } + }, "X-Rate-Limit" : { "description" : "calls per hour allowed by the user", + "style" : "simple", + "explode" : false, "schema" : { "type" : "integer", "format" : "int32" @@ -625,6 +612,8 @@ }, "X-Expires-After" : { "description" : "date in UTC when toekn expires", + "style" : "simple", + "explode" : false, "schema" : { "type" : "string", "format" : "date-time" @@ -645,8 +634,7 @@ } }, "400" : { - "description" : "Invalid username/password supplied", - "content" : { } + "description" : "Invalid username/password supplied" } } } @@ -658,10 +646,12 @@ "operationId" : "logoutUser", "responses" : { "default" : { - "description" : "successful operation", - "content" : { } + "description" : "successful operation" } - } + }, + "security" : [ { + "auth_cookie" : [ ] + } ] } }, "/user/{username}" : { @@ -674,6 +664,8 @@ "in" : "path", "description" : "The name that needs to be fetched. Use user1 for testing.", "required" : true, + "style" : "simple", + "explode" : false, "schema" : { "type" : "string" } @@ -695,12 +687,10 @@ } }, "400" : { - "description" : "Invalid username supplied", - "content" : { } + "description" : "Invalid username supplied" }, "404" : { - "description" : "User not found", - "content" : { } + "description" : "User not found" } } }, @@ -714,6 +704,8 @@ "in" : "path", "description" : "name that need to be deleted", "required" : true, + "style" : "simple", + "explode" : false, "schema" : { "type" : "string" } @@ -721,7 +713,7 @@ "requestBody" : { "description" : "Updated user object", "content" : { - "*/*" : { + "application/json" : { "schema" : { "$ref" : "#/components/schemas/User" } @@ -731,15 +723,15 @@ }, "responses" : { "400" : { - "description" : "Invalid user supplied", - "content" : { } + "description" : "Invalid user supplied" }, "404" : { - "description" : "User not found", - "content" : { } + "description" : "User not found" } }, - "x-codegen-request-body-name" : "body" + "security" : [ { + "auth_cookie" : [ ] + } ] }, "delete" : { "tags" : [ "user" ], @@ -751,20 +743,23 @@ "in" : "path", "description" : "The name that needs to be deleted", "required" : true, + "style" : "simple", + "explode" : false, "schema" : { "type" : "string" } } ], "responses" : { "400" : { - "description" : "Invalid username supplied", - "content" : { } + "description" : "Invalid username supplied" }, "404" : { - "description" : "User not found", - "content" : { } + "description" : "User not found" } - } + }, + "security" : [ { + "auth_cookie" : [ ] + } ] } } }, @@ -822,6 +817,7 @@ "format" : "int64" }, "name" : { + "pattern" : "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$", "type" : "string" } }, @@ -987,6 +983,83 @@ "type" : "type", "message" : "message" } + }, + "inline_object" : { + "type" : "object", + "properties" : { + "name" : { + "type" : "string", + "description" : "Updated name of the pet" + }, + "status" : { + "type" : "string", + "description" : "Updated status of the pet" + } + } + }, + "inline_object_1" : { + "type" : "object", + "properties" : { + "additionalMetadata" : { + "type" : "string", + "description" : "Additional data to pass to server" + }, + "file" : { + "type" : "string", + "description" : "file to upload", + "format" : "binary" + } + } + } + }, + "requestBodies" : { + "UserArray" : { + "description" : "List of user object", + "content" : { + "application/json" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/User" + } + } + } + }, + "required" : true + }, + "Pet" : { + "description" : "Pet object that needs to be added to the store", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + }, + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + } + }, + "required" : true + }, + "inline_object" : { + "content" : { + "application/x-www-form-urlencoded" : { + "schema" : { + "$ref" : "#/components/schemas/inline_object" + } + } + } + }, + "inline_object_1" : { + "content" : { + "multipart/form-data" : { + "schema" : { + "$ref" : "#/components/schemas/inline_object_1" + } + } + } } }, "securitySchemes" : { @@ -1006,6 +1079,11 @@ "type" : "apiKey", "name" : "api_key", "in" : "header" + }, + "auth_cookie" : { + "type" : "apiKey", + "name" : "AUTH_KEY", + "in" : "cookie" } } } diff --git a/samples/server/petstore/erlang-server/src/openapi_api.erl b/samples/server/petstore/erlang-server/src/openapi_api.erl index ba4b3a0e7aff..eeb02c95c49d 100644 --- a/samples/server/petstore/erlang-server/src/openapi_api.erl +++ b/samples/server/petstore/erlang-server/src/openapi_api.erl @@ -33,7 +33,8 @@ request_params('FindPetsByStatus') -> request_params('FindPetsByTags') -> [ - 'tags' + 'tags', + 'maxCount' ]; request_params('GetPetById') -> @@ -196,6 +197,15 @@ request_param_info('FindPetsByTags', 'tags') -> ] }; +request_param_info('FindPetsByTags', 'maxCount') -> + #{ + source => qs_val , + rules => [ + {type, 'integer'}, + not_required + ] + }; + request_param_info('GetPetById', 'petId') -> #{ source => binding , @@ -349,6 +359,7 @@ request_param_info('LoginUser', 'username') -> source => qs_val , rules => [ {type, 'binary'}, + {pattern, "/^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$/" }, required ] }; diff --git a/samples/server/petstore/erlang-server/src/openapi_auth.erl b/samples/server/petstore/erlang-server/src/openapi_auth.erl index 06f1f163953b..7cc2c138e19d 100644 --- a/samples/server/petstore/erlang-server/src/openapi_auth.erl +++ b/samples/server/petstore/erlang-server/src/openapi_auth.erl @@ -24,6 +24,8 @@ authorize_api_key(LogicHandler, OperationID, From, KeyParam, Req0) -> ApiKey ), case Result of + {true, Context} -> + {true, Context, Req}; {true, Context} -> {true, Context, Req}; false -> diff --git a/samples/server/petstore/erlang-server/src/openapi_default_logic_handler.erl b/samples/server/petstore/erlang-server/src/openapi_default_logic_handler.erl index da6e79a74ebd..a1b9e14385db 100644 --- a/samples/server/petstore/erlang-server/src/openapi_default_logic_handler.erl +++ b/samples/server/petstore/erlang-server/src/openapi_default_logic_handler.erl @@ -4,7 +4,11 @@ -export([handle_request/3]). -export([authorize_api_key/2]). +-export([authorize_api_key/2]). + +-spec authorize_api_key(OperationID :: openapi_api:operation_id(), ApiKey :: binary()) -> {true, #{}}. +authorize_api_key(_, _) -> {true, #{}}. -spec authorize_api_key(OperationID :: openapi_api:operation_id(), ApiKey :: binary()) -> {true, #{}}. authorize_api_key(_, _) -> {true, #{}}. diff --git a/samples/server/petstore/erlang-server/src/openapi_logic_handler.erl b/samples/server/petstore/erlang-server/src/openapi_logic_handler.erl index 2c05ce24836e..4d45fe7a59c8 100644 --- a/samples/server/petstore/erlang-server/src/openapi_logic_handler.erl +++ b/samples/server/petstore/erlang-server/src/openapi_logic_handler.erl @@ -16,6 +16,11 @@ ApiKey :: binary() ) -> Result :: boolean() | {boolean(), context()}. +-callback authorize_api_key( + OperationID :: openapi_api:operation_id(), + ApiKey :: binary() +) -> + Result :: boolean() | {boolean(), context()}. -callback handle_request(OperationID :: openapi_api:operation_id(), cowboy_req:req(), Context :: context()) -> @@ -36,3 +41,7 @@ handle_request(Handler, OperationID, Req, Context) -> Result :: false | {true, context()}. authorize_api_key(Handler, OperationID, ApiKey) -> Handler:authorize_api_key(OperationID, ApiKey). +-spec authorize_api_key(Handler :: atom(), OperationID :: openapi_api:operation_id(), ApiKey :: binary()) -> + Result :: false | {true, context()}. +authorize_api_key(Handler, OperationID, ApiKey) -> + Handler:authorize_api_key(OperationID, ApiKey). diff --git a/samples/server/petstore/erlang-server/src/openapi_user_handler.erl b/samples/server/petstore/erlang-server/src/openapi_user_handler.erl index c45a2a22651a..d8bf275d444e 100644 --- a/samples/server/petstore/erlang-server/src/openapi_user_handler.erl +++ b/samples/server/petstore/erlang-server/src/openapi_user_handler.erl @@ -119,6 +119,120 @@ allowed_methods(Req, State) -> Req :: cowboy_req:req(), State :: state() }. +is_authorized( + Req0, + State = #state{ + operation_id = 'CreateUser' = OperationID, + logic_handler = LogicHandler + } +) -> + From = , + Result = openapi_auth:authorize_api_key( + LogicHandler, + OperationID, + From, + "AUTH_KEY", + Req0 + ), + case Result of + {true, Context, Req} -> {true, Req, State#state{context = Context}}; + {false, AuthHeader, Req} -> {{false, AuthHeader}, Req, State} + end; +is_authorized( + Req0, + State = #state{ + operation_id = 'CreateUsersWithArrayInput' = OperationID, + logic_handler = LogicHandler + } +) -> + From = , + Result = openapi_auth:authorize_api_key( + LogicHandler, + OperationID, + From, + "AUTH_KEY", + Req0 + ), + case Result of + {true, Context, Req} -> {true, Req, State#state{context = Context}}; + {false, AuthHeader, Req} -> {{false, AuthHeader}, Req, State} + end; +is_authorized( + Req0, + State = #state{ + operation_id = 'CreateUsersWithListInput' = OperationID, + logic_handler = LogicHandler + } +) -> + From = , + Result = openapi_auth:authorize_api_key( + LogicHandler, + OperationID, + From, + "AUTH_KEY", + Req0 + ), + case Result of + {true, Context, Req} -> {true, Req, State#state{context = Context}}; + {false, AuthHeader, Req} -> {{false, AuthHeader}, Req, State} + end; +is_authorized( + Req0, + State = #state{ + operation_id = 'DeleteUser' = OperationID, + logic_handler = LogicHandler + } +) -> + From = , + Result = openapi_auth:authorize_api_key( + LogicHandler, + OperationID, + From, + "AUTH_KEY", + Req0 + ), + case Result of + {true, Context, Req} -> {true, Req, State#state{context = Context}}; + {false, AuthHeader, Req} -> {{false, AuthHeader}, Req, State} + end; +is_authorized( + Req0, + State = #state{ + operation_id = 'LogoutUser' = OperationID, + logic_handler = LogicHandler + } +) -> + From = , + Result = openapi_auth:authorize_api_key( + LogicHandler, + OperationID, + From, + "AUTH_KEY", + Req0 + ), + case Result of + {true, Context, Req} -> {true, Req, State#state{context = Context}}; + {false, AuthHeader, Req} -> {{false, AuthHeader}, Req, State} + end; +is_authorized( + Req0, + State = #state{ + operation_id = 'UpdateUser' = OperationID, + logic_handler = LogicHandler + } +) -> + From = , + Result = openapi_auth:authorize_api_key( + LogicHandler, + OperationID, + From, + "AUTH_KEY", + Req0 + ), + case Result of + {true, Context, Req} -> {true, Req, State#state{context = Context}}; + {false, AuthHeader, Req} -> {{false, AuthHeader}, Req, State} + end; is_authorized(Req, State) -> {true, Req, State}. diff --git a/samples/server/petstore/fsharp-giraffe/.openapi-generator/VERSION b/samples/server/petstore/fsharp-giraffe/.openapi-generator/VERSION index afa636560641..83a328a9227e 100644 --- a/samples/server/petstore/fsharp-giraffe/.openapi-generator/VERSION +++ b/samples/server/petstore/fsharp-giraffe/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/go-api-server/.openapi-generator/VERSION b/samples/server/petstore/go-api-server/.openapi-generator/VERSION index afa636560641..83a328a9227e 100644 --- a/samples/server/petstore/go-api-server/.openapi-generator/VERSION +++ b/samples/server/petstore/go-api-server/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/go-api-server/Dockerfile b/samples/server/petstore/go-api-server/Dockerfile index 0f512c75104b..cfdfbaed0804 100644 --- a/samples/server/petstore/go-api-server/Dockerfile +++ b/samples/server/petstore/go-api-server/Dockerfile @@ -1,6 +1,6 @@ FROM golang:1.10 AS build WORKDIR /go/src -COPY ./ +COPY go ./go COPY main.go . ENV CGO_ENABLED=0 diff --git a/samples/server/petstore/go-api-server/go/README.md b/samples/server/petstore/go-api-server/README.md similarity index 100% rename from samples/server/petstore/go-api-server/go/README.md rename to samples/server/petstore/go-api-server/README.md diff --git a/samples/server/petstore/go-api-server/api/openapi.yaml b/samples/server/petstore/go-api-server/api/openapi.yaml index b25b5c3fe61c..a088e6e6c48b 100644 --- a/samples/server/petstore/go-api-server/api/openapi.yaml +++ b/samples/server/petstore/go-api-server/api/openapi.yaml @@ -1,14 +1,12 @@ -openapi: 3.0.0 +openapi: 3.0.1 info: - description: This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + description: This is a sample server Petstore server. For this sample, you can use + the api key `special-key` to test the authorization filters. license: name: Apache-2.0 url: http://www.apache.org/licenses/LICENSE-2.0.html title: OpenAPI Petstore version: 1.0.0 -externalDocs: - description: Find out more about Swagger - url: http://swagger.io servers: - url: http://petstore.swagger.io/v2 tags: @@ -23,9 +21,18 @@ paths: post: operationId: addPet requestBody: - $ref: '#/components/requestBodies/Pet' + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true responses: 405: + content: {} description: Invalid input security: - petstore_auth: @@ -38,13 +45,24 @@ paths: put: operationId: updatePet requestBody: - $ref: '#/components/requestBodies/Pet' + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true responses: 400: + content: {} description: Invalid ID supplied 404: + content: {} description: Pet not found 405: + content: {} description: Validation exception security: - petstore_auth: @@ -89,6 +107,7 @@ paths: type: array description: successful operation 400: + content: {} description: Invalid status value security: - petstore_auth: @@ -100,7 +119,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + description: Multiple tags can be provided with comma separated strings. Use + tag1, tag2, tag3 for testing. operationId: findPetsByTags parameters: - description: Tags to filter by @@ -128,6 +148,7 @@ paths: type: array description: successful operation 400: + content: {} description: Invalid tag value security: - petstore_auth: @@ -140,24 +161,20 @@ paths: delete: operationId: deletePet parameters: - - explode: false - in: header + - in: header name: api_key - required: false schema: type: string - style: simple - description: Pet id to delete - explode: false in: path name: petId required: true schema: format: int64 type: integer - style: simple responses: 400: + content: {} description: Invalid pet value security: - petstore_auth: @@ -171,14 +188,12 @@ paths: operationId: getPetById parameters: - description: ID of pet to return - explode: false in: path name: petId required: true schema: format: int64 type: integer - style: simple responses: 200: content: @@ -190,8 +205,10 @@ paths: $ref: '#/components/schemas/Pet' description: successful operation 400: + content: {} description: Invalid ID supplied 404: + content: {} description: Pet not found security: - api_key: [] @@ -202,16 +219,13 @@ paths: operationId: updatePetWithForm parameters: - description: ID of pet that needs to be updated - explode: false in: path name: petId required: true schema: format: int64 type: integer - style: simple requestBody: - $ref: '#/components/requestBodies/inline_object' content: application/x-www-form-urlencoded: schema: @@ -222,9 +236,9 @@ paths: status: description: Updated status of the pet type: string - type: object responses: 405: + content: {} description: Invalid input security: - petstore_auth: @@ -238,16 +252,13 @@ paths: operationId: uploadFile parameters: - description: ID of pet to update - explode: false in: path name: petId required: true schema: format: int64 type: integer - style: simple requestBody: - $ref: '#/components/requestBodies/inline_object_1' content: multipart/form-data: schema: @@ -259,7 +270,6 @@ paths: description: file to upload format: binary type: string - type: object responses: 200: content: @@ -298,7 +308,7 @@ paths: operationId: placeOrder requestBody: content: - application/json: + '*/*': schema: $ref: '#/components/schemas/Order' description: order placed for purchasing the pet @@ -314,6 +324,7 @@ paths: $ref: '#/components/schemas/Order' description: successful operation 400: + content: {} description: Invalid Order summary: Place an order for a pet tags: @@ -321,31 +332,32 @@ paths: x-codegen-request-body-name: body /store/order/{orderId}: delete: - description: For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + description: For valid response try integer IDs with value < 1000. Anything + above 1000 or nonintegers will generate API errors operationId: deleteOrder parameters: - description: ID of the order that needs to be deleted - explode: false in: path name: orderId required: true schema: type: string - style: simple responses: 400: + content: {} description: Invalid ID supplied 404: + content: {} description: Order not found summary: Delete purchase order by ID tags: - store get: - description: For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generated exceptions operationId: getOrderById parameters: - description: ID of pet that needs to be fetched - explode: false in: path name: orderId required: true @@ -354,7 +366,6 @@ paths: maximum: 5 minimum: 1 type: integer - style: simple responses: 200: content: @@ -366,8 +377,10 @@ paths: $ref: '#/components/schemas/Order' description: successful operation 400: + content: {} description: Invalid ID supplied 404: + content: {} description: Order not found summary: Find purchase order by ID tags: @@ -378,13 +391,14 @@ paths: operationId: createUser requestBody: content: - application/json: + '*/*': schema: $ref: '#/components/schemas/User' description: Created user object required: true responses: default: + content: {} description: successful operation summary: Create user tags: @@ -394,9 +408,17 @@ paths: post: operationId: createUsersWithArrayInput requestBody: - $ref: '#/components/requestBodies/UserArray' + content: + '*/*': + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true responses: default: + content: {} description: successful operation summary: Creates list of users with given input array tags: @@ -406,9 +428,17 @@ paths: post: operationId: createUsersWithListInput requestBody: - $ref: '#/components/requestBodies/UserArray' + content: + '*/*': + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true responses: default: + content: {} description: successful operation summary: Creates list of users with given input array tags: @@ -419,21 +449,17 @@ paths: operationId: loginUser parameters: - description: The user name for login - explode: true in: query name: username required: true schema: type: string - style: form - description: The password for login in clear text - explode: true in: query name: password required: true schema: type: string - style: form responses: 200: content: @@ -447,19 +473,16 @@ paths: headers: X-Rate-Limit: description: calls per hour allowed by the user - explode: false schema: format: int32 type: integer - style: simple X-Expires-After: description: date in UTC when toekn expires - explode: false schema: format: date-time type: string - style: simple 400: + content: {} description: Invalid username/password supplied summary: Logs user into the system tags: @@ -469,6 +492,7 @@ paths: operationId: logoutUser responses: default: + content: {} description: successful operation summary: Logs out current logged in user session tags: @@ -479,17 +503,17 @@ paths: operationId: deleteUser parameters: - description: The name that needs to be deleted - explode: false in: path name: username required: true schema: type: string - style: simple responses: 400: + content: {} description: Invalid username supplied 404: + content: {} description: User not found summary: Delete user tags: @@ -498,13 +522,11 @@ paths: operationId: getUserByName parameters: - description: The name that needs to be fetched. Use user1 for testing. - explode: false in: path name: username required: true schema: type: string - style: simple responses: 200: content: @@ -516,8 +538,10 @@ paths: $ref: '#/components/schemas/User' description: successful operation 400: + content: {} description: Invalid username supplied 404: + content: {} description: User not found summary: Get user by user name tags: @@ -527,60 +551,30 @@ paths: operationId: updateUser parameters: - description: name that need to be deleted - explode: false in: path name: username required: true schema: type: string - style: simple requestBody: content: - application/json: + '*/*': schema: $ref: '#/components/schemas/User' description: Updated user object required: true responses: 400: + content: {} description: Invalid user supplied 404: + content: {} description: User not found summary: Updated user tags: - user x-codegen-request-body-name: body components: - requestBodies: - UserArray: - content: - application/json: - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true - Pet: - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - description: Pet object that needs to be added to the store - required: true - inline_object: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/inline_object' - inline_object_1: - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/inline_object_1' schemas: Order: description: An order for a pets from the pet store @@ -753,25 +747,6 @@ components: type: string title: An uploaded response type: object - inline_object: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string - type: object - inline_object_1: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string - type: object securitySchemes: petstore_auth: flows: diff --git a/samples/server/petstore/go-api-server/go/model_inline_object.go b/samples/server/petstore/go-api-server/go/model_inline_object.go deleted file mode 100644 index ee13c18c29aa..000000000000 --- a/samples/server/petstore/go-api-server/go/model_inline_object.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * OpenAPI Petstore - * - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type InlineObject struct { - - // Updated name of the pet - Name string `json:"name,omitempty"` - - // Updated status of the pet - Status string `json:"status,omitempty"` -} diff --git a/samples/server/petstore/go-api-server/go/model_inline_object_1.go b/samples/server/petstore/go-api-server/go/model_inline_object_1.go deleted file mode 100644 index a41e0bff7d95..000000000000 --- a/samples/server/petstore/go-api-server/go/model_inline_object_1.go +++ /dev/null @@ -1,23 +0,0 @@ -/* - * OpenAPI Petstore - * - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -import ( - "os" -) - -type InlineObject1 struct { - - // Additional data to pass to server - AdditionalMetadata string `json:"additionalMetadata,omitempty"` - - // file to upload - File **os.File `json:"file,omitempty"` -} diff --git a/samples/server/petstore/go-api-server/main.go b/samples/server/petstore/go-api-server/main.go index 2e6999c2f480..0c8750779476 100644 --- a/samples/server/petstore/go-api-server/main.go +++ b/samples/server/petstore/go-api-server/main.go @@ -18,9 +18,9 @@ import ( // once you place this file into your project. // For example, // - // sw "github.com/myname/myrepo/" + // sw "github.com/myname/myrepo/go" // - sw "./" + sw "./go" ) func main() { diff --git a/samples/server/petstore/graphql-nodejs-express-server/.openapi-generator/VERSION b/samples/server/petstore/graphql-nodejs-express-server/.openapi-generator/VERSION index afa636560641..83a328a9227e 100644 --- a/samples/server/petstore/graphql-nodejs-express-server/.openapi-generator/VERSION +++ b/samples/server/petstore/graphql-nodejs-express-server/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/graphql-nodejs-express-server/docs/InlineObject.md b/samples/server/petstore/graphql-nodejs-express-server/docs/InlineObject.md new file mode 100644 index 000000000000..85328bff1d32 --- /dev/null +++ b/samples/server/petstore/graphql-nodejs-express-server/docs/InlineObject.md @@ -0,0 +1,11 @@ +# InlineObject + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String!** | Updated name of the pet | [optional] [default to null] +**status** | **String!** | Updated status of the pet | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/server/petstore/graphql-nodejs-express-server/docs/InlineObject1.md b/samples/server/petstore/graphql-nodejs-express-server/docs/InlineObject1.md new file mode 100644 index 000000000000..e9c888d56388 --- /dev/null +++ b/samples/server/petstore/graphql-nodejs-express-server/docs/InlineObject1.md @@ -0,0 +1,11 @@ +# InlineObject1 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**additionalMetadata** | **String!** | Additional data to pass to server | [optional] [default to null] +**file** | **String!** | file to upload | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/server/petstore/graphql-nodejs-express-server/docs/pet_api.md b/samples/server/petstore/graphql-nodejs-express-server/docs/pet_api.md index 30b9ba0a15ef..6c0b6325702a 100644 --- a/samples/server/petstore/graphql-nodejs-express-server/docs/pet_api.md +++ b/samples/server/petstore/graphql-nodejs-express-server/docs/pet_api.md @@ -16,7 +16,7 @@ Method | HTTP request | Description # **AddPet** -> AddPet(body) +> AddPet(pet) Add a new pet to the store @@ -33,7 +33,7 @@ Finds Pets by status Multiple status values can be provided with comma separated strings # **FindPetsByTags** -> Pet FindPetsByTags(tags) +> Pet FindPetsByTags(tags, maxCount) Finds Pets by tags @@ -47,7 +47,7 @@ Find pet by ID Returns a single pet # **UpdatePet** -> UpdatePet(body) +> UpdatePet(pet) Update an existing pet diff --git a/samples/server/petstore/graphql-nodejs-express-server/docs/store_api.md b/samples/server/petstore/graphql-nodejs-express-server/docs/store_api.md index 10aac58f007e..af02156f435f 100644 --- a/samples/server/petstore/graphql-nodejs-express-server/docs/store_api.md +++ b/samples/server/petstore/graphql-nodejs-express-server/docs/store_api.md @@ -33,6 +33,6 @@ Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions # **PlaceOrder** -> Order PlaceOrder(body) +> Order PlaceOrder(order) Place an order for a pet diff --git a/samples/server/petstore/graphql-nodejs-express-server/docs/user_api.md b/samples/server/petstore/graphql-nodejs-express-server/docs/user_api.md index 27ed441b09f5..deb512ef0e41 100644 --- a/samples/server/petstore/graphql-nodejs-express-server/docs/user_api.md +++ b/samples/server/petstore/graphql-nodejs-express-server/docs/user_api.md @@ -16,19 +16,19 @@ Method | HTTP request | Description # **CreateUser** -> CreateUser(body) +> CreateUser(user) Create user This can only be done by the logged in user. # **CreateUsersWithArrayInput** -> CreateUsersWithArrayInput(body) +> CreateUsersWithArrayInput(user) Creates list of users with given input array # **CreateUsersWithListInput** -> CreateUsersWithListInput(body) +> CreateUsersWithListInput(user) Creates list of users with given input array @@ -55,7 +55,7 @@ Logs user into the system Logs out current logged in user session # **UpdateUser** -> UpdateUser(username, body) +> UpdateUser(username, user) Updated user diff --git a/samples/server/petstore/graphql-nodejs-express-server/petstore/api/pet_api.graphql b/samples/server/petstore/graphql-nodejs-express-server/petstore/api/pet_api.graphql index 78d17f95b05c..75bd5d1f1c2b 100644 --- a/samples/server/petstore/graphql-nodejs-express-server/petstore/api/pet_api.graphql +++ b/samples/server/petstore/graphql-nodejs-express-server/petstore/api/pet_api.graphql @@ -16,7 +16,7 @@ input AddPetInput { # Pet object that needs to be added to the store - body: PetInput + pet: PetInput } input DeletePetInput { @@ -28,7 +28,7 @@ input DeletePetInput { input UpdatePetInput { # Pet object that needs to be added to the store - body: PetInput + pet: PetInput } input UpdatePetWithFormInput { @@ -51,7 +51,7 @@ input UploadFileInput { type Mutation { # Add a new pet to the store - # @param Pet body Pet object that needs to be added to the store + # @param Pet pet Pet object that needs to be added to the store # @return [Boolean] AddPet(input: AddPetInput!): Boolean # Deletes a pet @@ -60,7 +60,7 @@ type Mutation { # @return [Boolean] DeletePet(input: DeletePetInput!): Boolean # Update an existing pet - # @param Pet body Pet object that needs to be added to the store + # @param Pet pet Pet object that needs to be added to the store # @return [Boolean] UpdatePet(input: UpdatePetInput!): Boolean # Updates a pet in the store with form data @@ -86,8 +86,9 @@ type Query { # Finds Pets by tags # Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # @param String! tags Tags to filter by + # @param Int! maxCount Maximum number of items to return # @return [Pet] - FindPetsByTags(tags: String!): Pet + FindPetsByTags(tags: String!, maxCount: Int!): Pet # Find pet by ID # Returns a single pet # @param Int! petId ID of pet to return diff --git a/samples/server/petstore/graphql-nodejs-express-server/petstore/api/pet_api_resolver.js b/samples/server/petstore/graphql-nodejs-express-server/petstore/api/pet_api_resolver.js index 67b45ec30c3d..3841fbe4e885 100644 --- a/samples/server/petstore/graphql-nodejs-express-server/petstore/api/pet_api_resolver.js +++ b/samples/server/petstore/graphql-nodejs-express-server/petstore/api/pet_api_resolver.js @@ -25,9 +25,10 @@ export default { }, // @return Pet - FindPetsByTags: ($tags) => { + FindPetsByTags: ($tags, $maxCount) => { return { - "tags": "" + "tags": "", + "maxCount": "56" }; }, @@ -43,9 +44,9 @@ export default { Mutation: { // @return - AddPet: ($body) => { + AddPet: ($pet) => { return { - "body": "" + "pet": "" }; }, @@ -58,9 +59,9 @@ export default { }, // @return - UpdatePet: ($body) => { + UpdatePet: ($pet) => { return { - "body": "" + "pet": "" }; }, diff --git a/samples/server/petstore/graphql-nodejs-express-server/petstore/api/store_api.graphql b/samples/server/petstore/graphql-nodejs-express-server/petstore/api/store_api.graphql index 28bf223d3514..4ad4c53c00c5 100644 --- a/samples/server/petstore/graphql-nodejs-express-server/petstore/api/store_api.graphql +++ b/samples/server/petstore/graphql-nodejs-express-server/petstore/api/store_api.graphql @@ -21,7 +21,7 @@ input DeleteOrderInput { input PlaceOrderInput { # order placed for purchasing the pet - body: OrderInput + order: OrderInput } type Mutation { @@ -31,7 +31,7 @@ type Mutation { # @return [Boolean] DeleteOrder(input: DeleteOrderInput!): Boolean # Place an order for a pet - # @param Order body order placed for purchasing the pet + # @param Order order order placed for purchasing the pet # @return [Order] PlaceOrder(input: PlaceOrderInput!): Order } diff --git a/samples/server/petstore/graphql-nodejs-express-server/petstore/api/store_api_resolver.js b/samples/server/petstore/graphql-nodejs-express-server/petstore/api/store_api_resolver.js index d02f4b31c428..a20d3113ac8d 100644 --- a/samples/server/petstore/graphql-nodejs-express-server/petstore/api/store_api_resolver.js +++ b/samples/server/petstore/graphql-nodejs-express-server/petstore/api/store_api_resolver.js @@ -43,9 +43,9 @@ export default { }, // @return Order - PlaceOrder: ($body) => { + PlaceOrder: ($order) => { return { - "body": "" + "order": "" }; }, diff --git a/samples/server/petstore/graphql-nodejs-express-server/petstore/api/user_api.graphql b/samples/server/petstore/graphql-nodejs-express-server/petstore/api/user_api.graphql index d2744e88c4b0..e709fb3c565d 100644 --- a/samples/server/petstore/graphql-nodejs-express-server/petstore/api/user_api.graphql +++ b/samples/server/petstore/graphql-nodejs-express-server/petstore/api/user_api.graphql @@ -16,17 +16,17 @@ input CreateUserInput { # Created user object - body: UserInput + user: UserInput } input CreateUsersWithArrayInputInput { # List of user object - body: [UserInput] + user: [UserInput] } input CreateUsersWithListInputInput { # List of user object - body: [UserInput] + user: [UserInput] } input DeleteUserInput { @@ -38,21 +38,21 @@ input UpdateUserInput { # name that need to be deleted username: String!, # Updated user object - body: UserInput + user: UserInput } type Mutation { # Create user # This can only be done by the logged in user. - # @param User body Created user object + # @param User user Created user object # @return [Boolean] CreateUser(input: CreateUserInput!): Boolean # Creates list of users with given input array - # @param User body List of user object + # @param User user List of user object # @return [Boolean] CreateUsersWithArrayInput(input: CreateUsersWithArrayInputInput!): Boolean # Creates list of users with given input array - # @param User body List of user object + # @param User user List of user object # @return [Boolean] CreateUsersWithListInput(input: CreateUsersWithListInputInput!): Boolean # Delete user @@ -63,7 +63,7 @@ type Mutation { # Updated user # This can only be done by the logged in user. # @param String! username name that need to be deleted - # @param User body Updated user object + # @param User user Updated user object # @return [Boolean] UpdateUser(input: UpdateUserInput!): Boolean } diff --git a/samples/server/petstore/graphql-nodejs-express-server/petstore/api/user_api_resolver.js b/samples/server/petstore/graphql-nodejs-express-server/petstore/api/user_api_resolver.js index 2ee01c50a6d6..9865bd72c9a6 100644 --- a/samples/server/petstore/graphql-nodejs-express-server/petstore/api/user_api_resolver.js +++ b/samples/server/petstore/graphql-nodejs-express-server/petstore/api/user_api_resolver.js @@ -44,23 +44,23 @@ export default { Mutation: { // @return - CreateUser: ($body) => { + CreateUser: ($user) => { return { - "body": "" + "user": "" }; }, // @return - CreateUsersWithArrayInput: ($body) => { + CreateUsersWithArrayInput: ($user) => { return { - "body": "" + "user": "" }; }, // @return - CreateUsersWithListInput: ($body) => { + CreateUsersWithListInput: ($user) => { return { - "body": "" + "user": "" }; }, @@ -72,10 +72,10 @@ export default { }, // @return - UpdateUser: ($username, $body) => { + UpdateUser: ($username, $user) => { return { "username": "username_example", - "body": "" + "user": "" }; }, diff --git a/samples/server/petstore/graphql-nodejs-express-server/petstore/model/inline_object.graphql b/samples/server/petstore/graphql-nodejs-express-server/petstore/model/inline_object.graphql new file mode 100644 index 000000000000..ef9c97e15d63 --- /dev/null +++ b/samples/server/petstore/graphql-nodejs-express-server/petstore/model/inline_object.graphql @@ -0,0 +1,23 @@ +# +# OpenAPI Petstore +# +# +# This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +# +# Version: 1.0.0 +# +# Generated by OpenAPI Generator: https://openapi-generator.tech + +type InlineObject { + # Updated name of the pet + name: String! + # Updated status of the pet + status: String! +} + +input InlineObjectInput { + # Updated name of the pet + name: String! + # Updated status of the pet + status: String! +} diff --git a/samples/server/petstore/graphql-nodejs-express-server/petstore/model/inline_object_1.graphql b/samples/server/petstore/graphql-nodejs-express-server/petstore/model/inline_object_1.graphql new file mode 100644 index 000000000000..ef13a19d0b5c --- /dev/null +++ b/samples/server/petstore/graphql-nodejs-express-server/petstore/model/inline_object_1.graphql @@ -0,0 +1,23 @@ +# +# OpenAPI Petstore +# +# +# This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +# +# Version: 1.0.0 +# +# Generated by OpenAPI Generator: https://openapi-generator.tech + +type InlineObject1 { + # Additional data to pass to server + additionalMetadata: String! + # file to upload + file: String! +} + +input InlineObject1Input { + # Additional data to pass to server + additionalMetadata: String! + # file to upload + file: String! +} diff --git a/samples/server/petstore/haskell-servant/.openapi-generator/VERSION b/samples/server/petstore/haskell-servant/.openapi-generator/VERSION index 479c313e87b9..83a328a9227e 100644 --- a/samples/server/petstore/haskell-servant/.openapi-generator/VERSION +++ b/samples/server/petstore/haskell-servant/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.3-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-inflector/.openapi-generator/VERSION b/samples/server/petstore/java-inflector/.openapi-generator/VERSION index dde25ef08e8c..83a328a9227e 100644 --- a/samples/server/petstore/java-inflector/.openapi-generator/VERSION +++ b/samples/server/petstore/java-inflector/.openapi-generator/VERSION @@ -1 +1 @@ -3.1.1-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java new file mode 100644 index 000000000000..87b408f8664c --- /dev/null +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -0,0 +1,76 @@ +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.Map; + + + + + + +public class AdditionalPropertiesAnyType extends HashMap { + @JsonProperty("name") + private String name; + + /** + **/ + public AdditionalPropertiesAnyType name(String name) { + this.name = name; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("name") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesAnyType additionalPropertiesAnyType = (AdditionalPropertiesAnyType) o; + return Objects.equals(name, additionalPropertiesAnyType.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesAnyType {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java new file mode 100644 index 000000000000..a59423124b27 --- /dev/null +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -0,0 +1,77 @@ +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + + + + + +public class AdditionalPropertiesArray extends HashMap { + @JsonProperty("name") + private String name; + + /** + **/ + public AdditionalPropertiesArray name(String name) { + this.name = name; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("name") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesArray additionalPropertiesArray = (AdditionalPropertiesArray) o; + return Objects.equals(name, additionalPropertiesArray.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesArray {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java new file mode 100644 index 000000000000..03d6f1e0ebad --- /dev/null +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -0,0 +1,76 @@ +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.Map; + + + + + + +public class AdditionalPropertiesBoolean extends HashMap { + @JsonProperty("name") + private String name; + + /** + **/ + public AdditionalPropertiesBoolean name(String name) { + this.name = name; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("name") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesBoolean additionalPropertiesBoolean = (AdditionalPropertiesBoolean) o; + return Objects.equals(name, additionalPropertiesBoolean.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesBoolean {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index f9d5285bb6e6..721b680da8bc 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -15,44 +16,224 @@ public class AdditionalPropertiesClass { - @JsonProperty("map_property") - private Map mapProperty = null; + @JsonProperty("map_string") + private Map mapString = null; - @JsonProperty("map_of_map_property") - private Map> mapOfMapProperty = null; + @JsonProperty("map_number") + private Map mapNumber = null; + + @JsonProperty("map_integer") + private Map mapInteger = null; + + @JsonProperty("map_boolean") + private Map mapBoolean = null; + + @JsonProperty("map_array_integer") + private Map> mapArrayInteger = null; + + @JsonProperty("map_array_anytype") + private Map> mapArrayAnytype = null; + + @JsonProperty("map_map_string") + private Map> mapMapString = null; + + @JsonProperty("map_map_anytype") + private Map> mapMapAnytype = null; + + @JsonProperty("anytype_1") + private Object anytype1 = null; + + @JsonProperty("anytype_2") + private Object anytype2 = null; + + @JsonProperty("anytype_3") + private Object anytype3 = null; + + /** + **/ + public AdditionalPropertiesClass mapString(Map mapString) { + this.mapString = mapString; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("map_string") + public Map getMapString() { + return mapString; + } + public void setMapString(Map mapString) { + this.mapString = mapString; + } + + /** + **/ + public AdditionalPropertiesClass mapNumber(Map mapNumber) { + this.mapNumber = mapNumber; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("map_number") + public Map getMapNumber() { + return mapNumber; + } + public void setMapNumber(Map mapNumber) { + this.mapNumber = mapNumber; + } + + /** + **/ + public AdditionalPropertiesClass mapInteger(Map mapInteger) { + this.mapInteger = mapInteger; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("map_integer") + public Map getMapInteger() { + return mapInteger; + } + public void setMapInteger(Map mapInteger) { + this.mapInteger = mapInteger; + } + + /** + **/ + public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { + this.mapBoolean = mapBoolean; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("map_boolean") + public Map getMapBoolean() { + return mapBoolean; + } + public void setMapBoolean(Map mapBoolean) { + this.mapBoolean = mapBoolean; + } + + /** + **/ + public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { + this.mapArrayInteger = mapArrayInteger; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("map_array_integer") + public Map> getMapArrayInteger() { + return mapArrayInteger; + } + public void setMapArrayInteger(Map> mapArrayInteger) { + this.mapArrayInteger = mapArrayInteger; + } + + /** + **/ + public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { + this.mapArrayAnytype = mapArrayAnytype; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("map_array_anytype") + public Map> getMapArrayAnytype() { + return mapArrayAnytype; + } + public void setMapArrayAnytype(Map> mapArrayAnytype) { + this.mapArrayAnytype = mapArrayAnytype; + } + + /** + **/ + public AdditionalPropertiesClass mapMapString(Map> mapMapString) { + this.mapMapString = mapMapString; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("map_map_string") + public Map> getMapMapString() { + return mapMapString; + } + public void setMapMapString(Map> mapMapString) { + this.mapMapString = mapMapString; + } + + /** + **/ + public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { + this.mapMapAnytype = mapMapAnytype; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("map_map_anytype") + public Map> getMapMapAnytype() { + return mapMapAnytype; + } + public void setMapMapAnytype(Map> mapMapAnytype) { + this.mapMapAnytype = mapMapAnytype; + } + + /** + **/ + public AdditionalPropertiesClass anytype1(Object anytype1) { + this.anytype1 = anytype1; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("anytype_1") + public Object getAnytype1() { + return anytype1; + } + public void setAnytype1(Object anytype1) { + this.anytype1 = anytype1; + } /** **/ - public AdditionalPropertiesClass mapProperty(Map mapProperty) { - this.mapProperty = mapProperty; + public AdditionalPropertiesClass anytype2(Object anytype2) { + this.anytype2 = anytype2; return this; } @ApiModelProperty(value = "") - @JsonProperty("map_property") - public Map getMapProperty() { - return mapProperty; + @JsonProperty("anytype_2") + public Object getAnytype2() { + return anytype2; } - public void setMapProperty(Map mapProperty) { - this.mapProperty = mapProperty; + public void setAnytype2(Object anytype2) { + this.anytype2 = anytype2; } /** **/ - public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { - this.mapOfMapProperty = mapOfMapProperty; + public AdditionalPropertiesClass anytype3(Object anytype3) { + this.anytype3 = anytype3; return this; } @ApiModelProperty(value = "") - @JsonProperty("map_of_map_property") - public Map> getMapOfMapProperty() { - return mapOfMapProperty; + @JsonProperty("anytype_3") + public Object getAnytype3() { + return anytype3; } - public void setMapOfMapProperty(Map> mapOfMapProperty) { - this.mapOfMapProperty = mapOfMapProperty; + public void setAnytype3(Object anytype3) { + this.anytype3 = anytype3; } @@ -65,13 +246,22 @@ public boolean equals(java.lang.Object o) { return false; } AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o; - return Objects.equals(mapProperty, additionalPropertiesClass.mapProperty) && - Objects.equals(mapOfMapProperty, additionalPropertiesClass.mapOfMapProperty); + return Objects.equals(mapString, additionalPropertiesClass.mapString) && + Objects.equals(mapNumber, additionalPropertiesClass.mapNumber) && + Objects.equals(mapInteger, additionalPropertiesClass.mapInteger) && + Objects.equals(mapBoolean, additionalPropertiesClass.mapBoolean) && + Objects.equals(mapArrayInteger, additionalPropertiesClass.mapArrayInteger) && + Objects.equals(mapArrayAnytype, additionalPropertiesClass.mapArrayAnytype) && + Objects.equals(mapMapString, additionalPropertiesClass.mapMapString) && + Objects.equals(mapMapAnytype, additionalPropertiesClass.mapMapAnytype) && + Objects.equals(anytype1, additionalPropertiesClass.anytype1) && + Objects.equals(anytype2, additionalPropertiesClass.anytype2) && + Objects.equals(anytype3, additionalPropertiesClass.anytype3); } @Override public int hashCode() { - return Objects.hash(mapProperty, mapOfMapProperty); + return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); } @Override @@ -79,8 +269,17 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class AdditionalPropertiesClass {\n"); - sb.append(" mapProperty: ").append(toIndentedString(mapProperty)).append("\n"); - sb.append(" mapOfMapProperty: ").append(toIndentedString(mapOfMapProperty)).append("\n"); + sb.append(" mapString: ").append(toIndentedString(mapString)).append("\n"); + sb.append(" mapNumber: ").append(toIndentedString(mapNumber)).append("\n"); + sb.append(" mapInteger: ").append(toIndentedString(mapInteger)).append("\n"); + sb.append(" mapBoolean: ").append(toIndentedString(mapBoolean)).append("\n"); + sb.append(" mapArrayInteger: ").append(toIndentedString(mapArrayInteger)).append("\n"); + sb.append(" mapArrayAnytype: ").append(toIndentedString(mapArrayAnytype)).append("\n"); + sb.append(" mapMapString: ").append(toIndentedString(mapMapString)).append("\n"); + sb.append(" mapMapAnytype: ").append(toIndentedString(mapMapAnytype)).append("\n"); + sb.append(" anytype1: ").append(toIndentedString(anytype1)).append("\n"); + sb.append(" anytype2: ").append(toIndentedString(anytype2)).append("\n"); + sb.append(" anytype3: ").append(toIndentedString(anytype3)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java new file mode 100644 index 000000000000..7b2e3d212fbb --- /dev/null +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -0,0 +1,76 @@ +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.Map; + + + + + + +public class AdditionalPropertiesInteger extends HashMap { + @JsonProperty("name") + private String name; + + /** + **/ + public AdditionalPropertiesInteger name(String name) { + this.name = name; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("name") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesInteger additionalPropertiesInteger = (AdditionalPropertiesInteger) o; + return Objects.equals(name, additionalPropertiesInteger.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesInteger {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java new file mode 100644 index 000000000000..1a8fd4dc6322 --- /dev/null +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -0,0 +1,77 @@ +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.Map; + + + + + + +public class AdditionalPropertiesNumber extends HashMap { + @JsonProperty("name") + private String name; + + /** + **/ + public AdditionalPropertiesNumber name(String name) { + this.name = name; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("name") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesNumber additionalPropertiesNumber = (AdditionalPropertiesNumber) o; + return Objects.equals(name, additionalPropertiesNumber.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesNumber {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java new file mode 100644 index 000000000000..e298a87806fb --- /dev/null +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -0,0 +1,76 @@ +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.Map; + + + + + + +public class AdditionalPropertiesObject extends HashMap { + @JsonProperty("name") + private String name; + + /** + **/ + public AdditionalPropertiesObject name(String name) { + this.name = name; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("name") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesObject additionalPropertiesObject = (AdditionalPropertiesObject) o; + return Objects.equals(name, additionalPropertiesObject.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesObject {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java new file mode 100644 index 000000000000..7d557665eb6f --- /dev/null +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java @@ -0,0 +1,76 @@ +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.Map; + + + + + + +public class AdditionalPropertiesString extends HashMap { + @JsonProperty("name") + private String name; + + /** + **/ + public AdditionalPropertiesString name(String name) { + this.name = name; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("name") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesString additionalPropertiesString = (AdditionalPropertiesString) o; + return Objects.equals(name, additionalPropertiesString.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesString {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Animal.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Animal.java index dd9447b5ebef..bfcf5486f248 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Animal.java @@ -15,7 +15,7 @@ public class Animal { @JsonProperty("className") - private String className = null; + private String className; @JsonProperty("color") private String color = "red"; diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Capitalization.java index 02af8353e587..5ac9b3add792 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Capitalization.java @@ -13,22 +13,22 @@ public class Capitalization { @JsonProperty("smallCamel") - private String smallCamel = null; + private String smallCamel; @JsonProperty("CapitalCamel") - private String capitalCamel = null; + private String capitalCamel; @JsonProperty("small_Snake") - private String smallSnake = null; + private String smallSnake; @JsonProperty("Capital_Snake") - private String capitalSnake = null; + private String capitalSnake; @JsonProperty("SCA_ETH_Flow_Points") - private String scAETHFlowPoints = null; + private String scAETHFlowPoints; @JsonProperty("ATT_NAME") - private String ATT_NAME = null; + private String ATT_NAME; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Cat.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Cat.java index 5335d698a8b2..c8a9293aba98 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Cat.java @@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; +import org.openapitools.model.CatAllOf; @@ -14,7 +15,7 @@ public class Cat extends Animal { @JsonProperty("declawed") - private Boolean declawed = null; + private Boolean declawed; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/CatAllOf.java new file mode 100644 index 000000000000..80e67fbfdf7d --- /dev/null +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/CatAllOf.java @@ -0,0 +1,74 @@ +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + + + + + + +public class CatAllOf { + @JsonProperty("declawed") + private Boolean declawed; + + /** + **/ + public CatAllOf declawed(Boolean declawed) { + this.declawed = declawed; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("declawed") + public Boolean getDeclawed() { + return declawed; + } + public void setDeclawed(Boolean declawed) { + this.declawed = declawed; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CatAllOf catAllOf = (CatAllOf) o; + return Objects.equals(declawed, catAllOf.declawed); + } + + @Override + public int hashCode() { + return Objects.hash(declawed); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CatAllOf {\n"); + + sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Category.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Category.java index 873014460b2e..fe52381c0934 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Category.java @@ -13,10 +13,10 @@ public class Category { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name = "default-name"; /** **/ @@ -43,7 +43,7 @@ public Category name(String name) { } - @ApiModelProperty(value = "") + @ApiModelProperty(required = true, value = "") @JsonProperty("name") public String getName() { return name; diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ClassModel.java index d01849217ed0..ca34fbd20177 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ClassModel.java @@ -16,7 +16,7 @@ public class ClassModel { @JsonProperty("_class") - private String propertyClass = null; + private String propertyClass; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Client.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Client.java index 9e2392899fa4..a1838210b476 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Client.java @@ -13,7 +13,7 @@ public class Client { @JsonProperty("client") - private String client = null; + private String client; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Dog.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Dog.java index 3cc5ac3dad58..9198fef58d58 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Dog.java @@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; +import org.openapitools.model.DogAllOf; @@ -14,7 +15,7 @@ public class Dog extends Animal { @JsonProperty("breed") - private String breed = null; + private String breed; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/DogAllOf.java new file mode 100644 index 000000000000..16c0b0451f58 --- /dev/null +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/DogAllOf.java @@ -0,0 +1,74 @@ +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + + + + + + +public class DogAllOf { + @JsonProperty("breed") + private String breed; + + /** + **/ + public DogAllOf breed(String breed) { + this.breed = breed; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("breed") + public String getBreed() { + return breed; + } + public void setBreed(String breed) { + this.breed = breed; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DogAllOf dogAllOf = (DogAllOf) o; + return Objects.equals(breed, dogAllOf.breed); + } + + @Override + public int hashCode() { + return Objects.hash(breed); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DogAllOf {\n"); + + sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/EnumArrays.java index e53b95e708fb..56b5ce98e147 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/EnumArrays.java @@ -42,12 +42,12 @@ public static JustSymbolEnum fromValue(String text) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + text + "'"); } } @JsonProperty("just_symbol") - private JustSymbolEnum justSymbol = null; + private JustSymbolEnum justSymbol; /** * Gets or Sets arrayEnum @@ -76,7 +76,7 @@ public static ArrayEnumEnum fromValue(String text) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + text + "'"); } } diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/EnumClass.java index 04b4b96e1633..c0e2beefb8a0 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/EnumClass.java @@ -37,7 +37,7 @@ public static EnumClass fromValue(String text) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + text + "'"); } } diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/EnumTest.java index c3aa4764bd05..4c3d4a46380e 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/EnumTest.java @@ -43,12 +43,12 @@ public static EnumStringEnum fromValue(String text) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + text + "'"); } } @JsonProperty("enum_string") - private EnumStringEnum enumString = null; + private EnumStringEnum enumString; /** * Gets or Sets enumStringRequired @@ -79,12 +79,12 @@ public static EnumStringRequiredEnum fromValue(String text) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + text + "'"); } } @JsonProperty("enum_string_required") - private EnumStringRequiredEnum enumStringRequired = null; + private EnumStringRequiredEnum enumStringRequired; /** * Gets or Sets enumInteger @@ -113,12 +113,12 @@ public static EnumIntegerEnum fromValue(String text) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + text + "'"); } } @JsonProperty("enum_integer") - private EnumIntegerEnum enumInteger = null; + private EnumIntegerEnum enumInteger; /** * Gets or Sets enumNumber @@ -147,15 +147,15 @@ public static EnumNumberEnum fromValue(String text) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + text + "'"); } } @JsonProperty("enum_number") - private EnumNumberEnum enumNumber = null; + private EnumNumberEnum enumNumber; @JsonProperty("outerEnum") - private OuterEnum outerEnum = null; + private OuterEnum outerEnum; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/FormatTest.java index b755b19fda8d..d0d25fc140c6 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/FormatTest.java @@ -17,43 +17,43 @@ public class FormatTest { @JsonProperty("integer") - private Integer integer = null; + private Integer integer; @JsonProperty("int32") - private Integer int32 = null; + private Integer int32; @JsonProperty("int64") - private Long int64 = null; + private Long int64; @JsonProperty("number") - private BigDecimal number = null; + private BigDecimal number; @JsonProperty("float") - private Float _float = null; + private Float _float; @JsonProperty("double") - private Double _double = null; + private Double _double; @JsonProperty("string") - private String string = null; + private String string; @JsonProperty("byte") - private byte[] _byte = null; + private byte[] _byte; @JsonProperty("binary") - private File binary = null; + private File binary; @JsonProperty("date") - private Date date = null; + private Date date; @JsonProperty("dateTime") - private Date dateTime = null; + private Date dateTime; @JsonProperty("uuid") - private UUID uuid = null; + private UUID uuid; @JsonProperty("password") - private String password = null; + private String password; /** * minimum: 10 @@ -260,7 +260,7 @@ public FormatTest uuid(UUID uuid) { } - @ApiModelProperty(value = "") + @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") @JsonProperty("uuid") public UUID getUuid() { return uuid; diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java index 7dce1117eb1c..b3c40ffb503e 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java @@ -13,10 +13,10 @@ public class HasOnlyReadOnly { @JsonProperty("bar") - private String bar = null; + private String bar; @JsonProperty("foo") - private String foo = null; + private String foo; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/MapTest.java index 2ba14f914ebe..7f22d852e3c1 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/MapTest.java @@ -9,7 +9,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import org.openapitools.model.StringBooleanMap; @@ -47,7 +46,7 @@ public static InnerEnum fromValue(String text) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + text + "'"); } } @@ -58,7 +57,7 @@ public static InnerEnum fromValue(String text) { private Map directMap = null; @JsonProperty("indirect_map") - private StringBooleanMap indirectMap = null; + private Map indirectMap = null; /** **/ @@ -113,7 +112,7 @@ public void setDirectMap(Map directMap) { /** **/ - public MapTest indirectMap(StringBooleanMap indirectMap) { + public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; return this; } @@ -121,10 +120,10 @@ public MapTest indirectMap(StringBooleanMap indirectMap) { @ApiModelProperty(value = "") @JsonProperty("indirect_map") - public StringBooleanMap getIndirectMap() { + public Map getIndirectMap() { return indirectMap; } - public void setIndirectMap(StringBooleanMap indirectMap) { + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 1a09fa8a7f22..24b4ef0e1e71 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -19,10 +19,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("uuid") - private UUID uuid = null; + private UUID uuid; @JsonProperty("dateTime") - private Date dateTime = null; + private Date dateTime; @JsonProperty("map") private Map map = null; diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Model200Response.java index 84f8223b8040..d2bb54537374 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Model200Response.java @@ -16,10 +16,10 @@ public class Model200Response { @JsonProperty("name") - private Integer name = null; + private Integer name; @JsonProperty("class") - private String propertyClass = null; + private String propertyClass; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ModelApiResponse.java index 9e77e3f7d0d4..b711cae39dd0 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -13,13 +13,13 @@ public class ModelApiResponse { @JsonProperty("code") - private Integer code = null; + private Integer code; @JsonProperty("type") - private String type = null; + private String type; @JsonProperty("message") - private String message = null; + private String message; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ModelReturn.java index 5e768ccc566a..990b7b9a36d4 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ModelReturn.java @@ -16,7 +16,7 @@ public class ModelReturn { @JsonProperty("return") - private Integer _return = null; + private Integer _return; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Name.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Name.java index 5ec8687a8ba6..e96e805ba3ce 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Name.java @@ -16,16 +16,16 @@ public class Name { @JsonProperty("name") - private Integer name = null; + private Integer name; @JsonProperty("snake_case") - private Integer snakeCase = null; + private Integer snakeCase; @JsonProperty("property") - private String property = null; + private String property; @JsonProperty("123Number") - private Integer _123number = null; + private Integer _123number; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/NumberOnly.java index 24389e9446e5..8bb6fd8fe02f 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/NumberOnly.java @@ -14,7 +14,7 @@ public class NumberOnly { @JsonProperty("JustNumber") - private BigDecimal justNumber = null; + private BigDecimal justNumber; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Order.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Order.java index 632b6f6e4ed6..ac70304afdaf 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Order.java @@ -15,16 +15,16 @@ public class Order { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("petId") - private Long petId = null; + private Long petId; @JsonProperty("quantity") - private Integer quantity = null; + private Integer quantity; @JsonProperty("shipDate") - private Date shipDate = null; + private Date shipDate; /** * Order Status @@ -55,12 +55,12 @@ public static StatusEnum fromValue(String text) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + text + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; @JsonProperty("complete") private Boolean complete = false; diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/OuterComposite.java index cbbd53117cd3..6d46e00e23c0 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/OuterComposite.java @@ -14,13 +14,13 @@ public class OuterComposite { @JsonProperty("my_number") - private BigDecimal myNumber = null; + private BigDecimal myNumber; @JsonProperty("my_string") - private String myString = null; + private String myString; @JsonProperty("my_boolean") - private Boolean myBoolean = null; + private Boolean myBoolean; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/OuterEnum.java index d46baedf6c20..f7dc82feebdd 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/OuterEnum.java @@ -37,7 +37,7 @@ public static OuterEnum fromValue(String text) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + text + "'"); } } diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Pet.java index 97a03717d3c9..64cfa2c01bbb 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Pet.java @@ -18,13 +18,13 @@ public class Pet { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("category") private Category category = null; @JsonProperty("name") - private String name = null; + private String name; @JsonProperty("photoUrls") private List photoUrls = new ArrayList(); @@ -61,12 +61,12 @@ public static StatusEnum fromValue(String text) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + text + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ReadOnlyFirst.java index 451402ed9bd3..6c2e27d8bc3d 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ReadOnlyFirst.java @@ -13,10 +13,10 @@ public class ReadOnlyFirst { @JsonProperty("bar") - private String bar = null; + private String bar; @JsonProperty("baz") - private String baz = null; + private String baz; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/SpecialModelName.java index a85a7e51fdc8..6582bf518848 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/SpecialModelName.java @@ -13,7 +13,7 @@ public class SpecialModelName { @JsonProperty("$special[property.name]") - private Long $specialPropertyName = null; + private Long $specialPropertyName; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Tag.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Tag.java index fb242eaafd8f..24e27ce9b245 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Tag.java @@ -13,10 +13,10 @@ public class Tag { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/TypeHolderDefault.java new file mode 100644 index 000000000000..bef647c19a99 --- /dev/null +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/TypeHolderDefault.java @@ -0,0 +1,165 @@ +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + + + + + + +public class TypeHolderDefault { + @JsonProperty("string_item") + private String stringItem = "what"; + + @JsonProperty("number_item") + private BigDecimal numberItem; + + @JsonProperty("integer_item") + private Integer integerItem; + + @JsonProperty("bool_item") + private Boolean boolItem = true; + + @JsonProperty("array_item") + private List arrayItem = new ArrayList(); + + /** + **/ + public TypeHolderDefault stringItem(String stringItem) { + this.stringItem = stringItem; + return this; + } + + + @ApiModelProperty(required = true, value = "") + @JsonProperty("string_item") + public String getStringItem() { + return stringItem; + } + public void setStringItem(String stringItem) { + this.stringItem = stringItem; + } + + /** + **/ + public TypeHolderDefault numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; + return this; + } + + + @ApiModelProperty(required = true, value = "") + @JsonProperty("number_item") + public BigDecimal getNumberItem() { + return numberItem; + } + public void setNumberItem(BigDecimal numberItem) { + this.numberItem = numberItem; + } + + /** + **/ + public TypeHolderDefault integerItem(Integer integerItem) { + this.integerItem = integerItem; + return this; + } + + + @ApiModelProperty(required = true, value = "") + @JsonProperty("integer_item") + public Integer getIntegerItem() { + return integerItem; + } + public void setIntegerItem(Integer integerItem) { + this.integerItem = integerItem; + } + + /** + **/ + public TypeHolderDefault boolItem(Boolean boolItem) { + this.boolItem = boolItem; + return this; + } + + + @ApiModelProperty(required = true, value = "") + @JsonProperty("bool_item") + public Boolean getBoolItem() { + return boolItem; + } + public void setBoolItem(Boolean boolItem) { + this.boolItem = boolItem; + } + + /** + **/ + public TypeHolderDefault arrayItem(List arrayItem) { + this.arrayItem = arrayItem; + return this; + } + + + @ApiModelProperty(required = true, value = "") + @JsonProperty("array_item") + public List getArrayItem() { + return arrayItem; + } + public void setArrayItem(List arrayItem) { + this.arrayItem = arrayItem; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TypeHolderDefault typeHolderDefault = (TypeHolderDefault) o; + return Objects.equals(stringItem, typeHolderDefault.stringItem) && + Objects.equals(numberItem, typeHolderDefault.numberItem) && + Objects.equals(integerItem, typeHolderDefault.integerItem) && + Objects.equals(boolItem, typeHolderDefault.boolItem) && + Objects.equals(arrayItem, typeHolderDefault.arrayItem); + } + + @Override + public int hashCode() { + return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TypeHolderDefault {\n"); + + sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); + sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); + sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); + sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/TypeHolderExample.java new file mode 100644 index 000000000000..6f8415beb96a --- /dev/null +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/TypeHolderExample.java @@ -0,0 +1,165 @@ +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + + + + + + +public class TypeHolderExample { + @JsonProperty("string_item") + private String stringItem; + + @JsonProperty("number_item") + private BigDecimal numberItem; + + @JsonProperty("integer_item") + private Integer integerItem; + + @JsonProperty("bool_item") + private Boolean boolItem; + + @JsonProperty("array_item") + private List arrayItem = new ArrayList(); + + /** + **/ + public TypeHolderExample stringItem(String stringItem) { + this.stringItem = stringItem; + return this; + } + + + @ApiModelProperty(example = "what", required = true, value = "") + @JsonProperty("string_item") + public String getStringItem() { + return stringItem; + } + public void setStringItem(String stringItem) { + this.stringItem = stringItem; + } + + /** + **/ + public TypeHolderExample numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; + return this; + } + + + @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty("number_item") + public BigDecimal getNumberItem() { + return numberItem; + } + public void setNumberItem(BigDecimal numberItem) { + this.numberItem = numberItem; + } + + /** + **/ + public TypeHolderExample integerItem(Integer integerItem) { + this.integerItem = integerItem; + return this; + } + + + @ApiModelProperty(example = "-2", required = true, value = "") + @JsonProperty("integer_item") + public Integer getIntegerItem() { + return integerItem; + } + public void setIntegerItem(Integer integerItem) { + this.integerItem = integerItem; + } + + /** + **/ + public TypeHolderExample boolItem(Boolean boolItem) { + this.boolItem = boolItem; + return this; + } + + + @ApiModelProperty(example = "true", required = true, value = "") + @JsonProperty("bool_item") + public Boolean getBoolItem() { + return boolItem; + } + public void setBoolItem(Boolean boolItem) { + this.boolItem = boolItem; + } + + /** + **/ + public TypeHolderExample arrayItem(List arrayItem) { + this.arrayItem = arrayItem; + return this; + } + + + @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + @JsonProperty("array_item") + public List getArrayItem() { + return arrayItem; + } + public void setArrayItem(List arrayItem) { + this.arrayItem = arrayItem; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TypeHolderExample typeHolderExample = (TypeHolderExample) o; + return Objects.equals(stringItem, typeHolderExample.stringItem) && + Objects.equals(numberItem, typeHolderExample.numberItem) && + Objects.equals(integerItem, typeHolderExample.integerItem) && + Objects.equals(boolItem, typeHolderExample.boolItem) && + Objects.equals(arrayItem, typeHolderExample.arrayItem); + } + + @Override + public int hashCode() { + return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TypeHolderExample {\n"); + + sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); + sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); + sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); + sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/User.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/User.java index b991f07867a9..c1f4956c8e98 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/User.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/User.java @@ -13,28 +13,28 @@ public class User { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("username") - private String username = null; + private String username; @JsonProperty("firstName") - private String firstName = null; + private String firstName; @JsonProperty("lastName") - private String lastName = null; + private String lastName; @JsonProperty("email") - private String email = null; + private String email; @JsonProperty("password") - private String password = null; + private String password; @JsonProperty("phone") - private String phone = null; + private String phone; @JsonProperty("userStatus") - private Integer userStatus = null; + private Integer userStatus; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/XmlItem.java new file mode 100644 index 000000000000..8a9de640ab6b --- /dev/null +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/XmlItem.java @@ -0,0 +1,693 @@ +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + + + + + + +public class XmlItem { + @JsonProperty("attribute_string") + private String attributeString; + + @JsonProperty("attribute_number") + private BigDecimal attributeNumber; + + @JsonProperty("attribute_integer") + private Integer attributeInteger; + + @JsonProperty("attribute_boolean") + private Boolean attributeBoolean; + + @JsonProperty("wrapped_array") + private List wrappedArray = null; + + @JsonProperty("name_string") + private String nameString; + + @JsonProperty("name_number") + private BigDecimal nameNumber; + + @JsonProperty("name_integer") + private Integer nameInteger; + + @JsonProperty("name_boolean") + private Boolean nameBoolean; + + @JsonProperty("name_array") + private List nameArray = null; + + @JsonProperty("name_wrapped_array") + private List nameWrappedArray = null; + + @JsonProperty("prefix_string") + private String prefixString; + + @JsonProperty("prefix_number") + private BigDecimal prefixNumber; + + @JsonProperty("prefix_integer") + private Integer prefixInteger; + + @JsonProperty("prefix_boolean") + private Boolean prefixBoolean; + + @JsonProperty("prefix_array") + private List prefixArray = null; + + @JsonProperty("prefix_wrapped_array") + private List prefixWrappedArray = null; + + @JsonProperty("namespace_string") + private String namespaceString; + + @JsonProperty("namespace_number") + private BigDecimal namespaceNumber; + + @JsonProperty("namespace_integer") + private Integer namespaceInteger; + + @JsonProperty("namespace_boolean") + private Boolean namespaceBoolean; + + @JsonProperty("namespace_array") + private List namespaceArray = null; + + @JsonProperty("namespace_wrapped_array") + private List namespaceWrappedArray = null; + + @JsonProperty("prefix_ns_string") + private String prefixNsString; + + @JsonProperty("prefix_ns_number") + private BigDecimal prefixNsNumber; + + @JsonProperty("prefix_ns_integer") + private Integer prefixNsInteger; + + @JsonProperty("prefix_ns_boolean") + private Boolean prefixNsBoolean; + + @JsonProperty("prefix_ns_array") + private List prefixNsArray = null; + + @JsonProperty("prefix_ns_wrapped_array") + private List prefixNsWrappedArray = null; + + /** + **/ + public XmlItem attributeString(String attributeString) { + this.attributeString = attributeString; + return this; + } + + + @ApiModelProperty(example = "string", value = "") + @JsonProperty("attribute_string") + public String getAttributeString() { + return attributeString; + } + public void setAttributeString(String attributeString) { + this.attributeString = attributeString; + } + + /** + **/ + public XmlItem attributeNumber(BigDecimal attributeNumber) { + this.attributeNumber = attributeNumber; + return this; + } + + + @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("attribute_number") + public BigDecimal getAttributeNumber() { + return attributeNumber; + } + public void setAttributeNumber(BigDecimal attributeNumber) { + this.attributeNumber = attributeNumber; + } + + /** + **/ + public XmlItem attributeInteger(Integer attributeInteger) { + this.attributeInteger = attributeInteger; + return this; + } + + + @ApiModelProperty(example = "-2", value = "") + @JsonProperty("attribute_integer") + public Integer getAttributeInteger() { + return attributeInteger; + } + public void setAttributeInteger(Integer attributeInteger) { + this.attributeInteger = attributeInteger; + } + + /** + **/ + public XmlItem attributeBoolean(Boolean attributeBoolean) { + this.attributeBoolean = attributeBoolean; + return this; + } + + + @ApiModelProperty(example = "true", value = "") + @JsonProperty("attribute_boolean") + public Boolean getAttributeBoolean() { + return attributeBoolean; + } + public void setAttributeBoolean(Boolean attributeBoolean) { + this.attributeBoolean = attributeBoolean; + } + + /** + **/ + public XmlItem wrappedArray(List wrappedArray) { + this.wrappedArray = wrappedArray; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("wrapped_array") + public List getWrappedArray() { + return wrappedArray; + } + public void setWrappedArray(List wrappedArray) { + this.wrappedArray = wrappedArray; + } + + /** + **/ + public XmlItem nameString(String nameString) { + this.nameString = nameString; + return this; + } + + + @ApiModelProperty(example = "string", value = "") + @JsonProperty("name_string") + public String getNameString() { + return nameString; + } + public void setNameString(String nameString) { + this.nameString = nameString; + } + + /** + **/ + public XmlItem nameNumber(BigDecimal nameNumber) { + this.nameNumber = nameNumber; + return this; + } + + + @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("name_number") + public BigDecimal getNameNumber() { + return nameNumber; + } + public void setNameNumber(BigDecimal nameNumber) { + this.nameNumber = nameNumber; + } + + /** + **/ + public XmlItem nameInteger(Integer nameInteger) { + this.nameInteger = nameInteger; + return this; + } + + + @ApiModelProperty(example = "-2", value = "") + @JsonProperty("name_integer") + public Integer getNameInteger() { + return nameInteger; + } + public void setNameInteger(Integer nameInteger) { + this.nameInteger = nameInteger; + } + + /** + **/ + public XmlItem nameBoolean(Boolean nameBoolean) { + this.nameBoolean = nameBoolean; + return this; + } + + + @ApiModelProperty(example = "true", value = "") + @JsonProperty("name_boolean") + public Boolean getNameBoolean() { + return nameBoolean; + } + public void setNameBoolean(Boolean nameBoolean) { + this.nameBoolean = nameBoolean; + } + + /** + **/ + public XmlItem nameArray(List nameArray) { + this.nameArray = nameArray; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("name_array") + public List getNameArray() { + return nameArray; + } + public void setNameArray(List nameArray) { + this.nameArray = nameArray; + } + + /** + **/ + public XmlItem nameWrappedArray(List nameWrappedArray) { + this.nameWrappedArray = nameWrappedArray; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("name_wrapped_array") + public List getNameWrappedArray() { + return nameWrappedArray; + } + public void setNameWrappedArray(List nameWrappedArray) { + this.nameWrappedArray = nameWrappedArray; + } + + /** + **/ + public XmlItem prefixString(String prefixString) { + this.prefixString = prefixString; + return this; + } + + + @ApiModelProperty(example = "string", value = "") + @JsonProperty("prefix_string") + public String getPrefixString() { + return prefixString; + } + public void setPrefixString(String prefixString) { + this.prefixString = prefixString; + } + + /** + **/ + public XmlItem prefixNumber(BigDecimal prefixNumber) { + this.prefixNumber = prefixNumber; + return this; + } + + + @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("prefix_number") + public BigDecimal getPrefixNumber() { + return prefixNumber; + } + public void setPrefixNumber(BigDecimal prefixNumber) { + this.prefixNumber = prefixNumber; + } + + /** + **/ + public XmlItem prefixInteger(Integer prefixInteger) { + this.prefixInteger = prefixInteger; + return this; + } + + + @ApiModelProperty(example = "-2", value = "") + @JsonProperty("prefix_integer") + public Integer getPrefixInteger() { + return prefixInteger; + } + public void setPrefixInteger(Integer prefixInteger) { + this.prefixInteger = prefixInteger; + } + + /** + **/ + public XmlItem prefixBoolean(Boolean prefixBoolean) { + this.prefixBoolean = prefixBoolean; + return this; + } + + + @ApiModelProperty(example = "true", value = "") + @JsonProperty("prefix_boolean") + public Boolean getPrefixBoolean() { + return prefixBoolean; + } + public void setPrefixBoolean(Boolean prefixBoolean) { + this.prefixBoolean = prefixBoolean; + } + + /** + **/ + public XmlItem prefixArray(List prefixArray) { + this.prefixArray = prefixArray; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("prefix_array") + public List getPrefixArray() { + return prefixArray; + } + public void setPrefixArray(List prefixArray) { + this.prefixArray = prefixArray; + } + + /** + **/ + public XmlItem prefixWrappedArray(List prefixWrappedArray) { + this.prefixWrappedArray = prefixWrappedArray; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("prefix_wrapped_array") + public List getPrefixWrappedArray() { + return prefixWrappedArray; + } + public void setPrefixWrappedArray(List prefixWrappedArray) { + this.prefixWrappedArray = prefixWrappedArray; + } + + /** + **/ + public XmlItem namespaceString(String namespaceString) { + this.namespaceString = namespaceString; + return this; + } + + + @ApiModelProperty(example = "string", value = "") + @JsonProperty("namespace_string") + public String getNamespaceString() { + return namespaceString; + } + public void setNamespaceString(String namespaceString) { + this.namespaceString = namespaceString; + } + + /** + **/ + public XmlItem namespaceNumber(BigDecimal namespaceNumber) { + this.namespaceNumber = namespaceNumber; + return this; + } + + + @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("namespace_number") + public BigDecimal getNamespaceNumber() { + return namespaceNumber; + } + public void setNamespaceNumber(BigDecimal namespaceNumber) { + this.namespaceNumber = namespaceNumber; + } + + /** + **/ + public XmlItem namespaceInteger(Integer namespaceInteger) { + this.namespaceInteger = namespaceInteger; + return this; + } + + + @ApiModelProperty(example = "-2", value = "") + @JsonProperty("namespace_integer") + public Integer getNamespaceInteger() { + return namespaceInteger; + } + public void setNamespaceInteger(Integer namespaceInteger) { + this.namespaceInteger = namespaceInteger; + } + + /** + **/ + public XmlItem namespaceBoolean(Boolean namespaceBoolean) { + this.namespaceBoolean = namespaceBoolean; + return this; + } + + + @ApiModelProperty(example = "true", value = "") + @JsonProperty("namespace_boolean") + public Boolean getNamespaceBoolean() { + return namespaceBoolean; + } + public void setNamespaceBoolean(Boolean namespaceBoolean) { + this.namespaceBoolean = namespaceBoolean; + } + + /** + **/ + public XmlItem namespaceArray(List namespaceArray) { + this.namespaceArray = namespaceArray; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("namespace_array") + public List getNamespaceArray() { + return namespaceArray; + } + public void setNamespaceArray(List namespaceArray) { + this.namespaceArray = namespaceArray; + } + + /** + **/ + public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { + this.namespaceWrappedArray = namespaceWrappedArray; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("namespace_wrapped_array") + public List getNamespaceWrappedArray() { + return namespaceWrappedArray; + } + public void setNamespaceWrappedArray(List namespaceWrappedArray) { + this.namespaceWrappedArray = namespaceWrappedArray; + } + + /** + **/ + public XmlItem prefixNsString(String prefixNsString) { + this.prefixNsString = prefixNsString; + return this; + } + + + @ApiModelProperty(example = "string", value = "") + @JsonProperty("prefix_ns_string") + public String getPrefixNsString() { + return prefixNsString; + } + public void setPrefixNsString(String prefixNsString) { + this.prefixNsString = prefixNsString; + } + + /** + **/ + public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { + this.prefixNsNumber = prefixNsNumber; + return this; + } + + + @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("prefix_ns_number") + public BigDecimal getPrefixNsNumber() { + return prefixNsNumber; + } + public void setPrefixNsNumber(BigDecimal prefixNsNumber) { + this.prefixNsNumber = prefixNsNumber; + } + + /** + **/ + public XmlItem prefixNsInteger(Integer prefixNsInteger) { + this.prefixNsInteger = prefixNsInteger; + return this; + } + + + @ApiModelProperty(example = "-2", value = "") + @JsonProperty("prefix_ns_integer") + public Integer getPrefixNsInteger() { + return prefixNsInteger; + } + public void setPrefixNsInteger(Integer prefixNsInteger) { + this.prefixNsInteger = prefixNsInteger; + } + + /** + **/ + public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { + this.prefixNsBoolean = prefixNsBoolean; + return this; + } + + + @ApiModelProperty(example = "true", value = "") + @JsonProperty("prefix_ns_boolean") + public Boolean getPrefixNsBoolean() { + return prefixNsBoolean; + } + public void setPrefixNsBoolean(Boolean prefixNsBoolean) { + this.prefixNsBoolean = prefixNsBoolean; + } + + /** + **/ + public XmlItem prefixNsArray(List prefixNsArray) { + this.prefixNsArray = prefixNsArray; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("prefix_ns_array") + public List getPrefixNsArray() { + return prefixNsArray; + } + public void setPrefixNsArray(List prefixNsArray) { + this.prefixNsArray = prefixNsArray; + } + + /** + **/ + public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { + this.prefixNsWrappedArray = prefixNsWrappedArray; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("prefix_ns_wrapped_array") + public List getPrefixNsWrappedArray() { + return prefixNsWrappedArray; + } + public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { + this.prefixNsWrappedArray = prefixNsWrappedArray; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + XmlItem xmlItem = (XmlItem) o; + return Objects.equals(attributeString, xmlItem.attributeString) && + Objects.equals(attributeNumber, xmlItem.attributeNumber) && + Objects.equals(attributeInteger, xmlItem.attributeInteger) && + Objects.equals(attributeBoolean, xmlItem.attributeBoolean) && + Objects.equals(wrappedArray, xmlItem.wrappedArray) && + Objects.equals(nameString, xmlItem.nameString) && + Objects.equals(nameNumber, xmlItem.nameNumber) && + Objects.equals(nameInteger, xmlItem.nameInteger) && + Objects.equals(nameBoolean, xmlItem.nameBoolean) && + Objects.equals(nameArray, xmlItem.nameArray) && + Objects.equals(nameWrappedArray, xmlItem.nameWrappedArray) && + Objects.equals(prefixString, xmlItem.prefixString) && + Objects.equals(prefixNumber, xmlItem.prefixNumber) && + Objects.equals(prefixInteger, xmlItem.prefixInteger) && + Objects.equals(prefixBoolean, xmlItem.prefixBoolean) && + Objects.equals(prefixArray, xmlItem.prefixArray) && + Objects.equals(prefixWrappedArray, xmlItem.prefixWrappedArray) && + Objects.equals(namespaceString, xmlItem.namespaceString) && + Objects.equals(namespaceNumber, xmlItem.namespaceNumber) && + Objects.equals(namespaceInteger, xmlItem.namespaceInteger) && + Objects.equals(namespaceBoolean, xmlItem.namespaceBoolean) && + Objects.equals(namespaceArray, xmlItem.namespaceArray) && + Objects.equals(namespaceWrappedArray, xmlItem.namespaceWrappedArray) && + Objects.equals(prefixNsString, xmlItem.prefixNsString) && + Objects.equals(prefixNsNumber, xmlItem.prefixNsNumber) && + Objects.equals(prefixNsInteger, xmlItem.prefixNsInteger) && + Objects.equals(prefixNsBoolean, xmlItem.prefixNsBoolean) && + Objects.equals(prefixNsArray, xmlItem.prefixNsArray) && + Objects.equals(prefixNsWrappedArray, xmlItem.prefixNsWrappedArray); + } + + @Override + public int hashCode() { + return Objects.hash(attributeString, attributeNumber, attributeInteger, attributeBoolean, wrappedArray, nameString, nameNumber, nameInteger, nameBoolean, nameArray, nameWrappedArray, prefixString, prefixNumber, prefixInteger, prefixBoolean, prefixArray, prefixWrappedArray, namespaceString, namespaceNumber, namespaceInteger, namespaceBoolean, namespaceArray, namespaceWrappedArray, prefixNsString, prefixNsNumber, prefixNsInteger, prefixNsBoolean, prefixNsArray, prefixNsWrappedArray); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class XmlItem {\n"); + + sb.append(" attributeString: ").append(toIndentedString(attributeString)).append("\n"); + sb.append(" attributeNumber: ").append(toIndentedString(attributeNumber)).append("\n"); + sb.append(" attributeInteger: ").append(toIndentedString(attributeInteger)).append("\n"); + sb.append(" attributeBoolean: ").append(toIndentedString(attributeBoolean)).append("\n"); + sb.append(" wrappedArray: ").append(toIndentedString(wrappedArray)).append("\n"); + sb.append(" nameString: ").append(toIndentedString(nameString)).append("\n"); + sb.append(" nameNumber: ").append(toIndentedString(nameNumber)).append("\n"); + sb.append(" nameInteger: ").append(toIndentedString(nameInteger)).append("\n"); + sb.append(" nameBoolean: ").append(toIndentedString(nameBoolean)).append("\n"); + sb.append(" nameArray: ").append(toIndentedString(nameArray)).append("\n"); + sb.append(" nameWrappedArray: ").append(toIndentedString(nameWrappedArray)).append("\n"); + sb.append(" prefixString: ").append(toIndentedString(prefixString)).append("\n"); + sb.append(" prefixNumber: ").append(toIndentedString(prefixNumber)).append("\n"); + sb.append(" prefixInteger: ").append(toIndentedString(prefixInteger)).append("\n"); + sb.append(" prefixBoolean: ").append(toIndentedString(prefixBoolean)).append("\n"); + sb.append(" prefixArray: ").append(toIndentedString(prefixArray)).append("\n"); + sb.append(" prefixWrappedArray: ").append(toIndentedString(prefixWrappedArray)).append("\n"); + sb.append(" namespaceString: ").append(toIndentedString(namespaceString)).append("\n"); + sb.append(" namespaceNumber: ").append(toIndentedString(namespaceNumber)).append("\n"); + sb.append(" namespaceInteger: ").append(toIndentedString(namespaceInteger)).append("\n"); + sb.append(" namespaceBoolean: ").append(toIndentedString(namespaceBoolean)).append("\n"); + sb.append(" namespaceArray: ").append(toIndentedString(namespaceArray)).append("\n"); + sb.append(" namespaceWrappedArray: ").append(toIndentedString(namespaceWrappedArray)).append("\n"); + sb.append(" prefixNsString: ").append(toIndentedString(prefixNsString)).append("\n"); + sb.append(" prefixNsNumber: ").append(toIndentedString(prefixNsNumber)).append("\n"); + sb.append(" prefixNsInteger: ").append(toIndentedString(prefixNsInteger)).append("\n"); + sb.append(" prefixNsBoolean: ").append(toIndentedString(prefixNsBoolean)).append("\n"); + sb.append(" prefixNsArray: ").append(toIndentedString(prefixNsArray)).append("\n"); + sb.append(" prefixNsWrappedArray: ").append(toIndentedString(prefixNsWrappedArray)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/AnotherFakeController.java b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/AnotherFakeController.java index 529234297d99..6c23f0dfa38d 100644 --- a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/AnotherFakeController.java +++ b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/AnotherFakeController.java @@ -21,7 +21,7 @@ public class AnotherFakeController { **/ /* - public ResponseContext testSpecialTags(RequestContext request , Client client) { + public ResponseContext call123testSpecialTags(RequestContext request , Client body) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ diff --git a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/FakeClassnameTestController.java b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/FakeClassnameTestController.java index f3e1b163c24a..df32b5442dce 100644 --- a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/FakeClassnameTestController.java +++ b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/FakeClassnameTestController.java @@ -21,7 +21,7 @@ public class FakeClassnameTestController { **/ /* - public ResponseContext testClassname(RequestContext request , Client client) { + public ResponseContext testClassname(RequestContext request , Client body) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ diff --git a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/FakeController.java b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/FakeController.java index e069a8c9751b..19f6101d56f9 100644 --- a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/FakeController.java +++ b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/FakeController.java @@ -19,6 +19,7 @@ import org.openapitools.model.ModelApiResponse; import org.openapitools.model.OuterComposite; import org.openapitools.model.User; +import org.openapitools.model.XmlItem; public class FakeController { @@ -28,6 +29,12 @@ public class FakeController { * Code allows you to implement logic incrementally, they are disabled. **/ + /* + public ResponseContext createXmlItem(RequestContext request , XmlItem xmlItem) { + return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); + } + */ + /* public ResponseContext fakeOuterBooleanSerialize(RequestContext request , Boolean body) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); @@ -35,7 +42,7 @@ public ResponseContext fakeOuterBooleanSerialize(RequestContext request , Boolea */ /* - public ResponseContext fakeOuterCompositeSerialize(RequestContext request , OuterComposite outerComposite) { + public ResponseContext fakeOuterCompositeSerialize(RequestContext request , OuterComposite body) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ @@ -53,19 +60,19 @@ public ResponseContext fakeOuterStringSerialize(RequestContext request , String */ /* - public ResponseContext testBodyWithFileSchema(RequestContext request , FileSchemaTestClass fileSchemaTestClass) { + public ResponseContext testBodyWithFileSchema(RequestContext request , FileSchemaTestClass body) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ /* - public ResponseContext testBodyWithQueryParams(RequestContext request , String query, User user) { + public ResponseContext testBodyWithQueryParams(RequestContext request , String query, User body) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ /* - public ResponseContext testClientModel(RequestContext request , Client client) { + public ResponseContext testClientModel(RequestContext request , Client body) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ @@ -83,7 +90,13 @@ public ResponseContext testEnumParameters(RequestContext request , List */ /* - public ResponseContext testInlineAdditionalProperties(RequestContext request , Map requestBody) { + public ResponseContext testGroupParameters(RequestContext request , Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) { + return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); + } + */ + + /* + public ResponseContext testInlineAdditionalProperties(RequestContext request , Map param) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ diff --git a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/PetController.java b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/PetController.java index cd276a634870..4475ca1323a9 100644 --- a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/PetController.java +++ b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/PetController.java @@ -23,7 +23,7 @@ public class PetController { **/ /* - public ResponseContext addPet(RequestContext request , Pet pet) { + public ResponseContext addPet(RequestContext request , Pet body) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ @@ -53,7 +53,7 @@ public ResponseContext getPetById(RequestContext request , Long petId) { */ /* - public ResponseContext updatePet(RequestContext request , Pet pet) { + public ResponseContext updatePet(RequestContext request , Pet body) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ diff --git a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/StoreController.java b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/StoreController.java index f67f43a380c6..f77cc1110dd1 100644 --- a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/StoreController.java +++ b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/StoreController.java @@ -40,7 +40,7 @@ public ResponseContext getOrderById(RequestContext request , Long orderId) { */ /* - public ResponseContext placeOrder(RequestContext request , Order order) { + public ResponseContext placeOrder(RequestContext request , Order body) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ diff --git a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/UserController.java b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/UserController.java index 21ce727c6283..01fd4b9873ac 100644 --- a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/UserController.java +++ b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/UserController.java @@ -22,19 +22,19 @@ public class UserController { **/ /* - public ResponseContext createUser(RequestContext request , User user) { + public ResponseContext createUser(RequestContext request , User body) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ /* - public ResponseContext createUsersWithArrayInput(RequestContext request , List user) { + public ResponseContext createUsersWithArrayInput(RequestContext request , List body) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ /* - public ResponseContext createUsersWithListInput(RequestContext request , List user) { + public ResponseContext createUsersWithListInput(RequestContext request , List body) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ @@ -64,7 +64,7 @@ public ResponseContext logoutUser(RequestContext request ) { */ /* - public ResponseContext updateUser(RequestContext request , String username, User user) { + public ResponseContext updateUser(RequestContext request , String username, User body) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ diff --git a/samples/server/petstore/java-inflector/src/main/openapi/openapi.yaml b/samples/server/petstore/java-inflector/src/main/openapi/openapi.yaml index ae9b35de6a83..a87acd20ee26 100644 --- a/samples/server/petstore/java-inflector/src/main/openapi/openapi.yaml +++ b/samples/server/petstore/java-inflector/src/main/openapi/openapi.yaml @@ -32,6 +32,9 @@ paths: description: Pet object that needs to be added to the store required: true responses: + 200: + content: {} + description: successful operation 405: content: {} description: Invalid input @@ -42,6 +45,7 @@ paths: summary: Add a new pet to the store tags: - pet + x-codegen-request-body-name: body x-contentType: application/json x-accepts: application/json put: @@ -57,6 +61,9 @@ paths: description: Pet object that needs to be added to the store required: true responses: + 200: + content: {} + description: successful operation 400: content: {} description: Invalid ID supplied @@ -73,6 +80,7 @@ paths: summary: Update an existing pet tags: - pet + x-codegen-request-body-name: body x-contentType: application/json x-accepts: application/json /pet/findByStatus: @@ -123,7 +131,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + description: Multiple tags can be provided with comma separated strings. Use + tag1, tag2, tag3 for testing. operationId: findPetsByTags parameters: - description: Tags to filter by @@ -177,6 +186,9 @@ paths: format: int64 type: integer responses: + 200: + content: {} + description: successful operation 400: content: {} description: Invalid pet value @@ -340,11 +352,13 @@ paths: summary: Place an order for a pet tags: - store + x-codegen-request-body-name: body x-contentType: '*/*' x-accepts: application/json /store/order/{order_id}: delete: - description: For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + description: For valid response try integer IDs with value < 1000. Anything + above 1000 or nonintegers will generate API errors operationId: deleteOrder parameters: - description: ID of the order that needs to be deleted @@ -365,7 +379,8 @@ paths: - store x-accepts: application/json get: - description: For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generated exceptions operationId: getOrderById parameters: - description: ID of pet that needs to be fetched @@ -415,6 +430,7 @@ paths: summary: Create user tags: - user + x-codegen-request-body-name: body x-contentType: '*/*' x-accepts: application/json /user/createWithArray: @@ -436,6 +452,7 @@ paths: summary: Creates list of users with given input array tags: - user + x-codegen-request-body-name: body x-contentType: '*/*' x-accepts: application/json /user/createWithList: @@ -457,6 +474,7 @@ paths: summary: Creates list of users with given input array tags: - user + x-codegen-request-body-name: body x-contentType: '*/*' x-accepts: application/json /user/login: @@ -592,6 +610,7 @@ paths: summary: Updated user tags: - user + x-codegen-request-body-name: body x-contentType: '*/*' x-accepts: application/json /fake_classname_test: @@ -617,9 +636,58 @@ paths: summary: To test class name in snake case tags: - fake_classname_tags 123#$%^ + x-codegen-request-body-name: body x-contentType: application/json x-accepts: application/json /fake: + delete: + description: Fake endpoint to test group parameters (optional) + operationId: testGroupParameters + parameters: + - description: Required String in group parameters + in: query + name: required_string_group + required: true + schema: + type: integer + - description: Required Boolean in group parameters + in: header + name: required_boolean_group + required: true + schema: + type: boolean + - description: Required Integer in group parameters + in: query + name: required_int64_group + required: true + schema: + format: int64 + type: integer + - description: String in group parameters + in: query + name: string_group + schema: + type: integer + - description: Boolean in group parameters + in: header + name: boolean_group + schema: + type: boolean + - description: Integer in group parameters + in: query + name: int64_group + schema: + format: int64 + type: integer + responses: + 400: + content: {} + description: Someting wrong + summary: Fake endpoint to test group parameters (optional) + tags: + - fake + x-group-parameters: true + x-accepts: application/json get: description: To test enum parameters operationId: testEnumParameters @@ -742,6 +810,7 @@ paths: summary: To test "client" model tags: - fake + x-codegen-request-body-name: body x-contentType: application/json x-accepts: application/json post: @@ -864,6 +933,7 @@ paths: description: Output number tags: - fake + x-codegen-request-body-name: body x-contentType: '*/*' x-accepts: '*/*' /fake/outer/string: @@ -886,6 +956,7 @@ paths: description: Output string tags: - fake + x-codegen-request-body-name: body x-contentType: '*/*' x-accepts: '*/*' /fake/outer/boolean: @@ -908,6 +979,7 @@ paths: description: Output boolean tags: - fake + x-codegen-request-body-name: body x-contentType: '*/*' x-accepts: '*/*' /fake/outer/composite: @@ -930,6 +1002,7 @@ paths: description: Output composite tags: - fake + x-codegen-request-body-name: body x-contentType: '*/*' x-accepts: '*/*' /fake/jsonFormData: @@ -978,6 +1051,7 @@ paths: summary: test inline additionalProperties tags: - fake + x-codegen-request-body-name: param x-contentType: application/json x-accepts: application/json /fake/body-with-query-params: @@ -1001,12 +1075,49 @@ paths: description: Success tags: - fake + x-codegen-request-body-name: body x-contentType: application/json x-accepts: application/json + /fake/create_xml_item: + post: + description: this route creates an XmlItem + operationId: createXmlItem + requestBody: + content: + application/xml: + schema: + $ref: '#/components/schemas/XmlItem' + application/xml; charset=utf-8: + schema: + $ref: '#/components/schemas/XmlItem' + application/xml; charset=utf-16: + schema: + $ref: '#/components/schemas/XmlItem' + text/xml: + schema: + $ref: '#/components/schemas/XmlItem' + text/xml; charset=utf-8: + schema: + $ref: '#/components/schemas/XmlItem' + text/xml; charset=utf-16: + schema: + $ref: '#/components/schemas/XmlItem' + description: XmlItem Body + required: true + responses: + 200: + content: {} + description: successful operation + summary: creates an XmlItem + tags: + - fake + x-codegen-request-body-name: XmlItem + x-contentType: application/xml + x-accepts: application/json /another-fake/dummy: patch: - description: To test special tags - operationId: test_special_tags + description: To test special tags and operation ID starting with number + operationId: 123_test_@#$%_special_tags requestBody: content: application/json: @@ -1024,11 +1135,13 @@ paths: summary: To test special tags tags: - $another-fake? + x-codegen-request-body-name: body x-contentType: application/json x-accepts: application/json /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema named `File`. + description: For this test, the body for this request much reference a schema + named `File`. operationId: testBodyWithFileSchema requestBody: content: @@ -1042,6 +1155,7 @@ paths: description: Success tags: - fake + x-codegen-request-body-name: body x-contentType: application/json x-accepts: application/json /fake/{petId}/uploadImageWithRequiredFile: @@ -1063,12 +1177,12 @@ paths: additionalMetadata: description: Additional data to pass to server type: string - file: + requiredFile: description: file to upload format: binary type: string required: - - file + - requiredFile required: true responses: 200: @@ -1088,16 +1202,53 @@ paths: x-accepts: application/json components: schemas: + Order: + example: + petId: 6 + quantity: 1 + id: 0 + shipDate: 2000-01-23T04:56:07.000+00:00 + complete: false + status: placed + properties: + id: + format: int64 + type: integer + petId: + format: int64 + type: integer + quantity: + format: int32 + type: integer + shipDate: + format: date-time + type: string + status: + description: Order Status + enum: + - placed + - approved + - delivered + type: string + complete: + default: false + type: boolean + type: object + xml: + name: Order Category: example: - name: name + name: default-name id: 6 properties: id: format: int64 type: integer name: + default: default-name type: string + required: + - name type: object xml: name: Category @@ -1135,45 +1286,72 @@ components: type: object xml: name: User - OuterNumber: - type: number - ArrayOfNumberOnly: - properties: - ArrayNumber: - items: - type: number - type: array - type: object - Capitalization: + Tag: + example: + name: name + id: 1 properties: - smallCamel: - type: string - CapitalCamel: - type: string - small_Snake: - type: string - Capital_Snake: - type: string - SCA_ETH_Flow_Points: - type: string - ATT_NAME: - description: | - Name of the pet + id: + format: int64 + type: integer + name: type: string type: object - MixedPropertiesAndAdditionalPropertiesClass: + xml: + name: Tag + Pet: + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: default-name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available properties: - uuid: - format: uuid + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie type: string - dateTime: - format: date-time + photoUrls: + items: + type: string + type: array + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold type: string - map: - additionalProperties: - $ref: '#/components/schemas/Animal' - type: object + required: + - name + - photoUrls type: object + xml: + name: Pet ApiResponse: example: code: 0 @@ -1188,6 +1366,23 @@ components: message: type: string type: object + $special[model.name]: + properties: + $special[property.name]: + format: int64 + type: integer + type: object + xml: + name: $special[model.name] + Return: + description: Model for testing reserved words + properties: + return: + format: int32 + type: integer + type: object + xml: + name: Return Name: description: Model for testing model name same as property name properties: @@ -1208,25 +1403,6 @@ components: type: object xml: name: Name - EnumClass: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - List: - example: - 123-list: 123-list - properties: - 123-list: - type: string - type: object - NumberOnly: - properties: - JustNumber: - type: number - type: object 200_response: description: Model for testing model name starting with number properties: @@ -1238,172 +1414,36 @@ components: type: object xml: name: Name - Client: - example: - client: client + ClassModel: + description: Model for testing model with "_class" property properties: - client: + _class: type: string type: object Dog: allOf: - $ref: '#/components/schemas/Animal' - - properties: - breed: - type: string - type: object - Enum_Test: + - $ref: '#/components/schemas/Dog_allOf' + Cat: + allOf: + - $ref: '#/components/schemas/Animal' + - $ref: '#/components/schemas/Cat_allOf' + Animal: + discriminator: + propertyName: className properties: - enum_string: - enum: - - UPPER - - lower - - "" + className: type: string - enum_string_required: - enum: - - UPPER - - lower - - "" + color: + default: red type: string - enum_integer: - enum: - - 1 - - -1 - format: int32 - type: integer - enum_number: - enum: - - 1.1 - - -1.2 - format: double - type: number - outerEnum: - $ref: '#/components/schemas/OuterEnum' required: - - enum_string_required - type: object - Order: - example: - petId: 6 - quantity: 1 - id: 0 - shipDate: 2000-01-23T04:56:07.000+00:00 - complete: false - status: placed - properties: - id: - format: int64 - type: integer - petId: - format: int64 - type: integer - quantity: - format: int32 - type: integer - shipDate: - format: date-time - type: string - status: - description: Order Status - enum: - - placed - - approved - - delivered - type: string - complete: - default: false - type: boolean - type: object - xml: - name: Order - AdditionalPropertiesClass: - properties: - map_property: - additionalProperties: - type: string - type: object - map_of_map_property: - additionalProperties: - additionalProperties: - type: string - type: object - type: object - type: object - $special[model.name]: - properties: - $special[property.name]: - format: int64 - type: integer - type: object - xml: - name: $special[model.name] - Return: - description: Model for testing reserved words - properties: - return: - format: int32 - type: integer - type: object - xml: - name: Return - ReadOnlyFirst: - properties: - bar: - readOnly: true - type: string - baz: - type: string - type: object - ArrayOfArrayOfNumberOnly: - properties: - ArrayArrayNumber: - items: - items: - type: number - type: array - type: array - type: object - OuterEnum: - enum: - - placed - - approved - - delivered - type: string - ArrayTest: - properties: - array_of_string: - items: - type: string - type: array - array_array_of_integer: - items: - items: - format: int64 - type: integer - type: array - type: array - array_array_of_model: - items: - items: - $ref: '#/components/schemas/ReadOnlyFirst' - type: array - type: array - type: object - OuterComposite: - example: - my_string: my_string - my_number: 0.80082819046101150206595775671303272247314453125 - my_boolean: true - properties: - my_number: - type: number - my_string: - type: string - my_boolean: - type: boolean - x-codegen-body-parameter-name: boolean_post_body + - className type: object + AnimalFarm: + items: + $ref: '#/components/schemas/Animal' + type: array format_test: properties: integer: @@ -1449,6 +1489,7 @@ components: format: date-time type: string uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 format: uuid type: string password: @@ -1462,6 +1503,277 @@ components: - number - password type: object + EnumClass: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + Enum_Test: + properties: + enum_string: + enum: + - UPPER + - lower + - "" + type: string + enum_string_required: + enum: + - UPPER + - lower + - "" + type: string + enum_integer: + enum: + - 1 + - -1 + format: int32 + type: integer + enum_number: + enum: + - 1.1 + - -1.2 + format: double + type: number + outerEnum: + $ref: '#/components/schemas/OuterEnum' + required: + - enum_string_required + type: object + AdditionalPropertiesClass: + properties: + map_string: + additionalProperties: + type: string + type: object + map_number: + additionalProperties: + type: number + type: object + map_integer: + additionalProperties: + type: integer + type: object + map_boolean: + additionalProperties: + type: boolean + type: object + map_array_integer: + additionalProperties: + items: + type: integer + type: array + type: object + map_array_anytype: + additionalProperties: + items: + properties: {} + type: object + type: array + type: object + map_map_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_map_anytype: + additionalProperties: + additionalProperties: + properties: {} + type: object + type: object + type: object + anytype_1: + properties: {} + type: object + anytype_2: + type: object + anytype_3: + properties: {} + type: object + type: object + AdditionalPropertiesString: + additionalProperties: + type: string + properties: + name: + type: string + type: object + AdditionalPropertiesInteger: + additionalProperties: + type: integer + properties: + name: + type: string + type: object + AdditionalPropertiesNumber: + additionalProperties: + type: number + properties: + name: + type: string + type: object + AdditionalPropertiesBoolean: + additionalProperties: + type: boolean + properties: + name: + type: string + type: object + AdditionalPropertiesArray: + additionalProperties: + items: + properties: {} + type: object + type: array + properties: + name: + type: string + type: object + AdditionalPropertiesObject: + additionalProperties: + additionalProperties: + properties: {} + type: object + type: object + properties: + name: + type: string + type: object + AdditionalPropertiesAnyType: + additionalProperties: + properties: {} + type: object + properties: + name: + type: string + type: object + MixedPropertiesAndAdditionalPropertiesClass: + properties: + uuid: + format: uuid + type: string + dateTime: + format: date-time + type: string + map: + additionalProperties: + $ref: '#/components/schemas/Animal' + type: object + type: object + List: + properties: + 123-list: + type: string + type: object + Client: + example: + client: client + properties: + client: + type: string + type: object + ReadOnlyFirst: + properties: + bar: + readOnly: true + type: string + baz: + type: string + type: object + hasOnlyReadOnly: + properties: + bar: + readOnly: true + type: string + foo: + readOnly: true + type: string + type: object + Capitalization: + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + type: object + MapTest: + properties: + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + additionalProperties: + type: boolean + type: object + type: object + ArrayTest: + properties: + array_of_string: + items: + type: string + type: array + array_array_of_integer: + items: + items: + format: int64 + type: integer + type: array + type: array + array_array_of_model: + items: + items: + $ref: '#/components/schemas/ReadOnlyFirst' + type: array + type: array + type: object + NumberOnly: + properties: + JustNumber: + type: number + type: object + ArrayOfNumberOnly: + properties: + ArrayNumber: + items: + type: number + type: array + type: object + ArrayOfArrayOfNumberOnly: + properties: + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array + type: object EnumArrays: properties: just_symbol: @@ -1477,17 +1789,37 @@ components: type: string type: array type: object - OuterString: + OuterEnum: + enum: + - placed + - approved + - delivered type: string - ClassModel: - description: Model for testing model with "_class" property + OuterComposite: + example: + my_string: my_string + my_number: 0.8008281904610115 + my_boolean: true properties: - _class: + my_number: + type: number + my_string: type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body type: object + OuterNumber: + type: number + OuterString: + type: string OuterBoolean: type: boolean x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + type: object FileSchemaTestClass: example: file: @@ -1503,138 +1835,255 @@ components: $ref: '#/components/schemas/File' type: array type: object - Animal: - discriminator: - propertyName: className + File: + description: Must be named `File` for test. + example: + sourceURI: sourceURI properties: - className: - type: string - color: - default: red + sourceURI: + description: Test capitalization type: string - required: - - className - type: object - StringBooleanMap: - additionalProperties: - type: boolean - type: object - Cat: - allOf: - - $ref: '#/components/schemas/Animal' - - properties: - declawed: - type: boolean - type: object - MapTest: - properties: - map_map_of_string: - additionalProperties: - additionalProperties: - type: string - type: object - type: object - map_of_enum_string: - additionalProperties: - enum: - - UPPER - - lower - type: string - type: object - direct_map: - additionalProperties: - type: boolean - type: object - indirect_map: - $ref: '#/components/schemas/StringBooleanMap' type: object - Tag: - example: - name: name - id: 1 + TypeHolderDefault: properties: - id: - format: int64 - type: integer - name: + string_item: + default: what type: string + number_item: + type: number + integer_item: + type: integer + bool_item: + default: true + type: boolean + array_item: + items: + type: integer + type: array + required: + - array_item + - bool_item + - integer_item + - number_item + - string_item type: object - xml: - name: Tag - AnimalFarm: - items: - $ref: '#/components/schemas/Animal' - type: array - File: - example: - sourceURI: sourceURI + TypeHolderExample: properties: - sourceURI: - description: Test capitalization + string_item: + example: what type: string + number_item: + example: 1.234 + type: number + integer_item: + example: -2 + type: integer + bool_item: + example: true + type: boolean + array_item: + example: + - 0 + - 1 + - 2 + - 3 + items: + type: integer + type: array + required: + - array_item + - bool_item + - integer_item + - number_item + - string_item type: object - Pet: - example: - photoUrls: - - photoUrls - - photoUrls - name: doggie - id: 0 - category: - name: name - id: 6 - tags: - - name: name - id: 1 - - name: name - id: 1 - status: available + XmlItem: properties: - id: - format: int64 + attribute_string: + example: string + type: string + xml: + attribute: true + attribute_number: + example: 1.234 + type: number + xml: + attribute: true + attribute_integer: + example: -2 type: integer - x-is-unique: true - category: - $ref: '#/components/schemas/Category' - name: - example: doggie + xml: + attribute: true + attribute_boolean: + example: true + type: boolean + xml: + attribute: true + wrapped_array: + items: + type: integer + type: array + xml: + wrapped: true + name_string: + example: string type: string - photoUrls: + xml: + name: xml_name_string + name_number: + example: 1.234 + type: number + xml: + name: xml_name_number + name_integer: + example: -2 + type: integer + xml: + name: xml_name_integer + name_boolean: + example: true + type: boolean + xml: + name: xml_name_boolean + name_array: items: - type: string + type: integer + xml: + name: xml_name_array_item + type: array + name_wrapped_array: + items: + type: integer + xml: + name: xml_name_wrapped_array_item type: array xml: - name: photoUrl + name: xml_name_wrapped_array wrapped: true - tags: + prefix_string: + example: string + type: string + xml: + prefix: ab + prefix_number: + example: 1.234 + type: number + xml: + prefix: cd + prefix_integer: + example: -2 + type: integer + xml: + prefix: ef + prefix_boolean: + example: true + type: boolean + xml: + prefix: gh + prefix_array: items: - $ref: '#/components/schemas/Tag' + type: integer + xml: + prefix: ij + type: array + prefix_wrapped_array: + items: + type: integer + xml: + prefix: mn type: array xml: - name: tag + prefix: kl wrapped: true - status: - description: pet status in the store - enum: - - available - - pending - - sold + namespace_string: + example: string type: string - required: - - name - - photoUrls + xml: + namespace: http://a.com/schema + namespace_number: + example: 1.234 + type: number + xml: + namespace: http://b.com/schema + namespace_integer: + example: -2 + type: integer + xml: + namespace: http://c.com/schema + namespace_boolean: + example: true + type: boolean + xml: + namespace: http://d.com/schema + namespace_array: + items: + type: integer + xml: + namespace: http://e.com/schema + type: array + namespace_wrapped_array: + items: + type: integer + xml: + namespace: http://g.com/schema + type: array + xml: + namespace: http://f.com/schema + wrapped: true + prefix_ns_string: + example: string + type: string + xml: + namespace: http://a.com/schema + prefix: a + prefix_ns_number: + example: 1.234 + type: number + xml: + namespace: http://b.com/schema + prefix: b + prefix_ns_integer: + example: -2 + type: integer + xml: + namespace: http://c.com/schema + prefix: c + prefix_ns_boolean: + example: true + type: boolean + xml: + namespace: http://d.com/schema + prefix: d + prefix_ns_array: + items: + type: integer + xml: + namespace: http://e.com/schema + prefix: e + type: array + prefix_ns_wrapped_array: + items: + type: integer + xml: + namespace: http://g.com/schema + prefix: g + type: array + xml: + namespace: http://f.com/schema + prefix: f + wrapped: true type: object xml: - name: Pet - hasOnlyReadOnly: + namespace: http://a.com/schema + prefix: pre + Dog_allOf: properties: - bar: - readOnly: true + breed: type: string - foo: - readOnly: true - type: string - type: object + Cat_allOf: + properties: + declawed: + type: boolean securitySchemes: petstore_auth: flows: @@ -1644,9 +2093,6 @@ components: write:pets: modify pets in your account read:pets: read your pets type: oauth2 - http_basic_test: - scheme: basic - type: http api_key: in: header name: api_key @@ -1655,3 +2101,6 @@ components: in: query name: api_key_query type: apiKey + http_basic_test: + scheme: basic + type: http diff --git a/samples/server/petstore/java-pkmst/.openapi-generator/VERSION b/samples/server/petstore/java-pkmst/.openapi-generator/VERSION index afa636560641..83a328a9227e 100644 --- a/samples/server/petstore/java-pkmst/.openapi-generator/VERSION +++ b/samples/server/petstore/java-pkmst/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/PetApi.java b/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/PetApi.java index 5f3bc7b91155..117b8048ce2e 100644 --- a/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/PetApi.java +++ b/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.0.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/StoreApi.java b/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/StoreApi.java index e4786488ec79..70460d501e91 100644 --- a/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/StoreApi.java +++ b/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.0.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/UserApi.java b/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/UserApi.java index f136720e1970..7b30a2cf09ce 100644 --- a/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/UserApi.java +++ b/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.0.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/java-play-framework-api-package-override/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-api-package-override/.openapi-generator/VERSION index dde25ef08e8c..83a328a9227e 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-api-package-override/.openapi-generator/VERSION @@ -1 +1 @@ -3.1.1-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Category.java b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Category.java index 9f0206575f5c..86c8ed0cdefc 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Category.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Category.java @@ -12,10 +12,10 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Category { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; public Category id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/ModelApiResponse.java index 07493e848250..91638ac8c602 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/ModelApiResponse.java @@ -12,13 +12,13 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ModelApiResponse { @JsonProperty("code") - private Integer code = null; + private Integer code; @JsonProperty("type") - private String type = null; + private String type; @JsonProperty("message") - private String message = null; + private String message; public ModelApiResponse code(Integer code) { this.code = code; diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Order.java b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Order.java index d1aaa38d0029..91d6d09e7f7e 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Order.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Order.java @@ -13,16 +13,16 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Order { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("petId") - private Long petId = null; + private Long petId; @JsonProperty("quantity") - private Integer quantity = null; + private Integer quantity; @JsonProperty("shipDate") - private OffsetDateTime shipDate = null; + private OffsetDateTime shipDate; /** * Order Status @@ -47,18 +47,18 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; @JsonProperty("complete") private Boolean complete = false; diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Pet.java index 5e5ff3762945..a4e223b2b156 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Pet.java @@ -16,13 +16,13 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Pet { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("category") private Category category = null; @JsonProperty("name") - private String name = null; + private String name; @JsonProperty("photoUrls") private List photoUrls = new ArrayList<>(); @@ -53,18 +53,18 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; public Pet id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Tag.java b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Tag.java index 15a8774252af..1a9079ff3456 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Tag.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Tag.java @@ -12,10 +12,10 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Tag { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; public Tag id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/User.java b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/User.java index 689de768893e..8df0a6506702 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/User.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/User.java @@ -12,28 +12,28 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class User { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("username") - private String username = null; + private String username; @JsonProperty("firstName") - private String firstName = null; + private String firstName; @JsonProperty("lastName") - private String lastName = null; + private String lastName; @JsonProperty("email") - private String email = null; + private String email; @JsonProperty("password") - private String password = null; + private String password; @JsonProperty("phone") - private String phone = null; + private String phone; @JsonProperty("userStatus") - private Integer userStatus = null; + private Integer userStatus; public User id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/PetApiController.java b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/PetApiController.java index 7932fea7b2af..253f6e33751c 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/PetApiController.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/PetApiController.java @@ -39,17 +39,17 @@ private PetApiController(Configuration configuration, PetApiControllerImpInterfa @ApiAction public Result addPet() throws Exception { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(pet); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.addPet(pet); + imp.addPet(body); return ok(); } @@ -126,17 +126,17 @@ public Result getPetById(Long petId) throws Exception { @ApiAction public Result updatePet() throws Exception { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(pet); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.updatePet(pet); + imp.updatePet(body); return ok(); } @@ -147,14 +147,14 @@ public Result updatePetWithForm(Long petId) throws Exception { if (valuename != null) { name = valuename; } else { - name = "null"; + name = null; } String valuestatus = (request().body().asMultipartFormData().asFormUrlEncoded().get("status"))[0]; String status; if (valuestatus != null) { status = valuestatus; } else { - status = "null"; + status = null; } imp.updatePetWithForm(petId, name, status); return ok(); @@ -167,7 +167,7 @@ public Result uploadFile(Long petId) throws Exception { if (valueadditionalMetadata != null) { additionalMetadata = valueadditionalMetadata; } else { - additionalMetadata = "null"; + additionalMetadata = null; } Http.MultipartFormData.FilePart file = request().body().asMultipartFormData().getFile("file"); ModelApiResponse obj = imp.uploadFile(petId, additionalMetadata, file); diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/PetApiControllerImp.java b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/PetApiControllerImp.java index 2eb66e8fbb9b..8b6dde9c2d15 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/PetApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/PetApiControllerImp.java @@ -13,7 +13,7 @@ public class PetApiControllerImp implements PetApiControllerImpInterface { @Override - public void addPet(Pet pet) throws Exception { + public void addPet(Pet body) throws Exception { //Do your magic!!! } @@ -41,7 +41,7 @@ public Pet getPetById(Long petId) throws Exception { } @Override - public void updatePet(Pet pet) throws Exception { + public void updatePet(Pet body) throws Exception { //Do your magic!!! } diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/PetApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/PetApiControllerImpInterface.java index 19b38fe2142a..39679e11f45c 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/PetApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/PetApiControllerImpInterface.java @@ -13,7 +13,7 @@ @SuppressWarnings("RedundantThrows") public interface PetApiControllerImpInterface { - void addPet(Pet pet) throws Exception; + void addPet(Pet body) throws Exception; void deletePet(Long petId, String apiKey) throws Exception; @@ -23,7 +23,7 @@ public interface PetApiControllerImpInterface { Pet getPetById(Long petId) throws Exception; - void updatePet(Pet pet) throws Exception; + void updatePet(Pet body) throws Exception; void updatePetWithForm(Long petId, String name, String status) throws Exception; diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/StoreApiController.java b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/StoreApiController.java index 2aaae94f8dfd..225d3009543f 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/StoreApiController.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/StoreApiController.java @@ -61,17 +61,17 @@ public Result getOrderById( @Min(1) @Max(5)Long orderId) throws Exception { @ApiAction public Result placeOrder() throws Exception { - JsonNode nodeorder = request().body().asJson(); - Order order; - if (nodeorder != null) { - order = mapper.readValue(nodeorder.toString(), Order.class); + JsonNode nodebody = request().body().asJson(); + Order body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Order.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(order); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Order' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - Order obj = imp.placeOrder(order); + Order obj = imp.placeOrder(body); if (configuration.getBoolean("useOutputBeanValidation")) { OpenAPIUtils.validate(obj); } diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/StoreApiControllerImp.java b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/StoreApiControllerImp.java index 4166031e9082..fe2cf4f6808e 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/StoreApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/StoreApiControllerImp.java @@ -29,7 +29,7 @@ public Order getOrderById( @Min(1) @Max(5)Long orderId) throws Exception { } @Override - public Order placeOrder(Order order) throws Exception { + public Order placeOrder(Order body) throws Exception { //Do your magic!!! return new Order(); } diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/StoreApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/StoreApiControllerImpInterface.java index 387836d83804..4f2aadae998c 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/StoreApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/StoreApiControllerImpInterface.java @@ -18,6 +18,6 @@ public interface StoreApiControllerImpInterface { Order getOrderById( @Min(1) @Max(5)Long orderId) throws Exception; - Order placeOrder(Order order) throws Exception; + Order placeOrder(Order body) throws Exception; } diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiController.java b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiController.java index 8190c6f6f6a2..5e103c7eeb6f 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiController.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiController.java @@ -38,53 +38,53 @@ private UserApiController(Configuration configuration, UserApiControllerImpInter @ApiAction public Result createUser() throws Exception { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(user); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUser(user); + imp.createUser(body); return ok(); } @ApiAction public Result createUsersWithArrayInput() throws Exception { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); if (configuration.getBoolean("useInputBeanValidation")) { - for (User curItem : user) { + for (User curItem : body) { OpenAPIUtils.validate(curItem); } } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithArrayInput(user); + imp.createUsersWithArrayInput(body); return ok(); } @ApiAction public Result createUsersWithListInput() throws Exception { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); if (configuration.getBoolean("useInputBeanValidation")) { - for (User curItem : user) { + for (User curItem : body) { OpenAPIUtils.validate(curItem); } } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithListInput(user); + imp.createUsersWithListInput(body); return ok(); } @@ -133,17 +133,17 @@ public Result logoutUser() throws Exception { @ApiAction public Result updateUser(String username) throws Exception { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(user); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.updateUser(username, user); + imp.updateUser(username, body); return ok(); } } diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiControllerImp.java b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiControllerImp.java index 85a70248c4ad..d53c2a82c11d 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiControllerImp.java @@ -12,17 +12,17 @@ public class UserApiControllerImp implements UserApiControllerImpInterface { @Override - public void createUser(User user) throws Exception { + public void createUser(User body) throws Exception { //Do your magic!!! } @Override - public void createUsersWithArrayInput(List user) throws Exception { + public void createUsersWithArrayInput(List body) throws Exception { //Do your magic!!! } @Override - public void createUsersWithListInput(List user) throws Exception { + public void createUsersWithListInput(List body) throws Exception { //Do your magic!!! } @@ -49,7 +49,7 @@ public void logoutUser() throws Exception { } @Override - public void updateUser(String username, User user) throws Exception { + public void updateUser(String username, User body) throws Exception { //Do your magic!!! } diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiControllerImpInterface.java index d103affead0d..4904073cbc2e 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiControllerImpInterface.java @@ -12,11 +12,11 @@ @SuppressWarnings("RedundantThrows") public interface UserApiControllerImpInterface { - void createUser(User user) throws Exception; + void createUser(User body) throws Exception; - void createUsersWithArrayInput(List user) throws Exception; + void createUsersWithArrayInput(List body) throws Exception; - void createUsersWithListInput(List user) throws Exception; + void createUsersWithListInput(List body) throws Exception; void deleteUser(String username) throws Exception; @@ -26,6 +26,6 @@ public interface UserApiControllerImpInterface { void logoutUser() throws Exception; - void updateUser(String username, User user) throws Exception; + void updateUser(String username, User body) throws Exception; } diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/openapitools/OpenAPIUtils.java b/samples/server/petstore/java-play-framework-api-package-override/app/openapitools/OpenAPIUtils.java index c707ca74ac7e..385ef97a0083 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/openapitools/OpenAPIUtils.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/openapitools/OpenAPIUtils.java @@ -98,6 +98,6 @@ public static String parameterToString(Object param) { } public static String formatDatetime(Date date) { - return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX").format(date); + return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX", Locale.ROOT).format(date); } -} \ No newline at end of file +} diff --git a/samples/server/petstore/java-play-framework-api-package-override/public/openapi.json b/samples/server/petstore/java-play-framework-api-package-override/public/openapi.json index ac1d45047828..d536f6b09046 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/public/openapi.json +++ b/samples/server/petstore/java-play-framework-api-package-override/public/openapi.json @@ -61,6 +61,7 @@ "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "x-codegen-request-body-name" : "body", "x-contentType" : "application/json", "x-accepts" : "application/json" }, @@ -93,6 +94,7 @@ "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "x-codegen-request-body-name" : "body", "x-contentType" : "application/json", "x-accepts" : "application/json" } @@ -114,8 +116,8 @@ "type" : "array", "items" : { "type" : "string", - "enum" : [ "available", "pending", "sold" ], - "default" : "available" + "default" : "available", + "enum" : [ "available", "pending", "sold" ] } } } ], @@ -446,6 +448,7 @@ "content" : { } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } @@ -545,6 +548,7 @@ "content" : { } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } @@ -574,6 +578,7 @@ "content" : { } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } @@ -603,6 +608,7 @@ "content" : { } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } @@ -759,6 +765,7 @@ "content" : { } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" }, diff --git a/samples/server/petstore/java-play-framework-async/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-async/.openapi-generator/VERSION index dde25ef08e8c..83a328a9227e 100644 --- a/samples/server/petstore/java-play-framework-async/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-async/.openapi-generator/VERSION @@ -1 +1 @@ -3.1.1-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-async/app/apimodels/Category.java b/samples/server/petstore/java-play-framework-async/app/apimodels/Category.java index 9f0206575f5c..86c8ed0cdefc 100644 --- a/samples/server/petstore/java-play-framework-async/app/apimodels/Category.java +++ b/samples/server/petstore/java-play-framework-async/app/apimodels/Category.java @@ -12,10 +12,10 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Category { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; public Category id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-async/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework-async/app/apimodels/ModelApiResponse.java index 07493e848250..91638ac8c602 100644 --- a/samples/server/petstore/java-play-framework-async/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework-async/app/apimodels/ModelApiResponse.java @@ -12,13 +12,13 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ModelApiResponse { @JsonProperty("code") - private Integer code = null; + private Integer code; @JsonProperty("type") - private String type = null; + private String type; @JsonProperty("message") - private String message = null; + private String message; public ModelApiResponse code(Integer code) { this.code = code; diff --git a/samples/server/petstore/java-play-framework-async/app/apimodels/Order.java b/samples/server/petstore/java-play-framework-async/app/apimodels/Order.java index d1aaa38d0029..91d6d09e7f7e 100644 --- a/samples/server/petstore/java-play-framework-async/app/apimodels/Order.java +++ b/samples/server/petstore/java-play-framework-async/app/apimodels/Order.java @@ -13,16 +13,16 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Order { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("petId") - private Long petId = null; + private Long petId; @JsonProperty("quantity") - private Integer quantity = null; + private Integer quantity; @JsonProperty("shipDate") - private OffsetDateTime shipDate = null; + private OffsetDateTime shipDate; /** * Order Status @@ -47,18 +47,18 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; @JsonProperty("complete") private Boolean complete = false; diff --git a/samples/server/petstore/java-play-framework-async/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework-async/app/apimodels/Pet.java index 5e5ff3762945..a4e223b2b156 100644 --- a/samples/server/petstore/java-play-framework-async/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework-async/app/apimodels/Pet.java @@ -16,13 +16,13 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Pet { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("category") private Category category = null; @JsonProperty("name") - private String name = null; + private String name; @JsonProperty("photoUrls") private List photoUrls = new ArrayList<>(); @@ -53,18 +53,18 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; public Pet id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-async/app/apimodels/Tag.java b/samples/server/petstore/java-play-framework-async/app/apimodels/Tag.java index 15a8774252af..1a9079ff3456 100644 --- a/samples/server/petstore/java-play-framework-async/app/apimodels/Tag.java +++ b/samples/server/petstore/java-play-framework-async/app/apimodels/Tag.java @@ -12,10 +12,10 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Tag { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; public Tag id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-async/app/apimodels/User.java b/samples/server/petstore/java-play-framework-async/app/apimodels/User.java index 689de768893e..8df0a6506702 100644 --- a/samples/server/petstore/java-play-framework-async/app/apimodels/User.java +++ b/samples/server/petstore/java-play-framework-async/app/apimodels/User.java @@ -12,28 +12,28 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class User { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("username") - private String username = null; + private String username; @JsonProperty("firstName") - private String firstName = null; + private String firstName; @JsonProperty("lastName") - private String lastName = null; + private String lastName; @JsonProperty("email") - private String email = null; + private String email; @JsonProperty("password") - private String password = null; + private String password; @JsonProperty("phone") - private String phone = null; + private String phone; @JsonProperty("userStatus") - private Integer userStatus = null; + private Integer userStatus; public User id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-async/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework-async/app/controllers/PetApiController.java index 0dd34c6888f2..1344ffe7afb1 100644 --- a/samples/server/petstore/java-play-framework-async/app/controllers/PetApiController.java +++ b/samples/server/petstore/java-play-framework-async/app/controllers/PetApiController.java @@ -17,9 +17,6 @@ import openapitools.OpenAPIUtils; import com.fasterxml.jackson.core.type.TypeReference; -import java.util.concurrent.CompletionStage; -import java.util.concurrent.CompletableFuture; - import javax.validation.constraints.*; import play.Configuration; @@ -41,25 +38,23 @@ private PetApiController(Configuration configuration, PetApiControllerImpInterfa @ApiAction - public CompletionStage addPet() throws Exception { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + public Result addPet() throws Exception { + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(pet); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - return CompletableFuture.supplyAsync(() -> { - imp.addPet(pet) - return ok(); - }); + imp.addPet(body); + return ok(); } @ApiAction - public CompletionStage deletePet(Long petId) throws Exception { + public Result deletePet(Long petId) throws Exception { String valueapiKey = request().getHeader("api_key"); String apiKey; if (valueapiKey != null) { @@ -67,14 +62,12 @@ public CompletionStage deletePet(Long petId) throws Exception { } else { apiKey = null; } - return CompletableFuture.supplyAsync(() -> { - imp.deletePet(petId, apiKey) - return ok(); - }); + imp.deletePet(petId, apiKey); + return ok(); } @ApiAction - public CompletionStage findPetsByStatus() throws Exception { + public Result findPetsByStatus() throws Exception { String[] statusArray = request().queryString().get("status"); if (statusArray == null) { throw new IllegalArgumentException("'status' parameter is required"); @@ -87,22 +80,18 @@ public CompletionStage findPetsByStatus() throws Exception { status.add(curParam); } } - CompletionStage> stage = imp.findPetsByStatus(status).thenApply(obj -> { - if (configuration.getBoolean("useOutputBeanValidation")) { - for (Pet curItem : obj) { - OpenAPIUtils.validate(curItem); - } + List obj = imp.findPetsByStatus(status); + if (configuration.getBoolean("useOutputBeanValidation")) { + for (Pet curItem : obj) { + OpenAPIUtils.validate(curItem); } - return obj; - }); - stage.thenApply(obj -> { - JsonNode result = mapper.valueToTree(obj); - return ok(result); - }); + } + JsonNode result = mapper.valueToTree(obj); + return ok(result); } @ApiAction - public CompletionStage findPetsByTags() throws Exception { + public Result findPetsByTags() throws Exception { String[] tagsArray = request().queryString().get("tags"); if (tagsArray == null) { throw new IllegalArgumentException("'tags' parameter is required"); @@ -115,93 +104,77 @@ public CompletionStage findPetsByTags() throws Exception { tags.add(curParam); } } - CompletionStage> stage = imp.findPetsByTags(tags).thenApply(obj -> { - if (configuration.getBoolean("useOutputBeanValidation")) { - for (Pet curItem : obj) { - OpenAPIUtils.validate(curItem); - } + List obj = imp.findPetsByTags(tags); + if (configuration.getBoolean("useOutputBeanValidation")) { + for (Pet curItem : obj) { + OpenAPIUtils.validate(curItem); } - return obj; - }); - stage.thenApply(obj -> { - JsonNode result = mapper.valueToTree(obj); - return ok(result); - }); + } + JsonNode result = mapper.valueToTree(obj); + return ok(result); } @ApiAction - public CompletionStage getPetById(Long petId) throws Exception { - CompletionStage stage = imp.getPetById(petId).thenApply(obj -> { - if (configuration.getBoolean("useOutputBeanValidation")) { - OpenAPIUtils.validate(obj); - } - return obj; - }); - stage.thenApply(obj -> { - JsonNode result = mapper.valueToTree(obj); - return ok(result); - }); + public Result getPetById(Long petId) throws Exception { + Pet obj = imp.getPetById(petId); + if (configuration.getBoolean("useOutputBeanValidation")) { + OpenAPIUtils.validate(obj); + } + JsonNode result = mapper.valueToTree(obj); + return ok(result); } @ApiAction - public CompletionStage updatePet() throws Exception { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + public Result updatePet() throws Exception { + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(pet); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - return CompletableFuture.supplyAsync(() -> { - imp.updatePet(pet) - return ok(); - }); + imp.updatePet(body); + return ok(); } @ApiAction - public CompletionStage updatePetWithForm(Long petId) throws Exception { + public Result updatePetWithForm(Long petId) throws Exception { String valuename = (request().body().asMultipartFormData().asFormUrlEncoded().get("name"))[0]; String name; if (valuename != null) { name = valuename; } else { - name = "null"; + name = null; } String valuestatus = (request().body().asMultipartFormData().asFormUrlEncoded().get("status"))[0]; String status; if (valuestatus != null) { status = valuestatus; } else { - status = "null"; + status = null; } - return CompletableFuture.supplyAsync(() -> { - imp.updatePetWithForm(petId, name, status) - return ok(); - }); + imp.updatePetWithForm(petId, name, status); + return ok(); } @ApiAction - public CompletionStage uploadFile(Long petId) throws Exception { + public Result uploadFile(Long petId) throws Exception { String valueadditionalMetadata = (request().body().asMultipartFormData().asFormUrlEncoded().get("additionalMetadata"))[0]; String additionalMetadata; if (valueadditionalMetadata != null) { additionalMetadata = valueadditionalMetadata; } else { - additionalMetadata = "null"; + additionalMetadata = null; } Http.MultipartFormData.FilePart file = request().body().asMultipartFormData().getFile("file"); - CompletionStage stage = imp.uploadFile(petId, additionalMetadata, file).thenApply(obj -> { - if (configuration.getBoolean("useOutputBeanValidation")) { - OpenAPIUtils.validate(obj); - } - return obj; - }); - stage.thenApply(obj -> { - JsonNode result = mapper.valueToTree(obj); - return ok(result); - }); + ModelApiResponse obj = imp.uploadFile(petId, additionalMetadata, file); + if (configuration.getBoolean("useOutputBeanValidation")) { + OpenAPIUtils.validate(obj); + } + JsonNode result = mapper.valueToTree(obj); + return ok(result); } } diff --git a/samples/server/petstore/java-play-framework-async/app/controllers/PetApiControllerImp.java b/samples/server/petstore/java-play-framework-async/app/controllers/PetApiControllerImp.java index a0cb57281b9c..c025993f7c13 100644 --- a/samples/server/petstore/java-play-framework-async/app/controllers/PetApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-async/app/controllers/PetApiControllerImp.java @@ -13,7 +13,7 @@ public class PetApiControllerImp implements PetApiControllerImpInterface { @Override - public void addPet(Pet pet) throws Exception { + public void addPet(Pet body) throws Exception { //Do your magic!!! } @@ -23,31 +23,25 @@ public void deletePet(Long petId, String apiKey) throws Exception { } @Override - public CompletionStage> findPetsByStatus( @NotNull List status) throws Exception { + public List findPetsByStatus( @NotNull List status) throws Exception { //Do your magic!!! - return CompletableFuture.supplyAsync(() -> { - return new ArrayList(); - }); + return new ArrayList(); } @Override - public CompletionStage> findPetsByTags( @NotNull List tags) throws Exception { + public List findPetsByTags( @NotNull List tags) throws Exception { //Do your magic!!! - return CompletableFuture.supplyAsync(() -> { - return new ArrayList(); - }); + return new ArrayList(); } @Override - public CompletionStage getPetById(Long petId) throws Exception { + public Pet getPetById(Long petId) throws Exception { //Do your magic!!! - return CompletableFuture.supplyAsync(() -> { - return new Pet(); - }); + return new Pet(); } @Override - public void updatePet(Pet pet) throws Exception { + public void updatePet(Pet body) throws Exception { //Do your magic!!! } @@ -57,11 +51,9 @@ public void updatePetWithForm(Long petId, String name, String status) throws Exc } @Override - public CompletionStage uploadFile(Long petId, String additionalMetadata, Http.MultipartFormData.FilePart file) throws Exception { + public ModelApiResponse uploadFile(Long petId, String additionalMetadata, Http.MultipartFormData.FilePart file) throws Exception { //Do your magic!!! - return CompletableFuture.supplyAsync(() -> { - return new ModelApiResponse(); - }); + return new ModelApiResponse(); } } diff --git a/samples/server/petstore/java-play-framework-async/app/controllers/PetApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-async/app/controllers/PetApiControllerImpInterface.java index 64b60d9ab75e..307c6c18cfb9 100644 --- a/samples/server/petstore/java-play-framework-async/app/controllers/PetApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-async/app/controllers/PetApiControllerImpInterface.java @@ -8,27 +8,25 @@ import java.util.List; import java.util.ArrayList; import java.util.HashMap; -import java.util.concurrent.CompletionStage; -import java.util.concurrent.CompletableFuture; import javax.validation.constraints.*; @SuppressWarnings("RedundantThrows") public interface PetApiControllerImpInterface { - void addPet(Pet pet) throws Exception; + void addPet(Pet body) throws Exception; void deletePet(Long petId, String apiKey) throws Exception; - CompletionStage> findPetsByStatus( @NotNull List status) throws Exception; + List findPetsByStatus( @NotNull List status) throws Exception; - CompletionStage> findPetsByTags( @NotNull List tags) throws Exception; + List findPetsByTags( @NotNull List tags) throws Exception; - CompletionStage getPetById(Long petId) throws Exception; + Pet getPetById(Long petId) throws Exception; - void updatePet(Pet pet) throws Exception; + void updatePet(Pet body) throws Exception; void updatePetWithForm(Long petId, String name, String status) throws Exception; - CompletionStage uploadFile(Long petId, String additionalMetadata, Http.MultipartFormData.FilePart file) throws Exception; + ModelApiResponse uploadFile(Long petId, String additionalMetadata, Http.MultipartFormData.FilePart file) throws Exception; } diff --git a/samples/server/petstore/java-play-framework-async/app/controllers/StoreApiController.java b/samples/server/petstore/java-play-framework-async/app/controllers/StoreApiController.java index 9c112f2e9d62..831f15dfe3c7 100644 --- a/samples/server/petstore/java-play-framework-async/app/controllers/StoreApiController.java +++ b/samples/server/petstore/java-play-framework-async/app/controllers/StoreApiController.java @@ -16,9 +16,6 @@ import openapitools.OpenAPIUtils; import com.fasterxml.jackson.core.type.TypeReference; -import java.util.concurrent.CompletionStage; -import java.util.concurrent.CompletableFuture; - import javax.validation.constraints.*; import play.Configuration; @@ -40,59 +37,45 @@ private StoreApiController(Configuration configuration, StoreApiControllerImpInt @ApiAction - public CompletionStage deleteOrder(String orderId) throws Exception { - return CompletableFuture.supplyAsync(() -> { - imp.deleteOrder(orderId) - return ok(); - }); + public Result deleteOrder(String orderId) throws Exception { + imp.deleteOrder(orderId); + return ok(); } @ApiAction - public CompletionStage getInventory() throws Exception { - CompletionStage> stage = imp.getInventory().thenApply(obj -> { - return obj; - }); - stage.thenApply(obj -> { - JsonNode result = mapper.valueToTree(obj); - return ok(result); - }); + public Result getInventory() throws Exception { + Map obj = imp.getInventory(); + JsonNode result = mapper.valueToTree(obj); + return ok(result); } @ApiAction - public CompletionStage getOrderById( @Min(1) @Max(5)Long orderId) throws Exception { - CompletionStage stage = imp.getOrderById(orderId).thenApply(obj -> { - if (configuration.getBoolean("useOutputBeanValidation")) { - OpenAPIUtils.validate(obj); - } - return obj; - }); - stage.thenApply(obj -> { - JsonNode result = mapper.valueToTree(obj); - return ok(result); - }); + public Result getOrderById( @Min(1) @Max(5)Long orderId) throws Exception { + Order obj = imp.getOrderById(orderId); + if (configuration.getBoolean("useOutputBeanValidation")) { + OpenAPIUtils.validate(obj); + } + JsonNode result = mapper.valueToTree(obj); + return ok(result); } @ApiAction - public CompletionStage placeOrder() throws Exception { - JsonNode nodeorder = request().body().asJson(); - Order order; - if (nodeorder != null) { - order = mapper.readValue(nodeorder.toString(), Order.class); + public Result placeOrder() throws Exception { + JsonNode nodebody = request().body().asJson(); + Order body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Order.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(order); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Order' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - CompletionStage stage = imp.placeOrder(order).thenApply(obj -> { - if (configuration.getBoolean("useOutputBeanValidation")) { - OpenAPIUtils.validate(obj); - } - return obj; - }); - stage.thenApply(obj -> { - JsonNode result = mapper.valueToTree(obj); - return ok(result); - }); + Order obj = imp.placeOrder(body); + if (configuration.getBoolean("useOutputBeanValidation")) { + OpenAPIUtils.validate(obj); + } + JsonNode result = mapper.valueToTree(obj); + return ok(result); } } diff --git a/samples/server/petstore/java-play-framework-async/app/controllers/StoreApiControllerImp.java b/samples/server/petstore/java-play-framework-async/app/controllers/StoreApiControllerImp.java index adcd9a11adc0..7c57d3d096c4 100644 --- a/samples/server/petstore/java-play-framework-async/app/controllers/StoreApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-async/app/controllers/StoreApiControllerImp.java @@ -17,27 +17,21 @@ public void deleteOrder(String orderId) throws Exception { } @Override - public CompletionStage> getInventory() throws Exception { + public Map getInventory() throws Exception { //Do your magic!!! - return CompletableFuture.supplyAsync(() -> { - return new HashMap(); - }); + return new HashMap(); } @Override - public CompletionStage getOrderById( @Min(1) @Max(5)Long orderId) throws Exception { + public Order getOrderById( @Min(1) @Max(5)Long orderId) throws Exception { //Do your magic!!! - return CompletableFuture.supplyAsync(() -> { - return new Order(); - }); + return new Order(); } @Override - public CompletionStage placeOrder(Order order) throws Exception { + public Order placeOrder(Order body) throws Exception { //Do your magic!!! - return CompletableFuture.supplyAsync(() -> { - return new Order(); - }); + return new Order(); } } diff --git a/samples/server/petstore/java-play-framework-async/app/controllers/StoreApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-async/app/controllers/StoreApiControllerImpInterface.java index 86fda5b54fb1..b42e4d6d3d02 100644 --- a/samples/server/petstore/java-play-framework-async/app/controllers/StoreApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-async/app/controllers/StoreApiControllerImpInterface.java @@ -7,8 +7,6 @@ import java.util.List; import java.util.ArrayList; import java.util.HashMap; -import java.util.concurrent.CompletionStage; -import java.util.concurrent.CompletableFuture; import javax.validation.constraints.*; @@ -16,10 +14,10 @@ public interface StoreApiControllerImpInterface { void deleteOrder(String orderId) throws Exception; - CompletionStage> getInventory() throws Exception; + Map getInventory() throws Exception; - CompletionStage getOrderById( @Min(1) @Max(5)Long orderId) throws Exception; + Order getOrderById( @Min(1) @Max(5)Long orderId) throws Exception; - CompletionStage placeOrder(Order order) throws Exception; + Order placeOrder(Order body) throws Exception; } diff --git a/samples/server/petstore/java-play-framework-async/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-async/app/controllers/UserApiController.java index 35c1134b0f41..aa3bbd80ba15 100644 --- a/samples/server/petstore/java-play-framework-async/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-async/app/controllers/UserApiController.java @@ -16,9 +16,6 @@ import openapitools.OpenAPIUtils; import com.fasterxml.jackson.core.type.TypeReference; -import java.util.concurrent.CompletionStage; -import java.util.concurrent.CompletableFuture; - import javax.validation.constraints.*; import play.Configuration; @@ -40,87 +37,75 @@ private UserApiController(Configuration configuration, UserApiControllerImpInter @ApiAction - public CompletionStage createUser() throws Exception { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + public Result createUser() throws Exception { + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(user); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - return CompletableFuture.supplyAsync(() -> { - imp.createUser(user) - return ok(); - }); + imp.createUser(body); + return ok(); } @ApiAction - public CompletionStage createUsersWithArrayInput() throws Exception { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + public Result createUsersWithArrayInput() throws Exception { + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); if (configuration.getBoolean("useInputBeanValidation")) { - for (User curItem : user) { + for (User curItem : body) { OpenAPIUtils.validate(curItem); } } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - return CompletableFuture.supplyAsync(() -> { - imp.createUsersWithArrayInput(user) - return ok(); - }); + imp.createUsersWithArrayInput(body); + return ok(); } @ApiAction - public CompletionStage createUsersWithListInput() throws Exception { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + public Result createUsersWithListInput() throws Exception { + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); if (configuration.getBoolean("useInputBeanValidation")) { - for (User curItem : user) { + for (User curItem : body) { OpenAPIUtils.validate(curItem); } } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - return CompletableFuture.supplyAsync(() -> { - imp.createUsersWithListInput(user) - return ok(); - }); + imp.createUsersWithListInput(body); + return ok(); } @ApiAction - public CompletionStage deleteUser(String username) throws Exception { - return CompletableFuture.supplyAsync(() -> { - imp.deleteUser(username) - return ok(); - }); + public Result deleteUser(String username) throws Exception { + imp.deleteUser(username); + return ok(); } @ApiAction - public CompletionStage getUserByName(String username) throws Exception { - CompletionStage stage = imp.getUserByName(username).thenApply(obj -> { - if (configuration.getBoolean("useOutputBeanValidation")) { - OpenAPIUtils.validate(obj); - } - return obj; - }); - stage.thenApply(obj -> { - JsonNode result = mapper.valueToTree(obj); - return ok(result); - }); + public Result getUserByName(String username) throws Exception { + User obj = imp.getUserByName(username); + if (configuration.getBoolean("useOutputBeanValidation")) { + OpenAPIUtils.validate(obj); + } + JsonNode result = mapper.valueToTree(obj); + return ok(result); } @ApiAction - public CompletionStage loginUser() throws Exception { + public Result loginUser() throws Exception { String valueusername = request().getQueryString("username"); String username; if (valueusername != null) { @@ -135,38 +120,30 @@ public CompletionStage loginUser() throws Exception { } else { throw new IllegalArgumentException("'password' parameter is required"); } - CompletionStage stage = imp.loginUser(username, password).thenApply(obj -> { - return obj; - }); - stage.thenApply(obj -> { - JsonNode result = mapper.valueToTree(obj); - return ok(result); - }); + String obj = imp.loginUser(username, password); + JsonNode result = mapper.valueToTree(obj); + return ok(result); } @ApiAction - public CompletionStage logoutUser() throws Exception { - return CompletableFuture.supplyAsync(() -> { - imp.logoutUser() - return ok(); - }); + public Result logoutUser() throws Exception { + imp.logoutUser(); + return ok(); } @ApiAction - public CompletionStage updateUser(String username) throws Exception { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + public Result updateUser(String username) throws Exception { + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(user); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - return CompletableFuture.supplyAsync(() -> { - imp.updateUser(username, user) - return ok(); - }); + imp.updateUser(username, body); + return ok(); } } diff --git a/samples/server/petstore/java-play-framework-async/app/controllers/UserApiControllerImp.java b/samples/server/petstore/java-play-framework-async/app/controllers/UserApiControllerImp.java index ebaae2d462bd..0ea7a808b9a4 100644 --- a/samples/server/petstore/java-play-framework-async/app/controllers/UserApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-async/app/controllers/UserApiControllerImp.java @@ -12,17 +12,17 @@ public class UserApiControllerImp implements UserApiControllerImpInterface { @Override - public void createUser(User user) throws Exception { + public void createUser(User body) throws Exception { //Do your magic!!! } @Override - public void createUsersWithArrayInput(List user) throws Exception { + public void createUsersWithArrayInput(List body) throws Exception { //Do your magic!!! } @Override - public void createUsersWithListInput(List user) throws Exception { + public void createUsersWithListInput(List body) throws Exception { //Do your magic!!! } @@ -32,19 +32,15 @@ public void deleteUser(String username) throws Exception { } @Override - public CompletionStage getUserByName(String username) throws Exception { + public User getUserByName(String username) throws Exception { //Do your magic!!! - return CompletableFuture.supplyAsync(() -> { - return new User(); - }); + return new User(); } @Override - public CompletionStage loginUser( @NotNull String username, @NotNull String password) throws Exception { + public String loginUser( @NotNull String username, @NotNull String password) throws Exception { //Do your magic!!! - return CompletableFuture.supplyAsync(() -> { - return new String(); - }); + return new String(); } @Override @@ -53,7 +49,7 @@ public void logoutUser() throws Exception { } @Override - public void updateUser(String username, User user) throws Exception { + public void updateUser(String username, User body) throws Exception { //Do your magic!!! } diff --git a/samples/server/petstore/java-play-framework-async/app/controllers/UserApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-async/app/controllers/UserApiControllerImpInterface.java index 62140ddabeae..1290c84835fb 100644 --- a/samples/server/petstore/java-play-framework-async/app/controllers/UserApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-async/app/controllers/UserApiControllerImpInterface.java @@ -7,27 +7,25 @@ import java.util.List; import java.util.ArrayList; import java.util.HashMap; -import java.util.concurrent.CompletionStage; -import java.util.concurrent.CompletableFuture; import javax.validation.constraints.*; @SuppressWarnings("RedundantThrows") public interface UserApiControllerImpInterface { - void createUser(User user) throws Exception; + void createUser(User body) throws Exception; - void createUsersWithArrayInput(List user) throws Exception; + void createUsersWithArrayInput(List body) throws Exception; - void createUsersWithListInput(List user) throws Exception; + void createUsersWithListInput(List body) throws Exception; void deleteUser(String username) throws Exception; - CompletionStage getUserByName(String username) throws Exception; + User getUserByName(String username) throws Exception; - CompletionStage loginUser( @NotNull String username, @NotNull String password) throws Exception; + String loginUser( @NotNull String username, @NotNull String password) throws Exception; void logoutUser() throws Exception; - void updateUser(String username, User user) throws Exception; + void updateUser(String username, User body) throws Exception; } diff --git a/samples/server/petstore/java-play-framework-async/app/openapitools/OpenAPIUtils.java b/samples/server/petstore/java-play-framework-async/app/openapitools/OpenAPIUtils.java index c707ca74ac7e..385ef97a0083 100644 --- a/samples/server/petstore/java-play-framework-async/app/openapitools/OpenAPIUtils.java +++ b/samples/server/petstore/java-play-framework-async/app/openapitools/OpenAPIUtils.java @@ -98,6 +98,6 @@ public static String parameterToString(Object param) { } public static String formatDatetime(Date date) { - return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX").format(date); + return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX", Locale.ROOT).format(date); } -} \ No newline at end of file +} diff --git a/samples/server/petstore/java-play-framework-async/public/openapi.json b/samples/server/petstore/java-play-framework-async/public/openapi.json index ac1d45047828..d536f6b09046 100644 --- a/samples/server/petstore/java-play-framework-async/public/openapi.json +++ b/samples/server/petstore/java-play-framework-async/public/openapi.json @@ -61,6 +61,7 @@ "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "x-codegen-request-body-name" : "body", "x-contentType" : "application/json", "x-accepts" : "application/json" }, @@ -93,6 +94,7 @@ "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "x-codegen-request-body-name" : "body", "x-contentType" : "application/json", "x-accepts" : "application/json" } @@ -114,8 +116,8 @@ "type" : "array", "items" : { "type" : "string", - "enum" : [ "available", "pending", "sold" ], - "default" : "available" + "default" : "available", + "enum" : [ "available", "pending", "sold" ] } } } ], @@ -446,6 +448,7 @@ "content" : { } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } @@ -545,6 +548,7 @@ "content" : { } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } @@ -574,6 +578,7 @@ "content" : { } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } @@ -603,6 +608,7 @@ "content" : { } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } @@ -759,6 +765,7 @@ "content" : { } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" }, diff --git a/samples/server/petstore/java-play-framework-controller-only/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-controller-only/.openapi-generator/VERSION index dde25ef08e8c..83a328a9227e 100644 --- a/samples/server/petstore/java-play-framework-controller-only/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-controller-only/.openapi-generator/VERSION @@ -1 +1 @@ -3.1.1-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Category.java b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Category.java index 9f0206575f5c..86c8ed0cdefc 100644 --- a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Category.java +++ b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Category.java @@ -12,10 +12,10 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Category { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; public Category id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/ModelApiResponse.java index 07493e848250..91638ac8c602 100644 --- a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/ModelApiResponse.java @@ -12,13 +12,13 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ModelApiResponse { @JsonProperty("code") - private Integer code = null; + private Integer code; @JsonProperty("type") - private String type = null; + private String type; @JsonProperty("message") - private String message = null; + private String message; public ModelApiResponse code(Integer code) { this.code = code; diff --git a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Order.java b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Order.java index d1aaa38d0029..91d6d09e7f7e 100644 --- a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Order.java +++ b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Order.java @@ -13,16 +13,16 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Order { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("petId") - private Long petId = null; + private Long petId; @JsonProperty("quantity") - private Integer quantity = null; + private Integer quantity; @JsonProperty("shipDate") - private OffsetDateTime shipDate = null; + private OffsetDateTime shipDate; /** * Order Status @@ -47,18 +47,18 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; @JsonProperty("complete") private Boolean complete = false; diff --git a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Pet.java index 5e5ff3762945..a4e223b2b156 100644 --- a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Pet.java @@ -16,13 +16,13 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Pet { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("category") private Category category = null; @JsonProperty("name") - private String name = null; + private String name; @JsonProperty("photoUrls") private List photoUrls = new ArrayList<>(); @@ -53,18 +53,18 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; public Pet id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Tag.java b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Tag.java index 15a8774252af..1a9079ff3456 100644 --- a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Tag.java +++ b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Tag.java @@ -12,10 +12,10 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Tag { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; public Tag id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/User.java b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/User.java index 689de768893e..8df0a6506702 100644 --- a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/User.java +++ b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/User.java @@ -12,28 +12,28 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class User { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("username") - private String username = null; + private String username; @JsonProperty("firstName") - private String firstName = null; + private String firstName; @JsonProperty("lastName") - private String lastName = null; + private String lastName; @JsonProperty("email") - private String email = null; + private String email; @JsonProperty("password") - private String password = null; + private String password; @JsonProperty("phone") - private String phone = null; + private String phone; @JsonProperty("userStatus") - private Integer userStatus = null; + private Integer userStatus; public User id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-controller-only/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework-controller-only/app/controllers/PetApiController.java index 916fd313b613..c00e111435b5 100644 --- a/samples/server/petstore/java-play-framework-controller-only/app/controllers/PetApiController.java +++ b/samples/server/petstore/java-play-framework-controller-only/app/controllers/PetApiController.java @@ -37,15 +37,15 @@ private PetApiController(Configuration configuration) { @ApiAction public Result addPet() throws Exception { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(pet); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } return ok(); } @@ -103,15 +103,15 @@ public Result getPetById(Long petId) throws Exception { @ApiAction public Result updatePet() throws Exception { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(pet); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } return ok(); } @@ -123,14 +123,14 @@ public Result updatePetWithForm(Long petId) throws Exception { if (valuename != null) { name = valuename; } else { - name = "null"; + name = null; } String valuestatus = (request().body().asMultipartFormData().asFormUrlEncoded().get("status"))[0]; String status; if (valuestatus != null) { status = valuestatus; } else { - status = "null"; + status = null; } return ok(); } @@ -142,7 +142,7 @@ public Result uploadFile(Long petId) throws Exception { if (valueadditionalMetadata != null) { additionalMetadata = valueadditionalMetadata; } else { - additionalMetadata = "null"; + additionalMetadata = null; } Http.MultipartFormData.FilePart file = request().body().asMultipartFormData().getFile("file"); return ok(); diff --git a/samples/server/petstore/java-play-framework-controller-only/app/controllers/StoreApiController.java b/samples/server/petstore/java-play-framework-controller-only/app/controllers/StoreApiController.java index 928173a5b557..c6b50d599729 100644 --- a/samples/server/petstore/java-play-framework-controller-only/app/controllers/StoreApiController.java +++ b/samples/server/petstore/java-play-framework-controller-only/app/controllers/StoreApiController.java @@ -51,15 +51,15 @@ public Result getOrderById( @Min(1) @Max(5)Long orderId) throws Exception { @ApiAction public Result placeOrder() throws Exception { - JsonNode nodeorder = request().body().asJson(); - Order order; - if (nodeorder != null) { - order = mapper.readValue(nodeorder.toString(), Order.class); + JsonNode nodebody = request().body().asJson(); + Order body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Order.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(order); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Order' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } return ok(); } diff --git a/samples/server/petstore/java-play-framework-controller-only/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-controller-only/app/controllers/UserApiController.java index 58bebfd7e1ef..9886a7b377a0 100644 --- a/samples/server/petstore/java-play-framework-controller-only/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-controller-only/app/controllers/UserApiController.java @@ -36,49 +36,49 @@ private UserApiController(Configuration configuration) { @ApiAction public Result createUser() throws Exception { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(user); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } return ok(); } @ApiAction public Result createUsersWithArrayInput() throws Exception { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); if (configuration.getBoolean("useInputBeanValidation")) { - for (User curItem : user) { + for (User curItem : body) { OpenAPIUtils.validate(curItem); } } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } return ok(); } @ApiAction public Result createUsersWithListInput() throws Exception { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); if (configuration.getBoolean("useInputBeanValidation")) { - for (User curItem : user) { + for (User curItem : body) { OpenAPIUtils.validate(curItem); } } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } return ok(); } @@ -119,15 +119,15 @@ public Result logoutUser() throws Exception { @ApiAction public Result updateUser(String username) throws Exception { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(user); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } return ok(); } diff --git a/samples/server/petstore/java-play-framework-controller-only/app/openapitools/OpenAPIUtils.java b/samples/server/petstore/java-play-framework-controller-only/app/openapitools/OpenAPIUtils.java index c707ca74ac7e..385ef97a0083 100644 --- a/samples/server/petstore/java-play-framework-controller-only/app/openapitools/OpenAPIUtils.java +++ b/samples/server/petstore/java-play-framework-controller-only/app/openapitools/OpenAPIUtils.java @@ -98,6 +98,6 @@ public static String parameterToString(Object param) { } public static String formatDatetime(Date date) { - return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX").format(date); + return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX", Locale.ROOT).format(date); } -} \ No newline at end of file +} diff --git a/samples/server/petstore/java-play-framework-controller-only/public/openapi.json b/samples/server/petstore/java-play-framework-controller-only/public/openapi.json index ac1d45047828..d536f6b09046 100644 --- a/samples/server/petstore/java-play-framework-controller-only/public/openapi.json +++ b/samples/server/petstore/java-play-framework-controller-only/public/openapi.json @@ -61,6 +61,7 @@ "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "x-codegen-request-body-name" : "body", "x-contentType" : "application/json", "x-accepts" : "application/json" }, @@ -93,6 +94,7 @@ "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "x-codegen-request-body-name" : "body", "x-contentType" : "application/json", "x-accepts" : "application/json" } @@ -114,8 +116,8 @@ "type" : "array", "items" : { "type" : "string", - "enum" : [ "available", "pending", "sold" ], - "default" : "available" + "default" : "available", + "enum" : [ "available", "pending", "sold" ] } } } ], @@ -446,6 +448,7 @@ "content" : { } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } @@ -545,6 +548,7 @@ "content" : { } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } @@ -574,6 +578,7 @@ "content" : { } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } @@ -603,6 +608,7 @@ "content" : { } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } @@ -759,6 +765,7 @@ "content" : { } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" }, diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-fake-endpoints/.openapi-generator/VERSION index dde25ef08e8c..83a328a9227e 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-fake-endpoints/.openapi-generator/VERSION @@ -1 +1 @@ -3.1.1-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesAnyType.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesAnyType.java new file mode 100644 index 000000000000..0d9f1a4dc74c --- /dev/null +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesAnyType.java @@ -0,0 +1,77 @@ +package apimodels; + +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.*; +import java.util.Set; +import javax.validation.*; +import java.util.Objects; +import javax.validation.constraints.*; +/** + * AdditionalPropertiesAnyType + */ + +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) +public class AdditionalPropertiesAnyType extends HashMap { + @JsonProperty("name") + private String name; + + public AdditionalPropertiesAnyType name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesAnyType additionalPropertiesAnyType = (AdditionalPropertiesAnyType) o; + return Objects.equals(name, additionalPropertiesAnyType.name) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(name, super.hashCode()); + } + + @SuppressWarnings("StringBufferReplaceableByString") + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesAnyType {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesArray.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesArray.java new file mode 100644 index 000000000000..0b169be3610d --- /dev/null +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesArray.java @@ -0,0 +1,78 @@ +package apimodels; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.*; +import java.util.Set; +import javax.validation.*; +import java.util.Objects; +import javax.validation.constraints.*; +/** + * AdditionalPropertiesArray + */ + +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) +public class AdditionalPropertiesArray extends HashMap { + @JsonProperty("name") + private String name; + + public AdditionalPropertiesArray name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesArray additionalPropertiesArray = (AdditionalPropertiesArray) o; + return Objects.equals(name, additionalPropertiesArray.name) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(name, super.hashCode()); + } + + @SuppressWarnings("StringBufferReplaceableByString") + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesArray {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesBoolean.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesBoolean.java new file mode 100644 index 000000000000..7658378e516c --- /dev/null +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesBoolean.java @@ -0,0 +1,77 @@ +package apimodels; + +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.*; +import java.util.Set; +import javax.validation.*; +import java.util.Objects; +import javax.validation.constraints.*; +/** + * AdditionalPropertiesBoolean + */ + +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) +public class AdditionalPropertiesBoolean extends HashMap { + @JsonProperty("name") + private String name; + + public AdditionalPropertiesBoolean name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesBoolean additionalPropertiesBoolean = (AdditionalPropertiesBoolean) o; + return Objects.equals(name, additionalPropertiesBoolean.name) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(name, super.hashCode()); + } + + @SuppressWarnings("StringBufferReplaceableByString") + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesBoolean {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesClass.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesClass.java index 0d1d7a1fd98e..022d9256f195 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesClass.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesClass.java @@ -1,5 +1,6 @@ package apimodels; +import java.math.BigDecimal; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -14,61 +15,296 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class AdditionalPropertiesClass { - @JsonProperty("map_property") - private Map mapProperty = null; + @JsonProperty("map_string") + private Map mapString = null; - @JsonProperty("map_of_map_property") - private Map> mapOfMapProperty = null; + @JsonProperty("map_number") + private Map mapNumber = null; - public AdditionalPropertiesClass mapProperty(Map mapProperty) { - this.mapProperty = mapProperty; + @JsonProperty("map_integer") + private Map mapInteger = null; + + @JsonProperty("map_boolean") + private Map mapBoolean = null; + + @JsonProperty("map_array_integer") + private Map> mapArrayInteger = null; + + @JsonProperty("map_array_anytype") + private Map> mapArrayAnytype = null; + + @JsonProperty("map_map_string") + private Map> mapMapString = null; + + @JsonProperty("map_map_anytype") + private Map> mapMapAnytype = null; + + @JsonProperty("anytype_1") + private Object anytype1 = null; + + @JsonProperty("anytype_2") + private Object anytype2 = null; + + @JsonProperty("anytype_3") + private Object anytype3 = null; + + public AdditionalPropertiesClass mapString(Map mapString) { + this.mapString = mapString; return this; } - public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { - if (this.mapProperty == null) { - this.mapProperty = new HashMap<>(); + public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) { + if (this.mapString == null) { + this.mapString = new HashMap<>(); } - this.mapProperty.put(key, mapPropertyItem); + this.mapString.put(key, mapStringItem); return this; } /** - * Get mapProperty - * @return mapProperty + * Get mapString + * @return mapString **/ - public Map getMapProperty() { - return mapProperty; + public Map getMapString() { + return mapString; } - public void setMapProperty(Map mapProperty) { - this.mapProperty = mapProperty; + public void setMapString(Map mapString) { + this.mapString = mapString; } - public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { - this.mapOfMapProperty = mapOfMapProperty; + public AdditionalPropertiesClass mapNumber(Map mapNumber) { + this.mapNumber = mapNumber; return this; } - public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { - if (this.mapOfMapProperty == null) { - this.mapOfMapProperty = new HashMap<>(); + public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) { + if (this.mapNumber == null) { + this.mapNumber = new HashMap<>(); } - this.mapOfMapProperty.put(key, mapOfMapPropertyItem); + this.mapNumber.put(key, mapNumberItem); + return this; + } + + /** + * Get mapNumber + * @return mapNumber + **/ + @Valid + public Map getMapNumber() { + return mapNumber; + } + + public void setMapNumber(Map mapNumber) { + this.mapNumber = mapNumber; + } + + public AdditionalPropertiesClass mapInteger(Map mapInteger) { + this.mapInteger = mapInteger; + return this; + } + + public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) { + if (this.mapInteger == null) { + this.mapInteger = new HashMap<>(); + } + this.mapInteger.put(key, mapIntegerItem); + return this; + } + + /** + * Get mapInteger + * @return mapInteger + **/ + public Map getMapInteger() { + return mapInteger; + } + + public void setMapInteger(Map mapInteger) { + this.mapInteger = mapInteger; + } + + public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { + this.mapBoolean = mapBoolean; + return this; + } + + public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) { + if (this.mapBoolean == null) { + this.mapBoolean = new HashMap<>(); + } + this.mapBoolean.put(key, mapBooleanItem); + return this; + } + + /** + * Get mapBoolean + * @return mapBoolean + **/ + public Map getMapBoolean() { + return mapBoolean; + } + + public void setMapBoolean(Map mapBoolean) { + this.mapBoolean = mapBoolean; + } + + public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { + this.mapArrayInteger = mapArrayInteger; + return this; + } + + public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List mapArrayIntegerItem) { + if (this.mapArrayInteger == null) { + this.mapArrayInteger = new HashMap<>(); + } + this.mapArrayInteger.put(key, mapArrayIntegerItem); + return this; + } + + /** + * Get mapArrayInteger + * @return mapArrayInteger + **/ + @Valid + public Map> getMapArrayInteger() { + return mapArrayInteger; + } + + public void setMapArrayInteger(Map> mapArrayInteger) { + this.mapArrayInteger = mapArrayInteger; + } + + public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { + this.mapArrayAnytype = mapArrayAnytype; + return this; + } + + public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List mapArrayAnytypeItem) { + if (this.mapArrayAnytype == null) { + this.mapArrayAnytype = new HashMap<>(); + } + this.mapArrayAnytype.put(key, mapArrayAnytypeItem); + return this; + } + + /** + * Get mapArrayAnytype + * @return mapArrayAnytype + **/ + @Valid + public Map> getMapArrayAnytype() { + return mapArrayAnytype; + } + + public void setMapArrayAnytype(Map> mapArrayAnytype) { + this.mapArrayAnytype = mapArrayAnytype; + } + + public AdditionalPropertiesClass mapMapString(Map> mapMapString) { + this.mapMapString = mapMapString; + return this; + } + + public AdditionalPropertiesClass putMapMapStringItem(String key, Map mapMapStringItem) { + if (this.mapMapString == null) { + this.mapMapString = new HashMap<>(); + } + this.mapMapString.put(key, mapMapStringItem); + return this; + } + + /** + * Get mapMapString + * @return mapMapString + **/ + @Valid + public Map> getMapMapString() { + return mapMapString; + } + + public void setMapMapString(Map> mapMapString) { + this.mapMapString = mapMapString; + } + + public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { + this.mapMapAnytype = mapMapAnytype; + return this; + } + + public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map mapMapAnytypeItem) { + if (this.mapMapAnytype == null) { + this.mapMapAnytype = new HashMap<>(); + } + this.mapMapAnytype.put(key, mapMapAnytypeItem); + return this; + } + + /** + * Get mapMapAnytype + * @return mapMapAnytype + **/ + @Valid + public Map> getMapMapAnytype() { + return mapMapAnytype; + } + + public void setMapMapAnytype(Map> mapMapAnytype) { + this.mapMapAnytype = mapMapAnytype; + } + + public AdditionalPropertiesClass anytype1(Object anytype1) { + this.anytype1 = anytype1; + return this; + } + + /** + * Get anytype1 + * @return anytype1 + **/ + @Valid + public Object getAnytype1() { + return anytype1; + } + + public void setAnytype1(Object anytype1) { + this.anytype1 = anytype1; + } + + public AdditionalPropertiesClass anytype2(Object anytype2) { + this.anytype2 = anytype2; + return this; + } + + /** + * Get anytype2 + * @return anytype2 + **/ + @Valid + public Object getAnytype2() { + return anytype2; + } + + public void setAnytype2(Object anytype2) { + this.anytype2 = anytype2; + } + + public AdditionalPropertiesClass anytype3(Object anytype3) { + this.anytype3 = anytype3; return this; } /** - * Get mapOfMapProperty - * @return mapOfMapProperty + * Get anytype3 + * @return anytype3 **/ @Valid - public Map> getMapOfMapProperty() { - return mapOfMapProperty; + public Object getAnytype3() { + return anytype3; } - public void setMapOfMapProperty(Map> mapOfMapProperty) { - this.mapOfMapProperty = mapOfMapProperty; + public void setAnytype3(Object anytype3) { + this.anytype3 = anytype3; } @@ -81,13 +317,22 @@ public boolean equals(java.lang.Object o) { return false; } AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o; - return Objects.equals(mapProperty, additionalPropertiesClass.mapProperty) && - Objects.equals(mapOfMapProperty, additionalPropertiesClass.mapOfMapProperty); + return Objects.equals(mapString, additionalPropertiesClass.mapString) && + Objects.equals(mapNumber, additionalPropertiesClass.mapNumber) && + Objects.equals(mapInteger, additionalPropertiesClass.mapInteger) && + Objects.equals(mapBoolean, additionalPropertiesClass.mapBoolean) && + Objects.equals(mapArrayInteger, additionalPropertiesClass.mapArrayInteger) && + Objects.equals(mapArrayAnytype, additionalPropertiesClass.mapArrayAnytype) && + Objects.equals(mapMapString, additionalPropertiesClass.mapMapString) && + Objects.equals(mapMapAnytype, additionalPropertiesClass.mapMapAnytype) && + Objects.equals(anytype1, additionalPropertiesClass.anytype1) && + Objects.equals(anytype2, additionalPropertiesClass.anytype2) && + Objects.equals(anytype3, additionalPropertiesClass.anytype3); } @Override public int hashCode() { - return Objects.hash(mapProperty, mapOfMapProperty); + return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); } @SuppressWarnings("StringBufferReplaceableByString") @@ -96,8 +341,17 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class AdditionalPropertiesClass {\n"); - sb.append(" mapProperty: ").append(toIndentedString(mapProperty)).append("\n"); - sb.append(" mapOfMapProperty: ").append(toIndentedString(mapOfMapProperty)).append("\n"); + sb.append(" mapString: ").append(toIndentedString(mapString)).append("\n"); + sb.append(" mapNumber: ").append(toIndentedString(mapNumber)).append("\n"); + sb.append(" mapInteger: ").append(toIndentedString(mapInteger)).append("\n"); + sb.append(" mapBoolean: ").append(toIndentedString(mapBoolean)).append("\n"); + sb.append(" mapArrayInteger: ").append(toIndentedString(mapArrayInteger)).append("\n"); + sb.append(" mapArrayAnytype: ").append(toIndentedString(mapArrayAnytype)).append("\n"); + sb.append(" mapMapString: ").append(toIndentedString(mapMapString)).append("\n"); + sb.append(" mapMapAnytype: ").append(toIndentedString(mapMapAnytype)).append("\n"); + sb.append(" anytype1: ").append(toIndentedString(anytype1)).append("\n"); + sb.append(" anytype2: ").append(toIndentedString(anytype2)).append("\n"); + sb.append(" anytype3: ").append(toIndentedString(anytype3)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesInteger.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesInteger.java new file mode 100644 index 000000000000..ed3671bfeeb0 --- /dev/null +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesInteger.java @@ -0,0 +1,77 @@ +package apimodels; + +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.*; +import java.util.Set; +import javax.validation.*; +import java.util.Objects; +import javax.validation.constraints.*; +/** + * AdditionalPropertiesInteger + */ + +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) +public class AdditionalPropertiesInteger extends HashMap { + @JsonProperty("name") + private String name; + + public AdditionalPropertiesInteger name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesInteger additionalPropertiesInteger = (AdditionalPropertiesInteger) o; + return Objects.equals(name, additionalPropertiesInteger.name) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(name, super.hashCode()); + } + + @SuppressWarnings("StringBufferReplaceableByString") + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesInteger {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesNumber.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesNumber.java new file mode 100644 index 000000000000..d3590987e618 --- /dev/null +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesNumber.java @@ -0,0 +1,78 @@ +package apimodels; + +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.*; +import java.util.Set; +import javax.validation.*; +import java.util.Objects; +import javax.validation.constraints.*; +/** + * AdditionalPropertiesNumber + */ + +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) +public class AdditionalPropertiesNumber extends HashMap { + @JsonProperty("name") + private String name; + + public AdditionalPropertiesNumber name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesNumber additionalPropertiesNumber = (AdditionalPropertiesNumber) o; + return Objects.equals(name, additionalPropertiesNumber.name) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(name, super.hashCode()); + } + + @SuppressWarnings("StringBufferReplaceableByString") + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesNumber {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesObject.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesObject.java new file mode 100644 index 000000000000..5b27a250f255 --- /dev/null +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesObject.java @@ -0,0 +1,77 @@ +package apimodels; + +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.*; +import java.util.Set; +import javax.validation.*; +import java.util.Objects; +import javax.validation.constraints.*; +/** + * AdditionalPropertiesObject + */ + +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) +public class AdditionalPropertiesObject extends HashMap { + @JsonProperty("name") + private String name; + + public AdditionalPropertiesObject name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesObject additionalPropertiesObject = (AdditionalPropertiesObject) o; + return Objects.equals(name, additionalPropertiesObject.name) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(name, super.hashCode()); + } + + @SuppressWarnings("StringBufferReplaceableByString") + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesObject {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesString.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesString.java new file mode 100644 index 000000000000..bbd9f6541420 --- /dev/null +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesString.java @@ -0,0 +1,77 @@ +package apimodels; + +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.*; +import java.util.Set; +import javax.validation.*; +import java.util.Objects; +import javax.validation.constraints.*; +/** + * AdditionalPropertiesString + */ + +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) +public class AdditionalPropertiesString extends HashMap { + @JsonProperty("name") + private String name; + + public AdditionalPropertiesString name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesString additionalPropertiesString = (AdditionalPropertiesString) o; + return Objects.equals(name, additionalPropertiesString.name) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(name, super.hashCode()); + } + + @SuppressWarnings("StringBufferReplaceableByString") + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesString {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Animal.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Animal.java index 2202fe1078e3..f79d687c4f98 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Animal.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Animal.java @@ -14,7 +14,7 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Animal { @JsonProperty("className") - private String className = null; + private String className; @JsonProperty("color") private String color = "red"; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Capitalization.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Capitalization.java index f78ceeb9d0b2..cd5031205e81 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Capitalization.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Capitalization.java @@ -12,22 +12,22 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Capitalization { @JsonProperty("smallCamel") - private String smallCamel = null; + private String smallCamel; @JsonProperty("CapitalCamel") - private String capitalCamel = null; + private String capitalCamel; @JsonProperty("small_Snake") - private String smallSnake = null; + private String smallSnake; @JsonProperty("Capital_Snake") - private String capitalSnake = null; + private String capitalSnake; @JsonProperty("SCA_ETH_Flow_Points") - private String scAETHFlowPoints = null; + private String scAETHFlowPoints; @JsonProperty("ATT_NAME") - private String ATT_NAME = null; + private String ATT_NAME; public Capitalization smallCamel(String smallCamel) { this.smallCamel = smallCamel; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Cat.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Cat.java index 5e8dfb06c054..0c0aa9fd204a 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Cat.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Cat.java @@ -1,6 +1,7 @@ package apimodels; import apimodels.Animal; +import apimodels.CatAllOf; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; @@ -13,7 +14,7 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Cat extends Animal { @JsonProperty("declawed") - private Boolean declawed = null; + private Boolean declawed; public Cat declawed(Boolean declawed) { this.declawed = declawed; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/CatAllOf.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/CatAllOf.java new file mode 100644 index 000000000000..04a1572284c8 --- /dev/null +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/CatAllOf.java @@ -0,0 +1,74 @@ +package apimodels; + +import com.fasterxml.jackson.annotation.*; +import java.util.Set; +import javax.validation.*; +import java.util.Objects; +import javax.validation.constraints.*; +/** + * CatAllOf + */ + +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) +public class CatAllOf { + @JsonProperty("declawed") + private Boolean declawed; + + public CatAllOf declawed(Boolean declawed) { + this.declawed = declawed; + return this; + } + + /** + * Get declawed + * @return declawed + **/ + public Boolean getDeclawed() { + return declawed; + } + + public void setDeclawed(Boolean declawed) { + this.declawed = declawed; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CatAllOf catAllOf = (CatAllOf) o; + return Objects.equals(declawed, catAllOf.declawed); + } + + @Override + public int hashCode() { + return Objects.hash(declawed); + } + + @SuppressWarnings("StringBufferReplaceableByString") + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CatAllOf {\n"); + + sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Category.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Category.java index c2a4222a8aa5..54b0afb8d7fe 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Category.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Category.java @@ -12,10 +12,10 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Category { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name = "default-name"; public Category id(Long id) { this.id = id; @@ -43,7 +43,8 @@ public Category name(String name) { * Get name * @return name **/ - public String getName() { + @NotNull + public String getName() { return name; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ClassModel.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ClassModel.java index ee8cd40ca40d..84a3fbddbf83 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ClassModel.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ClassModel.java @@ -12,7 +12,7 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ClassModel { @JsonProperty("_class") - private String propertyClass = null; + private String propertyClass; public ClassModel propertyClass(String propertyClass) { this.propertyClass = propertyClass; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Client.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Client.java index f14be52cf46e..90da55b8e99d 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Client.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Client.java @@ -12,7 +12,7 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Client { @JsonProperty("client") - private String client = null; + private String client; public Client client(String client) { this.client = client; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Dog.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Dog.java index 27e3f5fdb256..7e4fe30c682a 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Dog.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Dog.java @@ -1,6 +1,7 @@ package apimodels; import apimodels.Animal; +import apimodels.DogAllOf; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; @@ -13,7 +14,7 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Dog extends Animal { @JsonProperty("breed") - private String breed = null; + private String breed; public Dog breed(String breed) { this.breed = breed; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/DogAllOf.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/DogAllOf.java new file mode 100644 index 000000000000..c49367934f97 --- /dev/null +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/DogAllOf.java @@ -0,0 +1,74 @@ +package apimodels; + +import com.fasterxml.jackson.annotation.*; +import java.util.Set; +import javax.validation.*; +import java.util.Objects; +import javax.validation.constraints.*; +/** + * DogAllOf + */ + +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) +public class DogAllOf { + @JsonProperty("breed") + private String breed; + + public DogAllOf breed(String breed) { + this.breed = breed; + return this; + } + + /** + * Get breed + * @return breed + **/ + public String getBreed() { + return breed; + } + + public void setBreed(String breed) { + this.breed = breed; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DogAllOf dogAllOf = (DogAllOf) o; + return Objects.equals(breed, dogAllOf.breed); + } + + @Override + public int hashCode() { + return Objects.hash(breed); + } + + @SuppressWarnings("StringBufferReplaceableByString") + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DogAllOf {\n"); + + sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumArrays.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumArrays.java index 5f2c63d116d3..1c5806205d0e 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumArrays.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumArrays.java @@ -34,18 +34,18 @@ public String toString() { } @JsonCreator - public static JustSymbolEnum fromValue(String text) { + public static JustSymbolEnum fromValue(String value) { for (JustSymbolEnum b : JustSymbolEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("just_symbol") - private JustSymbolEnum justSymbol = null; + private JustSymbolEnum justSymbol; /** * Gets or Sets arrayEnum @@ -68,13 +68,13 @@ public String toString() { } @JsonCreator - public static ArrayEnumEnum fromValue(String text) { + public static ArrayEnumEnum fromValue(String value) { for (ArrayEnumEnum b : ArrayEnumEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumClass.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumClass.java index c0f2b0ad97ee..647abcf53424 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumClass.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumClass.java @@ -29,13 +29,13 @@ public String toString() { } @JsonCreator - public static EnumClass fromValue(String text) { + public static EnumClass fromValue(String value) { for (EnumClass b : EnumClass.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumTest.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumTest.java index 861a7e577770..9bafde9f409f 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumTest.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumTest.java @@ -35,18 +35,18 @@ public String toString() { } @JsonCreator - public static EnumStringEnum fromValue(String text) { + public static EnumStringEnum fromValue(String value) { for (EnumStringEnum b : EnumStringEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("enum_string") - private EnumStringEnum enumString = null; + private EnumStringEnum enumString; /** * Gets or Sets enumStringRequired @@ -71,18 +71,18 @@ public String toString() { } @JsonCreator - public static EnumStringRequiredEnum fromValue(String text) { + public static EnumStringRequiredEnum fromValue(String value) { for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("enum_string_required") - private EnumStringRequiredEnum enumStringRequired = null; + private EnumStringRequiredEnum enumStringRequired; /** * Gets or Sets enumInteger @@ -105,18 +105,18 @@ public String toString() { } @JsonCreator - public static EnumIntegerEnum fromValue(String text) { + public static EnumIntegerEnum fromValue(Integer value) { for (EnumIntegerEnum b : EnumIntegerEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("enum_integer") - private EnumIntegerEnum enumInteger = null; + private EnumIntegerEnum enumInteger; /** * Gets or Sets enumNumber @@ -139,21 +139,21 @@ public String toString() { } @JsonCreator - public static EnumNumberEnum fromValue(String text) { + public static EnumNumberEnum fromValue(Double value) { for (EnumNumberEnum b : EnumNumberEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("enum_number") - private EnumNumberEnum enumNumber = null; + private EnumNumberEnum enumNumber; @JsonProperty("outerEnum") - private OuterEnum outerEnum = null; + private OuterEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { this.enumString = enumString; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/FormatTest.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/FormatTest.java index b16bbd537f4f..e01fd150a45f 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/FormatTest.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/FormatTest.java @@ -17,43 +17,43 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class FormatTest { @JsonProperty("integer") - private Integer integer = null; + private Integer integer; @JsonProperty("int32") - private Integer int32 = null; + private Integer int32; @JsonProperty("int64") - private Long int64 = null; + private Long int64; @JsonProperty("number") - private BigDecimal number = null; + private BigDecimal number; @JsonProperty("float") - private Float _float = null; + private Float _float; @JsonProperty("double") - private Double _double = null; + private Double _double; @JsonProperty("string") - private String string = null; + private String string; @JsonProperty("byte") - private byte[] _byte = null; + private byte[] _byte; @JsonProperty("binary") - private InputStream binary = null; + private InputStream binary; @JsonProperty("date") - private LocalDate date = null; + private LocalDate date; @JsonProperty("dateTime") - private OffsetDateTime dateTime = null; + private OffsetDateTime dateTime; @JsonProperty("uuid") - private UUID uuid = null; + private UUID uuid; @JsonProperty("password") - private String password = null; + private String password; public FormatTest integer(Integer integer) { this.integer = integer; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/HasOnlyReadOnly.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/HasOnlyReadOnly.java index 17d09b40692f..20a101fd6b75 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/HasOnlyReadOnly.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/HasOnlyReadOnly.java @@ -12,10 +12,10 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class HasOnlyReadOnly { @JsonProperty("bar") - private String bar = null; + private String bar; @JsonProperty("foo") - private String foo = null; + private String foo; public HasOnlyReadOnly bar(String bar) { this.bar = bar; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/MapTest.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/MapTest.java index 5c1518d4cd3a..3b6a62bf3991 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/MapTest.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/MapTest.java @@ -1,6 +1,5 @@ package apimodels; -import apimodels.StringBooleanMap; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -39,13 +38,13 @@ public String toString() { } @JsonCreator - public static InnerEnum fromValue(String text) { + public static InnerEnum fromValue(String value) { for (InnerEnum b : InnerEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @@ -56,7 +55,7 @@ public static InnerEnum fromValue(String text) { private Map directMap = null; @JsonProperty("indirect_map") - private StringBooleanMap indirectMap = null; + private Map indirectMap = null; public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -134,21 +133,28 @@ public void setDirectMap(Map directMap) { this.directMap = directMap; } - public MapTest indirectMap(StringBooleanMap indirectMap) { + public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; return this; } + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap<>(); + } + this.indirectMap.put(key, indirectMapItem); + return this; + } + /** * Get indirectMap * @return indirectMap **/ - @Valid - public StringBooleanMap getIndirectMap() { + public Map getIndirectMap() { return indirectMap; } - public void setIndirectMap(StringBooleanMap indirectMap) { + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/MixedPropertiesAndAdditionalPropertiesClass.java index e52678fa5c45..461c704af66c 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/MixedPropertiesAndAdditionalPropertiesClass.java @@ -18,10 +18,10 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("uuid") - private UUID uuid = null; + private UUID uuid; @JsonProperty("dateTime") - private OffsetDateTime dateTime = null; + private OffsetDateTime dateTime; @JsonProperty("map") private Map map = null; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Model200Response.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Model200Response.java index b17e0ed8a79c..895a9578a350 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Model200Response.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Model200Response.java @@ -12,10 +12,10 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Model200Response { @JsonProperty("name") - private Integer name = null; + private Integer name; @JsonProperty("class") - private String propertyClass = null; + private String propertyClass; public Model200Response name(Integer name) { this.name = name; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelApiResponse.java index a5505482e089..0a884c198159 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelApiResponse.java @@ -12,13 +12,13 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ModelApiResponse { @JsonProperty("code") - private Integer code = null; + private Integer code; @JsonProperty("type") - private String type = null; + private String type; @JsonProperty("message") - private String message = null; + private String message; public ModelApiResponse code(Integer code) { this.code = code; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelReturn.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelReturn.java index 89d3a0e25ffa..f92e2c16411f 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelReturn.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelReturn.java @@ -12,7 +12,7 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ModelReturn { @JsonProperty("return") - private Integer _return = null; + private Integer _return; public ModelReturn _return(Integer _return) { this._return = _return; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Name.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Name.java index 7bfcff1e5be8..36d4fa5e5453 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Name.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Name.java @@ -12,16 +12,16 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Name { @JsonProperty("name") - private Integer name = null; + private Integer name; @JsonProperty("snake_case") - private Integer snakeCase = null; + private Integer snakeCase; @JsonProperty("property") - private String property = null; + private String property; @JsonProperty("123Number") - private Integer _123number = null; + private Integer _123number; public Name name(Integer name) { this.name = name; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/NumberOnly.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/NumberOnly.java index a54fece62687..0d35aae626b9 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/NumberOnly.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/NumberOnly.java @@ -13,7 +13,7 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class NumberOnly { @JsonProperty("JustNumber") - private BigDecimal justNumber = null; + private BigDecimal justNumber; public NumberOnly justNumber(BigDecimal justNumber) { this.justNumber = justNumber; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Order.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Order.java index 404beae15bc2..fa71fb1d7ef7 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Order.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Order.java @@ -13,16 +13,16 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Order { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("petId") - private Long petId = null; + private Long petId; @JsonProperty("quantity") - private Integer quantity = null; + private Integer quantity; @JsonProperty("shipDate") - private OffsetDateTime shipDate = null; + private OffsetDateTime shipDate; /** * Order Status @@ -47,18 +47,18 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; @JsonProperty("complete") private Boolean complete = false; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/OuterComposite.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/OuterComposite.java index 92a8ca4c95a3..22c5a23259f9 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/OuterComposite.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/OuterComposite.java @@ -13,13 +13,13 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class OuterComposite { @JsonProperty("my_number") - private BigDecimal myNumber = null; + private BigDecimal myNumber; @JsonProperty("my_string") - private String myString = null; + private String myString; @JsonProperty("my_boolean") - private Boolean myBoolean = null; + private Boolean myBoolean; public OuterComposite myNumber(BigDecimal myNumber) { this.myNumber = myNumber; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/OuterEnum.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/OuterEnum.java index f5026996917f..98cd7feae6a7 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/OuterEnum.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/OuterEnum.java @@ -29,13 +29,13 @@ public String toString() { } @JsonCreator - public static OuterEnum fromValue(String text) { + public static OuterEnum fromValue(String value) { for (OuterEnum b : OuterEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Pet.java index aaa139c566df..6b5e92718e2f 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Pet.java @@ -16,13 +16,13 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Pet { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("category") private Category category = null; @JsonProperty("name") - private String name = null; + private String name; @JsonProperty("photoUrls") private List photoUrls = new ArrayList<>(); @@ -53,18 +53,18 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; public Pet id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ReadOnlyFirst.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ReadOnlyFirst.java index 693aa7eba342..4457994d7ae1 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ReadOnlyFirst.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ReadOnlyFirst.java @@ -12,10 +12,10 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ReadOnlyFirst { @JsonProperty("bar") - private String bar = null; + private String bar; @JsonProperty("baz") - private String baz = null; + private String baz; public ReadOnlyFirst bar(String bar) { this.bar = bar; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/SpecialModelName.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/SpecialModelName.java index b8f387377d0c..9b1f8f6ebe3d 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/SpecialModelName.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/SpecialModelName.java @@ -12,7 +12,7 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class SpecialModelName { @JsonProperty("$special[property.name]") - private Long $specialPropertyName = null; + private Long $specialPropertyName; public SpecialModelName $specialPropertyName(Long $specialPropertyName) { this.$specialPropertyName = $specialPropertyName; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Tag.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Tag.java index 5426c883569b..ae8f84e74bc8 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Tag.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Tag.java @@ -12,10 +12,10 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Tag { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; public Tag id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/TypeHolderDefault.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/TypeHolderDefault.java new file mode 100644 index 000000000000..a12511e94fd2 --- /dev/null +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/TypeHolderDefault.java @@ -0,0 +1,176 @@ +package apimodels; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import com.fasterxml.jackson.annotation.*; +import java.util.Set; +import javax.validation.*; +import java.util.Objects; +import javax.validation.constraints.*; +/** + * TypeHolderDefault + */ + +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) +public class TypeHolderDefault { + @JsonProperty("string_item") + private String stringItem = "what"; + + @JsonProperty("number_item") + private BigDecimal numberItem; + + @JsonProperty("integer_item") + private Integer integerItem; + + @JsonProperty("bool_item") + private Boolean boolItem = true; + + @JsonProperty("array_item") + private List arrayItem = new ArrayList<>(); + + public TypeHolderDefault stringItem(String stringItem) { + this.stringItem = stringItem; + return this; + } + + /** + * Get stringItem + * @return stringItem + **/ + @NotNull + public String getStringItem() { + return stringItem; + } + + public void setStringItem(String stringItem) { + this.stringItem = stringItem; + } + + public TypeHolderDefault numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; + return this; + } + + /** + * Get numberItem + * @return numberItem + **/ + @NotNull +@Valid + public BigDecimal getNumberItem() { + return numberItem; + } + + public void setNumberItem(BigDecimal numberItem) { + this.numberItem = numberItem; + } + + public TypeHolderDefault integerItem(Integer integerItem) { + this.integerItem = integerItem; + return this; + } + + /** + * Get integerItem + * @return integerItem + **/ + @NotNull + public Integer getIntegerItem() { + return integerItem; + } + + public void setIntegerItem(Integer integerItem) { + this.integerItem = integerItem; + } + + public TypeHolderDefault boolItem(Boolean boolItem) { + this.boolItem = boolItem; + return this; + } + + /** + * Get boolItem + * @return boolItem + **/ + @NotNull + public Boolean getBoolItem() { + return boolItem; + } + + public void setBoolItem(Boolean boolItem) { + this.boolItem = boolItem; + } + + public TypeHolderDefault arrayItem(List arrayItem) { + this.arrayItem = arrayItem; + return this; + } + + public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + arrayItem.add(arrayItemItem); + return this; + } + + /** + * Get arrayItem + * @return arrayItem + **/ + @NotNull + public List getArrayItem() { + return arrayItem; + } + + public void setArrayItem(List arrayItem) { + this.arrayItem = arrayItem; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TypeHolderDefault typeHolderDefault = (TypeHolderDefault) o; + return Objects.equals(stringItem, typeHolderDefault.stringItem) && + Objects.equals(numberItem, typeHolderDefault.numberItem) && + Objects.equals(integerItem, typeHolderDefault.integerItem) && + Objects.equals(boolItem, typeHolderDefault.boolItem) && + Objects.equals(arrayItem, typeHolderDefault.arrayItem); + } + + @Override + public int hashCode() { + return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + } + + @SuppressWarnings("StringBufferReplaceableByString") + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TypeHolderDefault {\n"); + + sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); + sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); + sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); + sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/TypeHolderExample.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/TypeHolderExample.java new file mode 100644 index 000000000000..3165a322afac --- /dev/null +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/TypeHolderExample.java @@ -0,0 +1,176 @@ +package apimodels; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import com.fasterxml.jackson.annotation.*; +import java.util.Set; +import javax.validation.*; +import java.util.Objects; +import javax.validation.constraints.*; +/** + * TypeHolderExample + */ + +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) +public class TypeHolderExample { + @JsonProperty("string_item") + private String stringItem; + + @JsonProperty("number_item") + private BigDecimal numberItem; + + @JsonProperty("integer_item") + private Integer integerItem; + + @JsonProperty("bool_item") + private Boolean boolItem; + + @JsonProperty("array_item") + private List arrayItem = new ArrayList<>(); + + public TypeHolderExample stringItem(String stringItem) { + this.stringItem = stringItem; + return this; + } + + /** + * Get stringItem + * @return stringItem + **/ + @NotNull + public String getStringItem() { + return stringItem; + } + + public void setStringItem(String stringItem) { + this.stringItem = stringItem; + } + + public TypeHolderExample numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; + return this; + } + + /** + * Get numberItem + * @return numberItem + **/ + @NotNull +@Valid + public BigDecimal getNumberItem() { + return numberItem; + } + + public void setNumberItem(BigDecimal numberItem) { + this.numberItem = numberItem; + } + + public TypeHolderExample integerItem(Integer integerItem) { + this.integerItem = integerItem; + return this; + } + + /** + * Get integerItem + * @return integerItem + **/ + @NotNull + public Integer getIntegerItem() { + return integerItem; + } + + public void setIntegerItem(Integer integerItem) { + this.integerItem = integerItem; + } + + public TypeHolderExample boolItem(Boolean boolItem) { + this.boolItem = boolItem; + return this; + } + + /** + * Get boolItem + * @return boolItem + **/ + @NotNull + public Boolean getBoolItem() { + return boolItem; + } + + public void setBoolItem(Boolean boolItem) { + this.boolItem = boolItem; + } + + public TypeHolderExample arrayItem(List arrayItem) { + this.arrayItem = arrayItem; + return this; + } + + public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + arrayItem.add(arrayItemItem); + return this; + } + + /** + * Get arrayItem + * @return arrayItem + **/ + @NotNull + public List getArrayItem() { + return arrayItem; + } + + public void setArrayItem(List arrayItem) { + this.arrayItem = arrayItem; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TypeHolderExample typeHolderExample = (TypeHolderExample) o; + return Objects.equals(stringItem, typeHolderExample.stringItem) && + Objects.equals(numberItem, typeHolderExample.numberItem) && + Objects.equals(integerItem, typeHolderExample.integerItem) && + Objects.equals(boolItem, typeHolderExample.boolItem) && + Objects.equals(arrayItem, typeHolderExample.arrayItem); + } + + @Override + public int hashCode() { + return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + } + + @SuppressWarnings("StringBufferReplaceableByString") + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TypeHolderExample {\n"); + + sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); + sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); + sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); + sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/User.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/User.java index 0308cc926812..91739a288c97 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/User.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/User.java @@ -12,28 +12,28 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class User { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("username") - private String username = null; + private String username; @JsonProperty("firstName") - private String firstName = null; + private String firstName; @JsonProperty("lastName") - private String lastName = null; + private String lastName; @JsonProperty("email") - private String email = null; + private String email; @JsonProperty("password") - private String password = null; + private String password; @JsonProperty("phone") - private String phone = null; + private String phone; @JsonProperty("userStatus") - private Integer userStatus = null; + private Integer userStatus; public User id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/XmlItem.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/XmlItem.java new file mode 100644 index 000000000000..6cf480a9e7ec --- /dev/null +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/XmlItem.java @@ -0,0 +1,770 @@ +package apimodels; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import com.fasterxml.jackson.annotation.*; +import java.util.Set; +import javax.validation.*; +import java.util.Objects; +import javax.validation.constraints.*; +/** + * XmlItem + */ + +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) +public class XmlItem { + @JsonProperty("attribute_string") + private String attributeString; + + @JsonProperty("attribute_number") + private BigDecimal attributeNumber; + + @JsonProperty("attribute_integer") + private Integer attributeInteger; + + @JsonProperty("attribute_boolean") + private Boolean attributeBoolean; + + @JsonProperty("wrapped_array") + private List wrappedArray = null; + + @JsonProperty("name_string") + private String nameString; + + @JsonProperty("name_number") + private BigDecimal nameNumber; + + @JsonProperty("name_integer") + private Integer nameInteger; + + @JsonProperty("name_boolean") + private Boolean nameBoolean; + + @JsonProperty("name_array") + private List nameArray = null; + + @JsonProperty("name_wrapped_array") + private List nameWrappedArray = null; + + @JsonProperty("prefix_string") + private String prefixString; + + @JsonProperty("prefix_number") + private BigDecimal prefixNumber; + + @JsonProperty("prefix_integer") + private Integer prefixInteger; + + @JsonProperty("prefix_boolean") + private Boolean prefixBoolean; + + @JsonProperty("prefix_array") + private List prefixArray = null; + + @JsonProperty("prefix_wrapped_array") + private List prefixWrappedArray = null; + + @JsonProperty("namespace_string") + private String namespaceString; + + @JsonProperty("namespace_number") + private BigDecimal namespaceNumber; + + @JsonProperty("namespace_integer") + private Integer namespaceInteger; + + @JsonProperty("namespace_boolean") + private Boolean namespaceBoolean; + + @JsonProperty("namespace_array") + private List namespaceArray = null; + + @JsonProperty("namespace_wrapped_array") + private List namespaceWrappedArray = null; + + @JsonProperty("prefix_ns_string") + private String prefixNsString; + + @JsonProperty("prefix_ns_number") + private BigDecimal prefixNsNumber; + + @JsonProperty("prefix_ns_integer") + private Integer prefixNsInteger; + + @JsonProperty("prefix_ns_boolean") + private Boolean prefixNsBoolean; + + @JsonProperty("prefix_ns_array") + private List prefixNsArray = null; + + @JsonProperty("prefix_ns_wrapped_array") + private List prefixNsWrappedArray = null; + + public XmlItem attributeString(String attributeString) { + this.attributeString = attributeString; + return this; + } + + /** + * Get attributeString + * @return attributeString + **/ + public String getAttributeString() { + return attributeString; + } + + public void setAttributeString(String attributeString) { + this.attributeString = attributeString; + } + + public XmlItem attributeNumber(BigDecimal attributeNumber) { + this.attributeNumber = attributeNumber; + return this; + } + + /** + * Get attributeNumber + * @return attributeNumber + **/ + @Valid + public BigDecimal getAttributeNumber() { + return attributeNumber; + } + + public void setAttributeNumber(BigDecimal attributeNumber) { + this.attributeNumber = attributeNumber; + } + + public XmlItem attributeInteger(Integer attributeInteger) { + this.attributeInteger = attributeInteger; + return this; + } + + /** + * Get attributeInteger + * @return attributeInteger + **/ + public Integer getAttributeInteger() { + return attributeInteger; + } + + public void setAttributeInteger(Integer attributeInteger) { + this.attributeInteger = attributeInteger; + } + + public XmlItem attributeBoolean(Boolean attributeBoolean) { + this.attributeBoolean = attributeBoolean; + return this; + } + + /** + * Get attributeBoolean + * @return attributeBoolean + **/ + public Boolean getAttributeBoolean() { + return attributeBoolean; + } + + public void setAttributeBoolean(Boolean attributeBoolean) { + this.attributeBoolean = attributeBoolean; + } + + public XmlItem wrappedArray(List wrappedArray) { + this.wrappedArray = wrappedArray; + return this; + } + + public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { + if (wrappedArray == null) { + wrappedArray = new ArrayList<>(); + } + wrappedArray.add(wrappedArrayItem); + return this; + } + + /** + * Get wrappedArray + * @return wrappedArray + **/ + public List getWrappedArray() { + return wrappedArray; + } + + public void setWrappedArray(List wrappedArray) { + this.wrappedArray = wrappedArray; + } + + public XmlItem nameString(String nameString) { + this.nameString = nameString; + return this; + } + + /** + * Get nameString + * @return nameString + **/ + public String getNameString() { + return nameString; + } + + public void setNameString(String nameString) { + this.nameString = nameString; + } + + public XmlItem nameNumber(BigDecimal nameNumber) { + this.nameNumber = nameNumber; + return this; + } + + /** + * Get nameNumber + * @return nameNumber + **/ + @Valid + public BigDecimal getNameNumber() { + return nameNumber; + } + + public void setNameNumber(BigDecimal nameNumber) { + this.nameNumber = nameNumber; + } + + public XmlItem nameInteger(Integer nameInteger) { + this.nameInteger = nameInteger; + return this; + } + + /** + * Get nameInteger + * @return nameInteger + **/ + public Integer getNameInteger() { + return nameInteger; + } + + public void setNameInteger(Integer nameInteger) { + this.nameInteger = nameInteger; + } + + public XmlItem nameBoolean(Boolean nameBoolean) { + this.nameBoolean = nameBoolean; + return this; + } + + /** + * Get nameBoolean + * @return nameBoolean + **/ + public Boolean getNameBoolean() { + return nameBoolean; + } + + public void setNameBoolean(Boolean nameBoolean) { + this.nameBoolean = nameBoolean; + } + + public XmlItem nameArray(List nameArray) { + this.nameArray = nameArray; + return this; + } + + public XmlItem addNameArrayItem(Integer nameArrayItem) { + if (nameArray == null) { + nameArray = new ArrayList<>(); + } + nameArray.add(nameArrayItem); + return this; + } + + /** + * Get nameArray + * @return nameArray + **/ + public List getNameArray() { + return nameArray; + } + + public void setNameArray(List nameArray) { + this.nameArray = nameArray; + } + + public XmlItem nameWrappedArray(List nameWrappedArray) { + this.nameWrappedArray = nameWrappedArray; + return this; + } + + public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { + if (nameWrappedArray == null) { + nameWrappedArray = new ArrayList<>(); + } + nameWrappedArray.add(nameWrappedArrayItem); + return this; + } + + /** + * Get nameWrappedArray + * @return nameWrappedArray + **/ + public List getNameWrappedArray() { + return nameWrappedArray; + } + + public void setNameWrappedArray(List nameWrappedArray) { + this.nameWrappedArray = nameWrappedArray; + } + + public XmlItem prefixString(String prefixString) { + this.prefixString = prefixString; + return this; + } + + /** + * Get prefixString + * @return prefixString + **/ + public String getPrefixString() { + return prefixString; + } + + public void setPrefixString(String prefixString) { + this.prefixString = prefixString; + } + + public XmlItem prefixNumber(BigDecimal prefixNumber) { + this.prefixNumber = prefixNumber; + return this; + } + + /** + * Get prefixNumber + * @return prefixNumber + **/ + @Valid + public BigDecimal getPrefixNumber() { + return prefixNumber; + } + + public void setPrefixNumber(BigDecimal prefixNumber) { + this.prefixNumber = prefixNumber; + } + + public XmlItem prefixInteger(Integer prefixInteger) { + this.prefixInteger = prefixInteger; + return this; + } + + /** + * Get prefixInteger + * @return prefixInteger + **/ + public Integer getPrefixInteger() { + return prefixInteger; + } + + public void setPrefixInteger(Integer prefixInteger) { + this.prefixInteger = prefixInteger; + } + + public XmlItem prefixBoolean(Boolean prefixBoolean) { + this.prefixBoolean = prefixBoolean; + return this; + } + + /** + * Get prefixBoolean + * @return prefixBoolean + **/ + public Boolean getPrefixBoolean() { + return prefixBoolean; + } + + public void setPrefixBoolean(Boolean prefixBoolean) { + this.prefixBoolean = prefixBoolean; + } + + public XmlItem prefixArray(List prefixArray) { + this.prefixArray = prefixArray; + return this; + } + + public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { + if (prefixArray == null) { + prefixArray = new ArrayList<>(); + } + prefixArray.add(prefixArrayItem); + return this; + } + + /** + * Get prefixArray + * @return prefixArray + **/ + public List getPrefixArray() { + return prefixArray; + } + + public void setPrefixArray(List prefixArray) { + this.prefixArray = prefixArray; + } + + public XmlItem prefixWrappedArray(List prefixWrappedArray) { + this.prefixWrappedArray = prefixWrappedArray; + return this; + } + + public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { + if (prefixWrappedArray == null) { + prefixWrappedArray = new ArrayList<>(); + } + prefixWrappedArray.add(prefixWrappedArrayItem); + return this; + } + + /** + * Get prefixWrappedArray + * @return prefixWrappedArray + **/ + public List getPrefixWrappedArray() { + return prefixWrappedArray; + } + + public void setPrefixWrappedArray(List prefixWrappedArray) { + this.prefixWrappedArray = prefixWrappedArray; + } + + public XmlItem namespaceString(String namespaceString) { + this.namespaceString = namespaceString; + return this; + } + + /** + * Get namespaceString + * @return namespaceString + **/ + public String getNamespaceString() { + return namespaceString; + } + + public void setNamespaceString(String namespaceString) { + this.namespaceString = namespaceString; + } + + public XmlItem namespaceNumber(BigDecimal namespaceNumber) { + this.namespaceNumber = namespaceNumber; + return this; + } + + /** + * Get namespaceNumber + * @return namespaceNumber + **/ + @Valid + public BigDecimal getNamespaceNumber() { + return namespaceNumber; + } + + public void setNamespaceNumber(BigDecimal namespaceNumber) { + this.namespaceNumber = namespaceNumber; + } + + public XmlItem namespaceInteger(Integer namespaceInteger) { + this.namespaceInteger = namespaceInteger; + return this; + } + + /** + * Get namespaceInteger + * @return namespaceInteger + **/ + public Integer getNamespaceInteger() { + return namespaceInteger; + } + + public void setNamespaceInteger(Integer namespaceInteger) { + this.namespaceInteger = namespaceInteger; + } + + public XmlItem namespaceBoolean(Boolean namespaceBoolean) { + this.namespaceBoolean = namespaceBoolean; + return this; + } + + /** + * Get namespaceBoolean + * @return namespaceBoolean + **/ + public Boolean getNamespaceBoolean() { + return namespaceBoolean; + } + + public void setNamespaceBoolean(Boolean namespaceBoolean) { + this.namespaceBoolean = namespaceBoolean; + } + + public XmlItem namespaceArray(List namespaceArray) { + this.namespaceArray = namespaceArray; + return this; + } + + public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { + if (namespaceArray == null) { + namespaceArray = new ArrayList<>(); + } + namespaceArray.add(namespaceArrayItem); + return this; + } + + /** + * Get namespaceArray + * @return namespaceArray + **/ + public List getNamespaceArray() { + return namespaceArray; + } + + public void setNamespaceArray(List namespaceArray) { + this.namespaceArray = namespaceArray; + } + + public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { + this.namespaceWrappedArray = namespaceWrappedArray; + return this; + } + + public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { + if (namespaceWrappedArray == null) { + namespaceWrappedArray = new ArrayList<>(); + } + namespaceWrappedArray.add(namespaceWrappedArrayItem); + return this; + } + + /** + * Get namespaceWrappedArray + * @return namespaceWrappedArray + **/ + public List getNamespaceWrappedArray() { + return namespaceWrappedArray; + } + + public void setNamespaceWrappedArray(List namespaceWrappedArray) { + this.namespaceWrappedArray = namespaceWrappedArray; + } + + public XmlItem prefixNsString(String prefixNsString) { + this.prefixNsString = prefixNsString; + return this; + } + + /** + * Get prefixNsString + * @return prefixNsString + **/ + public String getPrefixNsString() { + return prefixNsString; + } + + public void setPrefixNsString(String prefixNsString) { + this.prefixNsString = prefixNsString; + } + + public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { + this.prefixNsNumber = prefixNsNumber; + return this; + } + + /** + * Get prefixNsNumber + * @return prefixNsNumber + **/ + @Valid + public BigDecimal getPrefixNsNumber() { + return prefixNsNumber; + } + + public void setPrefixNsNumber(BigDecimal prefixNsNumber) { + this.prefixNsNumber = prefixNsNumber; + } + + public XmlItem prefixNsInteger(Integer prefixNsInteger) { + this.prefixNsInteger = prefixNsInteger; + return this; + } + + /** + * Get prefixNsInteger + * @return prefixNsInteger + **/ + public Integer getPrefixNsInteger() { + return prefixNsInteger; + } + + public void setPrefixNsInteger(Integer prefixNsInteger) { + this.prefixNsInteger = prefixNsInteger; + } + + public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { + this.prefixNsBoolean = prefixNsBoolean; + return this; + } + + /** + * Get prefixNsBoolean + * @return prefixNsBoolean + **/ + public Boolean getPrefixNsBoolean() { + return prefixNsBoolean; + } + + public void setPrefixNsBoolean(Boolean prefixNsBoolean) { + this.prefixNsBoolean = prefixNsBoolean; + } + + public XmlItem prefixNsArray(List prefixNsArray) { + this.prefixNsArray = prefixNsArray; + return this; + } + + public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { + if (prefixNsArray == null) { + prefixNsArray = new ArrayList<>(); + } + prefixNsArray.add(prefixNsArrayItem); + return this; + } + + /** + * Get prefixNsArray + * @return prefixNsArray + **/ + public List getPrefixNsArray() { + return prefixNsArray; + } + + public void setPrefixNsArray(List prefixNsArray) { + this.prefixNsArray = prefixNsArray; + } + + public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { + this.prefixNsWrappedArray = prefixNsWrappedArray; + return this; + } + + public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { + if (prefixNsWrappedArray == null) { + prefixNsWrappedArray = new ArrayList<>(); + } + prefixNsWrappedArray.add(prefixNsWrappedArrayItem); + return this; + } + + /** + * Get prefixNsWrappedArray + * @return prefixNsWrappedArray + **/ + public List getPrefixNsWrappedArray() { + return prefixNsWrappedArray; + } + + public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { + this.prefixNsWrappedArray = prefixNsWrappedArray; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + XmlItem xmlItem = (XmlItem) o; + return Objects.equals(attributeString, xmlItem.attributeString) && + Objects.equals(attributeNumber, xmlItem.attributeNumber) && + Objects.equals(attributeInteger, xmlItem.attributeInteger) && + Objects.equals(attributeBoolean, xmlItem.attributeBoolean) && + Objects.equals(wrappedArray, xmlItem.wrappedArray) && + Objects.equals(nameString, xmlItem.nameString) && + Objects.equals(nameNumber, xmlItem.nameNumber) && + Objects.equals(nameInteger, xmlItem.nameInteger) && + Objects.equals(nameBoolean, xmlItem.nameBoolean) && + Objects.equals(nameArray, xmlItem.nameArray) && + Objects.equals(nameWrappedArray, xmlItem.nameWrappedArray) && + Objects.equals(prefixString, xmlItem.prefixString) && + Objects.equals(prefixNumber, xmlItem.prefixNumber) && + Objects.equals(prefixInteger, xmlItem.prefixInteger) && + Objects.equals(prefixBoolean, xmlItem.prefixBoolean) && + Objects.equals(prefixArray, xmlItem.prefixArray) && + Objects.equals(prefixWrappedArray, xmlItem.prefixWrappedArray) && + Objects.equals(namespaceString, xmlItem.namespaceString) && + Objects.equals(namespaceNumber, xmlItem.namespaceNumber) && + Objects.equals(namespaceInteger, xmlItem.namespaceInteger) && + Objects.equals(namespaceBoolean, xmlItem.namespaceBoolean) && + Objects.equals(namespaceArray, xmlItem.namespaceArray) && + Objects.equals(namespaceWrappedArray, xmlItem.namespaceWrappedArray) && + Objects.equals(prefixNsString, xmlItem.prefixNsString) && + Objects.equals(prefixNsNumber, xmlItem.prefixNsNumber) && + Objects.equals(prefixNsInteger, xmlItem.prefixNsInteger) && + Objects.equals(prefixNsBoolean, xmlItem.prefixNsBoolean) && + Objects.equals(prefixNsArray, xmlItem.prefixNsArray) && + Objects.equals(prefixNsWrappedArray, xmlItem.prefixNsWrappedArray); + } + + @Override + public int hashCode() { + return Objects.hash(attributeString, attributeNumber, attributeInteger, attributeBoolean, wrappedArray, nameString, nameNumber, nameInteger, nameBoolean, nameArray, nameWrappedArray, prefixString, prefixNumber, prefixInteger, prefixBoolean, prefixArray, prefixWrappedArray, namespaceString, namespaceNumber, namespaceInteger, namespaceBoolean, namespaceArray, namespaceWrappedArray, prefixNsString, prefixNsNumber, prefixNsInteger, prefixNsBoolean, prefixNsArray, prefixNsWrappedArray); + } + + @SuppressWarnings("StringBufferReplaceableByString") + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class XmlItem {\n"); + + sb.append(" attributeString: ").append(toIndentedString(attributeString)).append("\n"); + sb.append(" attributeNumber: ").append(toIndentedString(attributeNumber)).append("\n"); + sb.append(" attributeInteger: ").append(toIndentedString(attributeInteger)).append("\n"); + sb.append(" attributeBoolean: ").append(toIndentedString(attributeBoolean)).append("\n"); + sb.append(" wrappedArray: ").append(toIndentedString(wrappedArray)).append("\n"); + sb.append(" nameString: ").append(toIndentedString(nameString)).append("\n"); + sb.append(" nameNumber: ").append(toIndentedString(nameNumber)).append("\n"); + sb.append(" nameInteger: ").append(toIndentedString(nameInteger)).append("\n"); + sb.append(" nameBoolean: ").append(toIndentedString(nameBoolean)).append("\n"); + sb.append(" nameArray: ").append(toIndentedString(nameArray)).append("\n"); + sb.append(" nameWrappedArray: ").append(toIndentedString(nameWrappedArray)).append("\n"); + sb.append(" prefixString: ").append(toIndentedString(prefixString)).append("\n"); + sb.append(" prefixNumber: ").append(toIndentedString(prefixNumber)).append("\n"); + sb.append(" prefixInteger: ").append(toIndentedString(prefixInteger)).append("\n"); + sb.append(" prefixBoolean: ").append(toIndentedString(prefixBoolean)).append("\n"); + sb.append(" prefixArray: ").append(toIndentedString(prefixArray)).append("\n"); + sb.append(" prefixWrappedArray: ").append(toIndentedString(prefixWrappedArray)).append("\n"); + sb.append(" namespaceString: ").append(toIndentedString(namespaceString)).append("\n"); + sb.append(" namespaceNumber: ").append(toIndentedString(namespaceNumber)).append("\n"); + sb.append(" namespaceInteger: ").append(toIndentedString(namespaceInteger)).append("\n"); + sb.append(" namespaceBoolean: ").append(toIndentedString(namespaceBoolean)).append("\n"); + sb.append(" namespaceArray: ").append(toIndentedString(namespaceArray)).append("\n"); + sb.append(" namespaceWrappedArray: ").append(toIndentedString(namespaceWrappedArray)).append("\n"); + sb.append(" prefixNsString: ").append(toIndentedString(prefixNsString)).append("\n"); + sb.append(" prefixNsNumber: ").append(toIndentedString(prefixNsNumber)).append("\n"); + sb.append(" prefixNsInteger: ").append(toIndentedString(prefixNsInteger)).append("\n"); + sb.append(" prefixNsBoolean: ").append(toIndentedString(prefixNsBoolean)).append("\n"); + sb.append(" prefixNsArray: ").append(toIndentedString(prefixNsArray)).append("\n"); + sb.append(" prefixNsWrappedArray: ").append(toIndentedString(prefixNsWrappedArray)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/AnotherFakeApiController.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/AnotherFakeApiController.java index 3056c5a319ad..aa22bcb3ff80 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/AnotherFakeApiController.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/AnotherFakeApiController.java @@ -36,18 +36,18 @@ private AnotherFakeApiController(Configuration configuration, AnotherFakeApiCont @ApiAction - public Result testSpecialTags() throws Exception { - JsonNode nodeclient = request().body().asJson(); - Client client; - if (nodeclient != null) { - client = mapper.readValue(nodeclient.toString(), Client.class); + public Result call123testSpecialTags() throws Exception { + JsonNode nodebody = request().body().asJson(); + Client body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Client.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(client); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Client' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - Client obj = imp.testSpecialTags(client); + Client obj = imp.call123testSpecialTags(body); if (configuration.getBoolean("useOutputBeanValidation")) { OpenAPIUtils.validate(obj); } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/AnotherFakeApiControllerImp.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/AnotherFakeApiControllerImp.java index 28461fdd91ae..cb14f49165c8 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/AnotherFakeApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/AnotherFakeApiControllerImp.java @@ -11,7 +11,7 @@ public class AnotherFakeApiControllerImp implements AnotherFakeApiControllerImpInterface { @Override - public Client testSpecialTags(Client client) throws Exception { + public Client call123testSpecialTags(Client body) throws Exception { //Do your magic!!! return new Client(); } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/AnotherFakeApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/AnotherFakeApiControllerImpInterface.java index 28d1da8e37bc..ebc18b14f241 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/AnotherFakeApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/AnotherFakeApiControllerImpInterface.java @@ -11,6 +11,6 @@ @SuppressWarnings("RedundantThrows") public interface AnotherFakeApiControllerImpInterface { - Client testSpecialTags(Client client) throws Exception; + Client call123testSpecialTags(Client body) throws Exception; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiController.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiController.java index fb501df6b6f3..bc32ff07be0e 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiController.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiController.java @@ -9,6 +9,7 @@ import java.time.OffsetDateTime; import apimodels.OuterComposite; import apimodels.User; +import apimodels.XmlItem; import play.mvc.Controller; import play.mvc.Result; @@ -43,6 +44,22 @@ private FakeApiController(Configuration configuration, FakeApiControllerImpInter } + @ApiAction + public Result createXmlItem() throws Exception { + JsonNode nodexmlItem = request().body().asJson(); + XmlItem xmlItem; + if (nodexmlItem != null) { + xmlItem = mapper.readValue(nodexmlItem.toString(), XmlItem.class); + if (configuration.getBoolean("useInputBeanValidation")) { + OpenAPIUtils.validate(xmlItem); + } + } else { + throw new IllegalArgumentException("'XmlItem' parameter is required"); + } + imp.createXmlItem(xmlItem); + return ok(); + } + @ApiAction public Result fakeOuterBooleanSerialize() throws Exception { JsonNode nodebody = request().body().asJson(); @@ -62,17 +79,17 @@ public Result fakeOuterBooleanSerialize() throws Exception { @ApiAction public Result fakeOuterCompositeSerialize() throws Exception { - JsonNode nodeouterComposite = request().body().asJson(); - OuterComposite outerComposite; - if (nodeouterComposite != null) { - outerComposite = mapper.readValue(nodeouterComposite.toString(), OuterComposite.class); + JsonNode nodebody = request().body().asJson(); + OuterComposite body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), OuterComposite.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(outerComposite); + OpenAPIUtils.validate(body); } } else { - outerComposite = null; + body = null; } - OuterComposite obj = imp.fakeOuterCompositeSerialize(outerComposite); + OuterComposite obj = imp.fakeOuterCompositeSerialize(body); if (configuration.getBoolean("useOutputBeanValidation")) { OpenAPIUtils.validate(obj); } @@ -119,31 +136,31 @@ public Result fakeOuterStringSerialize() throws Exception { @ApiAction public Result testBodyWithFileSchema() throws Exception { - JsonNode nodefileSchemaTestClass = request().body().asJson(); - FileSchemaTestClass fileSchemaTestClass; - if (nodefileSchemaTestClass != null) { - fileSchemaTestClass = mapper.readValue(nodefileSchemaTestClass.toString(), FileSchemaTestClass.class); + JsonNode nodebody = request().body().asJson(); + FileSchemaTestClass body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), FileSchemaTestClass.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(fileSchemaTestClass); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'FileSchemaTestClass' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.testBodyWithFileSchema(fileSchemaTestClass); + imp.testBodyWithFileSchema(body); return ok(); } @ApiAction public Result testBodyWithQueryParams() throws Exception { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(user); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } String valuequery = request().getQueryString("query"); String query; @@ -152,23 +169,23 @@ public Result testBodyWithQueryParams() throws Exception { } else { throw new IllegalArgumentException("'query' parameter is required"); } - imp.testBodyWithQueryParams(query, user); + imp.testBodyWithQueryParams(query, body); return ok(); } @ApiAction public Result testClientModel() throws Exception { - JsonNode nodeclient = request().body().asJson(); - Client client; - if (nodeclient != null) { - client = mapper.readValue(nodeclient.toString(), Client.class); + JsonNode nodebody = request().body().asJson(); + Client body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Client.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(client); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Client' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - Client obj = imp.testClientModel(client); + Client obj = imp.testClientModel(body); if (configuration.getBoolean("useOutputBeanValidation")) { OpenAPIUtils.validate(obj); } @@ -225,7 +242,7 @@ public Result testEndpointParameters() throws Exception { if (valuestring != null) { string = valuestring; } else { - string = "null"; + string = null; } String valuepatternWithoutDelimiter = (request().body().asMultipartFormData().asFormUrlEncoded().get("pattern_without_delimiter"))[0]; String patternWithoutDelimiter; @@ -261,14 +278,14 @@ public Result testEndpointParameters() throws Exception { if (valuepassword != null) { password = valuepassword; } else { - password = "null"; + password = null; } String valueparamCallback = (request().body().asMultipartFormData().asFormUrlEncoded().get("callback"))[0]; String paramCallback; if (valueparamCallback != null) { paramCallback = valueparamCallback; } else { - paramCallback = "null"; + paramCallback = null; } imp.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); return ok(); @@ -342,21 +359,69 @@ public Result testEnumParameters() throws Exception { return ok(); } + @ApiAction + public Result testGroupParameters() throws Exception { + String valuerequiredStringGroup = request().getQueryString("required_string_group"); + Integer requiredStringGroup; + if (valuerequiredStringGroup != null) { + requiredStringGroup = Integer.parseInt(valuerequiredStringGroup); + } else { + throw new IllegalArgumentException("'required_string_group' parameter is required"); + } + String valuerequiredInt64Group = request().getQueryString("required_int64_group"); + Long requiredInt64Group; + if (valuerequiredInt64Group != null) { + requiredInt64Group = Long.parseLong(valuerequiredInt64Group); + } else { + throw new IllegalArgumentException("'required_int64_group' parameter is required"); + } + String valuestringGroup = request().getQueryString("string_group"); + Integer stringGroup; + if (valuestringGroup != null) { + stringGroup = Integer.parseInt(valuestringGroup); + } else { + stringGroup = null; + } + String valueint64Group = request().getQueryString("int64_group"); + Long int64Group; + if (valueint64Group != null) { + int64Group = Long.parseLong(valueint64Group); + } else { + int64Group = null; + } + String valuerequiredBooleanGroup = request().getHeader("required_boolean_group"); + Boolean requiredBooleanGroup; + if (valuerequiredBooleanGroup != null) { + requiredBooleanGroup = Boolean.valueOf(valuerequiredBooleanGroup); + } else { + throw new IllegalArgumentException("'required_boolean_group' parameter is required"); + } + String valuebooleanGroup = request().getHeader("boolean_group"); + Boolean booleanGroup; + if (valuebooleanGroup != null) { + booleanGroup = Boolean.valueOf(valuebooleanGroup); + } else { + booleanGroup = null; + } + imp.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + return ok(); + } + @ApiAction public Result testInlineAdditionalProperties() throws Exception { - JsonNode noderequestBody = request().body().asJson(); - Map requestBody; - if (noderequestBody != null) { - requestBody = mapper.readValue(noderequestBody.toString(), new TypeReference>(){}); + JsonNode nodeparam = request().body().asJson(); + Map param; + if (nodeparam != null) { + param = mapper.readValue(nodeparam.toString(), new TypeReference>(){}); if (configuration.getBoolean("useInputBeanValidation")) { - for (Map.Entry entry : requestBody.entrySet()) { + for (Map.Entry entry : param.entrySet()) { OpenAPIUtils.validate(entry.getValue()); } } } else { - throw new IllegalArgumentException("'request_body' parameter is required"); + throw new IllegalArgumentException("'param' parameter is required"); } - imp.testInlineAdditionalProperties(requestBody); + imp.testInlineAdditionalProperties(param); return ok(); } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiControllerImp.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiControllerImp.java index a33162119274..65ad23766167 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiControllerImp.java @@ -9,6 +9,7 @@ import java.time.OffsetDateTime; import apimodels.OuterComposite; import apimodels.User; +import apimodels.XmlItem; import play.mvc.Http; import java.util.List; @@ -18,6 +19,11 @@ import javax.validation.constraints.*; public class FakeApiControllerImp implements FakeApiControllerImpInterface { + @Override + public void createXmlItem(XmlItem xmlItem) throws Exception { + //Do your magic!!! + } + @Override public Boolean fakeOuterBooleanSerialize(Boolean body) throws Exception { //Do your magic!!! @@ -25,7 +31,7 @@ public Boolean fakeOuterBooleanSerialize(Boolean body) throws Exception { } @Override - public OuterComposite fakeOuterCompositeSerialize(OuterComposite outerComposite) throws Exception { + public OuterComposite fakeOuterCompositeSerialize(OuterComposite body) throws Exception { //Do your magic!!! return new OuterComposite(); } @@ -43,17 +49,17 @@ public String fakeOuterStringSerialize(String body) throws Exception { } @Override - public void testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) throws Exception { + public void testBodyWithFileSchema(FileSchemaTestClass body) throws Exception { //Do your magic!!! } @Override - public void testBodyWithQueryParams( @NotNull String query, User user) throws Exception { + public void testBodyWithQueryParams( @NotNull String query, User body) throws Exception { //Do your magic!!! } @Override - public Client testClientModel(Client client) throws Exception { + public Client testClientModel(Client body) throws Exception { //Do your magic!!! return new Client(); } @@ -69,7 +75,12 @@ public void testEnumParameters(List enumHeaderStringArray, String enumHe } @Override - public void testInlineAdditionalProperties(Map requestBody) throws Exception { + public void testGroupParameters( @NotNull Integer requiredStringGroup, Boolean requiredBooleanGroup, @NotNull Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws Exception { + //Do your magic!!! + } + + @Override + public void testInlineAdditionalProperties(Map param) throws Exception { //Do your magic!!! } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiControllerImpInterface.java index e36e7c50120c..2e6b9434f461 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiControllerImpInterface.java @@ -9,6 +9,7 @@ import java.time.OffsetDateTime; import apimodels.OuterComposite; import apimodels.User; +import apimodels.XmlItem; import play.mvc.Http; import java.util.List; @@ -19,25 +20,29 @@ @SuppressWarnings("RedundantThrows") public interface FakeApiControllerImpInterface { + void createXmlItem(XmlItem xmlItem) throws Exception; + Boolean fakeOuterBooleanSerialize(Boolean body) throws Exception; - OuterComposite fakeOuterCompositeSerialize(OuterComposite outerComposite) throws Exception; + OuterComposite fakeOuterCompositeSerialize(OuterComposite body) throws Exception; BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws Exception; String fakeOuterStringSerialize(String body) throws Exception; - void testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) throws Exception; + void testBodyWithFileSchema(FileSchemaTestClass body) throws Exception; - void testBodyWithQueryParams( @NotNull String query, User user) throws Exception; + void testBodyWithQueryParams( @NotNull String query, User body) throws Exception; - Client testClientModel(Client client) throws Exception; + Client testClientModel(Client body) throws Exception; void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, Http.MultipartFormData.FilePart binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws Exception; void testEnumParameters(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString) throws Exception; - void testInlineAdditionalProperties(Map requestBody) throws Exception; + void testGroupParameters( @NotNull Integer requiredStringGroup, Boolean requiredBooleanGroup, @NotNull Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws Exception; + + void testInlineAdditionalProperties(Map param) throws Exception; void testJsonFormData(String param, String param2) throws Exception; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiController.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiController.java index 748cb9f2af41..760b0a394169 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiController.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiController.java @@ -37,17 +37,17 @@ private FakeClassnameTags123ApiController(Configuration configuration, FakeClass @ApiAction public Result testClassname() throws Exception { - JsonNode nodeclient = request().body().asJson(); - Client client; - if (nodeclient != null) { - client = mapper.readValue(nodeclient.toString(), Client.class); + JsonNode nodebody = request().body().asJson(); + Client body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Client.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(client); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Client' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - Client obj = imp.testClassname(client); + Client obj = imp.testClassname(body); if (configuration.getBoolean("useOutputBeanValidation")) { OpenAPIUtils.validate(obj); } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiControllerImp.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiControllerImp.java index 8427478bcdd7..7d18dc42afba 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiControllerImp.java @@ -11,7 +11,7 @@ public class FakeClassnameTags123ApiControllerImp implements FakeClassnameTags123ApiControllerImpInterface { @Override - public Client testClassname(Client client) throws Exception { + public Client testClassname(Client body) throws Exception { //Do your magic!!! return new Client(); } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiControllerImpInterface.java index 224e8fbd8975..8ea6e6598f11 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiControllerImpInterface.java @@ -11,6 +11,6 @@ @SuppressWarnings("RedundantThrows") public interface FakeClassnameTags123ApiControllerImpInterface { - Client testClassname(Client client) throws Exception; + Client testClassname(Client body) throws Exception; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiController.java index 4b5720896eec..e4427543e641 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiController.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiController.java @@ -39,17 +39,17 @@ private PetApiController(Configuration configuration, PetApiControllerImpInterfa @ApiAction public Result addPet() throws Exception { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(pet); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.addPet(pet); + imp.addPet(body); return ok(); } @@ -126,17 +126,17 @@ public Result getPetById(Long petId) throws Exception { @ApiAction public Result updatePet() throws Exception { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(pet); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.updatePet(pet); + imp.updatePet(body); return ok(); } @@ -147,14 +147,14 @@ public Result updatePetWithForm(Long petId) throws Exception { if (valuename != null) { name = valuename; } else { - name = "null"; + name = null; } String valuestatus = (request().body().asMultipartFormData().asFormUrlEncoded().get("status"))[0]; String status; if (valuestatus != null) { status = valuestatus; } else { - status = "null"; + status = null; } imp.updatePetWithForm(petId, name, status); return ok(); @@ -167,7 +167,7 @@ public Result uploadFile(Long petId) throws Exception { if (valueadditionalMetadata != null) { additionalMetadata = valueadditionalMetadata; } else { - additionalMetadata = "null"; + additionalMetadata = null; } Http.MultipartFormData.FilePart file = request().body().asMultipartFormData().getFile("file"); ModelApiResponse obj = imp.uploadFile(petId, additionalMetadata, file); @@ -185,13 +185,13 @@ public Result uploadFileWithRequiredFile(Long petId) throws Exception { if (valueadditionalMetadata != null) { additionalMetadata = valueadditionalMetadata; } else { - additionalMetadata = "null"; + additionalMetadata = null; } - Http.MultipartFormData.FilePart file = request().body().asMultipartFormData().getFile("file"); - if ((file == null || ((File) file.getFile()).length() == 0)) { - throw new IllegalArgumentException("'file' file cannot be empty"); + Http.MultipartFormData.FilePart requiredFile = request().body().asMultipartFormData().getFile("requiredFile"); + if ((requiredFile == null || ((File) requiredFile.getFile()).length() == 0)) { + throw new IllegalArgumentException("'requiredFile' file cannot be empty"); } - ModelApiResponse obj = imp.uploadFileWithRequiredFile(petId, file, additionalMetadata); + ModelApiResponse obj = imp.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); if (configuration.getBoolean("useOutputBeanValidation")) { OpenAPIUtils.validate(obj); } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiControllerImp.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiControllerImp.java index 85e0c60ef6cf..3d028b318637 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiControllerImp.java @@ -13,7 +13,7 @@ public class PetApiControllerImp implements PetApiControllerImpInterface { @Override - public void addPet(Pet pet) throws Exception { + public void addPet(Pet body) throws Exception { //Do your magic!!! } @@ -41,7 +41,7 @@ public Pet getPetById(Long petId) throws Exception { } @Override - public void updatePet(Pet pet) throws Exception { + public void updatePet(Pet body) throws Exception { //Do your magic!!! } @@ -57,7 +57,7 @@ public ModelApiResponse uploadFile(Long petId, String additionalMetadata, Http.M } @Override - public ModelApiResponse uploadFileWithRequiredFile(Long petId, Http.MultipartFormData.FilePart file, String additionalMetadata) throws Exception { + public ModelApiResponse uploadFileWithRequiredFile(Long petId, Http.MultipartFormData.FilePart requiredFile, String additionalMetadata) throws Exception { //Do your magic!!! return new ModelApiResponse(); } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiControllerImpInterface.java index 1a87f77ac02c..a6c88443756b 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiControllerImpInterface.java @@ -13,7 +13,7 @@ @SuppressWarnings("RedundantThrows") public interface PetApiControllerImpInterface { - void addPet(Pet pet) throws Exception; + void addPet(Pet body) throws Exception; void deletePet(Long petId, String apiKey) throws Exception; @@ -23,12 +23,12 @@ public interface PetApiControllerImpInterface { Pet getPetById(Long petId) throws Exception; - void updatePet(Pet pet) throws Exception; + void updatePet(Pet body) throws Exception; void updatePetWithForm(Long petId, String name, String status) throws Exception; ModelApiResponse uploadFile(Long petId, String additionalMetadata, Http.MultipartFormData.FilePart file) throws Exception; - ModelApiResponse uploadFileWithRequiredFile(Long petId, Http.MultipartFormData.FilePart file, String additionalMetadata) throws Exception; + ModelApiResponse uploadFileWithRequiredFile(Long petId, Http.MultipartFormData.FilePart requiredFile, String additionalMetadata) throws Exception; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiController.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiController.java index 03d64c1346ca..831f15dfe3c7 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiController.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiController.java @@ -61,17 +61,17 @@ public Result getOrderById( @Min(1) @Max(5)Long orderId) throws Exception { @ApiAction public Result placeOrder() throws Exception { - JsonNode nodeorder = request().body().asJson(); - Order order; - if (nodeorder != null) { - order = mapper.readValue(nodeorder.toString(), Order.class); + JsonNode nodebody = request().body().asJson(); + Order body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Order.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(order); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Order' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - Order obj = imp.placeOrder(order); + Order obj = imp.placeOrder(body); if (configuration.getBoolean("useOutputBeanValidation")) { OpenAPIUtils.validate(obj); } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiControllerImp.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiControllerImp.java index f2ededef32fc..7c57d3d096c4 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiControllerImp.java @@ -29,7 +29,7 @@ public Order getOrderById( @Min(1) @Max(5)Long orderId) throws Exception { } @Override - public Order placeOrder(Order order) throws Exception { + public Order placeOrder(Order body) throws Exception { //Do your magic!!! return new Order(); } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiControllerImpInterface.java index 4a8c5d27d405..b42e4d6d3d02 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiControllerImpInterface.java @@ -18,6 +18,6 @@ public interface StoreApiControllerImpInterface { Order getOrderById( @Min(1) @Max(5)Long orderId) throws Exception; - Order placeOrder(Order order) throws Exception; + Order placeOrder(Order body) throws Exception; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiController.java index 439fa190f586..aa3bbd80ba15 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiController.java @@ -38,53 +38,53 @@ private UserApiController(Configuration configuration, UserApiControllerImpInter @ApiAction public Result createUser() throws Exception { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(user); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUser(user); + imp.createUser(body); return ok(); } @ApiAction public Result createUsersWithArrayInput() throws Exception { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); if (configuration.getBoolean("useInputBeanValidation")) { - for (User curItem : user) { + for (User curItem : body) { OpenAPIUtils.validate(curItem); } } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithArrayInput(user); + imp.createUsersWithArrayInput(body); return ok(); } @ApiAction public Result createUsersWithListInput() throws Exception { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); if (configuration.getBoolean("useInputBeanValidation")) { - for (User curItem : user) { + for (User curItem : body) { OpenAPIUtils.validate(curItem); } } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithListInput(user); + imp.createUsersWithListInput(body); return ok(); } @@ -133,17 +133,17 @@ public Result logoutUser() throws Exception { @ApiAction public Result updateUser(String username) throws Exception { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(user); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.updateUser(username, user); + imp.updateUser(username, body); return ok(); } } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiControllerImp.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiControllerImp.java index 63aafa7df25f..0ea7a808b9a4 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiControllerImp.java @@ -12,17 +12,17 @@ public class UserApiControllerImp implements UserApiControllerImpInterface { @Override - public void createUser(User user) throws Exception { + public void createUser(User body) throws Exception { //Do your magic!!! } @Override - public void createUsersWithArrayInput(List user) throws Exception { + public void createUsersWithArrayInput(List body) throws Exception { //Do your magic!!! } @Override - public void createUsersWithListInput(List user) throws Exception { + public void createUsersWithListInput(List body) throws Exception { //Do your magic!!! } @@ -49,7 +49,7 @@ public void logoutUser() throws Exception { } @Override - public void updateUser(String username, User user) throws Exception { + public void updateUser(String username, User body) throws Exception { //Do your magic!!! } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiControllerImpInterface.java index ee09b11e325f..1290c84835fb 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiControllerImpInterface.java @@ -12,11 +12,11 @@ @SuppressWarnings("RedundantThrows") public interface UserApiControllerImpInterface { - void createUser(User user) throws Exception; + void createUser(User body) throws Exception; - void createUsersWithArrayInput(List user) throws Exception; + void createUsersWithArrayInput(List body) throws Exception; - void createUsersWithListInput(List user) throws Exception; + void createUsersWithListInput(List body) throws Exception; void deleteUser(String username) throws Exception; @@ -26,6 +26,6 @@ public interface UserApiControllerImpInterface { void logoutUser() throws Exception; - void updateUser(String username, User user) throws Exception; + void updateUser(String username, User body) throws Exception; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/openapitools/OpenAPIUtils.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/openapitools/OpenAPIUtils.java index c707ca74ac7e..385ef97a0083 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/openapitools/OpenAPIUtils.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/openapitools/OpenAPIUtils.java @@ -98,6 +98,6 @@ public static String parameterToString(Object param) { } public static String formatDatetime(Date date) { - return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX").format(date); + return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX", Locale.ROOT).format(date); } -} \ No newline at end of file +} diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/conf/routes b/samples/server/petstore/java-play-framework-fake-endpoints/conf/routes index 08762f3f8ebd..ac52677f44c5 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/conf/routes +++ b/samples/server/petstore/java-play-framework-fake-endpoints/conf/routes @@ -6,9 +6,10 @@ GET /api controllers.ApiDocController.api #Functions for AnotherFake API -PATCH /v2/another-fake/dummy controllers.AnotherFakeApiController.testSpecialTags() +PATCH /v2/another-fake/dummy controllers.AnotherFakeApiController.call123testSpecialTags() #Functions for Fake API +POST /v2/fake/create_xml_item controllers.FakeApiController.createXmlItem() POST /v2/fake/outer/boolean controllers.FakeApiController.fakeOuterBooleanSerialize() POST /v2/fake/outer/composite controllers.FakeApiController.fakeOuterCompositeSerialize() POST /v2/fake/outer/number controllers.FakeApiController.fakeOuterNumberSerialize() @@ -18,6 +19,7 @@ PUT /v2/fake/body-with-query-params controllers.FakeApiC PATCH /v2/fake controllers.FakeApiController.testClientModel() POST /v2/fake controllers.FakeApiController.testEndpointParameters() GET /v2/fake controllers.FakeApiController.testEnumParameters() +DELETE /v2/fake controllers.FakeApiController.testGroupParameters() POST /v2/fake/inline-additionalProperties controllers.FakeApiController.testInlineAdditionalProperties() GET /v2/fake/jsonFormData controllers.FakeApiController.testJsonFormData() diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/public/openapi.json b/samples/server/petstore/java-play-framework-fake-endpoints/public/openapi.json index 6a55a7238e00..cb84972ecf10 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/public/openapi.json +++ b/samples/server/petstore/java-play-framework-fake-endpoints/public/openapi.json @@ -45,6 +45,10 @@ "required" : true }, "responses" : { + "200" : { + "description" : "successful operation", + "content" : { } + }, "400" : { "description" : "Invalid ID supplied", "content" : { } @@ -61,6 +65,7 @@ "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "x-codegen-request-body-name" : "body", "x-contentType" : "application/json", "x-accepts" : "application/json" }, @@ -85,6 +90,10 @@ "required" : true }, "responses" : { + "200" : { + "description" : "successful operation", + "content" : { } + }, "405" : { "description" : "Invalid input", "content" : { } @@ -93,6 +102,7 @@ "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "x-codegen-request-body-name" : "body", "x-contentType" : "application/json", "x-accepts" : "application/json" } @@ -114,8 +124,8 @@ "type" : "array", "items" : { "type" : "string", - "enum" : [ "available", "pending", "sold" ], - "default" : "available" + "default" : "available", + "enum" : [ "available", "pending", "sold" ] } } } ], @@ -317,6 +327,10 @@ } } ], "responses" : { + "200" : { + "description" : "successful operation", + "content" : { } + }, "400" : { "description" : "Invalid pet value", "content" : { } @@ -446,6 +460,7 @@ "content" : { } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } @@ -545,6 +560,7 @@ "content" : { } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } @@ -574,6 +590,7 @@ "content" : { } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } @@ -603,6 +620,7 @@ "content" : { } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } @@ -759,6 +777,7 @@ "content" : { } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" }, @@ -821,6 +840,7 @@ "security" : [ { "api_key_query" : [ ] } ], + "x-codegen-request-body-name" : "body", "x-contentType" : "application/json", "x-accepts" : "application/json" } @@ -841,8 +861,8 @@ "type" : "array", "items" : { "type" : "string", - "enum" : [ ">", "$" ], - "default" : "$" + "default" : "$", + "enum" : [ ">", "$" ] } } }, { @@ -851,8 +871,8 @@ "description" : "Header parameter enum test (string)", "schema" : { "type" : "string", - "enum" : [ "_abc", "-efg", "(xyz)" ], - "default" : "-efg" + "default" : "-efg", + "enum" : [ "_abc", "-efg", "(xyz)" ] } }, { "name" : "enum_query_string_array", @@ -864,8 +884,8 @@ "type" : "array", "items" : { "type" : "string", - "enum" : [ ">", "$" ], - "default" : "$" + "default" : "$", + "enum" : [ ">", "$" ] } } }, { @@ -874,8 +894,8 @@ "description" : "Query parameter enum test (string)", "schema" : { "type" : "string", - "enum" : [ "_abc", "-efg", "(xyz)" ], - "default" : "-efg" + "default" : "-efg", + "enum" : [ "_abc", "-efg", "(xyz)" ] } }, { "name" : "enum_query_integer", @@ -906,15 +926,15 @@ "description" : "Form parameter enum test (string array)", "items" : { "type" : "string", - "enum" : [ ">", "$" ], - "default" : "$" + "default" : "$", + "enum" : [ ">", "$" ] } }, "enum_form_string" : { "type" : "string", "description" : "Form parameter enum test (string)", - "enum" : [ "_abc", "-efg", "(xyz)" ], - "default" : "-efg" + "default" : "-efg", + "enum" : [ "_abc", "-efg", "(xyz)" ] } } } @@ -1045,6 +1065,68 @@ "x-contentType" : "application/x-www-form-urlencoded", "x-accepts" : "application/json" }, + "delete" : { + "tags" : [ "fake" ], + "summary" : "Fake endpoint to test group parameters (optional)", + "description" : "Fake endpoint to test group parameters (optional)", + "operationId" : "testGroupParameters", + "parameters" : [ { + "name" : "required_string_group", + "in" : "query", + "description" : "Required String in group parameters", + "required" : true, + "schema" : { + "type" : "integer" + } + }, { + "name" : "required_boolean_group", + "in" : "header", + "description" : "Required Boolean in group parameters", + "required" : true, + "schema" : { + "type" : "boolean" + } + }, { + "name" : "required_int64_group", + "in" : "query", + "description" : "Required Integer in group parameters", + "required" : true, + "schema" : { + "type" : "integer", + "format" : "int64" + } + }, { + "name" : "string_group", + "in" : "query", + "description" : "String in group parameters", + "schema" : { + "type" : "integer" + } + }, { + "name" : "boolean_group", + "in" : "header", + "description" : "Boolean in group parameters", + "schema" : { + "type" : "boolean" + } + }, { + "name" : "int64_group", + "in" : "query", + "description" : "Integer in group parameters", + "schema" : { + "type" : "integer", + "format" : "int64" + } + } ], + "responses" : { + "400" : { + "description" : "Someting wrong", + "content" : { } + } + }, + "x-group-parameters" : true, + "x-accepts" : "application/json" + }, "patch" : { "tags" : [ "fake" ], "summary" : "To test \"client\" model", @@ -1073,6 +1155,7 @@ } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "application/json", "x-accepts" : "application/json" } @@ -1105,6 +1188,7 @@ } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "*/*" } @@ -1137,6 +1221,7 @@ } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "*/*" } @@ -1169,6 +1254,7 @@ } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "*/*" } @@ -1201,6 +1287,7 @@ } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "*/*" } @@ -1265,6 +1352,7 @@ "content" : { } } }, + "x-codegen-request-body-name" : "param", "x-contentType" : "application/json", "x-accepts" : "application/json" } @@ -1297,16 +1385,70 @@ "content" : { } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "application/json", "x-accepts" : "application/json" } }, + "/fake/create_xml_item" : { + "post" : { + "tags" : [ "fake" ], + "summary" : "creates an XmlItem", + "description" : "this route creates an XmlItem", + "operationId" : "createXmlItem", + "requestBody" : { + "description" : "XmlItem Body", + "content" : { + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/XmlItem" + } + }, + "application/xml; charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/XmlItem" + } + }, + "application/xml; charset=utf-16" : { + "schema" : { + "$ref" : "#/components/schemas/XmlItem" + } + }, + "text/xml" : { + "schema" : { + "$ref" : "#/components/schemas/XmlItem" + } + }, + "text/xml; charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/XmlItem" + } + }, + "text/xml; charset=utf-16" : { + "schema" : { + "$ref" : "#/components/schemas/XmlItem" + } + } + }, + "required" : true + }, + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { } + } + }, + "x-codegen-request-body-name" : "XmlItem", + "x-contentType" : "application/xml", + "x-accepts" : "application/json" + } + }, "/another-fake/dummy" : { "patch" : { "tags" : [ "$another-fake?" ], "summary" : "To test special tags", - "description" : "To test special tags", - "operationId" : "test_special_tags", + "description" : "To test special tags and operation ID starting with number", + "operationId" : "123_test_@#$%_special_tags", "requestBody" : { "description" : "client model", "content" : { @@ -1330,6 +1472,7 @@ } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "application/json", "x-accepts" : "application/json" } @@ -1355,6 +1498,7 @@ "content" : { } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "application/json", "x-accepts" : "application/json" } @@ -1378,13 +1522,13 @@ "content" : { "multipart/form-data" : { "schema" : { - "required" : [ "file" ], + "required" : [ "requiredFile" ], "properties" : { "additionalMetadata" : { "type" : "string", "description" : "Additional data to pass to server" }, - "file" : { + "requiredFile" : { "type" : "string", "description" : "file to upload", "format" : "binary" @@ -1417,7 +1561,49 @@ }, "components" : { "schemas" : { + "Order" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64" + }, + "petId" : { + "type" : "integer", + "format" : "int64" + }, + "quantity" : { + "type" : "integer", + "format" : "int32" + }, + "shipDate" : { + "type" : "string", + "format" : "date-time" + }, + "status" : { + "type" : "string", + "description" : "Order Status", + "enum" : [ "placed", "approved", "delivered" ] + }, + "complete" : { + "type" : "boolean", + "default" : false + } + }, + "example" : { + "petId" : 6, + "quantity" : 1, + "id" : 0, + "shipDate" : "2000-01-23T04:56:07.000+00:00", + "complete" : false, + "status" : "placed" + }, + "xml" : { + "name" : "Order" + } + }, "Category" : { + "required" : [ "name" ], "type" : "object", "properties" : { "id" : { @@ -1425,11 +1611,12 @@ "format" : "int64" }, "name" : { - "type" : "string" + "type" : "string", + "default" : "default-name" } }, "example" : { - "name" : "name", + "name" : "default-name", "id" : 6 }, "xml" : { @@ -1482,61 +1669,86 @@ "name" : "User" } }, - "OuterNumber" : { - "type" : "number" - }, - "ArrayOfNumberOnly" : { + "Tag" : { "type" : "object", "properties" : { - "ArrayNumber" : { - "type" : "array", - "items" : { - "type" : "number" - } + "id" : { + "type" : "integer", + "format" : "int64" + }, + "name" : { + "type" : "string" } + }, + "example" : { + "name" : "name", + "id" : 1 + }, + "xml" : { + "name" : "Tag" } }, - "Capitalization" : { + "Pet" : { + "required" : [ "name", "photoUrls" ], "type" : "object", "properties" : { - "smallCamel" : { - "type" : "string" + "id" : { + "type" : "integer", + "format" : "int64", + "x-is-unique" : true }, - "CapitalCamel" : { - "type" : "string" + "category" : { + "$ref" : "#/components/schemas/Category" }, - "small_Snake" : { - "type" : "string" + "name" : { + "type" : "string", + "example" : "doggie" }, - "Capital_Snake" : { - "type" : "string" + "photoUrls" : { + "type" : "array", + "xml" : { + "name" : "photoUrl", + "wrapped" : true + }, + "items" : { + "type" : "string" + } }, - "SCA_ETH_Flow_Points" : { - "type" : "string" + "tags" : { + "type" : "array", + "xml" : { + "name" : "tag", + "wrapped" : true + }, + "items" : { + "$ref" : "#/components/schemas/Tag" + } }, - "ATT_NAME" : { + "status" : { "type" : "string", - "description" : "Name of the pet\n" + "description" : "pet status in the store", + "enum" : [ "available", "pending", "sold" ] } - } - }, - "MixedPropertiesAndAdditionalPropertiesClass" : { - "type" : "object", - "properties" : { - "uuid" : { - "type" : "string", - "format" : "uuid" - }, - "dateTime" : { - "type" : "string", - "format" : "date-time" + }, + "example" : { + "photoUrls" : [ "photoUrls", "photoUrls" ], + "name" : "doggie", + "id" : 0, + "category" : { + "name" : "default-name", + "id" : 6 }, - "map" : { - "type" : "object", - "additionalProperties" : { - "$ref" : "#/components/schemas/Animal" - } - } + "tags" : [ { + "name" : "name", + "id" : 1 + }, { + "name" : "name", + "id" : 1 + } ], + "status" : "available" + }, + "xml" : { + "name" : "Pet" } }, "ApiResponse" : { @@ -1559,54 +1771,55 @@ "message" : "message" } }, - "Name" : { - "required" : [ "name" ], + "$special[model.name]" : { "type" : "object", "properties" : { - "name" : { - "type" : "integer", - "format" : "int32" - }, - "snake_case" : { + "$special[property.name]" : { "type" : "integer", - "format" : "int32", - "readOnly" : true - }, - "property" : { - "type" : "string" - }, - "123Number" : { - "type" : "integer", - "readOnly" : true + "format" : "int64" } }, - "description" : "Model for testing model name same as property name", "xml" : { - "name" : "Name" + "name" : "$special[model.name]" } }, - "EnumClass" : { - "type" : "string", - "enum" : [ "_abc", "-efg", "(xyz)" ], - "default" : "-efg" - }, - "List" : { + "Return" : { "type" : "object", "properties" : { - "123-list" : { - "type" : "string" + "return" : { + "type" : "integer", + "format" : "int32" } }, - "example" : { - "123-list" : "123-list" + "description" : "Model for testing reserved words", + "xml" : { + "name" : "Return" } }, - "NumberOnly" : { + "Name" : { + "required" : [ "name" ], "type" : "object", "properties" : { - "JustNumber" : { - "type" : "number" + "name" : { + "type" : "integer", + "format" : "int32" + }, + "snake_case" : { + "type" : "integer", + "format" : "int32", + "readOnly" : true + }, + "property" : { + "type" : "string" + }, + "123Number" : { + "type" : "integer", + "readOnly" : true } + }, + "description" : "Model for testing model name same as property name", + "xml" : { + "name" : "Name" } }, "200_response" : { @@ -1625,220 +1838,49 @@ "name" : "Name" } }, - "Client" : { + "ClassModel" : { "type" : "object", "properties" : { - "client" : { + "_class" : { "type" : "string" } }, - "example" : { - "client" : "client" - } + "description" : "Model for testing model with \"_class\" property" }, "Dog" : { "allOf" : [ { "$ref" : "#/components/schemas/Animal" }, { - "type" : "object", - "properties" : { - "breed" : { - "type" : "string" - } - } + "$ref" : "#/components/schemas/Dog_allOf" } ] }, - "Enum_Test" : { - "required" : [ "enum_string_required" ], - "type" : "object", - "properties" : { - "enum_string" : { - "type" : "string", - "enum" : [ "UPPER", "lower", "" ] - }, - "enum_string_required" : { - "type" : "string", - "enum" : [ "UPPER", "lower", "" ] - }, - "enum_integer" : { - "type" : "integer", - "format" : "int32", - "enum" : [ 1, -1 ] - }, - "enum_number" : { - "type" : "number", - "format" : "double", - "enum" : [ 1.1, -1.2 ] - }, - "outerEnum" : { - "$ref" : "#/components/schemas/OuterEnum" - } - } + "Cat" : { + "allOf" : [ { + "$ref" : "#/components/schemas/Animal" + }, { + "$ref" : "#/components/schemas/Cat_allOf" + } ] }, - "Order" : { + "Animal" : { + "required" : [ "className" ], "type" : "object", "properties" : { - "id" : { - "type" : "integer", - "format" : "int64" - }, - "petId" : { - "type" : "integer", - "format" : "int64" - }, - "quantity" : { - "type" : "integer", - "format" : "int32" - }, - "shipDate" : { - "type" : "string", - "format" : "date-time" + "className" : { + "type" : "string" }, - "status" : { + "color" : { "type" : "string", - "description" : "Order Status", - "enum" : [ "placed", "approved", "delivered" ] - }, - "complete" : { - "type" : "boolean", - "default" : false - } - }, - "example" : { - "petId" : 6, - "quantity" : 1, - "id" : 0, - "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : false, - "status" : "placed" - }, - "xml" : { - "name" : "Order" - } - }, - "AdditionalPropertiesClass" : { - "type" : "object", - "properties" : { - "map_property" : { - "type" : "object", - "additionalProperties" : { - "type" : "string" - } - }, - "map_of_map_property" : { - "type" : "object", - "additionalProperties" : { - "type" : "object", - "additionalProperties" : { - "type" : "string" - } - } - } - } - }, - "$special[model.name]" : { - "type" : "object", - "properties" : { - "$special[property.name]" : { - "type" : "integer", - "format" : "int64" - } - }, - "xml" : { - "name" : "$special[model.name]" - } - }, - "Return" : { - "type" : "object", - "properties" : { - "return" : { - "type" : "integer", - "format" : "int32" + "default" : "red" } }, - "description" : "Model for testing reserved words", - "xml" : { - "name" : "Return" - } - }, - "ReadOnlyFirst" : { - "type" : "object", - "properties" : { - "bar" : { - "type" : "string", - "readOnly" : true - }, - "baz" : { - "type" : "string" - } - } - }, - "ArrayOfArrayOfNumberOnly" : { - "type" : "object", - "properties" : { - "ArrayArrayNumber" : { - "type" : "array", - "items" : { - "type" : "array", - "items" : { - "type" : "number" - } - } - } - } - }, - "OuterEnum" : { - "type" : "string", - "enum" : [ "placed", "approved", "delivered" ] - }, - "ArrayTest" : { - "type" : "object", - "properties" : { - "array_of_string" : { - "type" : "array", - "items" : { - "type" : "string" - } - }, - "array_array_of_integer" : { - "type" : "array", - "items" : { - "type" : "array", - "items" : { - "type" : "integer", - "format" : "int64" - } - } - }, - "array_array_of_model" : { - "type" : "array", - "items" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/ReadOnlyFirst" - } - } - } + "discriminator" : { + "propertyName" : "className" } }, - "OuterComposite" : { - "type" : "object", - "properties" : { - "my_number" : { - "type" : "number" - }, - "my_string" : { - "type" : "string" - }, - "my_boolean" : { - "type" : "boolean", - "x-codegen-body-parameter-name" : "boolean_post_body" - } - }, - "example" : { - "my_string" : "my_string", - "my_number" : 0.80082819046101150206595775671303272247314453125, - "my_boolean" : true + "AnimalFarm" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Animal" } }, "format_test" : { @@ -1900,7 +1942,8 @@ }, "uuid" : { "type" : "string", - "format" : "uuid" + "format" : "uuid", + "example" : "72f98069-206d-4f12-9f12-3d1e525a8e84" }, "password" : { "maxLength" : 64, @@ -1910,95 +1953,288 @@ } } }, - "EnumArrays" : { - "type" : "object", - "properties" : { - "just_symbol" : { + "EnumClass" : { + "type" : "string", + "default" : "-efg", + "enum" : [ "_abc", "-efg", "(xyz)" ] + }, + "Enum_Test" : { + "required" : [ "enum_string_required" ], + "type" : "object", + "properties" : { + "enum_string" : { "type" : "string", - "enum" : [ ">=", "$" ] + "enum" : [ "UPPER", "lower", "" ] }, - "array_enum" : { - "type" : "array", - "items" : { - "type" : "string", - "enum" : [ "fish", "crab" ] + "enum_string_required" : { + "type" : "string", + "enum" : [ "UPPER", "lower", "" ] + }, + "enum_integer" : { + "type" : "integer", + "format" : "int32", + "enum" : [ 1, -1 ] + }, + "enum_number" : { + "type" : "number", + "format" : "double", + "enum" : [ 1.1, -1.2 ] + }, + "outerEnum" : { + "$ref" : "#/components/schemas/OuterEnum" + } + } + }, + "AdditionalPropertiesClass" : { + "type" : "object", + "properties" : { + "map_string" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" } + }, + "map_number" : { + "type" : "object", + "additionalProperties" : { + "type" : "number" + } + }, + "map_integer" : { + "type" : "object", + "additionalProperties" : { + "type" : "integer" + } + }, + "map_boolean" : { + "type" : "object", + "additionalProperties" : { + "type" : "boolean" + } + }, + "map_array_integer" : { + "type" : "object", + "additionalProperties" : { + "type" : "array", + "items" : { + "type" : "integer" + } + } + }, + "map_array_anytype" : { + "type" : "object", + "additionalProperties" : { + "type" : "array", + "items" : { + "type" : "object", + "properties" : { } + } + } + }, + "map_map_string" : { + "type" : "object", + "additionalProperties" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" + } + } + }, + "map_map_anytype" : { + "type" : "object", + "additionalProperties" : { + "type" : "object", + "additionalProperties" : { + "type" : "object", + "properties" : { } + } + } + }, + "anytype_1" : { + "type" : "object", + "properties" : { } + }, + "anytype_2" : { + "type" : "object" + }, + "anytype_3" : { + "type" : "object", + "properties" : { } } } }, - "OuterString" : { - "type" : "string" + "AdditionalPropertiesString" : { + "type" : "object", + "properties" : { + "name" : { + "type" : "string" + } + }, + "additionalProperties" : { + "type" : "string" + } }, - "ClassModel" : { + "AdditionalPropertiesInteger" : { "type" : "object", "properties" : { - "_class" : { + "name" : { "type" : "string" } }, - "description" : "Model for testing model with \"_class\" property" + "additionalProperties" : { + "type" : "integer" + } }, - "OuterBoolean" : { - "type" : "boolean", - "x-codegen-body-parameter-name" : "boolean_post_body" + "AdditionalPropertiesNumber" : { + "type" : "object", + "properties" : { + "name" : { + "type" : "string" + } + }, + "additionalProperties" : { + "type" : "number" + } }, - "FileSchemaTestClass" : { + "AdditionalPropertiesBoolean" : { "type" : "object", "properties" : { - "file" : { - "$ref" : "#/components/schemas/File" - }, - "files" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/File" - } + "name" : { + "type" : "string" } }, - "example" : { - "file" : { - "sourceURI" : "sourceURI" - }, - "files" : [ { - "sourceURI" : "sourceURI" - }, { - "sourceURI" : "sourceURI" - } ] + "additionalProperties" : { + "type" : "boolean" } }, - "Animal" : { - "required" : [ "className" ], + "AdditionalPropertiesArray" : { "type" : "object", "properties" : { - "className" : { + "name" : { "type" : "string" - }, - "color" : { - "type" : "string", - "default" : "red" } }, - "discriminator" : { - "propertyName" : "className" + "additionalProperties" : { + "type" : "array", + "items" : { + "type" : "object", + "properties" : { } + } } }, - "StringBooleanMap" : { + "AdditionalPropertiesObject" : { "type" : "object", + "properties" : { + "name" : { + "type" : "string" + } + }, "additionalProperties" : { - "type" : "boolean" + "type" : "object", + "additionalProperties" : { + "type" : "object", + "properties" : { } + } } }, - "Cat" : { - "allOf" : [ { - "$ref" : "#/components/schemas/Animal" - }, { + "AdditionalPropertiesAnyType" : { + "type" : "object", + "properties" : { + "name" : { + "type" : "string" + } + }, + "additionalProperties" : { "type" : "object", - "properties" : { - "declawed" : { - "type" : "boolean" + "properties" : { } + } + }, + "MixedPropertiesAndAdditionalPropertiesClass" : { + "type" : "object", + "properties" : { + "uuid" : { + "type" : "string", + "format" : "uuid" + }, + "dateTime" : { + "type" : "string", + "format" : "date-time" + }, + "map" : { + "type" : "object", + "additionalProperties" : { + "$ref" : "#/components/schemas/Animal" } } - } ] + } + }, + "List" : { + "type" : "object", + "properties" : { + "123-list" : { + "type" : "string" + } + } + }, + "Client" : { + "type" : "object", + "properties" : { + "client" : { + "type" : "string" + } + }, + "example" : { + "client" : "client" + } + }, + "ReadOnlyFirst" : { + "type" : "object", + "properties" : { + "bar" : { + "type" : "string", + "readOnly" : true + }, + "baz" : { + "type" : "string" + } + } + }, + "hasOnlyReadOnly" : { + "type" : "object", + "properties" : { + "bar" : { + "type" : "string", + "readOnly" : true + }, + "foo" : { + "type" : "string", + "readOnly" : true + } + } + }, + "Capitalization" : { + "type" : "object", + "properties" : { + "smallCamel" : { + "type" : "string" + }, + "CapitalCamel" : { + "type" : "string" + }, + "small_Snake" : { + "type" : "string" + }, + "Capital_Snake" : { + "type" : "string" + }, + "SCA_ETH_Flow_Points" : { + "type" : "string" + }, + "ATT_NAME" : { + "type" : "string", + "description" : "Name of the pet\n" + } + } }, "MapTest" : { "type" : "object", @@ -2026,33 +2262,154 @@ } }, "indirect_map" : { - "$ref" : "#/components/schemas/StringBooleanMap" + "type" : "object", + "additionalProperties" : { + "type" : "boolean" + } + } + } + }, + "ArrayTest" : { + "type" : "object", + "properties" : { + "array_of_string" : { + "type" : "array", + "items" : { + "type" : "string" + } + }, + "array_array_of_integer" : { + "type" : "array", + "items" : { + "type" : "array", + "items" : { + "type" : "integer", + "format" : "int64" + } + } + }, + "array_array_of_model" : { + "type" : "array", + "items" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/ReadOnlyFirst" + } + } + } + } + }, + "NumberOnly" : { + "type" : "object", + "properties" : { + "JustNumber" : { + "type" : "number" + } + } + }, + "ArrayOfNumberOnly" : { + "type" : "object", + "properties" : { + "ArrayNumber" : { + "type" : "array", + "items" : { + "type" : "number" + } + } + } + }, + "ArrayOfArrayOfNumberOnly" : { + "type" : "object", + "properties" : { + "ArrayArrayNumber" : { + "type" : "array", + "items" : { + "type" : "array", + "items" : { + "type" : "number" + } + } + } + } + }, + "EnumArrays" : { + "type" : "object", + "properties" : { + "just_symbol" : { + "type" : "string", + "enum" : [ ">=", "$" ] + }, + "array_enum" : { + "type" : "array", + "items" : { + "type" : "string", + "enum" : [ "fish", "crab" ] + } + } + } + }, + "OuterEnum" : { + "type" : "string", + "enum" : [ "placed", "approved", "delivered" ] + }, + "OuterComposite" : { + "type" : "object", + "properties" : { + "my_number" : { + "type" : "number" + }, + "my_string" : { + "type" : "string" + }, + "my_boolean" : { + "type" : "boolean", + "x-codegen-body-parameter-name" : "boolean_post_body" } + }, + "example" : { + "my_string" : "my_string", + "my_number" : 0.8008281904610115, + "my_boolean" : true + } + }, + "OuterNumber" : { + "type" : "number" + }, + "OuterString" : { + "type" : "string" + }, + "OuterBoolean" : { + "type" : "boolean", + "x-codegen-body-parameter-name" : "boolean_post_body" + }, + "StringBooleanMap" : { + "type" : "object", + "additionalProperties" : { + "type" : "boolean" } }, - "Tag" : { + "FileSchemaTestClass" : { "type" : "object", "properties" : { - "id" : { - "type" : "integer", - "format" : "int64" + "file" : { + "$ref" : "#/components/schemas/File" }, - "name" : { - "type" : "string" + "files" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/File" + } } }, "example" : { - "name" : "name", - "id" : 1 - }, - "xml" : { - "name" : "Tag" - } - }, - "AnimalFarm" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/Animal" + "file" : { + "sourceURI" : "sourceURI" + }, + "files" : [ { + "sourceURI" : "sourceURI" + }, { + "sourceURI" : "sourceURI" + } ] } }, "File" : { @@ -2063,83 +2420,330 @@ "description" : "Test capitalization" } }, + "description" : "Must be named `File` for test.", "example" : { "sourceURI" : "sourceURI" } }, - "Pet" : { - "required" : [ "name", "photoUrls" ], + "TypeHolderDefault" : { + "required" : [ "array_item", "bool_item", "integer_item", "number_item", "string_item" ], "type" : "object", "properties" : { - "id" : { + "string_item" : { + "type" : "string", + "default" : "what" + }, + "number_item" : { + "type" : "number" + }, + "integer_item" : { + "type" : "integer" + }, + "bool_item" : { + "type" : "boolean", + "default" : true + }, + "array_item" : { + "type" : "array", + "items" : { + "type" : "integer" + } + } + } + }, + "TypeHolderExample" : { + "required" : [ "array_item", "bool_item", "integer_item", "number_item", "string_item" ], + "type" : "object", + "properties" : { + "string_item" : { + "type" : "string", + "example" : "what" + }, + "number_item" : { + "type" : "number", + "example" : 1.234 + }, + "integer_item" : { "type" : "integer", - "format" : "int64", - "x-is-unique" : true + "example" : -2 }, - "category" : { - "$ref" : "#/components/schemas/Category" + "bool_item" : { + "type" : "boolean", + "example" : true }, - "name" : { + "array_item" : { + "type" : "array", + "example" : [ 0, 1, 2, 3 ], + "items" : { + "type" : "integer" + } + } + } + }, + "XmlItem" : { + "type" : "object", + "properties" : { + "attribute_string" : { "type" : "string", - "example" : "doggie" + "example" : "string", + "xml" : { + "attribute" : true + } }, - "photoUrls" : { + "attribute_number" : { + "type" : "number", + "example" : 1.234, + "xml" : { + "attribute" : true + } + }, + "attribute_integer" : { + "type" : "integer", + "example" : -2, + "xml" : { + "attribute" : true + } + }, + "attribute_boolean" : { + "type" : "boolean", + "example" : true, + "xml" : { + "attribute" : true + } + }, + "wrapped_array" : { "type" : "array", "xml" : { - "name" : "photoUrl", "wrapped" : true }, "items" : { - "type" : "string" + "type" : "integer" } }, - "tags" : { + "name_string" : { + "type" : "string", + "example" : "string", + "xml" : { + "name" : "xml_name_string" + } + }, + "name_number" : { + "type" : "number", + "example" : 1.234, + "xml" : { + "name" : "xml_name_number" + } + }, + "name_integer" : { + "type" : "integer", + "example" : -2, + "xml" : { + "name" : "xml_name_integer" + } + }, + "name_boolean" : { + "type" : "boolean", + "example" : true, + "xml" : { + "name" : "xml_name_boolean" + } + }, + "name_array" : { + "type" : "array", + "items" : { + "type" : "integer", + "xml" : { + "name" : "xml_name_array_item" + } + } + }, + "name_wrapped_array" : { "type" : "array", "xml" : { - "name" : "tag", + "name" : "xml_name_wrapped_array", "wrapped" : true }, "items" : { - "$ref" : "#/components/schemas/Tag" + "type" : "integer", + "xml" : { + "name" : "xml_name_wrapped_array_item" + } } }, - "status" : { + "prefix_string" : { "type" : "string", - "description" : "pet status in the store", - "enum" : [ "available", "pending", "sold" ] - } - }, - "example" : { - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 + "example" : "string", + "xml" : { + "prefix" : "ab" + } }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" + "prefix_number" : { + "type" : "number", + "example" : 1.234, + "xml" : { + "prefix" : "cd" + } + }, + "prefix_integer" : { + "type" : "integer", + "example" : -2, + "xml" : { + "prefix" : "ef" + } + }, + "prefix_boolean" : { + "type" : "boolean", + "example" : true, + "xml" : { + "prefix" : "gh" + } + }, + "prefix_array" : { + "type" : "array", + "items" : { + "type" : "integer", + "xml" : { + "prefix" : "ij" + } + } + }, + "prefix_wrapped_array" : { + "type" : "array", + "xml" : { + "prefix" : "kl", + "wrapped" : true + }, + "items" : { + "type" : "integer", + "xml" : { + "prefix" : "mn" + } + } + }, + "namespace_string" : { + "type" : "string", + "example" : "string", + "xml" : { + "namespace" : "http://a.com/schema" + } + }, + "namespace_number" : { + "type" : "number", + "example" : 1.234, + "xml" : { + "namespace" : "http://b.com/schema" + } + }, + "namespace_integer" : { + "type" : "integer", + "example" : -2, + "xml" : { + "namespace" : "http://c.com/schema" + } + }, + "namespace_boolean" : { + "type" : "boolean", + "example" : true, + "xml" : { + "namespace" : "http://d.com/schema" + } + }, + "namespace_array" : { + "type" : "array", + "items" : { + "type" : "integer", + "xml" : { + "namespace" : "http://e.com/schema" + } + } + }, + "namespace_wrapped_array" : { + "type" : "array", + "xml" : { + "namespace" : "http://f.com/schema", + "wrapped" : true + }, + "items" : { + "type" : "integer", + "xml" : { + "namespace" : "http://g.com/schema" + } + } + }, + "prefix_ns_string" : { + "type" : "string", + "example" : "string", + "xml" : { + "namespace" : "http://a.com/schema", + "prefix" : "a" + } + }, + "prefix_ns_number" : { + "type" : "number", + "example" : 1.234, + "xml" : { + "namespace" : "http://b.com/schema", + "prefix" : "b" + } + }, + "prefix_ns_integer" : { + "type" : "integer", + "example" : -2, + "xml" : { + "namespace" : "http://c.com/schema", + "prefix" : "c" + } + }, + "prefix_ns_boolean" : { + "type" : "boolean", + "example" : true, + "xml" : { + "namespace" : "http://d.com/schema", + "prefix" : "d" + } + }, + "prefix_ns_array" : { + "type" : "array", + "items" : { + "type" : "integer", + "xml" : { + "namespace" : "http://e.com/schema", + "prefix" : "e" + } + } + }, + "prefix_ns_wrapped_array" : { + "type" : "array", + "xml" : { + "namespace" : "http://f.com/schema", + "prefix" : "f", + "wrapped" : true + }, + "items" : { + "type" : "integer", + "xml" : { + "namespace" : "http://g.com/schema", + "prefix" : "g" + } + } + } }, "xml" : { - "name" : "Pet" + "namespace" : "http://a.com/schema", + "prefix" : "pre" } }, - "hasOnlyReadOnly" : { - "type" : "object", + "Dog_allOf" : { "properties" : { - "bar" : { - "type" : "string", - "readOnly" : true - }, - "foo" : { - "type" : "string", - "readOnly" : true + "breed" : { + "type" : "string" + } + } + }, + "Cat_allOf" : { + "properties" : { + "declawed" : { + "type" : "boolean" } } } @@ -2157,10 +2761,6 @@ } } }, - "http_basic_test" : { - "type" : "http", - "scheme" : "basic" - }, "api_key" : { "type" : "apiKey", "name" : "api_key", @@ -2170,6 +2770,10 @@ "type" : "apiKey", "name" : "api_key_query", "in" : "query" + }, + "http_basic_test" : { + "type" : "http", + "scheme" : "basic" } } } diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-no-bean-validation/.openapi-generator/VERSION index dde25ef08e8c..83a328a9227e 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-no-bean-validation/.openapi-generator/VERSION @@ -1 +1 @@ -3.1.1-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Category.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Category.java index 44eb3a6bf7ab..a4c373424f6f 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Category.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Category.java @@ -11,10 +11,10 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Category { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; public Category id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/ModelApiResponse.java index 81a2333008b7..666fa5ac4a15 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/ModelApiResponse.java @@ -11,13 +11,13 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ModelApiResponse { @JsonProperty("code") - private Integer code = null; + private Integer code; @JsonProperty("type") - private String type = null; + private String type; @JsonProperty("message") - private String message = null; + private String message; public ModelApiResponse code(Integer code) { this.code = code; diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Order.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Order.java index a142a5974261..b6b87b743456 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Order.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Order.java @@ -12,16 +12,16 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Order { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("petId") - private Long petId = null; + private Long petId; @JsonProperty("quantity") - private Integer quantity = null; + private Integer quantity; @JsonProperty("shipDate") - private OffsetDateTime shipDate = null; + private OffsetDateTime shipDate; /** * Order Status @@ -46,18 +46,18 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; @JsonProperty("complete") private Boolean complete = false; diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Pet.java index ec14d76b41f8..bec086aef4ab 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Pet.java @@ -15,13 +15,13 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Pet { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("category") private Category category = null; @JsonProperty("name") - private String name = null; + private String name; @JsonProperty("photoUrls") private List photoUrls = new ArrayList<>(); @@ -52,18 +52,18 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; public Pet id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Tag.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Tag.java index 80b1d783b33e..7d0207c02586 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Tag.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Tag.java @@ -11,10 +11,10 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Tag { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; public Tag id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/User.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/User.java index 221a9f305912..2ef166c28380 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/User.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/User.java @@ -11,28 +11,28 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class User { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("username") - private String username = null; + private String username; @JsonProperty("firstName") - private String firstName = null; + private String firstName; @JsonProperty("lastName") - private String lastName = null; + private String lastName; @JsonProperty("email") - private String email = null; + private String email; @JsonProperty("password") - private String password = null; + private String password; @JsonProperty("phone") - private String phone = null; + private String phone; @JsonProperty("userStatus") - private Integer userStatus = null; + private Integer userStatus; public User id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/PetApiController.java index 63ed0f01c34b..1fa710bf5bc1 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/PetApiController.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/PetApiController.java @@ -35,14 +35,14 @@ private PetApiController(PetApiControllerImpInterface imp) { @ApiAction public Result addPet() throws Exception { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.addPet(pet); + imp.addPet(body); return ok(); } @@ -106,14 +106,14 @@ public Result getPetById(Long petId) throws Exception { @ApiAction public Result updatePet() throws Exception { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.updatePet(pet); + imp.updatePet(body); return ok(); } @@ -124,14 +124,14 @@ public Result updatePetWithForm(Long petId) throws Exception { if (valuename != null) { name = valuename; } else { - name = "null"; + name = null; } String valuestatus = (request().body().asMultipartFormData().asFormUrlEncoded().get("status"))[0]; String status; if (valuestatus != null) { status = valuestatus; } else { - status = "null"; + status = null; } imp.updatePetWithForm(petId, name, status); return ok(); @@ -144,7 +144,7 @@ public Result uploadFile(Long petId) throws Exception { if (valueadditionalMetadata != null) { additionalMetadata = valueadditionalMetadata; } else { - additionalMetadata = "null"; + additionalMetadata = null; } Http.MultipartFormData.FilePart file = request().body().asMultipartFormData().getFile("file"); ModelApiResponse obj = imp.uploadFile(petId, additionalMetadata, file); diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/PetApiControllerImp.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/PetApiControllerImp.java index 6c5234d33bc7..ed9b151a2388 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/PetApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/PetApiControllerImp.java @@ -12,7 +12,7 @@ public class PetApiControllerImp implements PetApiControllerImpInterface { @Override - public void addPet(Pet pet) throws Exception { + public void addPet(Pet body) throws Exception { //Do your magic!!! } @@ -40,7 +40,7 @@ public Pet getPetById(Long petId) throws Exception { } @Override - public void updatePet(Pet pet) throws Exception { + public void updatePet(Pet body) throws Exception { //Do your magic!!! } diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/PetApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/PetApiControllerImpInterface.java index 05a5a2002fb3..144362644aff 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/PetApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/PetApiControllerImpInterface.java @@ -12,7 +12,7 @@ @SuppressWarnings("RedundantThrows") public interface PetApiControllerImpInterface { - void addPet(Pet pet) throws Exception; + void addPet(Pet body) throws Exception; void deletePet(Long petId, String apiKey) throws Exception; @@ -22,7 +22,7 @@ public interface PetApiControllerImpInterface { Pet getPetById(Long petId) throws Exception; - void updatePet(Pet pet) throws Exception; + void updatePet(Pet body) throws Exception; void updatePetWithForm(Long petId, String name, String status) throws Exception; diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/StoreApiController.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/StoreApiController.java index 214a6a6afb46..029baa761df4 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/StoreApiController.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/StoreApiController.java @@ -54,14 +54,14 @@ public Result getOrderById(Long orderId) throws Exception { @ApiAction public Result placeOrder() throws Exception { - JsonNode nodeorder = request().body().asJson(); - Order order; - if (nodeorder != null) { - order = mapper.readValue(nodeorder.toString(), Order.class); + JsonNode nodebody = request().body().asJson(); + Order body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Order.class); } else { - throw new IllegalArgumentException("'Order' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - Order obj = imp.placeOrder(order); + Order obj = imp.placeOrder(body); JsonNode result = mapper.valueToTree(obj); return ok(result); } diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/StoreApiControllerImp.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/StoreApiControllerImp.java index fb964dab3edc..b0d2d8f88a14 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/StoreApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/StoreApiControllerImp.java @@ -28,7 +28,7 @@ public Order getOrderById(Long orderId) throws Exception { } @Override - public Order placeOrder(Order order) throws Exception { + public Order placeOrder(Order body) throws Exception { //Do your magic!!! return new Order(); } diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/StoreApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/StoreApiControllerImpInterface.java index 33f503ffd7fe..7a9c3fd82e85 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/StoreApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/StoreApiControllerImpInterface.java @@ -17,6 +17,6 @@ public interface StoreApiControllerImpInterface { Order getOrderById(Long orderId) throws Exception; - Order placeOrder(Order order) throws Exception; + Order placeOrder(Order body) throws Exception; } diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiController.java index 03e8392793c9..9b78e828229c 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiController.java @@ -34,40 +34,40 @@ private UserApiController(UserApiControllerImpInterface imp) { @ApiAction public Result createUser() throws Exception { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUser(user); + imp.createUser(body); return ok(); } @ApiAction public Result createUsersWithArrayInput() throws Exception { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithArrayInput(user); + imp.createUsersWithArrayInput(body); return ok(); } @ApiAction public Result createUsersWithListInput() throws Exception { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithListInput(user); + imp.createUsersWithListInput(body); return ok(); } @@ -113,14 +113,14 @@ public Result logoutUser() throws Exception { @ApiAction public Result updateUser(String username) throws Exception { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.updateUser(username, user); + imp.updateUser(username, body); return ok(); } } diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiControllerImp.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiControllerImp.java index cc9d1fdc8b45..8bf12fe7c82f 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiControllerImp.java @@ -11,17 +11,17 @@ public class UserApiControllerImp implements UserApiControllerImpInterface { @Override - public void createUser(User user) throws Exception { + public void createUser(User body) throws Exception { //Do your magic!!! } @Override - public void createUsersWithArrayInput(List user) throws Exception { + public void createUsersWithArrayInput(List body) throws Exception { //Do your magic!!! } @Override - public void createUsersWithListInput(List user) throws Exception { + public void createUsersWithListInput(List body) throws Exception { //Do your magic!!! } @@ -48,7 +48,7 @@ public void logoutUser() throws Exception { } @Override - public void updateUser(String username, User user) throws Exception { + public void updateUser(String username, User body) throws Exception { //Do your magic!!! } diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiControllerImpInterface.java index fdb3d301177d..8c5a5ee0af64 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiControllerImpInterface.java @@ -11,11 +11,11 @@ @SuppressWarnings("RedundantThrows") public interface UserApiControllerImpInterface { - void createUser(User user) throws Exception; + void createUser(User body) throws Exception; - void createUsersWithArrayInput(List user) throws Exception; + void createUsersWithArrayInput(List body) throws Exception; - void createUsersWithListInput(List user) throws Exception; + void createUsersWithListInput(List body) throws Exception; void deleteUser(String username) throws Exception; @@ -25,6 +25,6 @@ public interface UserApiControllerImpInterface { void logoutUser() throws Exception; - void updateUser(String username, User user) throws Exception; + void updateUser(String username, User body) throws Exception; } diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/openapitools/OpenAPIUtils.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/openapitools/OpenAPIUtils.java index 0fdd8c3cb4a8..6c40f54de9d6 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/openapitools/OpenAPIUtils.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/openapitools/OpenAPIUtils.java @@ -79,6 +79,6 @@ public static String parameterToString(Object param) { } public static String formatDatetime(Date date) { - return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX").format(date); + return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX", Locale.ROOT).format(date); } -} \ No newline at end of file +} diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/public/openapi.json b/samples/server/petstore/java-play-framework-no-bean-validation/public/openapi.json index ac1d45047828..d536f6b09046 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/public/openapi.json +++ b/samples/server/petstore/java-play-framework-no-bean-validation/public/openapi.json @@ -61,6 +61,7 @@ "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "x-codegen-request-body-name" : "body", "x-contentType" : "application/json", "x-accepts" : "application/json" }, @@ -93,6 +94,7 @@ "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "x-codegen-request-body-name" : "body", "x-contentType" : "application/json", "x-accepts" : "application/json" } @@ -114,8 +116,8 @@ "type" : "array", "items" : { "type" : "string", - "enum" : [ "available", "pending", "sold" ], - "default" : "available" + "default" : "available", + "enum" : [ "available", "pending", "sold" ] } } } ], @@ -446,6 +448,7 @@ "content" : { } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } @@ -545,6 +548,7 @@ "content" : { } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } @@ -574,6 +578,7 @@ "content" : { } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } @@ -603,6 +608,7 @@ "content" : { } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } @@ -759,6 +765,7 @@ "content" : { } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" }, diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-no-exception-handling/.openapi-generator/VERSION index dde25ef08e8c..83a328a9227e 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-no-exception-handling/.openapi-generator/VERSION @@ -1 +1 @@ -3.1.1-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Category.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Category.java index 9f0206575f5c..86c8ed0cdefc 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Category.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Category.java @@ -12,10 +12,10 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Category { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; public Category id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/ModelApiResponse.java index 07493e848250..91638ac8c602 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/ModelApiResponse.java @@ -12,13 +12,13 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ModelApiResponse { @JsonProperty("code") - private Integer code = null; + private Integer code; @JsonProperty("type") - private String type = null; + private String type; @JsonProperty("message") - private String message = null; + private String message; public ModelApiResponse code(Integer code) { this.code = code; diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Order.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Order.java index d1aaa38d0029..91d6d09e7f7e 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Order.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Order.java @@ -13,16 +13,16 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Order { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("petId") - private Long petId = null; + private Long petId; @JsonProperty("quantity") - private Integer quantity = null; + private Integer quantity; @JsonProperty("shipDate") - private OffsetDateTime shipDate = null; + private OffsetDateTime shipDate; /** * Order Status @@ -47,18 +47,18 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; @JsonProperty("complete") private Boolean complete = false; diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Pet.java index 5e5ff3762945..a4e223b2b156 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Pet.java @@ -16,13 +16,13 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Pet { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("category") private Category category = null; @JsonProperty("name") - private String name = null; + private String name; @JsonProperty("photoUrls") private List photoUrls = new ArrayList<>(); @@ -53,18 +53,18 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; public Pet id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Tag.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Tag.java index 15a8774252af..1a9079ff3456 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Tag.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Tag.java @@ -12,10 +12,10 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Tag { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; public Tag id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/User.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/User.java index 689de768893e..8df0a6506702 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/User.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/User.java @@ -12,28 +12,28 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class User { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("username") - private String username = null; + private String username; @JsonProperty("firstName") - private String firstName = null; + private String firstName; @JsonProperty("lastName") - private String lastName = null; + private String lastName; @JsonProperty("email") - private String email = null; + private String email; @JsonProperty("password") - private String password = null; + private String password; @JsonProperty("phone") - private String phone = null; + private String phone; @JsonProperty("userStatus") - private Integer userStatus = null; + private Integer userStatus; public User id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/PetApiController.java index 3bbbe36662a3..f94630bf20c4 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/PetApiController.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/PetApiController.java @@ -40,17 +40,17 @@ private PetApiController(Configuration configuration, PetApiControllerImpInterfa @ApiAction public Result addPet() throws IOException { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(pet); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.addPet(pet); + imp.addPet(body); return ok(); } @@ -127,17 +127,17 @@ public Result getPetById(Long petId) { @ApiAction public Result updatePet() throws IOException { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(pet); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.updatePet(pet); + imp.updatePet(body); return ok(); } @@ -148,14 +148,14 @@ public Result updatePetWithForm(Long petId) { if (valuename != null) { name = valuename; } else { - name = "null"; + name = null; } String valuestatus = (request().body().asMultipartFormData().asFormUrlEncoded().get("status"))[0]; String status; if (valuestatus != null) { status = valuestatus; } else { - status = "null"; + status = null; } imp.updatePetWithForm(petId, name, status); return ok(); @@ -168,7 +168,7 @@ public Result uploadFile(Long petId) { if (valueadditionalMetadata != null) { additionalMetadata = valueadditionalMetadata; } else { - additionalMetadata = "null"; + additionalMetadata = null; } Http.MultipartFormData.FilePart file = request().body().asMultipartFormData().getFile("file"); ModelApiResponse obj = imp.uploadFile(petId, additionalMetadata, file); diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/PetApiControllerImp.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/PetApiControllerImp.java index 2e129c9336f1..e8d4a8b504a1 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/PetApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/PetApiControllerImp.java @@ -13,7 +13,7 @@ public class PetApiControllerImp implements PetApiControllerImpInterface { @Override - public void addPet(Pet pet) { + public void addPet(Pet body) { //Do your magic!!! } @@ -41,7 +41,7 @@ public Pet getPetById(Long petId) { } @Override - public void updatePet(Pet pet) { + public void updatePet(Pet body) { //Do your magic!!! } diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/PetApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/PetApiControllerImpInterface.java index eaa035009c25..6efc073d0f28 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/PetApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/PetApiControllerImpInterface.java @@ -13,7 +13,7 @@ @SuppressWarnings("RedundantThrows") public interface PetApiControllerImpInterface { - void addPet(Pet pet) ; + void addPet(Pet body) ; void deletePet(Long petId, String apiKey) ; @@ -23,7 +23,7 @@ public interface PetApiControllerImpInterface { Pet getPetById(Long petId) ; - void updatePet(Pet pet) ; + void updatePet(Pet body) ; void updatePetWithForm(Long petId, String name, String status) ; diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/StoreApiController.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/StoreApiController.java index 0a29344d5eac..0836d1945e21 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/StoreApiController.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/StoreApiController.java @@ -62,17 +62,17 @@ public Result getOrderById( @Min(1) @Max(5)Long orderId) { @ApiAction public Result placeOrder() throws IOException { - JsonNode nodeorder = request().body().asJson(); - Order order; - if (nodeorder != null) { - order = mapper.readValue(nodeorder.toString(), Order.class); + JsonNode nodebody = request().body().asJson(); + Order body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Order.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(order); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Order' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - Order obj = imp.placeOrder(order); + Order obj = imp.placeOrder(body); if (configuration.getBoolean("useOutputBeanValidation")) { OpenAPIUtils.validate(obj); } diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/StoreApiControllerImp.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/StoreApiControllerImp.java index e5cab1016f2c..6406ee40e1fe 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/StoreApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/StoreApiControllerImp.java @@ -29,7 +29,7 @@ public Order getOrderById( @Min(1) @Max(5)Long orderId) { } @Override - public Order placeOrder(Order order) { + public Order placeOrder(Order body) { //Do your magic!!! return new Order(); } diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/StoreApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/StoreApiControllerImpInterface.java index 9a61d254de2a..70d313028c6e 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/StoreApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/StoreApiControllerImpInterface.java @@ -18,6 +18,6 @@ public interface StoreApiControllerImpInterface { Order getOrderById( @Min(1) @Max(5)Long orderId) ; - Order placeOrder(Order order) ; + Order placeOrder(Order body) ; } diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiController.java index 1b5d4522954a..07e8f8316181 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiController.java @@ -39,53 +39,53 @@ private UserApiController(Configuration configuration, UserApiControllerImpInter @ApiAction public Result createUser() throws IOException { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(user); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUser(user); + imp.createUser(body); return ok(); } @ApiAction public Result createUsersWithArrayInput() throws IOException { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); if (configuration.getBoolean("useInputBeanValidation")) { - for (User curItem : user) { + for (User curItem : body) { OpenAPIUtils.validate(curItem); } } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithArrayInput(user); + imp.createUsersWithArrayInput(body); return ok(); } @ApiAction public Result createUsersWithListInput() throws IOException { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); if (configuration.getBoolean("useInputBeanValidation")) { - for (User curItem : user) { + for (User curItem : body) { OpenAPIUtils.validate(curItem); } } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithListInput(user); + imp.createUsersWithListInput(body); return ok(); } @@ -134,17 +134,17 @@ public Result logoutUser() { @ApiAction public Result updateUser(String username) throws IOException { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(user); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.updateUser(username, user); + imp.updateUser(username, body); return ok(); } } diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiControllerImp.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiControllerImp.java index 979dfab18ac9..a6a588b6c8e2 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiControllerImp.java @@ -12,17 +12,17 @@ public class UserApiControllerImp implements UserApiControllerImpInterface { @Override - public void createUser(User user) { + public void createUser(User body) { //Do your magic!!! } @Override - public void createUsersWithArrayInput(List user) { + public void createUsersWithArrayInput(List body) { //Do your magic!!! } @Override - public void createUsersWithListInput(List user) { + public void createUsersWithListInput(List body) { //Do your magic!!! } @@ -49,7 +49,7 @@ public void logoutUser() { } @Override - public void updateUser(String username, User user) { + public void updateUser(String username, User body) { //Do your magic!!! } diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiControllerImpInterface.java index 3d48559fd3ef..c79d4b93820f 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiControllerImpInterface.java @@ -12,11 +12,11 @@ @SuppressWarnings("RedundantThrows") public interface UserApiControllerImpInterface { - void createUser(User user) ; + void createUser(User body) ; - void createUsersWithArrayInput(List user) ; + void createUsersWithArrayInput(List body) ; - void createUsersWithListInput(List user) ; + void createUsersWithListInput(List body) ; void deleteUser(String username) ; @@ -26,6 +26,6 @@ public interface UserApiControllerImpInterface { void logoutUser() ; - void updateUser(String username, User user) ; + void updateUser(String username, User body) ; } diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/openapitools/OpenAPIUtils.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/openapitools/OpenAPIUtils.java index c707ca74ac7e..385ef97a0083 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/openapitools/OpenAPIUtils.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/openapitools/OpenAPIUtils.java @@ -98,6 +98,6 @@ public static String parameterToString(Object param) { } public static String formatDatetime(Date date) { - return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX").format(date); + return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX", Locale.ROOT).format(date); } -} \ No newline at end of file +} diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/public/openapi.json b/samples/server/petstore/java-play-framework-no-exception-handling/public/openapi.json index ac1d45047828..d536f6b09046 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/public/openapi.json +++ b/samples/server/petstore/java-play-framework-no-exception-handling/public/openapi.json @@ -61,6 +61,7 @@ "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "x-codegen-request-body-name" : "body", "x-contentType" : "application/json", "x-accepts" : "application/json" }, @@ -93,6 +94,7 @@ "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "x-codegen-request-body-name" : "body", "x-contentType" : "application/json", "x-accepts" : "application/json" } @@ -114,8 +116,8 @@ "type" : "array", "items" : { "type" : "string", - "enum" : [ "available", "pending", "sold" ], - "default" : "available" + "default" : "available", + "enum" : [ "available", "pending", "sold" ] } } } ], @@ -446,6 +448,7 @@ "content" : { } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } @@ -545,6 +548,7 @@ "content" : { } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } @@ -574,6 +578,7 @@ "content" : { } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } @@ -603,6 +608,7 @@ "content" : { } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } @@ -759,6 +765,7 @@ "content" : { } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" }, diff --git a/samples/server/petstore/java-play-framework-no-interface/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-no-interface/.openapi-generator/VERSION index dde25ef08e8c..83a328a9227e 100644 --- a/samples/server/petstore/java-play-framework-no-interface/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-no-interface/.openapi-generator/VERSION @@ -1 +1 @@ -3.1.1-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Category.java b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Category.java index 9f0206575f5c..86c8ed0cdefc 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Category.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Category.java @@ -12,10 +12,10 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Category { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; public Category id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/ModelApiResponse.java index 07493e848250..91638ac8c602 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/ModelApiResponse.java @@ -12,13 +12,13 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ModelApiResponse { @JsonProperty("code") - private Integer code = null; + private Integer code; @JsonProperty("type") - private String type = null; + private String type; @JsonProperty("message") - private String message = null; + private String message; public ModelApiResponse code(Integer code) { this.code = code; diff --git a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Order.java b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Order.java index d1aaa38d0029..91d6d09e7f7e 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Order.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Order.java @@ -13,16 +13,16 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Order { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("petId") - private Long petId = null; + private Long petId; @JsonProperty("quantity") - private Integer quantity = null; + private Integer quantity; @JsonProperty("shipDate") - private OffsetDateTime shipDate = null; + private OffsetDateTime shipDate; /** * Order Status @@ -47,18 +47,18 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; @JsonProperty("complete") private Boolean complete = false; diff --git a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Pet.java index 5e5ff3762945..a4e223b2b156 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Pet.java @@ -16,13 +16,13 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Pet { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("category") private Category category = null; @JsonProperty("name") - private String name = null; + private String name; @JsonProperty("photoUrls") private List photoUrls = new ArrayList<>(); @@ -53,18 +53,18 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; public Pet id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Tag.java b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Tag.java index 15a8774252af..1a9079ff3456 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Tag.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Tag.java @@ -12,10 +12,10 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Tag { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; public Tag id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/User.java b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/User.java index 689de768893e..8df0a6506702 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/User.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/User.java @@ -12,28 +12,28 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class User { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("username") - private String username = null; + private String username; @JsonProperty("firstName") - private String firstName = null; + private String firstName; @JsonProperty("lastName") - private String lastName = null; + private String lastName; @JsonProperty("email") - private String email = null; + private String email; @JsonProperty("password") - private String password = null; + private String password; @JsonProperty("phone") - private String phone = null; + private String phone; @JsonProperty("userStatus") - private Integer userStatus = null; + private Integer userStatus; public User id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-interface/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework-no-interface/app/controllers/PetApiController.java index 74dc88d8ad67..dc9fa0cbbdf1 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/controllers/PetApiController.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/controllers/PetApiController.java @@ -39,17 +39,17 @@ private PetApiController(Configuration configuration, PetApiControllerImp imp) { @ApiAction public Result addPet() throws Exception { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(pet); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.addPet(pet); + imp.addPet(body); return ok(); } @@ -126,17 +126,17 @@ public Result getPetById(Long petId) throws Exception { @ApiAction public Result updatePet() throws Exception { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(pet); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.updatePet(pet); + imp.updatePet(body); return ok(); } @@ -147,14 +147,14 @@ public Result updatePetWithForm(Long petId) throws Exception { if (valuename != null) { name = valuename; } else { - name = "null"; + name = null; } String valuestatus = (request().body().asMultipartFormData().asFormUrlEncoded().get("status"))[0]; String status; if (valuestatus != null) { status = valuestatus; } else { - status = "null"; + status = null; } imp.updatePetWithForm(petId, name, status); return ok(); @@ -167,7 +167,7 @@ public Result uploadFile(Long petId) throws Exception { if (valueadditionalMetadata != null) { additionalMetadata = valueadditionalMetadata; } else { - additionalMetadata = "null"; + additionalMetadata = null; } Http.MultipartFormData.FilePart file = request().body().asMultipartFormData().getFile("file"); ModelApiResponse obj = imp.uploadFile(petId, additionalMetadata, file); diff --git a/samples/server/petstore/java-play-framework-no-interface/app/controllers/PetApiControllerImp.java b/samples/server/petstore/java-play-framework-no-interface/app/controllers/PetApiControllerImp.java index 15bee18486e5..3af35ea53033 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/controllers/PetApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/controllers/PetApiControllerImp.java @@ -13,7 +13,7 @@ public class PetApiControllerImp { - public void addPet(Pet pet) throws Exception { + public void addPet(Pet body) throws Exception { //Do your magic!!! } @@ -41,7 +41,7 @@ public Pet getPetById(Long petId) throws Exception { } - public void updatePet(Pet pet) throws Exception { + public void updatePet(Pet body) throws Exception { //Do your magic!!! } diff --git a/samples/server/petstore/java-play-framework-no-interface/app/controllers/StoreApiController.java b/samples/server/petstore/java-play-framework-no-interface/app/controllers/StoreApiController.java index e84ba99993d3..db21a0523d9e 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/controllers/StoreApiController.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/controllers/StoreApiController.java @@ -61,17 +61,17 @@ public Result getOrderById( @Min(1) @Max(5)Long orderId) throws Exception { @ApiAction public Result placeOrder() throws Exception { - JsonNode nodeorder = request().body().asJson(); - Order order; - if (nodeorder != null) { - order = mapper.readValue(nodeorder.toString(), Order.class); + JsonNode nodebody = request().body().asJson(); + Order body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Order.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(order); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Order' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - Order obj = imp.placeOrder(order); + Order obj = imp.placeOrder(body); if (configuration.getBoolean("useOutputBeanValidation")) { OpenAPIUtils.validate(obj); } diff --git a/samples/server/petstore/java-play-framework-no-interface/app/controllers/StoreApiControllerImp.java b/samples/server/petstore/java-play-framework-no-interface/app/controllers/StoreApiControllerImp.java index 5ee1178d5ffd..119afe97fbff 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/controllers/StoreApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/controllers/StoreApiControllerImp.java @@ -29,7 +29,7 @@ public Order getOrderById( @Min(1) @Max(5)Long orderId) throws Exception { } - public Order placeOrder(Order order) throws Exception { + public Order placeOrder(Order body) throws Exception { //Do your magic!!! return new Order(); } diff --git a/samples/server/petstore/java-play-framework-no-interface/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-no-interface/app/controllers/UserApiController.java index d0e01ef7720b..d4365213a672 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/controllers/UserApiController.java @@ -38,53 +38,53 @@ private UserApiController(Configuration configuration, UserApiControllerImp imp) @ApiAction public Result createUser() throws Exception { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(user); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUser(user); + imp.createUser(body); return ok(); } @ApiAction public Result createUsersWithArrayInput() throws Exception { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); if (configuration.getBoolean("useInputBeanValidation")) { - for (User curItem : user) { + for (User curItem : body) { OpenAPIUtils.validate(curItem); } } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithArrayInput(user); + imp.createUsersWithArrayInput(body); return ok(); } @ApiAction public Result createUsersWithListInput() throws Exception { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); if (configuration.getBoolean("useInputBeanValidation")) { - for (User curItem : user) { + for (User curItem : body) { OpenAPIUtils.validate(curItem); } } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithListInput(user); + imp.createUsersWithListInput(body); return ok(); } @@ -133,17 +133,17 @@ public Result logoutUser() throws Exception { @ApiAction public Result updateUser(String username) throws Exception { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(user); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.updateUser(username, user); + imp.updateUser(username, body); return ok(); } } diff --git a/samples/server/petstore/java-play-framework-no-interface/app/controllers/UserApiControllerImp.java b/samples/server/petstore/java-play-framework-no-interface/app/controllers/UserApiControllerImp.java index f4e968cc679e..569811fe0954 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/controllers/UserApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/controllers/UserApiControllerImp.java @@ -12,17 +12,17 @@ public class UserApiControllerImp { - public void createUser(User user) throws Exception { + public void createUser(User body) throws Exception { //Do your magic!!! } - public void createUsersWithArrayInput(List user) throws Exception { + public void createUsersWithArrayInput(List body) throws Exception { //Do your magic!!! } - public void createUsersWithListInput(List user) throws Exception { + public void createUsersWithListInput(List body) throws Exception { //Do your magic!!! } @@ -49,7 +49,7 @@ public void logoutUser() throws Exception { } - public void updateUser(String username, User user) throws Exception { + public void updateUser(String username, User body) throws Exception { //Do your magic!!! } diff --git a/samples/server/petstore/java-play-framework-no-interface/app/openapitools/OpenAPIUtils.java b/samples/server/petstore/java-play-framework-no-interface/app/openapitools/OpenAPIUtils.java index c707ca74ac7e..385ef97a0083 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/openapitools/OpenAPIUtils.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/openapitools/OpenAPIUtils.java @@ -98,6 +98,6 @@ public static String parameterToString(Object param) { } public static String formatDatetime(Date date) { - return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX").format(date); + return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX", Locale.ROOT).format(date); } -} \ No newline at end of file +} diff --git a/samples/server/petstore/java-play-framework-no-interface/public/openapi.json b/samples/server/petstore/java-play-framework-no-interface/public/openapi.json index ac1d45047828..d536f6b09046 100644 --- a/samples/server/petstore/java-play-framework-no-interface/public/openapi.json +++ b/samples/server/petstore/java-play-framework-no-interface/public/openapi.json @@ -61,6 +61,7 @@ "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "x-codegen-request-body-name" : "body", "x-contentType" : "application/json", "x-accepts" : "application/json" }, @@ -93,6 +94,7 @@ "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "x-codegen-request-body-name" : "body", "x-contentType" : "application/json", "x-accepts" : "application/json" } @@ -114,8 +116,8 @@ "type" : "array", "items" : { "type" : "string", - "enum" : [ "available", "pending", "sold" ], - "default" : "available" + "default" : "available", + "enum" : [ "available", "pending", "sold" ] } } } ], @@ -446,6 +448,7 @@ "content" : { } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } @@ -545,6 +548,7 @@ "content" : { } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } @@ -574,6 +578,7 @@ "content" : { } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } @@ -603,6 +608,7 @@ "content" : { } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } @@ -759,6 +765,7 @@ "content" : { } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" }, diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-no-swagger-ui/.openapi-generator/VERSION index dde25ef08e8c..83a328a9227e 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/.openapi-generator/VERSION @@ -1 +1 @@ -3.1.1-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Category.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Category.java index 9f0206575f5c..86c8ed0cdefc 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Category.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Category.java @@ -12,10 +12,10 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Category { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; public Category id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/ModelApiResponse.java index 07493e848250..91638ac8c602 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/ModelApiResponse.java @@ -12,13 +12,13 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ModelApiResponse { @JsonProperty("code") - private Integer code = null; + private Integer code; @JsonProperty("type") - private String type = null; + private String type; @JsonProperty("message") - private String message = null; + private String message; public ModelApiResponse code(Integer code) { this.code = code; diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Order.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Order.java index d1aaa38d0029..91d6d09e7f7e 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Order.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Order.java @@ -13,16 +13,16 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Order { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("petId") - private Long petId = null; + private Long petId; @JsonProperty("quantity") - private Integer quantity = null; + private Integer quantity; @JsonProperty("shipDate") - private OffsetDateTime shipDate = null; + private OffsetDateTime shipDate; /** * Order Status @@ -47,18 +47,18 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; @JsonProperty("complete") private Boolean complete = false; diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Pet.java index 5e5ff3762945..a4e223b2b156 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Pet.java @@ -16,13 +16,13 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Pet { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("category") private Category category = null; @JsonProperty("name") - private String name = null; + private String name; @JsonProperty("photoUrls") private List photoUrls = new ArrayList<>(); @@ -53,18 +53,18 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; public Pet id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Tag.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Tag.java index 15a8774252af..1a9079ff3456 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Tag.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Tag.java @@ -12,10 +12,10 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Tag { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; public Tag id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/User.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/User.java index 689de768893e..8df0a6506702 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/User.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/User.java @@ -12,28 +12,28 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class User { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("username") - private String username = null; + private String username; @JsonProperty("firstName") - private String firstName = null; + private String firstName; @JsonProperty("lastName") - private String lastName = null; + private String lastName; @JsonProperty("email") - private String email = null; + private String email; @JsonProperty("password") - private String password = null; + private String password; @JsonProperty("phone") - private String phone = null; + private String phone; @JsonProperty("userStatus") - private Integer userStatus = null; + private Integer userStatus; public User id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/PetApiController.java index 8dff19402378..1344ffe7afb1 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/PetApiController.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/PetApiController.java @@ -39,17 +39,17 @@ private PetApiController(Configuration configuration, PetApiControllerImpInterfa @ApiAction public Result addPet() throws Exception { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(pet); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.addPet(pet); + imp.addPet(body); return ok(); } @@ -126,17 +126,17 @@ public Result getPetById(Long petId) throws Exception { @ApiAction public Result updatePet() throws Exception { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(pet); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.updatePet(pet); + imp.updatePet(body); return ok(); } @@ -147,14 +147,14 @@ public Result updatePetWithForm(Long petId) throws Exception { if (valuename != null) { name = valuename; } else { - name = "null"; + name = null; } String valuestatus = (request().body().asMultipartFormData().asFormUrlEncoded().get("status"))[0]; String status; if (valuestatus != null) { status = valuestatus; } else { - status = "null"; + status = null; } imp.updatePetWithForm(petId, name, status); return ok(); @@ -167,7 +167,7 @@ public Result uploadFile(Long petId) throws Exception { if (valueadditionalMetadata != null) { additionalMetadata = valueadditionalMetadata; } else { - additionalMetadata = "null"; + additionalMetadata = null; } Http.MultipartFormData.FilePart file = request().body().asMultipartFormData().getFile("file"); ModelApiResponse obj = imp.uploadFile(petId, additionalMetadata, file); diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/PetApiControllerImp.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/PetApiControllerImp.java index 2cd201c4bc35..c025993f7c13 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/PetApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/PetApiControllerImp.java @@ -13,7 +13,7 @@ public class PetApiControllerImp implements PetApiControllerImpInterface { @Override - public void addPet(Pet pet) throws Exception { + public void addPet(Pet body) throws Exception { //Do your magic!!! } @@ -41,7 +41,7 @@ public Pet getPetById(Long petId) throws Exception { } @Override - public void updatePet(Pet pet) throws Exception { + public void updatePet(Pet body) throws Exception { //Do your magic!!! } diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/PetApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/PetApiControllerImpInterface.java index 961632675800..307c6c18cfb9 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/PetApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/PetApiControllerImpInterface.java @@ -13,7 +13,7 @@ @SuppressWarnings("RedundantThrows") public interface PetApiControllerImpInterface { - void addPet(Pet pet) throws Exception; + void addPet(Pet body) throws Exception; void deletePet(Long petId, String apiKey) throws Exception; @@ -23,7 +23,7 @@ public interface PetApiControllerImpInterface { Pet getPetById(Long petId) throws Exception; - void updatePet(Pet pet) throws Exception; + void updatePet(Pet body) throws Exception; void updatePetWithForm(Long petId, String name, String status) throws Exception; diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/StoreApiController.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/StoreApiController.java index 03d64c1346ca..831f15dfe3c7 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/StoreApiController.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/StoreApiController.java @@ -61,17 +61,17 @@ public Result getOrderById( @Min(1) @Max(5)Long orderId) throws Exception { @ApiAction public Result placeOrder() throws Exception { - JsonNode nodeorder = request().body().asJson(); - Order order; - if (nodeorder != null) { - order = mapper.readValue(nodeorder.toString(), Order.class); + JsonNode nodebody = request().body().asJson(); + Order body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Order.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(order); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Order' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - Order obj = imp.placeOrder(order); + Order obj = imp.placeOrder(body); if (configuration.getBoolean("useOutputBeanValidation")) { OpenAPIUtils.validate(obj); } diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/StoreApiControllerImp.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/StoreApiControllerImp.java index f2ededef32fc..7c57d3d096c4 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/StoreApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/StoreApiControllerImp.java @@ -29,7 +29,7 @@ public Order getOrderById( @Min(1) @Max(5)Long orderId) throws Exception { } @Override - public Order placeOrder(Order order) throws Exception { + public Order placeOrder(Order body) throws Exception { //Do your magic!!! return new Order(); } diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/StoreApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/StoreApiControllerImpInterface.java index 4a8c5d27d405..b42e4d6d3d02 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/StoreApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/StoreApiControllerImpInterface.java @@ -18,6 +18,6 @@ public interface StoreApiControllerImpInterface { Order getOrderById( @Min(1) @Max(5)Long orderId) throws Exception; - Order placeOrder(Order order) throws Exception; + Order placeOrder(Order body) throws Exception; } diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiController.java index 439fa190f586..aa3bbd80ba15 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiController.java @@ -38,53 +38,53 @@ private UserApiController(Configuration configuration, UserApiControllerImpInter @ApiAction public Result createUser() throws Exception { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(user); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUser(user); + imp.createUser(body); return ok(); } @ApiAction public Result createUsersWithArrayInput() throws Exception { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); if (configuration.getBoolean("useInputBeanValidation")) { - for (User curItem : user) { + for (User curItem : body) { OpenAPIUtils.validate(curItem); } } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithArrayInput(user); + imp.createUsersWithArrayInput(body); return ok(); } @ApiAction public Result createUsersWithListInput() throws Exception { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); if (configuration.getBoolean("useInputBeanValidation")) { - for (User curItem : user) { + for (User curItem : body) { OpenAPIUtils.validate(curItem); } } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithListInput(user); + imp.createUsersWithListInput(body); return ok(); } @@ -133,17 +133,17 @@ public Result logoutUser() throws Exception { @ApiAction public Result updateUser(String username) throws Exception { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(user); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.updateUser(username, user); + imp.updateUser(username, body); return ok(); } } diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiControllerImp.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiControllerImp.java index 63aafa7df25f..0ea7a808b9a4 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiControllerImp.java @@ -12,17 +12,17 @@ public class UserApiControllerImp implements UserApiControllerImpInterface { @Override - public void createUser(User user) throws Exception { + public void createUser(User body) throws Exception { //Do your magic!!! } @Override - public void createUsersWithArrayInput(List user) throws Exception { + public void createUsersWithArrayInput(List body) throws Exception { //Do your magic!!! } @Override - public void createUsersWithListInput(List user) throws Exception { + public void createUsersWithListInput(List body) throws Exception { //Do your magic!!! } @@ -49,7 +49,7 @@ public void logoutUser() throws Exception { } @Override - public void updateUser(String username, User user) throws Exception { + public void updateUser(String username, User body) throws Exception { //Do your magic!!! } diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiControllerImpInterface.java index ee09b11e325f..1290c84835fb 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiControllerImpInterface.java @@ -12,11 +12,11 @@ @SuppressWarnings("RedundantThrows") public interface UserApiControllerImpInterface { - void createUser(User user) throws Exception; + void createUser(User body) throws Exception; - void createUsersWithArrayInput(List user) throws Exception; + void createUsersWithArrayInput(List body) throws Exception; - void createUsersWithListInput(List user) throws Exception; + void createUsersWithListInput(List body) throws Exception; void deleteUser(String username) throws Exception; @@ -26,6 +26,6 @@ public interface UserApiControllerImpInterface { void logoutUser() throws Exception; - void updateUser(String username, User user) throws Exception; + void updateUser(String username, User body) throws Exception; } diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/openapitools/OpenAPIUtils.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/openapitools/OpenAPIUtils.java index c707ca74ac7e..385ef97a0083 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/openapitools/OpenAPIUtils.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/openapitools/OpenAPIUtils.java @@ -98,6 +98,6 @@ public static String parameterToString(Object param) { } public static String formatDatetime(Date date) { - return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX").format(date); + return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX", Locale.ROOT).format(date); } -} \ No newline at end of file +} diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-no-wrap-calls/.openapi-generator/VERSION index dde25ef08e8c..83a328a9227e 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/.openapi-generator/VERSION @@ -1 +1 @@ -3.1.1-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Category.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Category.java index 9f0206575f5c..86c8ed0cdefc 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Category.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Category.java @@ -12,10 +12,10 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Category { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; public Category id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/ModelApiResponse.java index 07493e848250..91638ac8c602 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/ModelApiResponse.java @@ -12,13 +12,13 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ModelApiResponse { @JsonProperty("code") - private Integer code = null; + private Integer code; @JsonProperty("type") - private String type = null; + private String type; @JsonProperty("message") - private String message = null; + private String message; public ModelApiResponse code(Integer code) { this.code = code; diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Order.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Order.java index d1aaa38d0029..91d6d09e7f7e 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Order.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Order.java @@ -13,16 +13,16 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Order { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("petId") - private Long petId = null; + private Long petId; @JsonProperty("quantity") - private Integer quantity = null; + private Integer quantity; @JsonProperty("shipDate") - private OffsetDateTime shipDate = null; + private OffsetDateTime shipDate; /** * Order Status @@ -47,18 +47,18 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; @JsonProperty("complete") private Boolean complete = false; diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Pet.java index 5e5ff3762945..a4e223b2b156 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Pet.java @@ -16,13 +16,13 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Pet { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("category") private Category category = null; @JsonProperty("name") - private String name = null; + private String name; @JsonProperty("photoUrls") private List photoUrls = new ArrayList<>(); @@ -53,18 +53,18 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; public Pet id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Tag.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Tag.java index 15a8774252af..1a9079ff3456 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Tag.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Tag.java @@ -12,10 +12,10 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Tag { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; public Tag id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/User.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/User.java index 689de768893e..8df0a6506702 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/User.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/User.java @@ -12,28 +12,28 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class User { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("username") - private String username = null; + private String username; @JsonProperty("firstName") - private String firstName = null; + private String firstName; @JsonProperty("lastName") - private String lastName = null; + private String lastName; @JsonProperty("email") - private String email = null; + private String email; @JsonProperty("password") - private String password = null; + private String password; @JsonProperty("phone") - private String phone = null; + private String phone; @JsonProperty("userStatus") - private Integer userStatus = null; + private Integer userStatus; public User id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/PetApiController.java index 9e1c362bfb08..9059f7e2d912 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/PetApiController.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/PetApiController.java @@ -38,17 +38,17 @@ private PetApiController(Configuration configuration, PetApiControllerImpInterfa public Result addPet() throws Exception { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(pet); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.addPet(pet); + imp.addPet(body); return ok(); } @@ -125,17 +125,17 @@ public Result getPetById(Long petId) throws Exception { public Result updatePet() throws Exception { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(pet); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.updatePet(pet); + imp.updatePet(body); return ok(); } @@ -146,14 +146,14 @@ public Result updatePetWithForm(Long petId) throws Exception { if (valuename != null) { name = valuename; } else { - name = "null"; + name = null; } String valuestatus = (request().body().asMultipartFormData().asFormUrlEncoded().get("status"))[0]; String status; if (valuestatus != null) { status = valuestatus; } else { - status = "null"; + status = null; } imp.updatePetWithForm(petId, name, status); return ok(); @@ -166,7 +166,7 @@ public Result uploadFile(Long petId) throws Exception { if (valueadditionalMetadata != null) { additionalMetadata = valueadditionalMetadata; } else { - additionalMetadata = "null"; + additionalMetadata = null; } Http.MultipartFormData.FilePart file = request().body().asMultipartFormData().getFile("file"); ModelApiResponse obj = imp.uploadFile(petId, additionalMetadata, file); diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/PetApiControllerImp.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/PetApiControllerImp.java index 2cd201c4bc35..c025993f7c13 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/PetApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/PetApiControllerImp.java @@ -13,7 +13,7 @@ public class PetApiControllerImp implements PetApiControllerImpInterface { @Override - public void addPet(Pet pet) throws Exception { + public void addPet(Pet body) throws Exception { //Do your magic!!! } @@ -41,7 +41,7 @@ public Pet getPetById(Long petId) throws Exception { } @Override - public void updatePet(Pet pet) throws Exception { + public void updatePet(Pet body) throws Exception { //Do your magic!!! } diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/PetApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/PetApiControllerImpInterface.java index 961632675800..307c6c18cfb9 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/PetApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/PetApiControllerImpInterface.java @@ -13,7 +13,7 @@ @SuppressWarnings("RedundantThrows") public interface PetApiControllerImpInterface { - void addPet(Pet pet) throws Exception; + void addPet(Pet body) throws Exception; void deletePet(Long petId, String apiKey) throws Exception; @@ -23,7 +23,7 @@ public interface PetApiControllerImpInterface { Pet getPetById(Long petId) throws Exception; - void updatePet(Pet pet) throws Exception; + void updatePet(Pet body) throws Exception; void updatePetWithForm(Long petId, String name, String status) throws Exception; diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/StoreApiController.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/StoreApiController.java index 5c73582f93d2..da1876d0b998 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/StoreApiController.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/StoreApiController.java @@ -60,17 +60,17 @@ public Result getOrderById( @Min(1) @Max(5)Long orderId) throws Exception { public Result placeOrder() throws Exception { - JsonNode nodeorder = request().body().asJson(); - Order order; - if (nodeorder != null) { - order = mapper.readValue(nodeorder.toString(), Order.class); + JsonNode nodebody = request().body().asJson(); + Order body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Order.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(order); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Order' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - Order obj = imp.placeOrder(order); + Order obj = imp.placeOrder(body); if (configuration.getBoolean("useOutputBeanValidation")) { OpenAPIUtils.validate(obj); } diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/StoreApiControllerImp.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/StoreApiControllerImp.java index f2ededef32fc..7c57d3d096c4 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/StoreApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/StoreApiControllerImp.java @@ -29,7 +29,7 @@ public Order getOrderById( @Min(1) @Max(5)Long orderId) throws Exception { } @Override - public Order placeOrder(Order order) throws Exception { + public Order placeOrder(Order body) throws Exception { //Do your magic!!! return new Order(); } diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/StoreApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/StoreApiControllerImpInterface.java index 4a8c5d27d405..b42e4d6d3d02 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/StoreApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/StoreApiControllerImpInterface.java @@ -18,6 +18,6 @@ public interface StoreApiControllerImpInterface { Order getOrderById( @Min(1) @Max(5)Long orderId) throws Exception; - Order placeOrder(Order order) throws Exception; + Order placeOrder(Order body) throws Exception; } diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiController.java index 9dd1065fa8ea..6bb020422605 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiController.java @@ -37,53 +37,53 @@ private UserApiController(Configuration configuration, UserApiControllerImpInter public Result createUser() throws Exception { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(user); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUser(user); + imp.createUser(body); return ok(); } public Result createUsersWithArrayInput() throws Exception { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); if (configuration.getBoolean("useInputBeanValidation")) { - for (User curItem : user) { + for (User curItem : body) { OpenAPIUtils.validate(curItem); } } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithArrayInput(user); + imp.createUsersWithArrayInput(body); return ok(); } public Result createUsersWithListInput() throws Exception { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); if (configuration.getBoolean("useInputBeanValidation")) { - for (User curItem : user) { + for (User curItem : body) { OpenAPIUtils.validate(curItem); } } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithListInput(user); + imp.createUsersWithListInput(body); return ok(); } @@ -132,17 +132,17 @@ public Result logoutUser() throws Exception { public Result updateUser(String username) throws Exception { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(user); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.updateUser(username, user); + imp.updateUser(username, body); return ok(); } } diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiControllerImp.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiControllerImp.java index 63aafa7df25f..0ea7a808b9a4 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiControllerImp.java @@ -12,17 +12,17 @@ public class UserApiControllerImp implements UserApiControllerImpInterface { @Override - public void createUser(User user) throws Exception { + public void createUser(User body) throws Exception { //Do your magic!!! } @Override - public void createUsersWithArrayInput(List user) throws Exception { + public void createUsersWithArrayInput(List body) throws Exception { //Do your magic!!! } @Override - public void createUsersWithListInput(List user) throws Exception { + public void createUsersWithListInput(List body) throws Exception { //Do your magic!!! } @@ -49,7 +49,7 @@ public void logoutUser() throws Exception { } @Override - public void updateUser(String username, User user) throws Exception { + public void updateUser(String username, User body) throws Exception { //Do your magic!!! } diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiControllerImpInterface.java index ee09b11e325f..1290c84835fb 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiControllerImpInterface.java @@ -12,11 +12,11 @@ @SuppressWarnings("RedundantThrows") public interface UserApiControllerImpInterface { - void createUser(User user) throws Exception; + void createUser(User body) throws Exception; - void createUsersWithArrayInput(List user) throws Exception; + void createUsersWithArrayInput(List body) throws Exception; - void createUsersWithListInput(List user) throws Exception; + void createUsersWithListInput(List body) throws Exception; void deleteUser(String username) throws Exception; @@ -26,6 +26,6 @@ public interface UserApiControllerImpInterface { void logoutUser() throws Exception; - void updateUser(String username, User user) throws Exception; + void updateUser(String username, User body) throws Exception; } diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/openapitools/OpenAPIUtils.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/openapitools/OpenAPIUtils.java index fca771cfb00a..aff8786b457a 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/openapitools/OpenAPIUtils.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/openapitools/OpenAPIUtils.java @@ -93,6 +93,6 @@ public static String parameterToString(Object param) { } public static String formatDatetime(Date date) { - return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX").format(date); + return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX", Locale.ROOT).format(date); } -} \ No newline at end of file +} diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/public/openapi.json b/samples/server/petstore/java-play-framework-no-wrap-calls/public/openapi.json index ac1d45047828..d536f6b09046 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/public/openapi.json +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/public/openapi.json @@ -61,6 +61,7 @@ "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "x-codegen-request-body-name" : "body", "x-contentType" : "application/json", "x-accepts" : "application/json" }, @@ -93,6 +94,7 @@ "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "x-codegen-request-body-name" : "body", "x-contentType" : "application/json", "x-accepts" : "application/json" } @@ -114,8 +116,8 @@ "type" : "array", "items" : { "type" : "string", - "enum" : [ "available", "pending", "sold" ], - "default" : "available" + "default" : "available", + "enum" : [ "available", "pending", "sold" ] } } } ], @@ -446,6 +448,7 @@ "content" : { } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } @@ -545,6 +548,7 @@ "content" : { } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } @@ -574,6 +578,7 @@ "content" : { } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } @@ -603,6 +608,7 @@ "content" : { } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } @@ -759,6 +765,7 @@ "content" : { } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" }, diff --git a/samples/server/petstore/java-play-framework/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework/.openapi-generator/VERSION index dde25ef08e8c..83a328a9227e 100644 --- a/samples/server/petstore/java-play-framework/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework/.openapi-generator/VERSION @@ -1 +1 @@ -3.1.1-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework/app/apimodels/Category.java b/samples/server/petstore/java-play-framework/app/apimodels/Category.java index 9f0206575f5c..86c8ed0cdefc 100644 --- a/samples/server/petstore/java-play-framework/app/apimodels/Category.java +++ b/samples/server/petstore/java-play-framework/app/apimodels/Category.java @@ -12,10 +12,10 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Category { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; public Category id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework/app/apimodels/ModelApiResponse.java index 07493e848250..91638ac8c602 100644 --- a/samples/server/petstore/java-play-framework/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework/app/apimodels/ModelApiResponse.java @@ -12,13 +12,13 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ModelApiResponse { @JsonProperty("code") - private Integer code = null; + private Integer code; @JsonProperty("type") - private String type = null; + private String type; @JsonProperty("message") - private String message = null; + private String message; public ModelApiResponse code(Integer code) { this.code = code; diff --git a/samples/server/petstore/java-play-framework/app/apimodels/Order.java b/samples/server/petstore/java-play-framework/app/apimodels/Order.java index d1aaa38d0029..91d6d09e7f7e 100644 --- a/samples/server/petstore/java-play-framework/app/apimodels/Order.java +++ b/samples/server/petstore/java-play-framework/app/apimodels/Order.java @@ -13,16 +13,16 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Order { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("petId") - private Long petId = null; + private Long petId; @JsonProperty("quantity") - private Integer quantity = null; + private Integer quantity; @JsonProperty("shipDate") - private OffsetDateTime shipDate = null; + private OffsetDateTime shipDate; /** * Order Status @@ -47,18 +47,18 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; @JsonProperty("complete") private Boolean complete = false; diff --git a/samples/server/petstore/java-play-framework/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework/app/apimodels/Pet.java index 5e5ff3762945..a4e223b2b156 100644 --- a/samples/server/petstore/java-play-framework/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework/app/apimodels/Pet.java @@ -16,13 +16,13 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Pet { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("category") private Category category = null; @JsonProperty("name") - private String name = null; + private String name; @JsonProperty("photoUrls") private List photoUrls = new ArrayList<>(); @@ -53,18 +53,18 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; public Pet id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework/app/apimodels/Tag.java b/samples/server/petstore/java-play-framework/app/apimodels/Tag.java index 15a8774252af..1a9079ff3456 100644 --- a/samples/server/petstore/java-play-framework/app/apimodels/Tag.java +++ b/samples/server/petstore/java-play-framework/app/apimodels/Tag.java @@ -12,10 +12,10 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Tag { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; public Tag id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework/app/apimodels/User.java b/samples/server/petstore/java-play-framework/app/apimodels/User.java index 689de768893e..8df0a6506702 100644 --- a/samples/server/petstore/java-play-framework/app/apimodels/User.java +++ b/samples/server/petstore/java-play-framework/app/apimodels/User.java @@ -12,28 +12,28 @@ @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class User { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("username") - private String username = null; + private String username; @JsonProperty("firstName") - private String firstName = null; + private String firstName; @JsonProperty("lastName") - private String lastName = null; + private String lastName; @JsonProperty("email") - private String email = null; + private String email; @JsonProperty("password") - private String password = null; + private String password; @JsonProperty("phone") - private String phone = null; + private String phone; @JsonProperty("userStatus") - private Integer userStatus = null; + private Integer userStatus; public User id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework/app/controllers/PetApiController.java index 8dff19402378..1344ffe7afb1 100644 --- a/samples/server/petstore/java-play-framework/app/controllers/PetApiController.java +++ b/samples/server/petstore/java-play-framework/app/controllers/PetApiController.java @@ -39,17 +39,17 @@ private PetApiController(Configuration configuration, PetApiControllerImpInterfa @ApiAction public Result addPet() throws Exception { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(pet); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.addPet(pet); + imp.addPet(body); return ok(); } @@ -126,17 +126,17 @@ public Result getPetById(Long petId) throws Exception { @ApiAction public Result updatePet() throws Exception { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(pet); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.updatePet(pet); + imp.updatePet(body); return ok(); } @@ -147,14 +147,14 @@ public Result updatePetWithForm(Long petId) throws Exception { if (valuename != null) { name = valuename; } else { - name = "null"; + name = null; } String valuestatus = (request().body().asMultipartFormData().asFormUrlEncoded().get("status"))[0]; String status; if (valuestatus != null) { status = valuestatus; } else { - status = "null"; + status = null; } imp.updatePetWithForm(petId, name, status); return ok(); @@ -167,7 +167,7 @@ public Result uploadFile(Long petId) throws Exception { if (valueadditionalMetadata != null) { additionalMetadata = valueadditionalMetadata; } else { - additionalMetadata = "null"; + additionalMetadata = null; } Http.MultipartFormData.FilePart file = request().body().asMultipartFormData().getFile("file"); ModelApiResponse obj = imp.uploadFile(petId, additionalMetadata, file); diff --git a/samples/server/petstore/java-play-framework/app/controllers/PetApiControllerImp.java b/samples/server/petstore/java-play-framework/app/controllers/PetApiControllerImp.java index 2cd201c4bc35..c025993f7c13 100644 --- a/samples/server/petstore/java-play-framework/app/controllers/PetApiControllerImp.java +++ b/samples/server/petstore/java-play-framework/app/controllers/PetApiControllerImp.java @@ -13,7 +13,7 @@ public class PetApiControllerImp implements PetApiControllerImpInterface { @Override - public void addPet(Pet pet) throws Exception { + public void addPet(Pet body) throws Exception { //Do your magic!!! } @@ -41,7 +41,7 @@ public Pet getPetById(Long petId) throws Exception { } @Override - public void updatePet(Pet pet) throws Exception { + public void updatePet(Pet body) throws Exception { //Do your magic!!! } diff --git a/samples/server/petstore/java-play-framework/app/controllers/PetApiControllerImpInterface.java b/samples/server/petstore/java-play-framework/app/controllers/PetApiControllerImpInterface.java index 961632675800..307c6c18cfb9 100644 --- a/samples/server/petstore/java-play-framework/app/controllers/PetApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework/app/controllers/PetApiControllerImpInterface.java @@ -13,7 +13,7 @@ @SuppressWarnings("RedundantThrows") public interface PetApiControllerImpInterface { - void addPet(Pet pet) throws Exception; + void addPet(Pet body) throws Exception; void deletePet(Long petId, String apiKey) throws Exception; @@ -23,7 +23,7 @@ public interface PetApiControllerImpInterface { Pet getPetById(Long petId) throws Exception; - void updatePet(Pet pet) throws Exception; + void updatePet(Pet body) throws Exception; void updatePetWithForm(Long petId, String name, String status) throws Exception; diff --git a/samples/server/petstore/java-play-framework/app/controllers/StoreApiController.java b/samples/server/petstore/java-play-framework/app/controllers/StoreApiController.java index 03d64c1346ca..831f15dfe3c7 100644 --- a/samples/server/petstore/java-play-framework/app/controllers/StoreApiController.java +++ b/samples/server/petstore/java-play-framework/app/controllers/StoreApiController.java @@ -61,17 +61,17 @@ public Result getOrderById( @Min(1) @Max(5)Long orderId) throws Exception { @ApiAction public Result placeOrder() throws Exception { - JsonNode nodeorder = request().body().asJson(); - Order order; - if (nodeorder != null) { - order = mapper.readValue(nodeorder.toString(), Order.class); + JsonNode nodebody = request().body().asJson(); + Order body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Order.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(order); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Order' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - Order obj = imp.placeOrder(order); + Order obj = imp.placeOrder(body); if (configuration.getBoolean("useOutputBeanValidation")) { OpenAPIUtils.validate(obj); } diff --git a/samples/server/petstore/java-play-framework/app/controllers/StoreApiControllerImp.java b/samples/server/petstore/java-play-framework/app/controllers/StoreApiControllerImp.java index f2ededef32fc..7c57d3d096c4 100644 --- a/samples/server/petstore/java-play-framework/app/controllers/StoreApiControllerImp.java +++ b/samples/server/petstore/java-play-framework/app/controllers/StoreApiControllerImp.java @@ -29,7 +29,7 @@ public Order getOrderById( @Min(1) @Max(5)Long orderId) throws Exception { } @Override - public Order placeOrder(Order order) throws Exception { + public Order placeOrder(Order body) throws Exception { //Do your magic!!! return new Order(); } diff --git a/samples/server/petstore/java-play-framework/app/controllers/StoreApiControllerImpInterface.java b/samples/server/petstore/java-play-framework/app/controllers/StoreApiControllerImpInterface.java index 4a8c5d27d405..b42e4d6d3d02 100644 --- a/samples/server/petstore/java-play-framework/app/controllers/StoreApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework/app/controllers/StoreApiControllerImpInterface.java @@ -18,6 +18,6 @@ public interface StoreApiControllerImpInterface { Order getOrderById( @Min(1) @Max(5)Long orderId) throws Exception; - Order placeOrder(Order order) throws Exception; + Order placeOrder(Order body) throws Exception; } diff --git a/samples/server/petstore/java-play-framework/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework/app/controllers/UserApiController.java index 439fa190f586..aa3bbd80ba15 100644 --- a/samples/server/petstore/java-play-framework/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework/app/controllers/UserApiController.java @@ -38,53 +38,53 @@ private UserApiController(Configuration configuration, UserApiControllerImpInter @ApiAction public Result createUser() throws Exception { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(user); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUser(user); + imp.createUser(body); return ok(); } @ApiAction public Result createUsersWithArrayInput() throws Exception { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); if (configuration.getBoolean("useInputBeanValidation")) { - for (User curItem : user) { + for (User curItem : body) { OpenAPIUtils.validate(curItem); } } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithArrayInput(user); + imp.createUsersWithArrayInput(body); return ok(); } @ApiAction public Result createUsersWithListInput() throws Exception { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); if (configuration.getBoolean("useInputBeanValidation")) { - for (User curItem : user) { + for (User curItem : body) { OpenAPIUtils.validate(curItem); } } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithListInput(user); + imp.createUsersWithListInput(body); return ok(); } @@ -133,17 +133,17 @@ public Result logoutUser() throws Exception { @ApiAction public Result updateUser(String username) throws Exception { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(user); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.updateUser(username, user); + imp.updateUser(username, body); return ok(); } } diff --git a/samples/server/petstore/java-play-framework/app/controllers/UserApiControllerImp.java b/samples/server/petstore/java-play-framework/app/controllers/UserApiControllerImp.java index 63aafa7df25f..0ea7a808b9a4 100644 --- a/samples/server/petstore/java-play-framework/app/controllers/UserApiControllerImp.java +++ b/samples/server/petstore/java-play-framework/app/controllers/UserApiControllerImp.java @@ -12,17 +12,17 @@ public class UserApiControllerImp implements UserApiControllerImpInterface { @Override - public void createUser(User user) throws Exception { + public void createUser(User body) throws Exception { //Do your magic!!! } @Override - public void createUsersWithArrayInput(List user) throws Exception { + public void createUsersWithArrayInput(List body) throws Exception { //Do your magic!!! } @Override - public void createUsersWithListInput(List user) throws Exception { + public void createUsersWithListInput(List body) throws Exception { //Do your magic!!! } @@ -49,7 +49,7 @@ public void logoutUser() throws Exception { } @Override - public void updateUser(String username, User user) throws Exception { + public void updateUser(String username, User body) throws Exception { //Do your magic!!! } diff --git a/samples/server/petstore/java-play-framework/app/controllers/UserApiControllerImpInterface.java b/samples/server/petstore/java-play-framework/app/controllers/UserApiControllerImpInterface.java index ee09b11e325f..1290c84835fb 100644 --- a/samples/server/petstore/java-play-framework/app/controllers/UserApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework/app/controllers/UserApiControllerImpInterface.java @@ -12,11 +12,11 @@ @SuppressWarnings("RedundantThrows") public interface UserApiControllerImpInterface { - void createUser(User user) throws Exception; + void createUser(User body) throws Exception; - void createUsersWithArrayInput(List user) throws Exception; + void createUsersWithArrayInput(List body) throws Exception; - void createUsersWithListInput(List user) throws Exception; + void createUsersWithListInput(List body) throws Exception; void deleteUser(String username) throws Exception; @@ -26,6 +26,6 @@ public interface UserApiControllerImpInterface { void logoutUser() throws Exception; - void updateUser(String username, User user) throws Exception; + void updateUser(String username, User body) throws Exception; } diff --git a/samples/server/petstore/java-play-framework/app/openapitools/OpenAPIUtils.java b/samples/server/petstore/java-play-framework/app/openapitools/OpenAPIUtils.java index c707ca74ac7e..385ef97a0083 100644 --- a/samples/server/petstore/java-play-framework/app/openapitools/OpenAPIUtils.java +++ b/samples/server/petstore/java-play-framework/app/openapitools/OpenAPIUtils.java @@ -98,6 +98,6 @@ public static String parameterToString(Object param) { } public static String formatDatetime(Date date) { - return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX").format(date); + return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX", Locale.ROOT).format(date); } -} \ No newline at end of file +} diff --git a/samples/server/petstore/java-play-framework/public/openapi.json b/samples/server/petstore/java-play-framework/public/openapi.json index ac1d45047828..d536f6b09046 100644 --- a/samples/server/petstore/java-play-framework/public/openapi.json +++ b/samples/server/petstore/java-play-framework/public/openapi.json @@ -61,6 +61,7 @@ "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "x-codegen-request-body-name" : "body", "x-contentType" : "application/json", "x-accepts" : "application/json" }, @@ -93,6 +94,7 @@ "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "x-codegen-request-body-name" : "body", "x-contentType" : "application/json", "x-accepts" : "application/json" } @@ -114,8 +116,8 @@ "type" : "array", "items" : { "type" : "string", - "enum" : [ "available", "pending", "sold" ], - "default" : "available" + "default" : "available", + "enum" : [ "available", "pending", "sold" ] } } } ], @@ -446,6 +448,7 @@ "content" : { } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } @@ -545,6 +548,7 @@ "content" : { } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } @@ -574,6 +578,7 @@ "content" : { } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } @@ -603,6 +608,7 @@ "content" : { } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } @@ -759,6 +765,7 @@ "content" : { } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" }, diff --git a/samples/server/petstore/java-undertow/.openapi-generator/VERSION b/samples/server/petstore/java-undertow/.openapi-generator/VERSION index 06b5019af3f4..83a328a9227e 100644 --- a/samples/server/petstore/java-undertow/.openapi-generator/VERSION +++ b/samples/server/petstore/java-undertow/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.1-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-vertx/async/.openapi-generator/VERSION b/samples/server/petstore/java-vertx/async/.openapi-generator/VERSION index d077ffb477a4..83a328a9227e 100644 --- a/samples/server/petstore/java-vertx/async/.openapi-generator/VERSION +++ b/samples/server/petstore/java-vertx/async/.openapi-generator/VERSION @@ -1 +1 @@ -3.3.4-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/PetApi.java b/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/PetApi.java index 28a9e6e3d24c..7ec2b40b8ff3 100644 --- a/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/PetApi.java +++ b/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/PetApi.java @@ -13,7 +13,7 @@ public interface PetApi { //addPet - void addPet(Pet pet, Handler> handler); + void addPet(Pet body, Handler> handler); //deletePet void deletePet(Long petId, String apiKey, Handler> handler); @@ -28,7 +28,7 @@ public interface PetApi { void getPetById(Long petId, Handler> handler); //updatePet - void updatePet(Pet pet, Handler> handler); + void updatePet(Pet body, Handler> handler); //updatePetWithForm void updatePetWithForm(Long petId, String name, String status, Handler> handler); diff --git a/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/PetApiVerticle.java b/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/PetApiVerticle.java index e2aabfc65105..4b3aa4cfb384 100644 --- a/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/PetApiVerticle.java +++ b/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/PetApiVerticle.java @@ -48,13 +48,13 @@ public void start() throws Exception { try { // Workaround for #allParams section clearing the vendorExtensions map String serviceId = "addPet"; - JsonObject petParam = message.body().getJsonObject("Pet"); - if (petParam == null) { - manageError(message, new MainApiException(400, "Pet is required"), serviceId); + JsonObject bodyParam = message.body().getJsonObject("body"); + if (bodyParam == null) { + manageError(message, new MainApiException(400, "body is required"), serviceId); return; } - Pet pet = Json.mapper.readValue(petParam.encode(), Pet.class); - service.addPet(pet, result -> { + Pet body = Json.mapper.readValue(bodyParam.encode(), Pet.class); + service.addPet(body, result -> { if (result.succeeded()) message.reply(null); else { @@ -177,13 +177,13 @@ public void start() throws Exception { try { // Workaround for #allParams section clearing the vendorExtensions map String serviceId = "updatePet"; - JsonObject petParam = message.body().getJsonObject("Pet"); - if (petParam == null) { - manageError(message, new MainApiException(400, "Pet is required"), serviceId); + JsonObject bodyParam = message.body().getJsonObject("body"); + if (bodyParam == null) { + manageError(message, new MainApiException(400, "body is required"), serviceId); return; } - Pet pet = Json.mapper.readValue(petParam.encode(), Pet.class); - service.updatePet(pet, result -> { + Pet body = Json.mapper.readValue(bodyParam.encode(), Pet.class); + service.updatePet(body, result -> { if (result.succeeded()) message.reply(null); else { diff --git a/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/StoreApi.java b/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/StoreApi.java index 1f348fa57a47..656978f999b8 100644 --- a/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/StoreApi.java +++ b/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/StoreApi.java @@ -20,6 +20,6 @@ public interface StoreApi { void getOrderById(Long orderId, Handler> handler); //placeOrder - void placeOrder(Order order, Handler> handler); + void placeOrder(Order body, Handler> handler); } diff --git a/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/StoreApiVerticle.java b/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/StoreApiVerticle.java index ebe4670ddc35..f83133b94b45 100644 --- a/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/StoreApiVerticle.java +++ b/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/StoreApiVerticle.java @@ -111,13 +111,13 @@ public void start() throws Exception { try { // Workaround for #allParams section clearing the vendorExtensions map String serviceId = "placeOrder"; - JsonObject orderParam = message.body().getJsonObject("Order"); - if (orderParam == null) { - manageError(message, new MainApiException(400, "Order is required"), serviceId); + JsonObject bodyParam = message.body().getJsonObject("body"); + if (bodyParam == null) { + manageError(message, new MainApiException(400, "body is required"), serviceId); return; } - Order order = Json.mapper.readValue(orderParam.encode(), Order.class); - service.placeOrder(order, result -> { + Order body = Json.mapper.readValue(bodyParam.encode(), Order.class); + service.placeOrder(body, result -> { if (result.succeeded()) message.reply(new JsonObject(Json.encode(result.result())).encodePrettily()); else { diff --git a/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/UserApi.java b/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/UserApi.java index bb114d2c704b..28f23b1501b3 100644 --- a/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/UserApi.java +++ b/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/UserApi.java @@ -11,13 +11,13 @@ public interface UserApi { //createUser - void createUser(User user, Handler> handler); + void createUser(User body, Handler> handler); //createUsersWithArrayInput - void createUsersWithArrayInput(List user, Handler> handler); + void createUsersWithArrayInput(List body, Handler> handler); //createUsersWithListInput - void createUsersWithListInput(List user, Handler> handler); + void createUsersWithListInput(List body, Handler> handler); //deleteUser void deleteUser(String username, Handler> handler); @@ -32,6 +32,6 @@ public interface UserApi { void logoutUser(Handler> handler); //updateUser - void updateUser(String username, User user, Handler> handler); + void updateUser(String username, User body, Handler> handler); } diff --git a/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/UserApiVerticle.java b/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/UserApiVerticle.java index a356f37a6743..8773908b5a0a 100644 --- a/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/UserApiVerticle.java +++ b/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/UserApiVerticle.java @@ -46,13 +46,13 @@ public void start() throws Exception { try { // Workaround for #allParams section clearing the vendorExtensions map String serviceId = "createUser"; - JsonObject userParam = message.body().getJsonObject("User"); - if (userParam == null) { - manageError(message, new MainApiException(400, "User is required"), serviceId); + JsonObject bodyParam = message.body().getJsonObject("body"); + if (bodyParam == null) { + manageError(message, new MainApiException(400, "body is required"), serviceId); return; } - User user = Json.mapper.readValue(userParam.encode(), User.class); - service.createUser(user, result -> { + User body = Json.mapper.readValue(bodyParam.encode(), User.class); + service.createUser(body, result -> { if (result.succeeded()) message.reply(null); else { @@ -71,14 +71,14 @@ public void start() throws Exception { try { // Workaround for #allParams section clearing the vendorExtensions map String serviceId = "createUsersWithArrayInput"; - JsonArray userParam = message.body().getJsonArray("User"); - if(userParam == null) { - manageError(message, new MainApiException(400, "User is required"), serviceId); + JsonArray bodyParam = message.body().getJsonArray("body"); + if(bodyParam == null) { + manageError(message, new MainApiException(400, "body is required"), serviceId); return; } - List user = Json.mapper.readValue(userParam.encode(), - Json.mapper.getTypeFactory().constructCollectionType(List.class, List.class)); - service.createUsersWithArrayInput(user, result -> { + List body = Json.mapper.readValue(bodyParam.encode(), + Json.mapper.getTypeFactory().constructCollectionType(List.class, User.class)); + service.createUsersWithArrayInput(body, result -> { if (result.succeeded()) message.reply(null); else { @@ -97,14 +97,14 @@ public void start() throws Exception { try { // Workaround for #allParams section clearing the vendorExtensions map String serviceId = "createUsersWithListInput"; - JsonArray userParam = message.body().getJsonArray("User"); - if(userParam == null) { - manageError(message, new MainApiException(400, "User is required"), serviceId); + JsonArray bodyParam = message.body().getJsonArray("body"); + if(bodyParam == null) { + manageError(message, new MainApiException(400, "body is required"), serviceId); return; } - List user = Json.mapper.readValue(userParam.encode(), - Json.mapper.getTypeFactory().constructCollectionType(List.class, List.class)); - service.createUsersWithListInput(user, result -> { + List body = Json.mapper.readValue(bodyParam.encode(), + Json.mapper.getTypeFactory().constructCollectionType(List.class, User.class)); + service.createUsersWithListInput(body, result -> { if (result.succeeded()) message.reply(null); else { @@ -229,13 +229,13 @@ public void start() throws Exception { return; } String username = usernameParam; - JsonObject userParam = message.body().getJsonObject("User"); - if (userParam == null) { - manageError(message, new MainApiException(400, "User is required"), serviceId); + JsonObject bodyParam = message.body().getJsonObject("body"); + if (bodyParam == null) { + manageError(message, new MainApiException(400, "body is required"), serviceId); return; } - User user = Json.mapper.readValue(userParam.encode(), User.class); - service.updateUser(username, user, result -> { + User body = Json.mapper.readValue(bodyParam.encode(), User.class); + service.updateUser(username, body, result -> { if (result.succeeded()) message.reply(null); else { diff --git a/samples/server/petstore/java-vertx/async/src/main/resources/openapi.json b/samples/server/petstore/java-vertx/async/src/main/resources/openapi.json index 01ebde2297ed..65f63604c9a6 100644 --- a/samples/server/petstore/java-vertx/async/src/main/resources/openapi.json +++ b/samples/server/petstore/java-vertx/async/src/main/resources/openapi.json @@ -61,6 +61,7 @@ "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "x-codegen-request-body-name" : "body", "x-contentType" : "application/json", "x-accepts" : "application/json", "x-serviceid" : "updatePet", @@ -95,6 +96,7 @@ "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "x-codegen-request-body-name" : "body", "x-contentType" : "application/json", "x-accepts" : "application/json", "x-serviceid" : "addPet", @@ -464,6 +466,7 @@ "content" : { } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json", "x-serviceid" : "placeOrder", @@ -569,6 +572,7 @@ "content" : { } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json", "x-serviceid" : "createUser", @@ -600,6 +604,7 @@ "content" : { } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json", "x-serviceid" : "createUsersWithArrayInput", @@ -631,6 +636,7 @@ "content" : { } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json", "x-serviceid" : "createUsersWithListInput", @@ -795,6 +801,7 @@ "content" : { } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json", "x-serviceid" : "updateUser", diff --git a/samples/server/petstore/java-vertx/rx/.openapi-generator/VERSION b/samples/server/petstore/java-vertx/rx/.openapi-generator/VERSION index 4395ff592326..83a328a9227e 100644 --- a/samples/server/petstore/java-vertx/rx/.openapi-generator/VERSION +++ b/samples/server/petstore/java-vertx/rx/.openapi-generator/VERSION @@ -1 +1 @@ -3.2.0-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/model/Category.java b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/model/Category.java index 58721d64cd37..2fdf0df82dae 100644 --- a/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/model/Category.java +++ b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/model/Category.java @@ -10,8 +10,8 @@ @JsonInclude(JsonInclude.Include.NON_NULL) public class Category { - private Long id = null; - private String name = null; + private Long id; + private String name; public Category () { diff --git a/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/model/ModelApiResponse.java b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/model/ModelApiResponse.java index 60e1945bf1ad..c6f2ba4ebd47 100644 --- a/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/model/ModelApiResponse.java +++ b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/model/ModelApiResponse.java @@ -10,9 +10,9 @@ @JsonInclude(JsonInclude.Include.NON_NULL) public class ModelApiResponse { - private Integer code = null; - private String type = null; - private String message = null; + private Integer code; + private String type; + private String message; public ModelApiResponse () { diff --git a/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/model/Order.java b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/model/Order.java index f34e4c0ff4f6..4fa04b8e0a91 100644 --- a/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/model/Order.java +++ b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/model/Order.java @@ -12,10 +12,10 @@ @JsonInclude(JsonInclude.Include.NON_NULL) public class Order { - private Long id = null; - private Long petId = null; - private Integer quantity = null; - private OffsetDateTime shipDate = null; + private Long id; + private Long petId; + private Integer quantity; + private OffsetDateTime shipDate; public enum StatusEnum { @@ -36,7 +36,7 @@ public String toString() { } } - private StatusEnum status = null; + private StatusEnum status; private Boolean complete = false; public Order () { diff --git a/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/model/Pet.java b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/model/Pet.java index be9ab39a4965..abc6feb302d2 100644 --- a/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/model/Pet.java +++ b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/model/Pet.java @@ -15,9 +15,9 @@ @JsonInclude(JsonInclude.Include.NON_NULL) public class Pet { - private Long id = null; + private Long id; private Category category = null; - private String name = null; + private String name; private List photoUrls = new ArrayList<>(); private List tags = new ArrayList<>(); @@ -40,7 +40,7 @@ public String toString() { } } - private StatusEnum status = null; + private StatusEnum status; public Pet () { diff --git a/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/model/Tag.java b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/model/Tag.java index acb51386a8fd..660b1d3bb074 100644 --- a/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/model/Tag.java +++ b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/model/Tag.java @@ -10,8 +10,8 @@ @JsonInclude(JsonInclude.Include.NON_NULL) public class Tag { - private Long id = null; - private String name = null; + private Long id; + private String name; public Tag () { diff --git a/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/model/User.java b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/model/User.java index fedd3d6207ed..c30e9eb84a8d 100644 --- a/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/model/User.java +++ b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/model/User.java @@ -10,14 +10,14 @@ @JsonInclude(JsonInclude.Include.NON_NULL) public class User { - private Long id = null; - private String username = null; - private String firstName = null; - private String lastName = null; - private String email = null; - private String password = null; - private String phone = null; - private Integer userStatus = null; + private Long id; + private String username; + private String firstName; + private String lastName; + private String email; + private String password; + private String phone; + private Integer userStatus; public User () { diff --git a/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/PetApi.java b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/PetApi.java index ed8784f284ff..ae86f9bee709 100644 --- a/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/PetApi.java +++ b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/PetApi.java @@ -13,7 +13,7 @@ public interface PetApi { //addPet - public Completable addPet(Pet pet); + public Completable addPet(Pet body); //deletePet public Completable deletePet(Long petId,String apiKey); @@ -28,7 +28,7 @@ public interface PetApi { public Single getPetById(Long petId); //updatePet - public Completable updatePet(Pet pet); + public Completable updatePet(Pet body); //updatePetWithForm public Completable updatePetWithForm(Long petId,String name,String status); diff --git a/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/PetApiVerticle.java b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/PetApiVerticle.java index 80f8a99f2e17..7caf45dfd249 100644 --- a/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/PetApiVerticle.java +++ b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/PetApiVerticle.java @@ -48,13 +48,13 @@ public void start() throws Exception { try { // Workaround for #allParams section clearing the vendorExtensions map String serviceId = "addPet"; - JsonObject petParam = message.body().getJsonObject("Pet"); - if (petParam == null) { - manageError(message, new MainApiException(400, "Pet is required"), serviceId); + JsonObject bodyParam = message.body().getJsonObject("body"); + if (bodyParam == null) { + manageError(message, new MainApiException(400, "body is required"), serviceId); return; } - Pet pet = Json.mapper.readValue(petParam.encode(), Pet.class); - service.addPet(pet).subscribe( + Pet body = Json.mapper.readValue(bodyParam.encode(), Pet.class); + service.addPet(body).subscribe( () -> { message.reply(null); }, @@ -172,13 +172,13 @@ public void start() throws Exception { try { // Workaround for #allParams section clearing the vendorExtensions map String serviceId = "updatePet"; - JsonObject petParam = message.body().getJsonObject("Pet"); - if (petParam == null) { - manageError(message, new MainApiException(400, "Pet is required"), serviceId); + JsonObject bodyParam = message.body().getJsonObject("body"); + if (bodyParam == null) { + manageError(message, new MainApiException(400, "body is required"), serviceId); return; } - Pet pet = Json.mapper.readValue(petParam.encode(), Pet.class); - service.updatePet(pet).subscribe( + Pet body = Json.mapper.readValue(bodyParam.encode(), Pet.class); + service.updatePet(body).subscribe( () -> { message.reply(null); }, diff --git a/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/StoreApi.java b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/StoreApi.java index fd43dcbbdb50..8f9c735708bd 100644 --- a/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/StoreApi.java +++ b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/StoreApi.java @@ -20,6 +20,6 @@ public interface StoreApi { public Single getOrderById(Long orderId); //placeOrder - public Single placeOrder(Order order); + public Single placeOrder(Order body); } diff --git a/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/StoreApiVerticle.java b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/StoreApiVerticle.java index ced8cdcbb9a9..6e1a60becac3 100644 --- a/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/StoreApiVerticle.java +++ b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/StoreApiVerticle.java @@ -108,13 +108,13 @@ public void start() throws Exception { try { // Workaround for #allParams section clearing the vendorExtensions map String serviceId = "placeOrder"; - JsonObject orderParam = message.body().getJsonObject("Order"); - if (orderParam == null) { - manageError(message, new MainApiException(400, "Order is required"), serviceId); + JsonObject bodyParam = message.body().getJsonObject("body"); + if (bodyParam == null) { + manageError(message, new MainApiException(400, "body is required"), serviceId); return; } - Order order = Json.mapper.readValue(orderParam.encode(), Order.class); - service.placeOrder(order).subscribe( + Order body = Json.mapper.readValue(bodyParam.encode(), Order.class); + service.placeOrder(body).subscribe( result -> { message.reply(new JsonObject(Json.encode(result)).encodePrettily()); }, diff --git a/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/UserApi.java b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/UserApi.java index 20ddbbb5331c..cc6be61055cd 100644 --- a/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/UserApi.java +++ b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/UserApi.java @@ -11,13 +11,13 @@ public interface UserApi { //createUser - public Completable createUser(User user); + public Completable createUser(User body); //createUsersWithArrayInput - public Completable createUsersWithArrayInput(List user); + public Completable createUsersWithArrayInput(List body); //createUsersWithListInput - public Completable createUsersWithListInput(List user); + public Completable createUsersWithListInput(List body); //deleteUser public Completable deleteUser(String username); @@ -32,6 +32,6 @@ public interface UserApi { public Completable logoutUser(); //updateUser - public Completable updateUser(String username,User user); + public Completable updateUser(String username,User body); } diff --git a/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/UserApiVerticle.java b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/UserApiVerticle.java index 2700bc5b2469..7233d8e3e29a 100644 --- a/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/UserApiVerticle.java +++ b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/UserApiVerticle.java @@ -46,13 +46,13 @@ public void start() throws Exception { try { // Workaround for #allParams section clearing the vendorExtensions map String serviceId = "createUser"; - JsonObject userParam = message.body().getJsonObject("User"); - if (userParam == null) { - manageError(message, new MainApiException(400, "User is required"), serviceId); + JsonObject bodyParam = message.body().getJsonObject("body"); + if (bodyParam == null) { + manageError(message, new MainApiException(400, "body is required"), serviceId); return; } - User user = Json.mapper.readValue(userParam.encode(), User.class); - service.createUser(user).subscribe( + User body = Json.mapper.readValue(bodyParam.encode(), User.class); + service.createUser(body).subscribe( () -> { message.reply(null); }, @@ -70,14 +70,14 @@ public void start() throws Exception { try { // Workaround for #allParams section clearing the vendorExtensions map String serviceId = "createUsersWithArrayInput"; - JsonArray userParam = message.body().getJsonArray("User"); - if(userParam == null) { - manageError(message, new MainApiException(400, "User is required"), serviceId); + JsonArray bodyParam = message.body().getJsonArray("body"); + if(bodyParam == null) { + manageError(message, new MainApiException(400, "body is required"), serviceId); return; } - List user = Json.mapper.readValue(userParam.encode(), - Json.mapper.getTypeFactory().constructCollectionType(List.class, List.class)); - service.createUsersWithArrayInput(user).subscribe( + List body = Json.mapper.readValue(bodyParam.encode(), + Json.mapper.getTypeFactory().constructCollectionType(List.class, User.class)); + service.createUsersWithArrayInput(body).subscribe( () -> { message.reply(null); }, @@ -95,14 +95,14 @@ public void start() throws Exception { try { // Workaround for #allParams section clearing the vendorExtensions map String serviceId = "createUsersWithListInput"; - JsonArray userParam = message.body().getJsonArray("User"); - if(userParam == null) { - manageError(message, new MainApiException(400, "User is required"), serviceId); + JsonArray bodyParam = message.body().getJsonArray("body"); + if(bodyParam == null) { + manageError(message, new MainApiException(400, "body is required"), serviceId); return; } - List user = Json.mapper.readValue(userParam.encode(), - Json.mapper.getTypeFactory().constructCollectionType(List.class, List.class)); - service.createUsersWithListInput(user).subscribe( + List body = Json.mapper.readValue(bodyParam.encode(), + Json.mapper.getTypeFactory().constructCollectionType(List.class, User.class)); + service.createUsersWithListInput(body).subscribe( () -> { message.reply(null); }, @@ -222,13 +222,13 @@ public void start() throws Exception { return; } String username = usernameParam; - JsonObject userParam = message.body().getJsonObject("User"); - if (userParam == null) { - manageError(message, new MainApiException(400, "User is required"), serviceId); + JsonObject bodyParam = message.body().getJsonObject("body"); + if (bodyParam == null) { + manageError(message, new MainApiException(400, "body is required"), serviceId); return; } - User user = Json.mapper.readValue(userParam.encode(), User.class); - service.updateUser(username, user).subscribe( + User body = Json.mapper.readValue(bodyParam.encode(), User.class); + service.updateUser(username, body).subscribe( () -> { message.reply(null); }, diff --git a/samples/server/petstore/java-vertx/rx/src/main/resources/openapi.json b/samples/server/petstore/java-vertx/rx/src/main/resources/openapi.json index fab44c6d95a2..65f63604c9a6 100644 --- a/samples/server/petstore/java-vertx/rx/src/main/resources/openapi.json +++ b/samples/server/petstore/java-vertx/rx/src/main/resources/openapi.json @@ -61,6 +61,7 @@ "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "x-codegen-request-body-name" : "body", "x-contentType" : "application/json", "x-accepts" : "application/json", "x-serviceid" : "updatePet", @@ -95,6 +96,7 @@ "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "x-codegen-request-body-name" : "body", "x-contentType" : "application/json", "x-accepts" : "application/json", "x-serviceid" : "addPet", @@ -118,8 +120,8 @@ "type" : "array", "items" : { "type" : "string", - "enum" : [ "available", "pending", "sold" ], - "default" : "available" + "default" : "available", + "enum" : [ "available", "pending", "sold" ] } } } ], @@ -464,6 +466,7 @@ "content" : { } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json", "x-serviceid" : "placeOrder", @@ -569,6 +572,7 @@ "content" : { } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json", "x-serviceid" : "createUser", @@ -600,6 +604,7 @@ "content" : { } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json", "x-serviceid" : "createUsersWithArrayInput", @@ -631,6 +636,7 @@ "content" : { } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json", "x-serviceid" : "createUsersWithListInput", @@ -795,6 +801,7 @@ "content" : { } } }, + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json", "x-serviceid" : "updateUser", diff --git a/samples/server/petstore/jaxrs-cxf-test-data/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-cxf-test-data/.openapi-generator/VERSION index afa636560641..83a328a9227e 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-cxf-test-data/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Cat.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Cat.java index 83b49a63e37b..7ba4b7c7896b 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Cat.java @@ -1,6 +1,7 @@ package org.openapitools.model; import org.openapitools.model.Animal; +import org.openapitools.model.CatAllOf; import javax.validation.constraints.*; import javax.validation.Valid; diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/CatAllOf.java new file mode 100644 index 000000000000..81b5da7a3d09 --- /dev/null +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/CatAllOf.java @@ -0,0 +1,67 @@ +package org.openapitools.model; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonProperty; + +public class CatAllOf { + + @ApiModelProperty(value = "") + private Boolean declawed; + /** + * Get declawed + * @return declawed + */ + @JsonProperty("declawed") + public Boolean getDeclawed() { + return declawed; + } + + /** + * Sets the declawed property. + */ + public void setDeclawed(Boolean declawed) { + this.declawed = declawed; + } + + /** + * Sets the declawed property. + */ + public CatAllOf declawed(Boolean declawed) { + this.declawed = declawed; + return this; + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CatAllOf {\n"); + + sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Dog.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Dog.java index e9d8e2ba5416..f37ebcee84c3 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Dog.java @@ -1,6 +1,7 @@ package org.openapitools.model; import org.openapitools.model.Animal; +import org.openapitools.model.DogAllOf; import javax.validation.constraints.*; import javax.validation.Valid; diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/DogAllOf.java new file mode 100644 index 000000000000..e4b39cd934ee --- /dev/null +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/DogAllOf.java @@ -0,0 +1,67 @@ +package org.openapitools.model; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonProperty; + +public class DogAllOf { + + @ApiModelProperty(value = "") + private String breed; + /** + * Get breed + * @return breed + */ + @JsonProperty("breed") + public String getBreed() { + return breed; + } + + /** + * Sets the breed property. + */ + public void setBreed(String breed) { + this.breed = breed; + } + + /** + * Sets the breed property. + */ + public DogAllOf breed(String breed) { + this.breed = breed; + return this; + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DogAllOf {\n"); + + sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java index 6ebd879ad571..d5455f75d70b 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java @@ -35,7 +35,7 @@ public class AnotherFakeApiServiceImpl implements AnotherFakeApi { { try { File cacheFile = new File(System.getProperty("jaxrs.test.server.json", - "/home/tduperron/git/zomzog/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); + "/Users/user/Documents/Apps/java/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); cache = JsonCache.Factory.instance.get("test-data").load(cacheFile).child("/org.openapitools.api/AnotherFakeApi"); } catch (CacheException e) { e.printStackTrace(); diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java index 2d987e5a1cd1..da82d3d30594 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java @@ -43,7 +43,7 @@ public class FakeApiServiceImpl implements FakeApi { { try { File cacheFile = new File(System.getProperty("jaxrs.test.server.json", - "/home/tduperron/git/zomzog/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); + "/Users/user/Documents/Apps/java/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); cache = JsonCache.Factory.instance.get("test-data").load(cacheFile).child("/org.openapitools.api/FakeApi"); } catch (CacheException e) { e.printStackTrace(); diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/FakeClassnameTags123ApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/FakeClassnameTags123ApiServiceImpl.java index 4440d69a1ea3..54808bcd386c 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/FakeClassnameTags123ApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/FakeClassnameTags123ApiServiceImpl.java @@ -35,7 +35,7 @@ public class FakeClassnameTags123ApiServiceImpl implements FakeClassnameTags123A { try { File cacheFile = new File(System.getProperty("jaxrs.test.server.json", - "/home/tduperron/git/zomzog/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); + "/Users/user/Documents/Apps/java/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); cache = JsonCache.Factory.instance.get("test-data").load(cacheFile).child("/org.openapitools.api/FakeClassnameTags123Api"); } catch (CacheException e) { e.printStackTrace(); diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java index 19dbdf663104..1ee0ded5d2a6 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java @@ -38,7 +38,7 @@ public class PetApiServiceImpl implements PetApi { { try { File cacheFile = new File(System.getProperty("jaxrs.test.server.json", - "/home/tduperron/git/zomzog/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); + "/Users/user/Documents/Apps/java/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); cache = JsonCache.Factory.instance.get("test-data").load(cacheFile).child("/org.openapitools.api/PetApi"); } catch (CacheException e) { e.printStackTrace(); diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java index 3de4afe148ea..5c858a0de13a 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java @@ -35,7 +35,7 @@ public class StoreApiServiceImpl implements StoreApi { { try { File cacheFile = new File(System.getProperty("jaxrs.test.server.json", - "/home/tduperron/git/zomzog/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); + "/Users/user/Documents/Apps/java/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); cache = JsonCache.Factory.instance.get("test-data").load(cacheFile).child("/org.openapitools.api/StoreApi"); } catch (CacheException e) { e.printStackTrace(); diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java index 0d97bd614bb1..01cf772a6f7c 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java @@ -35,7 +35,7 @@ public class UserApiServiceImpl implements UserApi { { try { File cacheFile = new File(System.getProperty("jaxrs.test.server.json", - "/home/tduperron/git/zomzog/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); + "/Users/user/Documents/Apps/java/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); cache = JsonCache.Factory.instance.get("test-data").load(cacheFile).child("/org.openapitools.api/UserApi"); } catch (CacheException e) { e.printStackTrace(); diff --git a/samples/server/petstore/jaxrs-spec-interface-response/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-spec-interface-response/.openapi-generator/VERSION index 6d94c9c2e12a..83a328a9227e 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-spec-interface-response/.openapi-generator/VERSION @@ -1 +1 @@ -3.3.0-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/AnotherFakeApi.java index d72eaf4a3932..b9c2317cb327 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/AnotherFakeApi.java @@ -24,5 +24,5 @@ public interface AnotherFakeApi { @ApiOperation(value = "To test special tags", notes = "To test special tags and operation ID starting with number", tags={ "$another-fake?" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - Response call123testSpecialTags(@Valid Client client); + Response call123testSpecialTags(@Valid Client body); } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/FakeApi.java index fed7bbc7f69b..dc7a43d29107 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/FakeApi.java @@ -10,6 +10,7 @@ import org.openapitools.model.ModelApiResponse; import org.openapitools.model.OuterComposite; import org.openapitools.model.User; +import org.openapitools.model.XmlItem; import javax.ws.rs.*; import javax.ws.rs.core.Response; @@ -26,6 +27,14 @@ @Api(description = "the fake API") public interface FakeApi { + @POST + @Path("/create_xml_item") + @Consumes({ "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" }) + @ApiOperation(value = "creates an XmlItem", notes = "this route creates an XmlItem", tags={ "fake", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + Response createXmlItem(@Valid XmlItem xmlItem); + @POST @Path("/outer/boolean") @Produces({ "*/*" }) @@ -40,7 +49,7 @@ public interface FakeApi { @ApiOperation(value = "", notes = "Test serialization of object with outer number type", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) - Response fakeOuterCompositeSerialize(@Valid OuterComposite outerComposite); + Response fakeOuterCompositeSerialize(@Valid OuterComposite body); @POST @Path("/outer/number") @@ -64,7 +73,7 @@ public interface FakeApi { @ApiOperation(value = "", notes = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success", response = Void.class) }) - Response testBodyWithFileSchema(@Valid FileSchemaTestClass fileSchemaTestClass); + Response testBodyWithFileSchema(@Valid FileSchemaTestClass body); @PUT @Path("/body-with-query-params") @@ -72,7 +81,7 @@ public interface FakeApi { @ApiOperation(value = "", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success", response = Void.class) }) - Response testBodyWithQueryParams(@QueryParam("query") @NotNull String query,@Valid User user); + Response testBodyWithQueryParams(@QueryParam("query") @NotNull String query,@Valid User body); @PATCH @Consumes({ "application/json" }) @@ -80,7 +89,7 @@ public interface FakeApi { @ApiOperation(value = "To test \"client\" model", notes = "To test \"client\" model", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - Response testClientModel(@Valid Client client); + Response testClientModel(@Valid Client body); @POST @Consumes({ "application/x-www-form-urlencoded" }) @@ -98,7 +107,13 @@ public interface FakeApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request", response = Void.class), @ApiResponse(code = 404, message = "Not found", response = Void.class) }) - Response testEnumParameters(@HeaderParam("enum_header_string_array") @DefaultValue("new ArrayList()") @ApiParam("Header parameter enum test (string array)") List enumHeaderStringArray,@HeaderParam("enum_header_string") @DefaultValue("-efg") @ApiParam("Header parameter enum test (string)") String enumHeaderString,@QueryParam("enum_query_string_array") @DefaultValue("new ArrayList()") @ApiParam("Query parameter enum test (string array)") List enumQueryStringArray,@QueryParam("enum_query_string") @DefaultValue("-efg") @ApiParam("Query parameter enum test (string)") String enumQueryString,@QueryParam("enum_query_integer") @ApiParam("Query parameter enum test (double)") Integer enumQueryInteger,@QueryParam("enum_query_double") @ApiParam("Query parameter enum test (double)") Double enumQueryDouble,@FormParam(value = "enum_form_string_array") List enumFormStringArray,@FormParam(value = "enum_form_string") String enumFormString); + Response testEnumParameters(@HeaderParam("enum_header_string_array") @DefaultValue("new ArrayList()") @ApiParam("Header parameter enum test (string array)") List enumHeaderStringArray,@HeaderParam("enum_header_string") @DefaultValue("-efg") @ApiParam("Header parameter enum test (string)") String enumHeaderString,@QueryParam("enum_query_string_array") @ApiParam("Query parameter enum test (string array)") List enumQueryStringArray,@QueryParam("enum_query_string") @DefaultValue("-efg") @ApiParam("Query parameter enum test (string)") String enumQueryString,@QueryParam("enum_query_integer") @ApiParam("Query parameter enum test (double)") Integer enumQueryInteger,@QueryParam("enum_query_double") @ApiParam("Query parameter enum test (double)") Double enumQueryDouble,@FormParam(value = "enum_form_string_array") List enumFormStringArray,@FormParam(value = "enum_form_string") String enumFormString); + + @DELETE + @ApiOperation(value = "Fake endpoint to test group parameters (optional)", notes = "Fake endpoint to test group parameters (optional)", tags={ "fake", }) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Someting wrong", response = Void.class) }) + Response testGroupParameters(@QueryParam("required_string_group") @NotNull @ApiParam("Required String in group parameters") Integer requiredStringGroup,@HeaderParam("required_boolean_group") @NotNull @ApiParam("Required Boolean in group parameters") Boolean requiredBooleanGroup,@QueryParam("required_int64_group") @NotNull @ApiParam("Required Integer in group parameters") Long requiredInt64Group,@QueryParam("string_group") @ApiParam("String in group parameters") Integer stringGroup,@HeaderParam("boolean_group") @ApiParam("Boolean in group parameters") Boolean booleanGroup,@QueryParam("int64_group") @ApiParam("Integer in group parameters") Long int64Group); @POST @Path("/inline-additionalProperties") @@ -106,7 +121,7 @@ public interface FakeApi { @ApiOperation(value = "test inline additionalProperties", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - Response testInlineAdditionalProperties(@Valid Map requestBody); + Response testInlineAdditionalProperties(@Valid Map param); @GET @Path("/jsonFormData") diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java index 4e7829ee210d..73e623e549e0 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java @@ -25,5 +25,5 @@ public interface FakeClassnameTestApi { }, tags={ "fake_classname_tags 123#$%^" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - Response testClassname(@Valid Client client); + Response testClassname(@Valid Client body); } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/PetApi.java index db4be50f07b9..f186a66d1a31 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/PetApi.java @@ -28,8 +28,9 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Void.class), @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) - Response addPet(@Valid Pet pet); + Response addPet(@Valid Pet body); @DELETE @Path("/{petId}") @@ -40,8 +41,9 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Void.class), @ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) - Response deletePet(@PathParam("petId") @ApiParam("Pet id to delete") Long petId,@HeaderParam("api_key") String apiKey); + Response deletePet(@PathParam("petId") @ApiParam("Pet id to delete") Long petId,@HeaderParam("api_key") String apiKey); @GET @Path("/findByStatus") @@ -55,7 +57,7 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid status value", response = Void.class, responseContainer = "List") }) - Response findPetsByStatus(@QueryParam("status") @NotNull @DefaultValue("new ArrayList()") @ApiParam("Status values that need to be considered for filter") List status); + Response findPetsByStatus(@QueryParam("status") @NotNull @ApiParam("Status values that need to be considered for filter") List status); @GET @Path("/findByTags") @@ -69,7 +71,7 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid tag value", response = Void.class, responseContainer = "List") }) - Response findPetsByTags(@QueryParam("tags") @NotNull @DefaultValue("new ArrayList()") @ApiParam("Tags to filter by") List tags); + Response findPetsByTags(@QueryParam("tags") @NotNull @ApiParam("Tags to filter by") List tags); @GET @Path("/{petId}") @@ -92,10 +94,11 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Void.class), @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Pet not found", response = Void.class), @ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) - Response updatePet(@Valid Pet pet); + Response updatePet(@Valid Pet body); @POST @Path("/{petId}") diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/StoreApi.java index 2712d44cc786..802979265c27 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/StoreApi.java @@ -53,5 +53,5 @@ public interface StoreApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order", response = Void.class) }) - Response placeOrder(@Valid Order order); + Response placeOrder(@Valid Order body); } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/UserApi.java index d239142bf3cb..7848c218f5ee 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/UserApi.java @@ -22,21 +22,21 @@ public interface UserApi { @ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - Response createUser(@Valid User user); + Response createUser(@Valid User body); @POST @Path("/createWithArray") @ApiOperation(value = "Creates list of users with given input array", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - Response createUsersWithArrayInput(@Valid List user); + Response createUsersWithArrayInput(@Valid List body); @POST @Path("/createWithList") @ApiOperation(value = "Creates list of users with given input array", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - Response createUsersWithListInput(@Valid List user); + Response createUsersWithListInput(@Valid List body); @DELETE @Path("/{username}") @@ -78,5 +78,5 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) - Response updateUser(@PathParam("username") @ApiParam("name that need to be deleted") String username,@Valid User user); + Response updateUser(@PathParam("username") @ApiParam("name that need to be deleted") String username,@Valid User body); } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java new file mode 100644 index 000000000000..784bdb2540cc --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -0,0 +1,80 @@ +package org.openapitools.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.Map; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import io.swagger.annotations.*; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + + + +public class AdditionalPropertiesAnyType extends HashMap implements Serializable { + + private @Valid String name; + + /** + **/ + public AdditionalPropertiesAnyType name(String name) { + this.name = name; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("name") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesAnyType additionalPropertiesAnyType = (AdditionalPropertiesAnyType) o; + return Objects.equals(this.name, additionalPropertiesAnyType.name) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(name, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesAnyType {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java new file mode 100644 index 000000000000..7e3b19874d3f --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -0,0 +1,81 @@ +package org.openapitools.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import io.swagger.annotations.*; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + + + +public class AdditionalPropertiesArray extends HashMap implements Serializable { + + private @Valid String name; + + /** + **/ + public AdditionalPropertiesArray name(String name) { + this.name = name; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("name") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesArray additionalPropertiesArray = (AdditionalPropertiesArray) o; + return Objects.equals(this.name, additionalPropertiesArray.name) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(name, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesArray {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java new file mode 100644 index 000000000000..1eb290fe3f21 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -0,0 +1,80 @@ +package org.openapitools.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.Map; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import io.swagger.annotations.*; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + + + +public class AdditionalPropertiesBoolean extends HashMap implements Serializable { + + private @Valid String name; + + /** + **/ + public AdditionalPropertiesBoolean name(String name) { + this.name = name; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("name") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesBoolean additionalPropertiesBoolean = (AdditionalPropertiesBoolean) o; + return Objects.equals(this.name, additionalPropertiesBoolean.name) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(name, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesBoolean {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index 58abe9915cb2..06ef5eeec8f0 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -2,6 +2,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -19,41 +20,203 @@ public class AdditionalPropertiesClass implements Serializable { - private @Valid Map mapProperty = new HashMap(); - private @Valid Map> mapOfMapProperty = new HashMap>(); + private @Valid Map mapString = new HashMap(); + private @Valid Map mapNumber = new HashMap(); + private @Valid Map mapInteger = new HashMap(); + private @Valid Map mapBoolean = new HashMap(); + private @Valid Map> mapArrayInteger = new HashMap>(); + private @Valid Map> mapArrayAnytype = new HashMap>(); + private @Valid Map> mapMapString = new HashMap>(); + private @Valid Map> mapMapAnytype = new HashMap>(); + private @Valid Object anytype1 = null; + private @Valid Object anytype2 = null; + private @Valid Object anytype3 = null; /** **/ - public AdditionalPropertiesClass mapProperty(Map mapProperty) { - this.mapProperty = mapProperty; + public AdditionalPropertiesClass mapString(Map mapString) { + this.mapString = mapString; return this; } @ApiModelProperty(value = "") - @JsonProperty("map_property") - public Map getMapProperty() { - return mapProperty; + @JsonProperty("map_string") + public Map getMapString() { + return mapString; } - public void setMapProperty(Map mapProperty) { - this.mapProperty = mapProperty; + public void setMapString(Map mapString) { + this.mapString = mapString; } /** **/ - public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { - this.mapOfMapProperty = mapOfMapProperty; + public AdditionalPropertiesClass mapNumber(Map mapNumber) { + this.mapNumber = mapNumber; return this; } @ApiModelProperty(value = "") - @JsonProperty("map_of_map_property") - public Map> getMapOfMapProperty() { - return mapOfMapProperty; + @JsonProperty("map_number") + public Map getMapNumber() { + return mapNumber; } - public void setMapOfMapProperty(Map> mapOfMapProperty) { - this.mapOfMapProperty = mapOfMapProperty; + public void setMapNumber(Map mapNumber) { + this.mapNumber = mapNumber; + } + + /** + **/ + public AdditionalPropertiesClass mapInteger(Map mapInteger) { + this.mapInteger = mapInteger; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("map_integer") + public Map getMapInteger() { + return mapInteger; + } + public void setMapInteger(Map mapInteger) { + this.mapInteger = mapInteger; + } + + /** + **/ + public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { + this.mapBoolean = mapBoolean; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("map_boolean") + public Map getMapBoolean() { + return mapBoolean; + } + public void setMapBoolean(Map mapBoolean) { + this.mapBoolean = mapBoolean; + } + + /** + **/ + public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { + this.mapArrayInteger = mapArrayInteger; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("map_array_integer") + public Map> getMapArrayInteger() { + return mapArrayInteger; + } + public void setMapArrayInteger(Map> mapArrayInteger) { + this.mapArrayInteger = mapArrayInteger; + } + + /** + **/ + public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { + this.mapArrayAnytype = mapArrayAnytype; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("map_array_anytype") + public Map> getMapArrayAnytype() { + return mapArrayAnytype; + } + public void setMapArrayAnytype(Map> mapArrayAnytype) { + this.mapArrayAnytype = mapArrayAnytype; + } + + /** + **/ + public AdditionalPropertiesClass mapMapString(Map> mapMapString) { + this.mapMapString = mapMapString; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("map_map_string") + public Map> getMapMapString() { + return mapMapString; + } + public void setMapMapString(Map> mapMapString) { + this.mapMapString = mapMapString; + } + + /** + **/ + public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { + this.mapMapAnytype = mapMapAnytype; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("map_map_anytype") + public Map> getMapMapAnytype() { + return mapMapAnytype; + } + public void setMapMapAnytype(Map> mapMapAnytype) { + this.mapMapAnytype = mapMapAnytype; + } + + /** + **/ + public AdditionalPropertiesClass anytype1(Object anytype1) { + this.anytype1 = anytype1; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("anytype_1") + public Object getAnytype1() { + return anytype1; + } + public void setAnytype1(Object anytype1) { + this.anytype1 = anytype1; + } + + /** + **/ + public AdditionalPropertiesClass anytype2(Object anytype2) { + this.anytype2 = anytype2; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("anytype_2") + public Object getAnytype2() { + return anytype2; + } + public void setAnytype2(Object anytype2) { + this.anytype2 = anytype2; + } + + /** + **/ + public AdditionalPropertiesClass anytype3(Object anytype3) { + this.anytype3 = anytype3; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("anytype_3") + public Object getAnytype3() { + return anytype3; + } + public void setAnytype3(Object anytype3) { + this.anytype3 = anytype3; } @@ -66,13 +229,22 @@ public boolean equals(java.lang.Object o) { return false; } AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o; - return Objects.equals(mapProperty, additionalPropertiesClass.mapProperty) && - Objects.equals(mapOfMapProperty, additionalPropertiesClass.mapOfMapProperty); + return Objects.equals(this.mapString, additionalPropertiesClass.mapString) && + Objects.equals(this.mapNumber, additionalPropertiesClass.mapNumber) && + Objects.equals(this.mapInteger, additionalPropertiesClass.mapInteger) && + Objects.equals(this.mapBoolean, additionalPropertiesClass.mapBoolean) && + Objects.equals(this.mapArrayInteger, additionalPropertiesClass.mapArrayInteger) && + Objects.equals(this.mapArrayAnytype, additionalPropertiesClass.mapArrayAnytype) && + Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) && + Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) && + Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) && + Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) && + Objects.equals(this.anytype3, additionalPropertiesClass.anytype3); } @Override public int hashCode() { - return Objects.hash(mapProperty, mapOfMapProperty); + return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); } @Override @@ -80,8 +252,17 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class AdditionalPropertiesClass {\n"); - sb.append(" mapProperty: ").append(toIndentedString(mapProperty)).append("\n"); - sb.append(" mapOfMapProperty: ").append(toIndentedString(mapOfMapProperty)).append("\n"); + sb.append(" mapString: ").append(toIndentedString(mapString)).append("\n"); + sb.append(" mapNumber: ").append(toIndentedString(mapNumber)).append("\n"); + sb.append(" mapInteger: ").append(toIndentedString(mapInteger)).append("\n"); + sb.append(" mapBoolean: ").append(toIndentedString(mapBoolean)).append("\n"); + sb.append(" mapArrayInteger: ").append(toIndentedString(mapArrayInteger)).append("\n"); + sb.append(" mapArrayAnytype: ").append(toIndentedString(mapArrayAnytype)).append("\n"); + sb.append(" mapMapString: ").append(toIndentedString(mapMapString)).append("\n"); + sb.append(" mapMapAnytype: ").append(toIndentedString(mapMapAnytype)).append("\n"); + sb.append(" anytype1: ").append(toIndentedString(anytype1)).append("\n"); + sb.append(" anytype2: ").append(toIndentedString(anytype2)).append("\n"); + sb.append(" anytype3: ").append(toIndentedString(anytype3)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java new file mode 100644 index 000000000000..c2c81ea584e1 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -0,0 +1,80 @@ +package org.openapitools.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.Map; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import io.swagger.annotations.*; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + + + +public class AdditionalPropertiesInteger extends HashMap implements Serializable { + + private @Valid String name; + + /** + **/ + public AdditionalPropertiesInteger name(String name) { + this.name = name; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("name") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesInteger additionalPropertiesInteger = (AdditionalPropertiesInteger) o; + return Objects.equals(this.name, additionalPropertiesInteger.name) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(name, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesInteger {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java new file mode 100644 index 000000000000..b4b4fc231978 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -0,0 +1,81 @@ +package org.openapitools.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.Map; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import io.swagger.annotations.*; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + + + +public class AdditionalPropertiesNumber extends HashMap implements Serializable { + + private @Valid String name; + + /** + **/ + public AdditionalPropertiesNumber name(String name) { + this.name = name; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("name") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesNumber additionalPropertiesNumber = (AdditionalPropertiesNumber) o; + return Objects.equals(this.name, additionalPropertiesNumber.name) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(name, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesNumber {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java new file mode 100644 index 000000000000..90ecd845ef3b --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -0,0 +1,80 @@ +package org.openapitools.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.Map; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import io.swagger.annotations.*; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + + + +public class AdditionalPropertiesObject extends HashMap implements Serializable { + + private @Valid String name; + + /** + **/ + public AdditionalPropertiesObject name(String name) { + this.name = name; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("name") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesObject additionalPropertiesObject = (AdditionalPropertiesObject) o; + return Objects.equals(this.name, additionalPropertiesObject.name) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(name, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesObject {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java new file mode 100644 index 000000000000..1454d0703802 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java @@ -0,0 +1,80 @@ +package org.openapitools.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.Map; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import io.swagger.annotations.*; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + + + +public class AdditionalPropertiesString extends HashMap implements Serializable { + + private @Valid String name; + + /** + **/ + public AdditionalPropertiesString name(String name) { + this.name = name; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("name") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesString additionalPropertiesString = (AdditionalPropertiesString) o; + return Objects.equals(this.name, additionalPropertiesString.name) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(name, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesString {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Animal.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Animal.java index 8b2e9658341d..48269bab57d9 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Animal.java @@ -14,6 +14,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = Dog.class, name = "Dog"), + @JsonSubTypes.Type(value = Cat.class, name = "Cat"), +}) public class Animal implements Serializable { @@ -66,8 +71,8 @@ public boolean equals(java.lang.Object o) { return false; } Animal animal = (Animal) o; - return Objects.equals(className, animal.className) && - Objects.equals(color, animal.color); + return Objects.equals(this.className, animal.className) && + Objects.equals(this.color, animal.color); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 43d65d72f381..cc9abca8a2a8 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -48,7 +48,7 @@ public boolean equals(java.lang.Object o) { return false; } ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly = (ArrayOfArrayOfNumberOnly) o; - return Objects.equals(arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber); + return Objects.equals(this.arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java index f29bd99493ae..40acdceef6a3 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -48,7 +48,7 @@ public boolean equals(java.lang.Object o) { return false; } ArrayOfNumberOnly arrayOfNumberOnly = (ArrayOfNumberOnly) o; - return Objects.equals(arrayNumber, arrayOfNumberOnly.arrayNumber); + return Objects.equals(this.arrayNumber, arrayOfNumberOnly.arrayNumber); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayTest.java index 249f75701bef..bd3241465564 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayTest.java @@ -84,9 +84,9 @@ public boolean equals(java.lang.Object o) { return false; } ArrayTest arrayTest = (ArrayTest) o; - return Objects.equals(arrayOfString, arrayTest.arrayOfString) && - Objects.equals(arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) && - Objects.equals(arrayArrayOfModel, arrayTest.arrayArrayOfModel); + return Objects.equals(this.arrayOfString, arrayTest.arrayOfString) && + Objects.equals(this.arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) && + Objects.equals(this.arrayArrayOfModel, arrayTest.arrayArrayOfModel); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Capitalization.java index 5ca325b2667b..9c9d8a8f4255 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Capitalization.java @@ -136,12 +136,12 @@ public boolean equals(java.lang.Object o) { return false; } Capitalization capitalization = (Capitalization) o; - return Objects.equals(smallCamel, capitalization.smallCamel) && - Objects.equals(capitalCamel, capitalization.capitalCamel) && - Objects.equals(smallSnake, capitalization.smallSnake) && - Objects.equals(capitalSnake, capitalization.capitalSnake) && - Objects.equals(scAETHFlowPoints, capitalization.scAETHFlowPoints) && - Objects.equals(ATT_NAME, capitalization.ATT_NAME); + return Objects.equals(this.smallCamel, capitalization.smallCamel) && + Objects.equals(this.capitalCamel, capitalization.capitalCamel) && + Objects.equals(this.smallSnake, capitalization.smallSnake) && + Objects.equals(this.capitalSnake, capitalization.capitalSnake) && + Objects.equals(this.scAETHFlowPoints, capitalization.scAETHFlowPoints) && + Objects.equals(this.ATT_NAME, capitalization.ATT_NAME); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Cat.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Cat.java index 9bfcfde280c2..12cfde8994ab 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Cat.java @@ -3,6 +3,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; +import org.openapitools.model.CatAllOf; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -46,12 +47,13 @@ public boolean equals(java.lang.Object o) { return false; } Cat cat = (Cat) o; - return Objects.equals(declawed, cat.declawed); + return Objects.equals(this.declawed, cat.declawed) && + super.equals(o); } @Override public int hashCode() { - return Objects.hash(declawed); + return Objects.hash(declawed, super.hashCode()); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/CatAllOf.java new file mode 100644 index 000000000000..66bfa279966f --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/CatAllOf.java @@ -0,0 +1,77 @@ +package org.openapitools.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import io.swagger.annotations.*; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + + + +public class CatAllOf implements Serializable { + + private @Valid Boolean declawed; + + /** + **/ + public CatAllOf declawed(Boolean declawed) { + this.declawed = declawed; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("declawed") + public Boolean getDeclawed() { + return declawed; + } + public void setDeclawed(Boolean declawed) { + this.declawed = declawed; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CatAllOf catAllOf = (CatAllOf) o; + return Objects.equals(this.declawed, catAllOf.declawed); + } + + @Override + public int hashCode() { + return Objects.hash(declawed); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CatAllOf {\n"); + + sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Category.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Category.java index 4c665566958b..fa0c47ddd86d 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Category.java @@ -17,7 +17,7 @@ public class Category implements Serializable { private @Valid Long id; - private @Valid String name; + private @Valid String name = "default-name"; /** **/ @@ -44,8 +44,9 @@ public Category name(String name) { } - @ApiModelProperty(value = "") + @ApiModelProperty(required = true, value = "") @JsonProperty("name") + @NotNull public String getName() { return name; } @@ -63,8 +64,8 @@ public boolean equals(java.lang.Object o) { return false; } Category category = (Category) o; - return Objects.equals(id, category.id) && - Objects.equals(name, category.name); + return Objects.equals(this.id, category.id) && + Objects.equals(this.name, category.name); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ClassModel.java index 5f7e3d649ce9..19e12db64933 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ClassModel.java @@ -12,6 +12,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; + /** * Model for testing model with \"_class\" property **/ @@ -47,7 +48,7 @@ public boolean equals(java.lang.Object o) { return false; } ClassModel classModel = (ClassModel) o; - return Objects.equals(propertyClass, classModel.propertyClass); + return Objects.equals(this.propertyClass, classModel.propertyClass); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Client.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Client.java index 92b6aed4de68..9703ba67fc95 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Client.java @@ -45,7 +45,7 @@ public boolean equals(java.lang.Object o) { return false; } Client client = (Client) o; - return Objects.equals(client, client.client); + return Objects.equals(this.client, client.client); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Dog.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Dog.java index d22452d2d879..685f46dcdd48 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Dog.java @@ -3,6 +3,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; +import org.openapitools.model.DogAllOf; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -46,12 +47,13 @@ public boolean equals(java.lang.Object o) { return false; } Dog dog = (Dog) o; - return Objects.equals(breed, dog.breed); + return Objects.equals(this.breed, dog.breed) && + super.equals(o); } @Override public int hashCode() { - return Objects.hash(breed); + return Objects.hash(breed, super.hashCode()); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/DogAllOf.java new file mode 100644 index 000000000000..dfcbfe7e72ad --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/DogAllOf.java @@ -0,0 +1,77 @@ +package org.openapitools.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import io.swagger.annotations.*; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + + + +public class DogAllOf implements Serializable { + + private @Valid String breed; + + /** + **/ + public DogAllOf breed(String breed) { + this.breed = breed; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("breed") + public String getBreed() { + return breed; + } + public void setBreed(String breed) { + this.breed = breed; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DogAllOf dogAllOf = (DogAllOf) o; + return Objects.equals(this.breed, dogAllOf.breed); + } + + @Override + public int hashCode() { + return Objects.hash(breed); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DogAllOf {\n"); + + sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/EnumArrays.java index ea468a71fc02..9a422c1c5540 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/EnumArrays.java @@ -41,13 +41,13 @@ public String toString() { } @JsonCreator - public static JustSymbolEnum fromValue(String v) { + public static JustSymbolEnum fromValue(String value) { for (JustSymbolEnum b : JustSymbolEnum.values()) { - if (String.valueOf(b.value).equals(v)) { + if (b.value.equals(value)) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + v + "'"); + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @@ -75,13 +75,13 @@ public String toString() { } @JsonCreator - public static ArrayEnumEnum fromValue(String v) { + public static ArrayEnumEnum fromValue(String value) { for (ArrayEnumEnum b : ArrayEnumEnum.values()) { - if (String.valueOf(b.value).equals(v)) { + if (b.value.equals(value)) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + v + "'"); + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @@ -131,8 +131,8 @@ public boolean equals(java.lang.Object o) { return false; } EnumArrays enumArrays = (EnumArrays) o; - return Objects.equals(justSymbol, enumArrays.justSymbol) && - Objects.equals(arrayEnum, enumArrays.arrayEnum); + return Objects.equals(this.justSymbol, enumArrays.justSymbol) && + Objects.equals(this.arrayEnum, enumArrays.arrayEnum); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/EnumClass.java index ba341ac9168c..64c669177148 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/EnumClass.java @@ -31,13 +31,13 @@ public String toString() { } @JsonCreator - public static EnumClass fromValue(String text) { + public static EnumClass fromValue(String value) { for (EnumClass b : EnumClass.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + text + "'"); + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/EnumTest.java index d3f415601893..7dc8942410a0 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/EnumTest.java @@ -40,13 +40,13 @@ public String toString() { } @JsonCreator - public static EnumStringEnum fromValue(String v) { + public static EnumStringEnum fromValue(String value) { for (EnumStringEnum b : EnumStringEnum.values()) { - if (String.valueOf(b.value).equals(v)) { + if (b.value.equals(value)) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + v + "'"); + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @@ -74,13 +74,13 @@ public String toString() { } @JsonCreator - public static EnumStringRequiredEnum fromValue(String v) { + public static EnumStringRequiredEnum fromValue(String value) { for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { - if (String.valueOf(b.value).equals(v)) { + if (b.value.equals(value)) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + v + "'"); + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @@ -108,13 +108,13 @@ public String toString() { } @JsonCreator - public static EnumIntegerEnum fromValue(String v) { + public static EnumIntegerEnum fromValue(Integer value) { for (EnumIntegerEnum b : EnumIntegerEnum.values()) { - if (String.valueOf(b.value).equals(v)) { + if (b.value.equals(value)) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + v + "'"); + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @@ -142,18 +142,18 @@ public String toString() { } @JsonCreator - public static EnumNumberEnum fromValue(String v) { + public static EnumNumberEnum fromValue(Double value) { for (EnumNumberEnum b : EnumNumberEnum.values()) { - if (String.valueOf(b.value).equals(v)) { + if (b.value.equals(value)) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + v + "'"); + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } private @Valid EnumNumberEnum enumNumber; - private @Valid OuterEnum outerEnum = null; + private @Valid OuterEnum outerEnum; /** **/ @@ -251,11 +251,11 @@ public boolean equals(java.lang.Object o) { return false; } EnumTest enumTest = (EnumTest) o; - return Objects.equals(enumString, enumTest.enumString) && - Objects.equals(enumStringRequired, enumTest.enumStringRequired) && - Objects.equals(enumInteger, enumTest.enumInteger) && - Objects.equals(enumNumber, enumTest.enumNumber) && - Objects.equals(outerEnum, enumTest.outerEnum); + return Objects.equals(this.enumString, enumTest.enumString) && + Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) && + Objects.equals(this.enumInteger, enumTest.enumInteger) && + Objects.equals(this.enumNumber, enumTest.enumNumber) && + Objects.equals(this.outerEnum, enumTest.outerEnum); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/FileSchemaTestClass.java index 0ba22995c7a2..f40b18f1cbd7 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/FileSchemaTestClass.java @@ -65,8 +65,8 @@ public boolean equals(java.lang.Object o) { return false; } FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o; - return Objects.equals(file, fileSchemaTestClass.file) && - Objects.equals(files, fileSchemaTestClass.files); + return Objects.equals(this.file, fileSchemaTestClass.file) && + Objects.equals(this.files, fileSchemaTestClass.files); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/FormatTest.java index 800fe24ff924..d86b83474ddd 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/FormatTest.java @@ -243,7 +243,7 @@ public FormatTest uuid(UUID uuid) { } - @ApiModelProperty(value = "") + @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") @JsonProperty("uuid") public UUID getUuid() { return uuid; @@ -280,19 +280,19 @@ public boolean equals(java.lang.Object o) { return false; } FormatTest formatTest = (FormatTest) o; - return Objects.equals(integer, formatTest.integer) && - Objects.equals(int32, formatTest.int32) && - Objects.equals(int64, formatTest.int64) && - Objects.equals(number, formatTest.number) && - Objects.equals(_float, formatTest._float) && - Objects.equals(_double, formatTest._double) && - Objects.equals(string, formatTest.string) && - Objects.equals(_byte, formatTest._byte) && - Objects.equals(binary, formatTest.binary) && - Objects.equals(date, formatTest.date) && - Objects.equals(dateTime, formatTest.dateTime) && - Objects.equals(uuid, formatTest.uuid) && - Objects.equals(password, formatTest.password); + return Objects.equals(this.integer, formatTest.integer) && + Objects.equals(this.int32, formatTest.int32) && + Objects.equals(this.int64, formatTest.int64) && + Objects.equals(this.number, formatTest.number) && + Objects.equals(this._float, formatTest._float) && + Objects.equals(this._double, formatTest._double) && + Objects.equals(this.string, formatTest.string) && + Objects.equals(this._byte, formatTest._byte) && + Objects.equals(this.binary, formatTest.binary) && + Objects.equals(this.date, formatTest.date) && + Objects.equals(this.dateTime, formatTest.dateTime) && + Objects.equals(this.uuid, formatTest.uuid) && + Objects.equals(this.password, formatTest.password); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java index 03cf3ef7aaaf..76898a7831bc 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java @@ -63,8 +63,8 @@ public boolean equals(java.lang.Object o) { return false; } HasOnlyReadOnly hasOnlyReadOnly = (HasOnlyReadOnly) o; - return Objects.equals(bar, hasOnlyReadOnly.bar) && - Objects.equals(foo, hasOnlyReadOnly.foo); + return Objects.equals(this.bar, hasOnlyReadOnly.bar) && + Objects.equals(this.foo, hasOnlyReadOnly.foo); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/MapTest.java index d0e0137e2107..059f500d097f 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/MapTest.java @@ -5,7 +5,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import org.openapitools.model.StringBooleanMap; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -44,19 +43,19 @@ public String toString() { } @JsonCreator - public static InnerEnum fromValue(String v) { + public static InnerEnum fromValue(String value) { for (InnerEnum b : InnerEnum.values()) { - if (String.valueOf(b.value).equals(v)) { + if (b.value.equals(value)) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + v + "'"); + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } private @Valid Map mapOfEnumString = new HashMap(); private @Valid Map directMap = new HashMap(); - private @Valid StringBooleanMap indirectMap = null; + private @Valid Map indirectMap = new HashMap(); /** **/ @@ -111,7 +110,7 @@ public void setDirectMap(Map directMap) { /** **/ - public MapTest indirectMap(StringBooleanMap indirectMap) { + public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; return this; } @@ -119,10 +118,10 @@ public MapTest indirectMap(StringBooleanMap indirectMap) { @ApiModelProperty(value = "") @JsonProperty("indirect_map") - public StringBooleanMap getIndirectMap() { + public Map getIndirectMap() { return indirectMap; } - public void setIndirectMap(StringBooleanMap indirectMap) { + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } @@ -136,10 +135,10 @@ public boolean equals(java.lang.Object o) { return false; } MapTest mapTest = (MapTest) o; - return Objects.equals(mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(mapOfEnumString, mapTest.mapOfEnumString) && - Objects.equals(directMap, mapTest.directMap) && - Objects.equals(indirectMap, mapTest.indirectMap); + return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && + Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && + Objects.equals(this.directMap, mapTest.directMap) && + Objects.equals(this.indirectMap, mapTest.indirectMap); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index dba6f5f403ff..8467e42ead18 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -87,9 +87,9 @@ public boolean equals(java.lang.Object o) { return false; } MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClass) o; - return Objects.equals(uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) && - Objects.equals(dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) && - Objects.equals(map, mixedPropertiesAndAdditionalPropertiesClass.map); + return Objects.equals(this.uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) && + Objects.equals(this.dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) && + Objects.equals(this.map, mixedPropertiesAndAdditionalPropertiesClass.map); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Model200Response.java index d4122c4a2e1e..d330491d413e 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Model200Response.java @@ -12,6 +12,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; + /** * Model for testing model name starting with number **/ @@ -65,8 +66,8 @@ public boolean equals(java.lang.Object o) { return false; } Model200Response _200response = (Model200Response) o; - return Objects.equals(name, _200response.name) && - Objects.equals(propertyClass, _200response.propertyClass); + return Objects.equals(this.name, _200response.name) && + Objects.equals(this.propertyClass, _200response.propertyClass); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ModelApiResponse.java index ab53e3693652..3aeaa2e80a83 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -81,9 +81,9 @@ public boolean equals(java.lang.Object o) { return false; } ModelApiResponse _apiResponse = (ModelApiResponse) o; - return Objects.equals(code, _apiResponse.code) && - Objects.equals(type, _apiResponse.type) && - Objects.equals(message, _apiResponse.message); + return Objects.equals(this.code, _apiResponse.code) && + Objects.equals(this.type, _apiResponse.type) && + Objects.equals(this.message, _apiResponse.message); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ModelReturn.java index 90f40a248f25..b8ccb56ccd5d 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ModelReturn.java @@ -12,6 +12,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; + /** * Model for testing reserved words **/ @@ -47,7 +48,7 @@ public boolean equals(java.lang.Object o) { return false; } ModelReturn _return = (ModelReturn) o; - return Objects.equals(_return, _return._return); + return Objects.equals(this._return, _return._return); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Name.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Name.java index bab48c428e64..30f2f65ac65e 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Name.java @@ -12,6 +12,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; + /** * Model for testing model name same as property name **/ @@ -102,10 +103,10 @@ public boolean equals(java.lang.Object o) { return false; } Name name = (Name) o; - return Objects.equals(name, name.name) && - Objects.equals(snakeCase, name.snakeCase) && - Objects.equals(property, name.property) && - Objects.equals(_123number, name._123number); + return Objects.equals(this.name, name.name) && + Objects.equals(this.snakeCase, name.snakeCase) && + Objects.equals(this.property, name.property) && + Objects.equals(this._123number, name._123number); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/NumberOnly.java index 000db43f0918..b5ae07a3dfb0 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/NumberOnly.java @@ -46,7 +46,7 @@ public boolean equals(java.lang.Object o) { return false; } NumberOnly numberOnly = (NumberOnly) o; - return Objects.equals(justNumber, numberOnly.justNumber); + return Objects.equals(this.justNumber, numberOnly.justNumber); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Order.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Order.java index dc35e75e0111..4c88bb4d6ad6 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Order.java @@ -44,13 +44,13 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String v) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(v)) { + if (b.value.equals(value)) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + v + "'"); + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @@ -170,12 +170,12 @@ public boolean equals(java.lang.Object o) { return false; } Order order = (Order) o; - return Objects.equals(id, order.id) && - Objects.equals(petId, order.petId) && - Objects.equals(quantity, order.quantity) && - Objects.equals(shipDate, order.shipDate) && - Objects.equals(status, order.status) && - Objects.equals(complete, order.complete); + return Objects.equals(this.id, order.id) && + Objects.equals(this.petId, order.petId) && + Objects.equals(this.quantity, order.quantity) && + Objects.equals(this.shipDate, order.shipDate) && + Objects.equals(this.status, order.status) && + Objects.equals(this.complete, order.complete); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/OuterComposite.java index 9ae89e7a2856..14e7f71319ad 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/OuterComposite.java @@ -82,9 +82,9 @@ public boolean equals(java.lang.Object o) { return false; } OuterComposite outerComposite = (OuterComposite) o; - return Objects.equals(myNumber, outerComposite.myNumber) && - Objects.equals(myString, outerComposite.myString) && - Objects.equals(myBoolean, outerComposite.myBoolean); + return Objects.equals(this.myNumber, outerComposite.myNumber) && + Objects.equals(this.myString, outerComposite.myString) && + Objects.equals(this.myBoolean, outerComposite.myBoolean); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/OuterEnum.java index f69d482a93d9..fbd86c9bdbe1 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/OuterEnum.java @@ -31,13 +31,13 @@ public String toString() { } @JsonCreator - public static OuterEnum fromValue(String text) { + public static OuterEnum fromValue(String value) { for (OuterEnum b : OuterEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + text + "'"); + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Pet.java index 6c5f3319798c..5e22807ad680 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Pet.java @@ -48,13 +48,13 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String v) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(v)) { + if (b.value.equals(value)) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + v + "'"); + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @@ -175,12 +175,12 @@ public boolean equals(java.lang.Object o) { return false; } Pet pet = (Pet) o; - return Objects.equals(id, pet.id) && - Objects.equals(category, pet.category) && - Objects.equals(name, pet.name) && - Objects.equals(photoUrls, pet.photoUrls) && - Objects.equals(tags, pet.tags) && - Objects.equals(status, pet.status); + return Objects.equals(this.id, pet.id) && + Objects.equals(this.category, pet.category) && + Objects.equals(this.name, pet.name) && + Objects.equals(this.photoUrls, pet.photoUrls) && + Objects.equals(this.tags, pet.tags) && + Objects.equals(this.status, pet.status); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ReadOnlyFirst.java index 031ee7cf9f12..27b680b98690 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ReadOnlyFirst.java @@ -63,8 +63,8 @@ public boolean equals(java.lang.Object o) { return false; } ReadOnlyFirst readOnlyFirst = (ReadOnlyFirst) o; - return Objects.equals(bar, readOnlyFirst.bar) && - Objects.equals(baz, readOnlyFirst.baz); + return Objects.equals(this.bar, readOnlyFirst.bar) && + Objects.equals(this.baz, readOnlyFirst.baz); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/SpecialModelName.java index 9d589d25a4b0..9e1984faaa05 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/SpecialModelName.java @@ -45,7 +45,7 @@ public boolean equals(java.lang.Object o) { return false; } SpecialModelName $specialModelName = (SpecialModelName) o; - return Objects.equals($specialPropertyName, $specialModelName.$specialPropertyName); + return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Tag.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Tag.java index 15e81930db25..cec2b713130a 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Tag.java @@ -63,8 +63,8 @@ public boolean equals(java.lang.Object o) { return false; } Tag tag = (Tag) o; - return Objects.equals(id, tag.id) && - Objects.equals(name, tag.name); + return Objects.equals(this.id, tag.id) && + Objects.equals(this.name, tag.name); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/TypeHolderDefault.java new file mode 100644 index 000000000000..957dd7c6cf3a --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/TypeHolderDefault.java @@ -0,0 +1,165 @@ +package org.openapitools.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import io.swagger.annotations.*; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + + + +public class TypeHolderDefault implements Serializable { + + private @Valid String stringItem = "what"; + private @Valid BigDecimal numberItem; + private @Valid Integer integerItem; + private @Valid Boolean boolItem = true; + private @Valid List arrayItem = new ArrayList(); + + /** + **/ + public TypeHolderDefault stringItem(String stringItem) { + this.stringItem = stringItem; + return this; + } + + + @ApiModelProperty(required = true, value = "") + @JsonProperty("string_item") + @NotNull + public String getStringItem() { + return stringItem; + } + public void setStringItem(String stringItem) { + this.stringItem = stringItem; + } + + /** + **/ + public TypeHolderDefault numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; + return this; + } + + + @ApiModelProperty(required = true, value = "") + @JsonProperty("number_item") + @NotNull + public BigDecimal getNumberItem() { + return numberItem; + } + public void setNumberItem(BigDecimal numberItem) { + this.numberItem = numberItem; + } + + /** + **/ + public TypeHolderDefault integerItem(Integer integerItem) { + this.integerItem = integerItem; + return this; + } + + + @ApiModelProperty(required = true, value = "") + @JsonProperty("integer_item") + @NotNull + public Integer getIntegerItem() { + return integerItem; + } + public void setIntegerItem(Integer integerItem) { + this.integerItem = integerItem; + } + + /** + **/ + public TypeHolderDefault boolItem(Boolean boolItem) { + this.boolItem = boolItem; + return this; + } + + + @ApiModelProperty(required = true, value = "") + @JsonProperty("bool_item") + @NotNull + public Boolean getBoolItem() { + return boolItem; + } + public void setBoolItem(Boolean boolItem) { + this.boolItem = boolItem; + } + + /** + **/ + public TypeHolderDefault arrayItem(List arrayItem) { + this.arrayItem = arrayItem; + return this; + } + + + @ApiModelProperty(required = true, value = "") + @JsonProperty("array_item") + @NotNull + public List getArrayItem() { + return arrayItem; + } + public void setArrayItem(List arrayItem) { + this.arrayItem = arrayItem; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TypeHolderDefault typeHolderDefault = (TypeHolderDefault) o; + return Objects.equals(this.stringItem, typeHolderDefault.stringItem) && + Objects.equals(this.numberItem, typeHolderDefault.numberItem) && + Objects.equals(this.integerItem, typeHolderDefault.integerItem) && + Objects.equals(this.boolItem, typeHolderDefault.boolItem) && + Objects.equals(this.arrayItem, typeHolderDefault.arrayItem); + } + + @Override + public int hashCode() { + return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TypeHolderDefault {\n"); + + sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); + sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); + sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); + sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/TypeHolderExample.java new file mode 100644 index 000000000000..c97a19122069 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/TypeHolderExample.java @@ -0,0 +1,165 @@ +package org.openapitools.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import io.swagger.annotations.*; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + + + +public class TypeHolderExample implements Serializable { + + private @Valid String stringItem; + private @Valid BigDecimal numberItem; + private @Valid Integer integerItem; + private @Valid Boolean boolItem; + private @Valid List arrayItem = new ArrayList(); + + /** + **/ + public TypeHolderExample stringItem(String stringItem) { + this.stringItem = stringItem; + return this; + } + + + @ApiModelProperty(example = "what", required = true, value = "") + @JsonProperty("string_item") + @NotNull + public String getStringItem() { + return stringItem; + } + public void setStringItem(String stringItem) { + this.stringItem = stringItem; + } + + /** + **/ + public TypeHolderExample numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; + return this; + } + + + @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty("number_item") + @NotNull + public BigDecimal getNumberItem() { + return numberItem; + } + public void setNumberItem(BigDecimal numberItem) { + this.numberItem = numberItem; + } + + /** + **/ + public TypeHolderExample integerItem(Integer integerItem) { + this.integerItem = integerItem; + return this; + } + + + @ApiModelProperty(example = "-2", required = true, value = "") + @JsonProperty("integer_item") + @NotNull + public Integer getIntegerItem() { + return integerItem; + } + public void setIntegerItem(Integer integerItem) { + this.integerItem = integerItem; + } + + /** + **/ + public TypeHolderExample boolItem(Boolean boolItem) { + this.boolItem = boolItem; + return this; + } + + + @ApiModelProperty(example = "true", required = true, value = "") + @JsonProperty("bool_item") + @NotNull + public Boolean getBoolItem() { + return boolItem; + } + public void setBoolItem(Boolean boolItem) { + this.boolItem = boolItem; + } + + /** + **/ + public TypeHolderExample arrayItem(List arrayItem) { + this.arrayItem = arrayItem; + return this; + } + + + @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + @JsonProperty("array_item") + @NotNull + public List getArrayItem() { + return arrayItem; + } + public void setArrayItem(List arrayItem) { + this.arrayItem = arrayItem; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TypeHolderExample typeHolderExample = (TypeHolderExample) o; + return Objects.equals(this.stringItem, typeHolderExample.stringItem) && + Objects.equals(this.numberItem, typeHolderExample.numberItem) && + Objects.equals(this.integerItem, typeHolderExample.integerItem) && + Objects.equals(this.boolItem, typeHolderExample.boolItem) && + Objects.equals(this.arrayItem, typeHolderExample.arrayItem); + } + + @Override + public int hashCode() { + return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TypeHolderExample {\n"); + + sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); + sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); + sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); + sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/User.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/User.java index 2b3123ad16b0..2ab19c284a30 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/User.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/User.java @@ -172,14 +172,14 @@ public boolean equals(java.lang.Object o) { return false; } User user = (User) o; - return Objects.equals(id, user.id) && - Objects.equals(username, user.username) && - Objects.equals(firstName, user.firstName) && - Objects.equals(lastName, user.lastName) && - Objects.equals(email, user.email) && - Objects.equals(password, user.password) && - Objects.equals(phone, user.phone) && - Objects.equals(userStatus, user.userStatus); + return Objects.equals(this.id, user.id) && + Objects.equals(this.username, user.username) && + Objects.equals(this.firstName, user.firstName) && + Objects.equals(this.lastName, user.lastName) && + Objects.equals(this.email, user.email) && + Objects.equals(this.password, user.password) && + Objects.equals(this.phone, user.phone) && + Objects.equals(this.userStatus, user.userStatus); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/XmlItem.java new file mode 100644 index 000000000000..8c841c34f110 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/XmlItem.java @@ -0,0 +1,640 @@ +package org.openapitools.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import io.swagger.annotations.*; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + + + +public class XmlItem implements Serializable { + + private @Valid String attributeString; + private @Valid BigDecimal attributeNumber; + private @Valid Integer attributeInteger; + private @Valid Boolean attributeBoolean; + private @Valid List wrappedArray = new ArrayList(); + private @Valid String nameString; + private @Valid BigDecimal nameNumber; + private @Valid Integer nameInteger; + private @Valid Boolean nameBoolean; + private @Valid List nameArray = new ArrayList(); + private @Valid List nameWrappedArray = new ArrayList(); + private @Valid String prefixString; + private @Valid BigDecimal prefixNumber; + private @Valid Integer prefixInteger; + private @Valid Boolean prefixBoolean; + private @Valid List prefixArray = new ArrayList(); + private @Valid List prefixWrappedArray = new ArrayList(); + private @Valid String namespaceString; + private @Valid BigDecimal namespaceNumber; + private @Valid Integer namespaceInteger; + private @Valid Boolean namespaceBoolean; + private @Valid List namespaceArray = new ArrayList(); + private @Valid List namespaceWrappedArray = new ArrayList(); + private @Valid String prefixNsString; + private @Valid BigDecimal prefixNsNumber; + private @Valid Integer prefixNsInteger; + private @Valid Boolean prefixNsBoolean; + private @Valid List prefixNsArray = new ArrayList(); + private @Valid List prefixNsWrappedArray = new ArrayList(); + + /** + **/ + public XmlItem attributeString(String attributeString) { + this.attributeString = attributeString; + return this; + } + + + @ApiModelProperty(example = "string", value = "") + @JsonProperty("attribute_string") + public String getAttributeString() { + return attributeString; + } + public void setAttributeString(String attributeString) { + this.attributeString = attributeString; + } + + /** + **/ + public XmlItem attributeNumber(BigDecimal attributeNumber) { + this.attributeNumber = attributeNumber; + return this; + } + + + @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("attribute_number") + public BigDecimal getAttributeNumber() { + return attributeNumber; + } + public void setAttributeNumber(BigDecimal attributeNumber) { + this.attributeNumber = attributeNumber; + } + + /** + **/ + public XmlItem attributeInteger(Integer attributeInteger) { + this.attributeInteger = attributeInteger; + return this; + } + + + @ApiModelProperty(example = "-2", value = "") + @JsonProperty("attribute_integer") + public Integer getAttributeInteger() { + return attributeInteger; + } + public void setAttributeInteger(Integer attributeInteger) { + this.attributeInteger = attributeInteger; + } + + /** + **/ + public XmlItem attributeBoolean(Boolean attributeBoolean) { + this.attributeBoolean = attributeBoolean; + return this; + } + + + @ApiModelProperty(example = "true", value = "") + @JsonProperty("attribute_boolean") + public Boolean getAttributeBoolean() { + return attributeBoolean; + } + public void setAttributeBoolean(Boolean attributeBoolean) { + this.attributeBoolean = attributeBoolean; + } + + /** + **/ + public XmlItem wrappedArray(List wrappedArray) { + this.wrappedArray = wrappedArray; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("wrapped_array") + public List getWrappedArray() { + return wrappedArray; + } + public void setWrappedArray(List wrappedArray) { + this.wrappedArray = wrappedArray; + } + + /** + **/ + public XmlItem nameString(String nameString) { + this.nameString = nameString; + return this; + } + + + @ApiModelProperty(example = "string", value = "") + @JsonProperty("name_string") + public String getNameString() { + return nameString; + } + public void setNameString(String nameString) { + this.nameString = nameString; + } + + /** + **/ + public XmlItem nameNumber(BigDecimal nameNumber) { + this.nameNumber = nameNumber; + return this; + } + + + @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("name_number") + public BigDecimal getNameNumber() { + return nameNumber; + } + public void setNameNumber(BigDecimal nameNumber) { + this.nameNumber = nameNumber; + } + + /** + **/ + public XmlItem nameInteger(Integer nameInteger) { + this.nameInteger = nameInteger; + return this; + } + + + @ApiModelProperty(example = "-2", value = "") + @JsonProperty("name_integer") + public Integer getNameInteger() { + return nameInteger; + } + public void setNameInteger(Integer nameInteger) { + this.nameInteger = nameInteger; + } + + /** + **/ + public XmlItem nameBoolean(Boolean nameBoolean) { + this.nameBoolean = nameBoolean; + return this; + } + + + @ApiModelProperty(example = "true", value = "") + @JsonProperty("name_boolean") + public Boolean getNameBoolean() { + return nameBoolean; + } + public void setNameBoolean(Boolean nameBoolean) { + this.nameBoolean = nameBoolean; + } + + /** + **/ + public XmlItem nameArray(List nameArray) { + this.nameArray = nameArray; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("name_array") + public List getNameArray() { + return nameArray; + } + public void setNameArray(List nameArray) { + this.nameArray = nameArray; + } + + /** + **/ + public XmlItem nameWrappedArray(List nameWrappedArray) { + this.nameWrappedArray = nameWrappedArray; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("name_wrapped_array") + public List getNameWrappedArray() { + return nameWrappedArray; + } + public void setNameWrappedArray(List nameWrappedArray) { + this.nameWrappedArray = nameWrappedArray; + } + + /** + **/ + public XmlItem prefixString(String prefixString) { + this.prefixString = prefixString; + return this; + } + + + @ApiModelProperty(example = "string", value = "") + @JsonProperty("prefix_string") + public String getPrefixString() { + return prefixString; + } + public void setPrefixString(String prefixString) { + this.prefixString = prefixString; + } + + /** + **/ + public XmlItem prefixNumber(BigDecimal prefixNumber) { + this.prefixNumber = prefixNumber; + return this; + } + + + @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("prefix_number") + public BigDecimal getPrefixNumber() { + return prefixNumber; + } + public void setPrefixNumber(BigDecimal prefixNumber) { + this.prefixNumber = prefixNumber; + } + + /** + **/ + public XmlItem prefixInteger(Integer prefixInteger) { + this.prefixInteger = prefixInteger; + return this; + } + + + @ApiModelProperty(example = "-2", value = "") + @JsonProperty("prefix_integer") + public Integer getPrefixInteger() { + return prefixInteger; + } + public void setPrefixInteger(Integer prefixInteger) { + this.prefixInteger = prefixInteger; + } + + /** + **/ + public XmlItem prefixBoolean(Boolean prefixBoolean) { + this.prefixBoolean = prefixBoolean; + return this; + } + + + @ApiModelProperty(example = "true", value = "") + @JsonProperty("prefix_boolean") + public Boolean getPrefixBoolean() { + return prefixBoolean; + } + public void setPrefixBoolean(Boolean prefixBoolean) { + this.prefixBoolean = prefixBoolean; + } + + /** + **/ + public XmlItem prefixArray(List prefixArray) { + this.prefixArray = prefixArray; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("prefix_array") + public List getPrefixArray() { + return prefixArray; + } + public void setPrefixArray(List prefixArray) { + this.prefixArray = prefixArray; + } + + /** + **/ + public XmlItem prefixWrappedArray(List prefixWrappedArray) { + this.prefixWrappedArray = prefixWrappedArray; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("prefix_wrapped_array") + public List getPrefixWrappedArray() { + return prefixWrappedArray; + } + public void setPrefixWrappedArray(List prefixWrappedArray) { + this.prefixWrappedArray = prefixWrappedArray; + } + + /** + **/ + public XmlItem namespaceString(String namespaceString) { + this.namespaceString = namespaceString; + return this; + } + + + @ApiModelProperty(example = "string", value = "") + @JsonProperty("namespace_string") + public String getNamespaceString() { + return namespaceString; + } + public void setNamespaceString(String namespaceString) { + this.namespaceString = namespaceString; + } + + /** + **/ + public XmlItem namespaceNumber(BigDecimal namespaceNumber) { + this.namespaceNumber = namespaceNumber; + return this; + } + + + @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("namespace_number") + public BigDecimal getNamespaceNumber() { + return namespaceNumber; + } + public void setNamespaceNumber(BigDecimal namespaceNumber) { + this.namespaceNumber = namespaceNumber; + } + + /** + **/ + public XmlItem namespaceInteger(Integer namespaceInteger) { + this.namespaceInteger = namespaceInteger; + return this; + } + + + @ApiModelProperty(example = "-2", value = "") + @JsonProperty("namespace_integer") + public Integer getNamespaceInteger() { + return namespaceInteger; + } + public void setNamespaceInteger(Integer namespaceInteger) { + this.namespaceInteger = namespaceInteger; + } + + /** + **/ + public XmlItem namespaceBoolean(Boolean namespaceBoolean) { + this.namespaceBoolean = namespaceBoolean; + return this; + } + + + @ApiModelProperty(example = "true", value = "") + @JsonProperty("namespace_boolean") + public Boolean getNamespaceBoolean() { + return namespaceBoolean; + } + public void setNamespaceBoolean(Boolean namespaceBoolean) { + this.namespaceBoolean = namespaceBoolean; + } + + /** + **/ + public XmlItem namespaceArray(List namespaceArray) { + this.namespaceArray = namespaceArray; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("namespace_array") + public List getNamespaceArray() { + return namespaceArray; + } + public void setNamespaceArray(List namespaceArray) { + this.namespaceArray = namespaceArray; + } + + /** + **/ + public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { + this.namespaceWrappedArray = namespaceWrappedArray; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("namespace_wrapped_array") + public List getNamespaceWrappedArray() { + return namespaceWrappedArray; + } + public void setNamespaceWrappedArray(List namespaceWrappedArray) { + this.namespaceWrappedArray = namespaceWrappedArray; + } + + /** + **/ + public XmlItem prefixNsString(String prefixNsString) { + this.prefixNsString = prefixNsString; + return this; + } + + + @ApiModelProperty(example = "string", value = "") + @JsonProperty("prefix_ns_string") + public String getPrefixNsString() { + return prefixNsString; + } + public void setPrefixNsString(String prefixNsString) { + this.prefixNsString = prefixNsString; + } + + /** + **/ + public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { + this.prefixNsNumber = prefixNsNumber; + return this; + } + + + @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("prefix_ns_number") + public BigDecimal getPrefixNsNumber() { + return prefixNsNumber; + } + public void setPrefixNsNumber(BigDecimal prefixNsNumber) { + this.prefixNsNumber = prefixNsNumber; + } + + /** + **/ + public XmlItem prefixNsInteger(Integer prefixNsInteger) { + this.prefixNsInteger = prefixNsInteger; + return this; + } + + + @ApiModelProperty(example = "-2", value = "") + @JsonProperty("prefix_ns_integer") + public Integer getPrefixNsInteger() { + return prefixNsInteger; + } + public void setPrefixNsInteger(Integer prefixNsInteger) { + this.prefixNsInteger = prefixNsInteger; + } + + /** + **/ + public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { + this.prefixNsBoolean = prefixNsBoolean; + return this; + } + + + @ApiModelProperty(example = "true", value = "") + @JsonProperty("prefix_ns_boolean") + public Boolean getPrefixNsBoolean() { + return prefixNsBoolean; + } + public void setPrefixNsBoolean(Boolean prefixNsBoolean) { + this.prefixNsBoolean = prefixNsBoolean; + } + + /** + **/ + public XmlItem prefixNsArray(List prefixNsArray) { + this.prefixNsArray = prefixNsArray; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("prefix_ns_array") + public List getPrefixNsArray() { + return prefixNsArray; + } + public void setPrefixNsArray(List prefixNsArray) { + this.prefixNsArray = prefixNsArray; + } + + /** + **/ + public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { + this.prefixNsWrappedArray = prefixNsWrappedArray; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("prefix_ns_wrapped_array") + public List getPrefixNsWrappedArray() { + return prefixNsWrappedArray; + } + public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { + this.prefixNsWrappedArray = prefixNsWrappedArray; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + XmlItem xmlItem = (XmlItem) o; + return Objects.equals(this.attributeString, xmlItem.attributeString) && + Objects.equals(this.attributeNumber, xmlItem.attributeNumber) && + Objects.equals(this.attributeInteger, xmlItem.attributeInteger) && + Objects.equals(this.attributeBoolean, xmlItem.attributeBoolean) && + Objects.equals(this.wrappedArray, xmlItem.wrappedArray) && + Objects.equals(this.nameString, xmlItem.nameString) && + Objects.equals(this.nameNumber, xmlItem.nameNumber) && + Objects.equals(this.nameInteger, xmlItem.nameInteger) && + Objects.equals(this.nameBoolean, xmlItem.nameBoolean) && + Objects.equals(this.nameArray, xmlItem.nameArray) && + Objects.equals(this.nameWrappedArray, xmlItem.nameWrappedArray) && + Objects.equals(this.prefixString, xmlItem.prefixString) && + Objects.equals(this.prefixNumber, xmlItem.prefixNumber) && + Objects.equals(this.prefixInteger, xmlItem.prefixInteger) && + Objects.equals(this.prefixBoolean, xmlItem.prefixBoolean) && + Objects.equals(this.prefixArray, xmlItem.prefixArray) && + Objects.equals(this.prefixWrappedArray, xmlItem.prefixWrappedArray) && + Objects.equals(this.namespaceString, xmlItem.namespaceString) && + Objects.equals(this.namespaceNumber, xmlItem.namespaceNumber) && + Objects.equals(this.namespaceInteger, xmlItem.namespaceInteger) && + Objects.equals(this.namespaceBoolean, xmlItem.namespaceBoolean) && + Objects.equals(this.namespaceArray, xmlItem.namespaceArray) && + Objects.equals(this.namespaceWrappedArray, xmlItem.namespaceWrappedArray) && + Objects.equals(this.prefixNsString, xmlItem.prefixNsString) && + Objects.equals(this.prefixNsNumber, xmlItem.prefixNsNumber) && + Objects.equals(this.prefixNsInteger, xmlItem.prefixNsInteger) && + Objects.equals(this.prefixNsBoolean, xmlItem.prefixNsBoolean) && + Objects.equals(this.prefixNsArray, xmlItem.prefixNsArray) && + Objects.equals(this.prefixNsWrappedArray, xmlItem.prefixNsWrappedArray); + } + + @Override + public int hashCode() { + return Objects.hash(attributeString, attributeNumber, attributeInteger, attributeBoolean, wrappedArray, nameString, nameNumber, nameInteger, nameBoolean, nameArray, nameWrappedArray, prefixString, prefixNumber, prefixInteger, prefixBoolean, prefixArray, prefixWrappedArray, namespaceString, namespaceNumber, namespaceInteger, namespaceBoolean, namespaceArray, namespaceWrappedArray, prefixNsString, prefixNsNumber, prefixNsInteger, prefixNsBoolean, prefixNsArray, prefixNsWrappedArray); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class XmlItem {\n"); + + sb.append(" attributeString: ").append(toIndentedString(attributeString)).append("\n"); + sb.append(" attributeNumber: ").append(toIndentedString(attributeNumber)).append("\n"); + sb.append(" attributeInteger: ").append(toIndentedString(attributeInteger)).append("\n"); + sb.append(" attributeBoolean: ").append(toIndentedString(attributeBoolean)).append("\n"); + sb.append(" wrappedArray: ").append(toIndentedString(wrappedArray)).append("\n"); + sb.append(" nameString: ").append(toIndentedString(nameString)).append("\n"); + sb.append(" nameNumber: ").append(toIndentedString(nameNumber)).append("\n"); + sb.append(" nameInteger: ").append(toIndentedString(nameInteger)).append("\n"); + sb.append(" nameBoolean: ").append(toIndentedString(nameBoolean)).append("\n"); + sb.append(" nameArray: ").append(toIndentedString(nameArray)).append("\n"); + sb.append(" nameWrappedArray: ").append(toIndentedString(nameWrappedArray)).append("\n"); + sb.append(" prefixString: ").append(toIndentedString(prefixString)).append("\n"); + sb.append(" prefixNumber: ").append(toIndentedString(prefixNumber)).append("\n"); + sb.append(" prefixInteger: ").append(toIndentedString(prefixInteger)).append("\n"); + sb.append(" prefixBoolean: ").append(toIndentedString(prefixBoolean)).append("\n"); + sb.append(" prefixArray: ").append(toIndentedString(prefixArray)).append("\n"); + sb.append(" prefixWrappedArray: ").append(toIndentedString(prefixWrappedArray)).append("\n"); + sb.append(" namespaceString: ").append(toIndentedString(namespaceString)).append("\n"); + sb.append(" namespaceNumber: ").append(toIndentedString(namespaceNumber)).append("\n"); + sb.append(" namespaceInteger: ").append(toIndentedString(namespaceInteger)).append("\n"); + sb.append(" namespaceBoolean: ").append(toIndentedString(namespaceBoolean)).append("\n"); + sb.append(" namespaceArray: ").append(toIndentedString(namespaceArray)).append("\n"); + sb.append(" namespaceWrappedArray: ").append(toIndentedString(namespaceWrappedArray)).append("\n"); + sb.append(" prefixNsString: ").append(toIndentedString(prefixNsString)).append("\n"); + sb.append(" prefixNsNumber: ").append(toIndentedString(prefixNsNumber)).append("\n"); + sb.append(" prefixNsInteger: ").append(toIndentedString(prefixNsInteger)).append("\n"); + sb.append(" prefixNsBoolean: ").append(toIndentedString(prefixNsBoolean)).append("\n"); + sb.append(" prefixNsArray: ").append(toIndentedString(prefixNsArray)).append("\n"); + sb.append(" prefixNsWrappedArray: ").append(toIndentedString(prefixNsWrappedArray)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/main/openapi/openapi.yaml b/samples/server/petstore/jaxrs-spec-interface-response/src/main/openapi/openapi.yaml index 8ce9975a0aa3..67ecc530a56d 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/main/openapi/openapi.yaml +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/main/openapi/openapi.yaml @@ -32,6 +32,9 @@ paths: description: Pet object that needs to be added to the store required: true responses: + 200: + content: {} + description: successful operation 405: content: {} description: Invalid input @@ -42,6 +45,9 @@ paths: summary: Add a new pet to the store tags: - pet + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json x-tags: - tag: pet put: @@ -57,6 +63,9 @@ paths: description: Pet object that needs to be added to the store required: true responses: + 200: + content: {} + description: successful operation 400: content: {} description: Invalid ID supplied @@ -73,6 +82,9 @@ paths: summary: Update an existing pet tags: - pet + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json x-tags: - tag: pet /pet/findByStatus: @@ -119,12 +131,14 @@ paths: summary: Finds Pets by status tags: - pet + x-accepts: application/json x-tags: - tag: pet /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + description: Multiple tags can be provided with comma separated strings. Use + tag1, tag2, tag3 for testing. operationId: findPetsByTags parameters: - description: Tags to filter by @@ -161,6 +175,7 @@ paths: summary: Finds Pets by tags tags: - pet + x-accepts: application/json x-tags: - tag: pet /pet/{petId}: @@ -179,6 +194,9 @@ paths: format: int64 type: integer responses: + 200: + content: {} + description: successful operation 400: content: {} description: Invalid pet value @@ -189,6 +207,7 @@ paths: summary: Deletes a pet tags: - pet + x-accepts: application/json x-tags: - tag: pet get: @@ -223,6 +242,7 @@ paths: summary: Find pet by ID tags: - pet + x-accepts: application/json x-tags: - tag: pet post: @@ -257,6 +277,8 @@ paths: summary: Updates a pet in the store with form data tags: - pet + x-contentType: application/x-www-form-urlencoded + x-accepts: application/json x-tags: - tag: pet /pet/{petId}/uploadImage: @@ -296,6 +318,8 @@ paths: summary: uploads an image tags: - pet + x-contentType: multipart/form-data + x-accepts: application/json x-tags: - tag: pet /store/inventory: @@ -317,6 +341,7 @@ paths: summary: Returns pet inventories by status tags: - store + x-accepts: application/json x-tags: - tag: store /store/order: @@ -345,11 +370,15 @@ paths: summary: Place an order for a pet tags: - store + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json x-tags: - tag: store /store/order/{order_id}: delete: - description: For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + description: For valid response try integer IDs with value < 1000. Anything + above 1000 or nonintegers will generate API errors operationId: deleteOrder parameters: - description: ID of the order that needs to be deleted @@ -368,10 +397,12 @@ paths: summary: Delete purchase order by ID tags: - store + x-accepts: application/json x-tags: - tag: store get: - description: For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generated exceptions operationId: getOrderById parameters: - description: ID of pet that needs to be fetched @@ -402,6 +433,7 @@ paths: summary: Find purchase order by ID tags: - store + x-accepts: application/json x-tags: - tag: store /user: @@ -422,6 +454,9 @@ paths: summary: Create user tags: - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json x-tags: - tag: user /user/createWithArray: @@ -443,6 +478,9 @@ paths: summary: Creates list of users with given input array tags: - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json x-tags: - tag: user /user/createWithList: @@ -464,6 +502,9 @@ paths: summary: Creates list of users with given input array tags: - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json x-tags: - tag: user /user/login: @@ -509,6 +550,7 @@ paths: summary: Logs user into the system tags: - user + x-accepts: application/json x-tags: - tag: user /user/logout: @@ -521,6 +563,7 @@ paths: summary: Logs out current logged in user session tags: - user + x-accepts: application/json x-tags: - tag: user /user/{username}: @@ -544,6 +587,7 @@ paths: summary: Delete user tags: - user + x-accepts: application/json x-tags: - tag: user get: @@ -574,6 +618,7 @@ paths: summary: Get user by user name tags: - user + x-accepts: application/json x-tags: - tag: user put: @@ -603,6 +648,9 @@ paths: summary: Updated user tags: - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json x-tags: - tag: user /fake_classname_test: @@ -628,9 +676,62 @@ paths: summary: To test class name in snake case tags: - fake_classname_tags 123#$%^ + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json x-tags: - tag: fake_classname_tags 123#$%^ /fake: + delete: + description: Fake endpoint to test group parameters (optional) + operationId: testGroupParameters + parameters: + - description: Required String in group parameters + in: query + name: required_string_group + required: true + schema: + type: integer + - description: Required Boolean in group parameters + in: header + name: required_boolean_group + required: true + schema: + type: boolean + - description: Required Integer in group parameters + in: query + name: required_int64_group + required: true + schema: + format: int64 + type: integer + - description: String in group parameters + in: query + name: string_group + schema: + type: integer + - description: Boolean in group parameters + in: header + name: boolean_group + schema: + type: boolean + - description: Integer in group parameters + in: query + name: int64_group + schema: + format: int64 + type: integer + responses: + 400: + content: {} + description: Someting wrong + summary: Fake endpoint to test group parameters (optional) + tags: + - fake + x-group-parameters: true + x-accepts: application/json + x-tags: + - tag: fake get: description: To test enum parameters operationId: testEnumParameters @@ -731,6 +832,8 @@ paths: summary: To test enum parameters tags: - fake + x-contentType: application/x-www-form-urlencoded + x-accepts: application/json x-tags: - tag: fake patch: @@ -753,6 +856,9 @@ paths: summary: To test "client" model tags: - fake + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json x-tags: - tag: fake post: @@ -853,6 +959,8 @@ paths: 가짜 엔드 포인트 tags: - fake + x-contentType: application/x-www-form-urlencoded + x-accepts: application/json x-tags: - tag: fake /fake/outer/number: @@ -875,6 +983,9 @@ paths: description: Output number tags: - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' x-tags: - tag: fake /fake/outer/string: @@ -897,6 +1008,9 @@ paths: description: Output string tags: - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' x-tags: - tag: fake /fake/outer/boolean: @@ -919,6 +1033,9 @@ paths: description: Output boolean tags: - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' x-tags: - tag: fake /fake/outer/composite: @@ -941,6 +1058,9 @@ paths: description: Output composite tags: - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' x-tags: - tag: fake /fake/jsonFormData: @@ -968,6 +1088,8 @@ paths: summary: test json serialization of form data tags: - fake + x-contentType: application/x-www-form-urlencoded + x-accepts: application/json x-tags: - tag: fake /fake/inline-additionalProperties: @@ -989,6 +1111,9 @@ paths: summary: test inline additionalProperties tags: - fake + x-codegen-request-body-name: param + x-contentType: application/json + x-accepts: application/json x-tags: - tag: fake /fake/body-with-query-params: @@ -1012,6 +1137,47 @@ paths: description: Success tags: - fake + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json + x-tags: + - tag: fake + /fake/create_xml_item: + post: + description: this route creates an XmlItem + operationId: createXmlItem + requestBody: + content: + application/xml: + schema: + $ref: '#/components/schemas/XmlItem' + application/xml; charset=utf-8: + schema: + $ref: '#/components/schemas/XmlItem' + application/xml; charset=utf-16: + schema: + $ref: '#/components/schemas/XmlItem' + text/xml: + schema: + $ref: '#/components/schemas/XmlItem' + text/xml; charset=utf-8: + schema: + $ref: '#/components/schemas/XmlItem' + text/xml; charset=utf-16: + schema: + $ref: '#/components/schemas/XmlItem' + description: XmlItem Body + required: true + responses: + 200: + content: {} + description: successful operation + summary: creates an XmlItem + tags: + - fake + x-codegen-request-body-name: XmlItem + x-contentType: application/xml + x-accepts: application/json x-tags: - tag: fake /another-fake/dummy: @@ -1035,11 +1201,15 @@ paths: summary: To test special tags tags: - $another-fake? + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json x-tags: - tag: $another-fake? /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema named `File`. + description: For this test, the body for this request much reference a schema + named `File`. operationId: testBodyWithFileSchema requestBody: content: @@ -1053,6 +1223,9 @@ paths: description: Success tags: - fake + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json x-tags: - tag: fake /fake/{petId}/uploadImageWithRequiredFile: @@ -1095,20 +1268,59 @@ paths: summary: uploads an image (required) tags: - pet + x-contentType: multipart/form-data + x-accepts: application/json x-tags: - tag: pet components: schemas: + Order: + example: + petId: 6 + quantity: 1 + id: 0 + shipDate: 2000-01-23T04:56:07.000+00:00 + complete: false + status: placed + properties: + id: + format: int64 + type: integer + petId: + format: int64 + type: integer + quantity: + format: int32 + type: integer + shipDate: + format: date-time + type: string + status: + description: Order Status + enum: + - placed + - approved + - delivered + type: string + complete: + default: false + type: boolean + type: object + xml: + name: Order Category: example: - name: name + name: default-name id: 6 properties: id: format: int64 type: integer name: + default: default-name type: string + required: + - name type: object xml: name: Category @@ -1146,45 +1358,72 @@ components: type: object xml: name: User - OuterNumber: - type: number - ArrayOfNumberOnly: - properties: - ArrayNumber: - items: - type: number - type: array - type: object - Capitalization: + Tag: + example: + name: name + id: 1 properties: - smallCamel: - type: string - CapitalCamel: - type: string - small_Snake: - type: string - Capital_Snake: - type: string - SCA_ETH_Flow_Points: - type: string - ATT_NAME: - description: | - Name of the pet + id: + format: int64 + type: integer + name: type: string type: object - MixedPropertiesAndAdditionalPropertiesClass: + xml: + name: Tag + Pet: + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: default-name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available properties: - uuid: - format: uuid + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie type: string - dateTime: - format: date-time + photoUrls: + items: + type: string + type: array + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold type: string - map: - additionalProperties: - $ref: '#/components/schemas/Animal' - type: object + required: + - name + - photoUrls type: object + xml: + name: Pet ApiResponse: example: code: 0 @@ -1199,6 +1438,23 @@ components: message: type: string type: object + $special[model.name]: + properties: + $special[property.name]: + format: int64 + type: integer + type: object + xml: + name: $special[model.name] + Return: + description: Model for testing reserved words + properties: + return: + format: int32 + type: integer + type: object + xml: + name: Return Name: description: Model for testing model name same as property name properties: @@ -1219,25 +1475,6 @@ components: type: object xml: name: Name - EnumClass: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - List: - example: - 123-list: 123-list - properties: - 123-list: - type: string - type: object - NumberOnly: - properties: - JustNumber: - type: number - type: object 200_response: description: Model for testing model name starting with number properties: @@ -1249,172 +1486,36 @@ components: type: object xml: name: Name - Client: - example: - client: client + ClassModel: + description: Model for testing model with "_class" property properties: - client: + _class: type: string type: object Dog: allOf: - $ref: '#/components/schemas/Animal' - - properties: - breed: - type: string - type: object - Enum_Test: + - $ref: '#/components/schemas/Dog_allOf' + Cat: + allOf: + - $ref: '#/components/schemas/Animal' + - $ref: '#/components/schemas/Cat_allOf' + Animal: + discriminator: + propertyName: className properties: - enum_string: - enum: - - UPPER - - lower - - "" + className: type: string - enum_string_required: - enum: - - UPPER - - lower - - "" + color: + default: red type: string - enum_integer: - enum: - - 1 - - -1 - format: int32 - type: integer - enum_number: - enum: - - 1.1 - - -1.2 - format: double - type: number - outerEnum: - $ref: '#/components/schemas/OuterEnum' required: - - enum_string_required - type: object - Order: - example: - petId: 6 - quantity: 1 - id: 0 - shipDate: 2000-01-23T04:56:07.000+00:00 - complete: false - status: placed - properties: - id: - format: int64 - type: integer - petId: - format: int64 - type: integer - quantity: - format: int32 - type: integer - shipDate: - format: date-time - type: string - status: - description: Order Status - enum: - - placed - - approved - - delivered - type: string - complete: - default: false - type: boolean - type: object - xml: - name: Order - AdditionalPropertiesClass: - properties: - map_property: - additionalProperties: - type: string - type: object - map_of_map_property: - additionalProperties: - additionalProperties: - type: string - type: object - type: object - type: object - $special[model.name]: - properties: - $special[property.name]: - format: int64 - type: integer - type: object - xml: - name: $special[model.name] - Return: - description: Model for testing reserved words - properties: - return: - format: int32 - type: integer - type: object - xml: - name: Return - ReadOnlyFirst: - properties: - bar: - readOnly: true - type: string - baz: - type: string - type: object - ArrayOfArrayOfNumberOnly: - properties: - ArrayArrayNumber: - items: - items: - type: number - type: array - type: array - type: object - OuterEnum: - enum: - - placed - - approved - - delivered - type: string - ArrayTest: - properties: - array_of_string: - items: - type: string - type: array - array_array_of_integer: - items: - items: - format: int64 - type: integer - type: array - type: array - array_array_of_model: - items: - items: - $ref: '#/components/schemas/ReadOnlyFirst' - type: array - type: array - type: object - OuterComposite: - example: - my_string: my_string - my_number: 0.80082819046101150206595775671303272247314453125 - my_boolean: true - properties: - my_number: - type: number - my_string: - type: string - my_boolean: - type: boolean - x-codegen-body-parameter-name: boolean_post_body + - className type: object + AnimalFarm: + items: + $ref: '#/components/schemas/Animal' + type: array format_test: properties: integer: @@ -1460,6 +1561,7 @@ components: format: date-time type: string uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 format: uuid type: string password: @@ -1473,6 +1575,277 @@ components: - number - password type: object + EnumClass: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + Enum_Test: + properties: + enum_string: + enum: + - UPPER + - lower + - "" + type: string + enum_string_required: + enum: + - UPPER + - lower + - "" + type: string + enum_integer: + enum: + - 1 + - -1 + format: int32 + type: integer + enum_number: + enum: + - 1.1 + - -1.2 + format: double + type: number + outerEnum: + $ref: '#/components/schemas/OuterEnum' + required: + - enum_string_required + type: object + AdditionalPropertiesClass: + properties: + map_string: + additionalProperties: + type: string + type: object + map_number: + additionalProperties: + type: number + type: object + map_integer: + additionalProperties: + type: integer + type: object + map_boolean: + additionalProperties: + type: boolean + type: object + map_array_integer: + additionalProperties: + items: + type: integer + type: array + type: object + map_array_anytype: + additionalProperties: + items: + properties: {} + type: object + type: array + type: object + map_map_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_map_anytype: + additionalProperties: + additionalProperties: + properties: {} + type: object + type: object + type: object + anytype_1: + properties: {} + type: object + anytype_2: + type: object + anytype_3: + properties: {} + type: object + type: object + AdditionalPropertiesString: + additionalProperties: + type: string + properties: + name: + type: string + type: object + AdditionalPropertiesInteger: + additionalProperties: + type: integer + properties: + name: + type: string + type: object + AdditionalPropertiesNumber: + additionalProperties: + type: number + properties: + name: + type: string + type: object + AdditionalPropertiesBoolean: + additionalProperties: + type: boolean + properties: + name: + type: string + type: object + AdditionalPropertiesArray: + additionalProperties: + items: + properties: {} + type: object + type: array + properties: + name: + type: string + type: object + AdditionalPropertiesObject: + additionalProperties: + additionalProperties: + properties: {} + type: object + type: object + properties: + name: + type: string + type: object + AdditionalPropertiesAnyType: + additionalProperties: + properties: {} + type: object + properties: + name: + type: string + type: object + MixedPropertiesAndAdditionalPropertiesClass: + properties: + uuid: + format: uuid + type: string + dateTime: + format: date-time + type: string + map: + additionalProperties: + $ref: '#/components/schemas/Animal' + type: object + type: object + List: + properties: + 123-list: + type: string + type: object + Client: + example: + client: client + properties: + client: + type: string + type: object + ReadOnlyFirst: + properties: + bar: + readOnly: true + type: string + baz: + type: string + type: object + hasOnlyReadOnly: + properties: + bar: + readOnly: true + type: string + foo: + readOnly: true + type: string + type: object + Capitalization: + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + type: object + MapTest: + properties: + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + additionalProperties: + type: boolean + type: object + type: object + ArrayTest: + properties: + array_of_string: + items: + type: string + type: array + array_array_of_integer: + items: + items: + format: int64 + type: integer + type: array + type: array + array_array_of_model: + items: + items: + $ref: '#/components/schemas/ReadOnlyFirst' + type: array + type: array + type: object + NumberOnly: + properties: + JustNumber: + type: number + type: object + ArrayOfNumberOnly: + properties: + ArrayNumber: + items: + type: number + type: array + type: object + ArrayOfArrayOfNumberOnly: + properties: + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array + type: object EnumArrays: properties: just_symbol: @@ -1488,17 +1861,37 @@ components: type: string type: array type: object - OuterString: + OuterEnum: + enum: + - placed + - approved + - delivered type: string - ClassModel: - description: Model for testing model with "_class" property + OuterComposite: + example: + my_string: my_string + my_number: 0.8008281904610115 + my_boolean: true properties: - _class: + my_number: + type: number + my_string: type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body type: object + OuterNumber: + type: number + OuterString: + type: string OuterBoolean: type: boolean x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + type: object FileSchemaTestClass: example: file: @@ -1514,68 +1907,6 @@ components: $ref: '#/components/schemas/File' type: array type: object - Animal: - discriminator: - propertyName: className - properties: - className: - type: string - color: - default: red - type: string - required: - - className - type: object - StringBooleanMap: - additionalProperties: - type: boolean - type: object - Cat: - allOf: - - $ref: '#/components/schemas/Animal' - - properties: - declawed: - type: boolean - type: object - MapTest: - properties: - map_map_of_string: - additionalProperties: - additionalProperties: - type: string - type: object - type: object - map_of_enum_string: - additionalProperties: - enum: - - UPPER - - lower - type: string - type: object - direct_map: - additionalProperties: - type: boolean - type: object - indirect_map: - $ref: '#/components/schemas/StringBooleanMap' - type: object - Tag: - example: - name: name - id: 1 - properties: - id: - format: int64 - type: integer - name: - type: string - type: object - xml: - name: Tag - AnimalFarm: - items: - $ref: '#/components/schemas/Animal' - type: array File: description: Must be named `File` for test. example: @@ -1585,68 +1916,246 @@ components: description: Test capitalization type: string type: object - Pet: - example: - photoUrls: - - photoUrls - - photoUrls - name: doggie - id: 0 - category: - name: name - id: 6 - tags: - - name: name - id: 1 - - name: name - id: 1 - status: available + TypeHolderDefault: properties: - id: - format: int64 + string_item: + default: what + type: string + number_item: + type: number + integer_item: type: integer - x-is-unique: true - category: - $ref: '#/components/schemas/Category' - name: - example: doggie + bool_item: + default: true + type: boolean + array_item: + items: + type: integer + type: array + required: + - array_item + - bool_item + - integer_item + - number_item + - string_item + type: object + TypeHolderExample: + properties: + string_item: + example: what type: string - photoUrls: + number_item: + example: 1.234 + type: number + integer_item: + example: -2 + type: integer + bool_item: + example: true + type: boolean + array_item: + example: + - 0 + - 1 + - 2 + - 3 items: - type: string + type: integer + type: array + required: + - array_item + - bool_item + - integer_item + - number_item + - string_item + type: object + XmlItem: + properties: + attribute_string: + example: string + type: string + xml: + attribute: true + attribute_number: + example: 1.234 + type: number + xml: + attribute: true + attribute_integer: + example: -2 + type: integer + xml: + attribute: true + attribute_boolean: + example: true + type: boolean + xml: + attribute: true + wrapped_array: + items: + type: integer type: array xml: - name: photoUrl wrapped: true - tags: + name_string: + example: string + type: string + xml: + name: xml_name_string + name_number: + example: 1.234 + type: number + xml: + name: xml_name_number + name_integer: + example: -2 + type: integer + xml: + name: xml_name_integer + name_boolean: + example: true + type: boolean + xml: + name: xml_name_boolean + name_array: items: - $ref: '#/components/schemas/Tag' + type: integer + xml: + name: xml_name_array_item + type: array + name_wrapped_array: + items: + type: integer + xml: + name: xml_name_wrapped_array_item type: array xml: - name: tag + name: xml_name_wrapped_array wrapped: true - status: - description: pet status in the store - enum: - - available - - pending - - sold + prefix_string: + example: string type: string - required: - - name - - photoUrls + xml: + prefix: ab + prefix_number: + example: 1.234 + type: number + xml: + prefix: cd + prefix_integer: + example: -2 + type: integer + xml: + prefix: ef + prefix_boolean: + example: true + type: boolean + xml: + prefix: gh + prefix_array: + items: + type: integer + xml: + prefix: ij + type: array + prefix_wrapped_array: + items: + type: integer + xml: + prefix: mn + type: array + xml: + prefix: kl + wrapped: true + namespace_string: + example: string + type: string + xml: + namespace: http://a.com/schema + namespace_number: + example: 1.234 + type: number + xml: + namespace: http://b.com/schema + namespace_integer: + example: -2 + type: integer + xml: + namespace: http://c.com/schema + namespace_boolean: + example: true + type: boolean + xml: + namespace: http://d.com/schema + namespace_array: + items: + type: integer + xml: + namespace: http://e.com/schema + type: array + namespace_wrapped_array: + items: + type: integer + xml: + namespace: http://g.com/schema + type: array + xml: + namespace: http://f.com/schema + wrapped: true + prefix_ns_string: + example: string + type: string + xml: + namespace: http://a.com/schema + prefix: a + prefix_ns_number: + example: 1.234 + type: number + xml: + namespace: http://b.com/schema + prefix: b + prefix_ns_integer: + example: -2 + type: integer + xml: + namespace: http://c.com/schema + prefix: c + prefix_ns_boolean: + example: true + type: boolean + xml: + namespace: http://d.com/schema + prefix: d + prefix_ns_array: + items: + type: integer + xml: + namespace: http://e.com/schema + prefix: e + type: array + prefix_ns_wrapped_array: + items: + type: integer + xml: + namespace: http://g.com/schema + prefix: g + type: array + xml: + namespace: http://f.com/schema + prefix: f + wrapped: true type: object xml: - name: Pet - hasOnlyReadOnly: + namespace: http://a.com/schema + prefix: pre + Dog_allOf: properties: - bar: - readOnly: true + breed: type: string - foo: - readOnly: true - type: string - type: object + Cat_allOf: + properties: + declawed: + type: boolean securitySchemes: petstore_auth: flows: @@ -1656,9 +2165,6 @@ components: write:pets: modify pets in your account read:pets: read your pets type: oauth2 - http_basic_test: - scheme: basic - type: http api_key: in: header name: api_key @@ -1667,3 +2173,6 @@ components: in: query name: api_key_query type: apiKey + http_basic_test: + scheme: basic + type: http diff --git a/samples/server/petstore/nancyfx-async/.openapi-generator/VERSION b/samples/server/petstore/nancyfx-async/.openapi-generator/VERSION index f9f7450d1359..83a328a9227e 100644 --- a/samples/server/petstore/nancyfx-async/.openapi-generator/VERSION +++ b/samples/server/petstore/nancyfx-async/.openapi-generator/VERSION @@ -1 +1 @@ -2.3.0-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/nancyfx-async/Org.OpenAPITools.sln b/samples/server/petstore/nancyfx-async/Org.OpenAPITools.sln new file mode 100644 index 000000000000..757078a1383c --- /dev/null +++ b/samples/server/petstore/nancyfx-async/Org.OpenAPITools.sln @@ -0,0 +1,25 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +VisualStudioVersion = 12.0.0.0 +MinimumVisualStudioVersion = 10.0.0.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools", "src\Org.OpenAPITools\Org.OpenAPITools.csproj", "{768B8DC6-54EE-4D40-9B20-7857E1D742A4}" +EndProject +Global +GlobalSection(SolutionConfigurationPlatforms) = preSolution +Debug|Any CPU = Debug|Any CPU +Release|Any CPU = Release|Any CPU +EndGlobalSection +GlobalSection(ProjectConfigurationPlatforms) = postSolution +{768B8DC6-54EE-4D40-9B20-7857E1D742A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU +{768B8DC6-54EE-4D40-9B20-7857E1D742A4}.Debug|Any CPU.Build.0 = Debug|Any CPU +{768B8DC6-54EE-4D40-9B20-7857E1D742A4}.Release|Any CPU.ActiveCfg = Release|Any CPU +{768B8DC6-54EE-4D40-9B20-7857E1D742A4}.Release|Any CPU.Build.0 = Release|Any CPU +{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU +{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU +{19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU +{19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.Build.0 = Release|Any CPU +EndGlobalSection +GlobalSection(SolutionProperties) = preSolution +HideSolutionNode = FALSE +EndGlobalSection +EndGlobal \ No newline at end of file diff --git a/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/ApiResponse.cs b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/ApiResponse.cs new file mode 100644 index 000000000000..b10ee5765733 --- /dev/null +++ b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/ApiResponse.cs @@ -0,0 +1,185 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using Sharpility.Extensions; +using NodaTime; + +namespace Org.OpenAPITools._v2.Models +{ + /// + /// Describes the result of uploading an image resource + /// + public sealed class ApiResponse: IEquatable + { + /// + /// Code + /// + public int? Code { get; private set; } + + /// + /// Type + /// + public string Type { get; private set; } + + /// + /// Message + /// + public string Message { get; private set; } + + + /// + /// Empty constructor required by some serializers. + /// Use ApiResponse.Builder() for instance creation instead. + /// + [Obsolete] + public ApiResponse() + { + } + + private ApiResponse(int? Code, string Type, string Message) + { + + this.Code = Code; + + this.Type = Type; + + this.Message = Message; + + } + + /// + /// Returns builder of ApiResponse. + /// + /// ApiResponseBuilder + public static ApiResponseBuilder Builder() + { + return new ApiResponseBuilder(); + } + + /// + /// Returns ApiResponseBuilder with properties set. + /// Use it to change properties. + /// + /// ApiResponseBuilder + public ApiResponseBuilder With() + { + return Builder() + .Code(Code) + .Type(Type) + .Message(Message); + } + + public override string ToString() + { + return this.PropertiesToString(); + } + + public override bool Equals(object obj) + { + return this.EqualsByProperties(obj); + } + + public bool Equals(ApiResponse other) + { + return Equals((object) other); + } + + public override int GetHashCode() + { + return this.PropertiesHash(); + } + + /// + /// Implementation of == operator for (ApiResponse. + /// + /// Compared (ApiResponse + /// Compared (ApiResponse + /// true if compared items are equals, false otherwise + public static bool operator == (ApiResponse left, ApiResponse right) + { + return Equals(left, right); + } + + /// + /// Implementation of != operator for (ApiResponse. + /// + /// Compared (ApiResponse + /// Compared (ApiResponse + /// true if compared items are not equals, false otherwise + public static bool operator != (ApiResponse left, ApiResponse right) + { + return !Equals(left, right); + } + + /// + /// Builder of ApiResponse. + /// + public sealed class ApiResponseBuilder + { + private int? _Code; + private string _Type; + private string _Message; + + internal ApiResponseBuilder() + { + SetupDefaults(); + } + + private void SetupDefaults() + { + } + + /// + /// Sets value for ApiResponse.Code property. + /// + /// Code + public ApiResponseBuilder Code(int? value) + { + _Code = value; + return this; + } + + /// + /// Sets value for ApiResponse.Type property. + /// + /// Type + public ApiResponseBuilder Type(string value) + { + _Type = value; + return this; + } + + /// + /// Sets value for ApiResponse.Message property. + /// + /// Message + public ApiResponseBuilder Message(string value) + { + _Message = value; + return this; + } + + + /// + /// Builds instance of ApiResponse. + /// + /// ApiResponse + public ApiResponse Build() + { + Validate(); + return new ApiResponse( + Code: _Code, + Type: _Type, + Message: _Message + ); + } + + private void Validate() + { + } + } + + + } +} \ No newline at end of file diff --git a/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/Category.cs b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/Category.cs new file mode 100644 index 000000000000..23f20131922d --- /dev/null +++ b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/Category.cs @@ -0,0 +1,165 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using Sharpility.Extensions; +using NodaTime; + +namespace Org.OpenAPITools._v2.Models +{ + /// + /// A category for a pet + /// + public sealed class Category: IEquatable + { + /// + /// Id + /// + public long? Id { get; private set; } + + /// + /// Name + /// + public string Name { get; private set; } + + + /// + /// Empty constructor required by some serializers. + /// Use Category.Builder() for instance creation instead. + /// + [Obsolete] + public Category() + { + } + + private Category(long? Id, string Name) + { + + this.Id = Id; + + this.Name = Name; + + } + + /// + /// Returns builder of Category. + /// + /// CategoryBuilder + public static CategoryBuilder Builder() + { + return new CategoryBuilder(); + } + + /// + /// Returns CategoryBuilder with properties set. + /// Use it to change properties. + /// + /// CategoryBuilder + public CategoryBuilder With() + { + return Builder() + .Id(Id) + .Name(Name); + } + + public override string ToString() + { + return this.PropertiesToString(); + } + + public override bool Equals(object obj) + { + return this.EqualsByProperties(obj); + } + + public bool Equals(Category other) + { + return Equals((object) other); + } + + public override int GetHashCode() + { + return this.PropertiesHash(); + } + + /// + /// Implementation of == operator for (Category. + /// + /// Compared (Category + /// Compared (Category + /// true if compared items are equals, false otherwise + public static bool operator == (Category left, Category right) + { + return Equals(left, right); + } + + /// + /// Implementation of != operator for (Category. + /// + /// Compared (Category + /// Compared (Category + /// true if compared items are not equals, false otherwise + public static bool operator != (Category left, Category right) + { + return !Equals(left, right); + } + + /// + /// Builder of Category. + /// + public sealed class CategoryBuilder + { + private long? _Id; + private string _Name; + + internal CategoryBuilder() + { + SetupDefaults(); + } + + private void SetupDefaults() + { + } + + /// + /// Sets value for Category.Id property. + /// + /// Id + public CategoryBuilder Id(long? value) + { + _Id = value; + return this; + } + + /// + /// Sets value for Category.Name property. + /// + /// Name + public CategoryBuilder Name(string value) + { + _Name = value; + return this; + } + + + /// + /// Builds instance of Category. + /// + /// Category + public Category Build() + { + Validate(); + return new Category( + Id: _Id, + Name: _Name + ); + } + + private void Validate() + { + } + } + + + } +} \ No newline at end of file diff --git a/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/Order.cs b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/Order.cs new file mode 100644 index 000000000000..cc5625e044a7 --- /dev/null +++ b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/Order.cs @@ -0,0 +1,247 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using Sharpility.Extensions; +using NodaTime; + +namespace Org.OpenAPITools._v2.Models +{ + /// + /// An order for a pets from the pet store + /// + public sealed class Order: IEquatable + { + /// + /// Id + /// + public long? Id { get; private set; } + + /// + /// PetId + /// + public long? PetId { get; private set; } + + /// + /// Quantity + /// + public int? Quantity { get; private set; } + + /// + /// ShipDate + /// + public DateTime? ShipDate { get; private set; } + + /// + /// Order Status + /// + public StatusEnum? Status { get; private set; } + + /// + /// Complete + /// + public bool? Complete { get; private set; } + + + /// + /// Empty constructor required by some serializers. + /// Use Order.Builder() for instance creation instead. + /// + [Obsolete] + public Order() + { + } + + private Order(long? Id, long? PetId, int? Quantity, DateTime? ShipDate, StatusEnum? Status, bool? Complete) + { + + this.Id = Id; + + this.PetId = PetId; + + this.Quantity = Quantity; + + this.ShipDate = ShipDate; + + this.Status = Status; + + this.Complete = Complete; + + } + + /// + /// Returns builder of Order. + /// + /// OrderBuilder + public static OrderBuilder Builder() + { + return new OrderBuilder(); + } + + /// + /// Returns OrderBuilder with properties set. + /// Use it to change properties. + /// + /// OrderBuilder + public OrderBuilder With() + { + return Builder() + .Id(Id) + .PetId(PetId) + .Quantity(Quantity) + .ShipDate(ShipDate) + .Status(Status) + .Complete(Complete); + } + + public override string ToString() + { + return this.PropertiesToString(); + } + + public override bool Equals(object obj) + { + return this.EqualsByProperties(obj); + } + + public bool Equals(Order other) + { + return Equals((object) other); + } + + public override int GetHashCode() + { + return this.PropertiesHash(); + } + + /// + /// Implementation of == operator for (Order. + /// + /// Compared (Order + /// Compared (Order + /// true if compared items are equals, false otherwise + public static bool operator == (Order left, Order right) + { + return Equals(left, right); + } + + /// + /// Implementation of != operator for (Order. + /// + /// Compared (Order + /// Compared (Order + /// true if compared items are not equals, false otherwise + public static bool operator != (Order left, Order right) + { + return !Equals(left, right); + } + + /// + /// Builder of Order. + /// + public sealed class OrderBuilder + { + private long? _Id; + private long? _PetId; + private int? _Quantity; + private DateTime? _ShipDate; + private StatusEnum? _Status; + private bool? _Complete; + + internal OrderBuilder() + { + SetupDefaults(); + } + + private void SetupDefaults() + { + _Complete = false; + } + + /// + /// Sets value for Order.Id property. + /// + /// Id + public OrderBuilder Id(long? value) + { + _Id = value; + return this; + } + + /// + /// Sets value for Order.PetId property. + /// + /// PetId + public OrderBuilder PetId(long? value) + { + _PetId = value; + return this; + } + + /// + /// Sets value for Order.Quantity property. + /// + /// Quantity + public OrderBuilder Quantity(int? value) + { + _Quantity = value; + return this; + } + + /// + /// Sets value for Order.ShipDate property. + /// + /// ShipDate + public OrderBuilder ShipDate(DateTime? value) + { + _ShipDate = value; + return this; + } + + /// + /// Sets value for Order.Status property. + /// + /// Order Status + public OrderBuilder Status(StatusEnum? value) + { + _Status = value; + return this; + } + + /// + /// Sets value for Order.Complete property. + /// + /// Complete + public OrderBuilder Complete(bool? value) + { + _Complete = value; + return this; + } + + + /// + /// Builds instance of Order. + /// + /// Order + public Order Build() + { + Validate(); + return new Order( + Id: _Id, + PetId: _PetId, + Quantity: _Quantity, + ShipDate: _ShipDate, + Status: _Status, + Complete: _Complete + ); + } + + private void Validate() + { + } + } + + + public enum StatusEnum { Placed, Approved, Delivered }; + } +} \ No newline at end of file diff --git a/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/Pet.cs b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/Pet.cs new file mode 100644 index 000000000000..7f33c53c9081 --- /dev/null +++ b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/Pet.cs @@ -0,0 +1,254 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using Sharpility.Extensions; +using NodaTime; + +namespace Org.OpenAPITools._v2.Models +{ + /// + /// A pet for sale in the pet store + /// + public sealed class Pet: IEquatable + { + /// + /// Id + /// + public long? Id { get; private set; } + + /// + /// Category + /// + public Category Category { get; private set; } + + /// + /// Name + /// + public string Name { get; private set; } + + /// + /// PhotoUrls + /// + public List PhotoUrls { get; private set; } + + /// + /// Tags + /// + public List Tags { get; private set; } + + /// + /// pet status in the store + /// + public StatusEnum? Status { get; private set; } + + + /// + /// Empty constructor required by some serializers. + /// Use Pet.Builder() for instance creation instead. + /// + [Obsolete] + public Pet() + { + } + + private Pet(long? Id, Category Category, string Name, List PhotoUrls, List Tags, StatusEnum? Status) + { + + this.Id = Id; + + this.Category = Category; + + this.Name = Name; + + this.PhotoUrls = PhotoUrls; + + this.Tags = Tags; + + this.Status = Status; + + } + + /// + /// Returns builder of Pet. + /// + /// PetBuilder + public static PetBuilder Builder() + { + return new PetBuilder(); + } + + /// + /// Returns PetBuilder with properties set. + /// Use it to change properties. + /// + /// PetBuilder + public PetBuilder With() + { + return Builder() + .Id(Id) + .Category(Category) + .Name(Name) + .PhotoUrls(PhotoUrls) + .Tags(Tags) + .Status(Status); + } + + public override string ToString() + { + return this.PropertiesToString(); + } + + public override bool Equals(object obj) + { + return this.EqualsByProperties(obj); + } + + public bool Equals(Pet other) + { + return Equals((object) other); + } + + public override int GetHashCode() + { + return this.PropertiesHash(); + } + + /// + /// Implementation of == operator for (Pet. + /// + /// Compared (Pet + /// Compared (Pet + /// true if compared items are equals, false otherwise + public static bool operator == (Pet left, Pet right) + { + return Equals(left, right); + } + + /// + /// Implementation of != operator for (Pet. + /// + /// Compared (Pet + /// Compared (Pet + /// true if compared items are not equals, false otherwise + public static bool operator != (Pet left, Pet right) + { + return !Equals(left, right); + } + + /// + /// Builder of Pet. + /// + public sealed class PetBuilder + { + private long? _Id; + private Category _Category; + private string _Name; + private List _PhotoUrls; + private List _Tags; + private StatusEnum? _Status; + + internal PetBuilder() + { + SetupDefaults(); + } + + private void SetupDefaults() + { + } + + /// + /// Sets value for Pet.Id property. + /// + /// Id + public PetBuilder Id(long? value) + { + _Id = value; + return this; + } + + /// + /// Sets value for Pet.Category property. + /// + /// Category + public PetBuilder Category(Category value) + { + _Category = value; + return this; + } + + /// + /// Sets value for Pet.Name property. + /// + /// Name + public PetBuilder Name(string value) + { + _Name = value; + return this; + } + + /// + /// Sets value for Pet.PhotoUrls property. + /// + /// PhotoUrls + public PetBuilder PhotoUrls(List value) + { + _PhotoUrls = value; + return this; + } + + /// + /// Sets value for Pet.Tags property. + /// + /// Tags + public PetBuilder Tags(List value) + { + _Tags = value; + return this; + } + + /// + /// Sets value for Pet.Status property. + /// + /// pet status in the store + public PetBuilder Status(StatusEnum? value) + { + _Status = value; + return this; + } + + + /// + /// Builds instance of Pet. + /// + /// Pet + public Pet Build() + { + Validate(); + return new Pet( + Id: _Id, + Category: _Category, + Name: _Name, + PhotoUrls: _PhotoUrls, + Tags: _Tags, + Status: _Status + ); + } + + private void Validate() + { + if (_Name == null) + { + throw new ArgumentException("Name is a required property for Pet and cannot be null"); + } + if (_PhotoUrls == null) + { + throw new ArgumentException("PhotoUrls is a required property for Pet and cannot be null"); + } + } + } + + + public enum StatusEnum { Available, Pending, Sold }; + } +} \ No newline at end of file diff --git a/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/Tag.cs b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/Tag.cs new file mode 100644 index 000000000000..4fb84eef765a --- /dev/null +++ b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/Tag.cs @@ -0,0 +1,165 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using Sharpility.Extensions; +using NodaTime; + +namespace Org.OpenAPITools._v2.Models +{ + /// + /// A tag for a pet + /// + public sealed class Tag: IEquatable + { + /// + /// Id + /// + public long? Id { get; private set; } + + /// + /// Name + /// + public string Name { get; private set; } + + + /// + /// Empty constructor required by some serializers. + /// Use Tag.Builder() for instance creation instead. + /// + [Obsolete] + public Tag() + { + } + + private Tag(long? Id, string Name) + { + + this.Id = Id; + + this.Name = Name; + + } + + /// + /// Returns builder of Tag. + /// + /// TagBuilder + public static TagBuilder Builder() + { + return new TagBuilder(); + } + + /// + /// Returns TagBuilder with properties set. + /// Use it to change properties. + /// + /// TagBuilder + public TagBuilder With() + { + return Builder() + .Id(Id) + .Name(Name); + } + + public override string ToString() + { + return this.PropertiesToString(); + } + + public override bool Equals(object obj) + { + return this.EqualsByProperties(obj); + } + + public bool Equals(Tag other) + { + return Equals((object) other); + } + + public override int GetHashCode() + { + return this.PropertiesHash(); + } + + /// + /// Implementation of == operator for (Tag. + /// + /// Compared (Tag + /// Compared (Tag + /// true if compared items are equals, false otherwise + public static bool operator == (Tag left, Tag right) + { + return Equals(left, right); + } + + /// + /// Implementation of != operator for (Tag. + /// + /// Compared (Tag + /// Compared (Tag + /// true if compared items are not equals, false otherwise + public static bool operator != (Tag left, Tag right) + { + return !Equals(left, right); + } + + /// + /// Builder of Tag. + /// + public sealed class TagBuilder + { + private long? _Id; + private string _Name; + + internal TagBuilder() + { + SetupDefaults(); + } + + private void SetupDefaults() + { + } + + /// + /// Sets value for Tag.Id property. + /// + /// Id + public TagBuilder Id(long? value) + { + _Id = value; + return this; + } + + /// + /// Sets value for Tag.Name property. + /// + /// Name + public TagBuilder Name(string value) + { + _Name = value; + return this; + } + + + /// + /// Builds instance of Tag. + /// + /// Tag + public Tag Build() + { + Validate(); + return new Tag( + Id: _Id, + Name: _Name + ); + } + + private void Validate() + { + } + } + + + } +} \ No newline at end of file diff --git a/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/User.cs b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/User.cs new file mode 100644 index 000000000000..f4307685294c --- /dev/null +++ b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/User.cs @@ -0,0 +1,285 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using Sharpility.Extensions; +using NodaTime; + +namespace Org.OpenAPITools._v2.Models +{ + /// + /// A User who is purchasing from the pet store + /// + public sealed class User: IEquatable + { + /// + /// Id + /// + public long? Id { get; private set; } + + /// + /// Username + /// + public string Username { get; private set; } + + /// + /// FirstName + /// + public string FirstName { get; private set; } + + /// + /// LastName + /// + public string LastName { get; private set; } + + /// + /// Email + /// + public string Email { get; private set; } + + /// + /// Password + /// + public string Password { get; private set; } + + /// + /// Phone + /// + public string Phone { get; private set; } + + /// + /// User Status + /// + public int? UserStatus { get; private set; } + + + /// + /// Empty constructor required by some serializers. + /// Use User.Builder() for instance creation instead. + /// + [Obsolete] + public User() + { + } + + private User(long? Id, string Username, string FirstName, string LastName, string Email, string Password, string Phone, int? UserStatus) + { + + this.Id = Id; + + this.Username = Username; + + this.FirstName = FirstName; + + this.LastName = LastName; + + this.Email = Email; + + this.Password = Password; + + this.Phone = Phone; + + this.UserStatus = UserStatus; + + } + + /// + /// Returns builder of User. + /// + /// UserBuilder + public static UserBuilder Builder() + { + return new UserBuilder(); + } + + /// + /// Returns UserBuilder with properties set. + /// Use it to change properties. + /// + /// UserBuilder + public UserBuilder With() + { + return Builder() + .Id(Id) + .Username(Username) + .FirstName(FirstName) + .LastName(LastName) + .Email(Email) + .Password(Password) + .Phone(Phone) + .UserStatus(UserStatus); + } + + public override string ToString() + { + return this.PropertiesToString(); + } + + public override bool Equals(object obj) + { + return this.EqualsByProperties(obj); + } + + public bool Equals(User other) + { + return Equals((object) other); + } + + public override int GetHashCode() + { + return this.PropertiesHash(); + } + + /// + /// Implementation of == operator for (User. + /// + /// Compared (User + /// Compared (User + /// true if compared items are equals, false otherwise + public static bool operator == (User left, User right) + { + return Equals(left, right); + } + + /// + /// Implementation of != operator for (User. + /// + /// Compared (User + /// Compared (User + /// true if compared items are not equals, false otherwise + public static bool operator != (User left, User right) + { + return !Equals(left, right); + } + + /// + /// Builder of User. + /// + public sealed class UserBuilder + { + private long? _Id; + private string _Username; + private string _FirstName; + private string _LastName; + private string _Email; + private string _Password; + private string _Phone; + private int? _UserStatus; + + internal UserBuilder() + { + SetupDefaults(); + } + + private void SetupDefaults() + { + } + + /// + /// Sets value for User.Id property. + /// + /// Id + public UserBuilder Id(long? value) + { + _Id = value; + return this; + } + + /// + /// Sets value for User.Username property. + /// + /// Username + public UserBuilder Username(string value) + { + _Username = value; + return this; + } + + /// + /// Sets value for User.FirstName property. + /// + /// FirstName + public UserBuilder FirstName(string value) + { + _FirstName = value; + return this; + } + + /// + /// Sets value for User.LastName property. + /// + /// LastName + public UserBuilder LastName(string value) + { + _LastName = value; + return this; + } + + /// + /// Sets value for User.Email property. + /// + /// Email + public UserBuilder Email(string value) + { + _Email = value; + return this; + } + + /// + /// Sets value for User.Password property. + /// + /// Password + public UserBuilder Password(string value) + { + _Password = value; + return this; + } + + /// + /// Sets value for User.Phone property. + /// + /// Phone + public UserBuilder Phone(string value) + { + _Phone = value; + return this; + } + + /// + /// Sets value for User.UserStatus property. + /// + /// User Status + public UserBuilder UserStatus(int? value) + { + _UserStatus = value; + return this; + } + + + /// + /// Builds instance of User. + /// + /// User + public User Build() + { + Validate(); + return new User( + Id: _Id, + Username: _Username, + FirstName: _FirstName, + LastName: _LastName, + Email: _Email, + Password: _Password, + Phone: _Phone, + UserStatus: _UserStatus + ); + } + + private void Validate() + { + } + } + + + } +} \ No newline at end of file diff --git a/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Modules/PetModule.cs b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Modules/PetModule.cs new file mode 100644 index 000000000000..28e385ce104d --- /dev/null +++ b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Modules/PetModule.cs @@ -0,0 +1,247 @@ +using System; +using Nancy; +using Nancy.ModelBinding; +using System.Collections.Generic; +using Sharpility.Base; +using Org.OpenAPITools._v2.Models; +using Org.OpenAPITools._v2.Utils; +using NodaTime; +using System.Threading.Tasks; + +namespace Org.OpenAPITools._v2.Modules +{ + /// + /// Status values that need to be considered for filter + /// + public enum FindPetsByStatusStatusEnum + { + available = 1, + pending = 2, + sold = 3 + }; + + + /// + /// Module processing requests of Pet domain. + /// + public sealed class PetModule : NancyModule + { + /// + /// Sets up HTTP methods mappings. + /// + /// Service handling requests + public PetModule(PetService service) : base("/v2") + { + Post["/pet", true] = async (parameters, ct) => + { + var body = this.Bind(); + Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'AddPet'"); + + await service.AddPet(Context, body); + return new Response { ContentType = ""}; + }; + + Delete["/pet/{petId}", true] = async (parameters, ct) => + { + var petId = Parameters.ValueOf(parameters, Context.Request, "petId", ParameterType.Path); + var apiKey = Parameters.ValueOf(parameters, Context.Request, "apiKey", ParameterType.Header); + Preconditions.IsNotNull(petId, "Required parameter: 'petId' is missing at 'DeletePet'"); + + await service.DeletePet(Context, petId, apiKey); + return new Response { ContentType = ""}; + }; + + Get["/pet/findByStatus", true] = async (parameters, ct) => + { + var status = Parameters.ValueOf(parameters, Context.Request, "status", ParameterType.Query); + Preconditions.IsNotNull(status, "Required parameter: 'status' is missing at 'FindPetsByStatus'"); + + return await service.FindPetsByStatus(Context, status).ToArray(); + }; + + Get["/pet/findByTags", true] = async (parameters, ct) => + { + var tags = Parameters.ValueOf>(parameters, Context.Request, "tags", ParameterType.Query); + Preconditions.IsNotNull(tags, "Required parameter: 'tags' is missing at 'FindPetsByTags'"); + + return await service.FindPetsByTags(Context, tags).ToArray(); + }; + + Get["/pet/{petId}", true] = async (parameters, ct) => + { + var petId = Parameters.ValueOf(parameters, Context.Request, "petId", ParameterType.Path); + Preconditions.IsNotNull(petId, "Required parameter: 'petId' is missing at 'GetPetById'"); + + return await service.GetPetById(Context, petId); + }; + + Put["/pet", true] = async (parameters, ct) => + { + var body = this.Bind(); + Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'UpdatePet'"); + + await service.UpdatePet(Context, body); + return new Response { ContentType = ""}; + }; + + Post["/pet/{petId}", true] = async (parameters, ct) => + { + var petId = Parameters.ValueOf(parameters, Context.Request, "petId", ParameterType.Path); + var name = Parameters.ValueOf(parameters, Context.Request, "name", ParameterType.Undefined); + var status = Parameters.ValueOf(parameters, Context.Request, "status", ParameterType.Undefined); + Preconditions.IsNotNull(petId, "Required parameter: 'petId' is missing at 'UpdatePetWithForm'"); + + await service.UpdatePetWithForm(Context, petId, name, status); + return new Response { ContentType = ""}; + }; + + Post["/pet/{petId}/uploadImage", true] = async (parameters, ct) => + { + var petId = Parameters.ValueOf(parameters, Context.Request, "petId", ParameterType.Path); + var additionalMetadata = Parameters.ValueOf(parameters, Context.Request, "additionalMetadata", ParameterType.Undefined); + var file = Parameters.ValueOf(parameters, Context.Request, "file", ParameterType.Undefined); + Preconditions.IsNotNull(petId, "Required parameter: 'petId' is missing at 'UploadFile'"); + + return await service.UploadFile(Context, petId, additionalMetadata, file); + }; + } + } + + /// + /// Service handling Pet requests. + /// + public interface PetService + { + /// + /// + /// + /// Context of request + /// Pet object that needs to be added to the store + /// + Task AddPet(NancyContext context, Pet body); + + /// + /// + /// + /// Context of request + /// Pet id to delete + /// (optional) + /// + Task DeletePet(NancyContext context, long? petId, string apiKey); + + /// + /// Multiple status values can be provided with comma separated strings + /// + /// Context of request + /// Status values that need to be considered for filter + /// List<Pet> + Task> FindPetsByStatus(NancyContext context, FindPetsByStatusStatusEnum? status); + + /// + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Context of request + /// Tags to filter by + /// List<Pet> + Task> FindPetsByTags(NancyContext context, List tags); + + /// + /// Returns a single pet + /// + /// Context of request + /// ID of pet to return + /// Pet + Task GetPetById(NancyContext context, long? petId); + + /// + /// + /// + /// Context of request + /// Pet object that needs to be added to the store + /// + Task UpdatePet(NancyContext context, Pet body); + + /// + /// + /// + /// Context of request + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// + Task UpdatePetWithForm(NancyContext context, long? petId, string name, string status); + + /// + /// + /// + /// Context of request + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// ApiResponse + Task UploadFile(NancyContext context, long? petId, string additionalMetadata, System.IO.Stream file); + } + + /// + /// Abstraction of PetService. + /// + public abstract class AbstractPetService: PetService + { + public virtual Task AddPet(NancyContext context, Pet body) + { + return AddPet(body); + } + + public virtual Task DeletePet(NancyContext context, long? petId, string apiKey) + { + return DeletePet(petId, apiKey); + } + + public virtual Task> FindPetsByStatus(NancyContext context, FindPetsByStatusStatusEnum? status) + { + return FindPetsByStatus(status); + } + + public virtual Task> FindPetsByTags(NancyContext context, List tags) + { + return FindPetsByTags(tags); + } + + public virtual Task GetPetById(NancyContext context, long? petId) + { + return GetPetById(petId); + } + + public virtual Task UpdatePet(NancyContext context, Pet body) + { + return UpdatePet(body); + } + + public virtual Task UpdatePetWithForm(NancyContext context, long? petId, string name, string status) + { + return UpdatePetWithForm(petId, name, status); + } + + public virtual Task UploadFile(NancyContext context, long? petId, string additionalMetadata, System.IO.Stream file) + { + return UploadFile(petId, additionalMetadata, file); + } + + protected abstract Task AddPet(Pet body); + + protected abstract Task DeletePet(long? petId, string apiKey); + + protected abstract Task> FindPetsByStatus(FindPetsByStatusStatusEnum? status); + + protected abstract Task> FindPetsByTags(List tags); + + protected abstract Task GetPetById(long? petId); + + protected abstract Task UpdatePet(Pet body); + + protected abstract Task UpdatePetWithForm(long? petId, string name, string status); + + protected abstract Task UploadFile(long? petId, string additionalMetadata, System.IO.Stream file); + } + +} diff --git a/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Modules/StoreModule.cs b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Modules/StoreModule.cs new file mode 100644 index 000000000000..eed0645da35b --- /dev/null +++ b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Modules/StoreModule.cs @@ -0,0 +1,129 @@ +using System; +using Nancy; +using Nancy.ModelBinding; +using System.Collections.Generic; +using Sharpility.Base; +using Org.OpenAPITools._v2.Models; +using Org.OpenAPITools._v2.Utils; +using NodaTime; +using System.Threading.Tasks; + +namespace Org.OpenAPITools._v2.Modules +{ + + /// + /// Module processing requests of Store domain. + /// + public sealed class StoreModule : NancyModule + { + /// + /// Sets up HTTP methods mappings. + /// + /// Service handling requests + public StoreModule(StoreService service) : base("/v2") + { + Delete["/store/order/{orderId}", true] = async (parameters, ct) => + { + var orderId = Parameters.ValueOf(parameters, Context.Request, "orderId", ParameterType.Path); + Preconditions.IsNotNull(orderId, "Required parameter: 'orderId' is missing at 'DeleteOrder'"); + + await service.DeleteOrder(Context, orderId); + return new Response { ContentType = ""}; + }; + + Get["/store/inventory", true] = async (parameters, ct) => + { + + return await service.GetInventory(Context); + }; + + Get["/store/order/{orderId}", true] = async (parameters, ct) => + { + var orderId = Parameters.ValueOf(parameters, Context.Request, "orderId", ParameterType.Path); + Preconditions.IsNotNull(orderId, "Required parameter: 'orderId' is missing at 'GetOrderById'"); + + return await service.GetOrderById(Context, orderId); + }; + + Post["/store/order", true] = async (parameters, ct) => + { + var body = this.Bind(); + Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'PlaceOrder'"); + + return await service.PlaceOrder(Context, body); + }; + } + } + + /// + /// Service handling Store requests. + /// + public interface StoreService + { + /// + /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Context of request + /// ID of the order that needs to be deleted + /// + Task DeleteOrder(NancyContext context, string orderId); + + /// + /// Returns a map of status codes to quantities + /// + /// Context of request + /// Dictionary<string, int?> + Task> GetInventory(NancyContext context); + + /// + /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + /// + /// Context of request + /// ID of pet that needs to be fetched + /// Order + Task GetOrderById(NancyContext context, long? orderId); + + /// + /// + /// + /// Context of request + /// order placed for purchasing the pet + /// Order + Task PlaceOrder(NancyContext context, Order body); + } + + /// + /// Abstraction of StoreService. + /// + public abstract class AbstractStoreService: StoreService + { + public virtual Task DeleteOrder(NancyContext context, string orderId) + { + return DeleteOrder(orderId); + } + + public virtual Task> GetInventory(NancyContext context) + { + return GetInventory(); + } + + public virtual Task GetOrderById(NancyContext context, long? orderId) + { + return GetOrderById(orderId); + } + + public virtual Task PlaceOrder(NancyContext context, Order body) + { + return PlaceOrder(body); + } + + protected abstract Task DeleteOrder(string orderId); + + protected abstract Task> GetInventory(); + + protected abstract Task GetOrderById(long? orderId); + + protected abstract Task PlaceOrder(Order body); + } + +} diff --git a/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Modules/UserModule.cs b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Modules/UserModule.cs new file mode 100644 index 000000000000..23d99c214e4c --- /dev/null +++ b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Modules/UserModule.cs @@ -0,0 +1,234 @@ +using System; +using Nancy; +using Nancy.ModelBinding; +using System.Collections.Generic; +using Sharpility.Base; +using Org.OpenAPITools._v2.Models; +using Org.OpenAPITools._v2.Utils; +using NodaTime; +using System.Threading.Tasks; + +namespace Org.OpenAPITools._v2.Modules +{ + + /// + /// Module processing requests of User domain. + /// + public sealed class UserModule : NancyModule + { + /// + /// Sets up HTTP methods mappings. + /// + /// Service handling requests + public UserModule(UserService service) : base("/v2") + { + Post["/user", true] = async (parameters, ct) => + { + var body = this.Bind(); + Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'CreateUser'"); + + await service.CreateUser(Context, body); + return new Response { ContentType = ""}; + }; + + Post["/user/createWithArray", true] = async (parameters, ct) => + { + var body = this.Bind>(); + Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'CreateUsersWithArrayInput'"); + + await service.CreateUsersWithArrayInput(Context, body); + return new Response { ContentType = ""}; + }; + + Post["/user/createWithList", true] = async (parameters, ct) => + { + var body = this.Bind>(); + Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'CreateUsersWithListInput'"); + + await service.CreateUsersWithListInput(Context, body); + return new Response { ContentType = ""}; + }; + + Delete["/user/{username}", true] = async (parameters, ct) => + { + var username = Parameters.ValueOf(parameters, Context.Request, "username", ParameterType.Path); + Preconditions.IsNotNull(username, "Required parameter: 'username' is missing at 'DeleteUser'"); + + await service.DeleteUser(Context, username); + return new Response { ContentType = ""}; + }; + + Get["/user/{username}", true] = async (parameters, ct) => + { + var username = Parameters.ValueOf(parameters, Context.Request, "username", ParameterType.Path); + Preconditions.IsNotNull(username, "Required parameter: 'username' is missing at 'GetUserByName'"); + + return await service.GetUserByName(Context, username); + }; + + Get["/user/login", true] = async (parameters, ct) => + { + var username = Parameters.ValueOf(parameters, Context.Request, "username", ParameterType.Query); + var password = Parameters.ValueOf(parameters, Context.Request, "password", ParameterType.Query); + Preconditions.IsNotNull(username, "Required parameter: 'username' is missing at 'LoginUser'"); + + Preconditions.IsNotNull(password, "Required parameter: 'password' is missing at 'LoginUser'"); + + return await service.LoginUser(Context, username, password); + }; + + Get["/user/logout", true] = async (parameters, ct) => + { + + await service.LogoutUser(Context); + return new Response { ContentType = ""}; + }; + + Put["/user/{username}", true] = async (parameters, ct) => + { + var username = Parameters.ValueOf(parameters, Context.Request, "username", ParameterType.Path); + var body = this.Bind(); + Preconditions.IsNotNull(username, "Required parameter: 'username' is missing at 'UpdateUser'"); + + Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'UpdateUser'"); + + await service.UpdateUser(Context, username, body); + return new Response { ContentType = ""}; + }; + } + } + + /// + /// Service handling User requests. + /// + public interface UserService + { + /// + /// This can only be done by the logged in user. + /// + /// Context of request + /// Created user object + /// + Task CreateUser(NancyContext context, User body); + + /// + /// + /// + /// Context of request + /// List of user object + /// + Task CreateUsersWithArrayInput(NancyContext context, List body); + + /// + /// + /// + /// Context of request + /// List of user object + /// + Task CreateUsersWithListInput(NancyContext context, List body); + + /// + /// This can only be done by the logged in user. + /// + /// Context of request + /// The name that needs to be deleted + /// + Task DeleteUser(NancyContext context, string username); + + /// + /// + /// + /// Context of request + /// The name that needs to be fetched. Use user1 for testing. + /// User + Task GetUserByName(NancyContext context, string username); + + /// + /// + /// + /// Context of request + /// The user name for login + /// The password for login in clear text + /// string + Task LoginUser(NancyContext context, string username, string password); + + /// + /// + /// + /// Context of request + /// + Task LogoutUser(NancyContext context); + + /// + /// This can only be done by the logged in user. + /// + /// Context of request + /// name that need to be deleted + /// Updated user object + /// + Task UpdateUser(NancyContext context, string username, User body); + } + + /// + /// Abstraction of UserService. + /// + public abstract class AbstractUserService: UserService + { + public virtual Task CreateUser(NancyContext context, User body) + { + return CreateUser(body); + } + + public virtual Task CreateUsersWithArrayInput(NancyContext context, List body) + { + return CreateUsersWithArrayInput(body); + } + + public virtual Task CreateUsersWithListInput(NancyContext context, List body) + { + return CreateUsersWithListInput(body); + } + + public virtual Task DeleteUser(NancyContext context, string username) + { + return DeleteUser(username); + } + + public virtual Task GetUserByName(NancyContext context, string username) + { + return GetUserByName(username); + } + + public virtual Task LoginUser(NancyContext context, string username, string password) + { + return LoginUser(username, password); + } + + public virtual Task LogoutUser(NancyContext context) + { + return LogoutUser(); + } + + public virtual Task UpdateUser(NancyContext context, string username, User body) + { + return UpdateUser(username, body); + } + + protected abstract Task CreateUser(User body); + + protected abstract Task CreateUsersWithArrayInput(List body); + + protected abstract Task CreateUsersWithListInput(List body); + + protected abstract Task DeleteUser(string username); + + protected abstract Task GetUserByName(string username); + + protected abstract Task LoginUser(string username, string password); + + protected abstract Task LogoutUser(); + + protected abstract Task UpdateUser(string username, User body); + } + +} diff --git a/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Org.OpenAPITools.csproj new file mode 100644 index 000000000000..b26666605cd3 --- /dev/null +++ b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -0,0 +1,66 @@ + + + + Debug + AnyCPU + {768B8DC6-54EE-4D40-9B20-7857E1D742A4} + Library + Properties + Org.OpenAPITools._v2 + Org.OpenAPITools + v4.5 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + bin\Debug\Org.OpenAPITools.XML + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + bin\Release\Org.OpenAPITools.XML + + + + ..\..\packages\Nancy.1.4.3\lib\net40\Nancy.dll + True + + + ..\..\packages\NodaTime.1.3.1\lib\net35-Client\NodaTime.dll + True + + + ..\..\packages\Sharpility.1.2.2\lib\net45\Sharpility.dll + True + + + ..\..\packages\System.Collections.Immutable.1.1.37\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll + True + + + + + + + + + + + + + + + + + + diff --git a/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Org.OpenAPITools.nuspec b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Org.OpenAPITools.nuspec new file mode 100644 index 000000000000..102c48def9d8 --- /dev/null +++ b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Org.OpenAPITools.nuspec @@ -0,0 +1,13 @@ + + + + Org.OpenAPITools + Org.OpenAPITools + 1.0.0 + openapi-generator + openapi-generator + false + NancyFx Org.OpenAPITools API + http://www.apache.org/licenses/LICENSE-2.0.html + + \ No newline at end of file diff --git a/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Utils/LocalDateConverter.cs b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Utils/LocalDateConverter.cs new file mode 100644 index 000000000000..dd90cbf5133d --- /dev/null +++ b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Utils/LocalDateConverter.cs @@ -0,0 +1,55 @@ +using Nancy.Bootstrapper; +using Nancy.Json; +using NodaTime; +using NodaTime.Text; +using System; +using System.Collections.Generic; + +namespace Org.OpenAPITools._v2.Utils +{ + /// + /// (De)serializes a to a string using + /// the RFC3339 + /// full-date format. + /// + public class LocalDateConverter : JavaScriptPrimitiveConverter, IApplicationStartup + { + public override IEnumerable SupportedTypes + { + get + { + yield return typeof(LocalDate); + yield return typeof(LocalDate?); + } + } + + public void Initialize(IPipelines pipelines) + { + JsonSettings.PrimitiveConverters.Add(new LocalDateConverter()); + } + + + public override object Serialize(object obj, JavaScriptSerializer serializer) + { + if (obj is LocalDate) + { + LocalDate localDate = (LocalDate)obj; + return LocalDatePattern.IsoPattern.Format(localDate); + } + return null; + } + + public override object Deserialize(object primitiveValue, Type type, JavaScriptSerializer serializer) + { + if ((type == typeof(LocalDate) || type == typeof(LocalDate?)) && primitiveValue is string) + { + try + { + return LocalDatePattern.IsoPattern.Parse(primitiveValue as string).GetValueOrThrow(); + } + catch { } + } + return null; + } + } +} diff --git a/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Utils/Parameters.cs b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Utils/Parameters.cs new file mode 100644 index 000000000000..847527a2dbb7 --- /dev/null +++ b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Utils/Parameters.cs @@ -0,0 +1,450 @@ +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Linq; +using Nancy; +using NodaTime; +using NodaTime.Text; +using Sharpility.Base; +using Sharpility.Extensions; +using Sharpility.Util; + +namespace Org.OpenAPITools._v2.Utils +{ + internal static class Parameters + { + private static readonly IDictionary> Parsers = CreateParsers(); + + internal static TValue ValueOf(dynamic parameters, Request request, string name, ParameterType parameterType) + { + var valueType = typeof(TValue); + var valueUnderlyingType = Nullable.GetUnderlyingType(valueType); + var isNullable = default(TValue) == null; + string value = RawValueOf(parameters, request, name, parameterType); + Preconditions.Evaluate(!string.IsNullOrEmpty(value) || isNullable, string.Format("Required parameter: '{0}' is missing", name)); + if (value == null && isNullable) + { + return default(TValue); + } + if (valueType.IsEnum || (valueUnderlyingType != null && valueUnderlyingType.IsEnum)) + { + return EnumValueOf(name, value); + } + return ValueOf(parameters, name, value, valueType, request, parameterType); + } + + private static string RawValueOf(dynamic parameters, Request request, string name, ParameterType parameterType) + { + try + { + switch (parameterType) + { + case ParameterType.Query: + string querValue = request.Query[name]; + return querValue; + case ParameterType.Path: + string pathValue = parameters[name]; + return pathValue; + case ParameterType.Header: + var headerValue = request.Headers[name]; + return headerValue != null ? string.Join(",", headerValue) : null; + } + } + catch (Exception e) + { + throw new InvalidOperationException(string.Format("Could not obtain value of '{0}' parameter", name), e); + } + throw new InvalidOperationException(string.Format("Parameter with type: {0} is not supported", parameterType)); + } + + private static TValue EnumValueOf(string name, string value) + { + var valueType = typeof(TValue); + var enumType = valueType.IsEnum ? valueType : Nullable.GetUnderlyingType(valueType); + Preconditions.IsNotNull(enumType, () => new InvalidOperationException( + string.Format("Could not parse parameter: '{0}' to enum. Type {1} is not enum", name, valueType))); + var values = Enum.GetValues(enumType); + foreach (var entry in values) + { + if (entry.ToString().EqualsIgnoreCases(value) + || ((int)entry).ToString().EqualsIgnoreCases(value)) + { + return (TValue)entry; + } + } + throw new ArgumentException(string.Format("Parameter: '{0}' value: '{1}' is not supported. Expected one of: {2}", + name, value, Strings.ToString(values))); + } + + private static TValue ValueOf(dynamic parameters, string name, string value, Type valueType, Request request, ParameterType parameterType) + { + var parser = Parsers.GetIfPresent(valueType); + if (parser != null) + { + return ParseValueUsing(name, value, valueType, parser); + } + if (parameterType == ParameterType.Path) + { + return DynamicValueOf(parameters, name); + } + if (parameterType == ParameterType.Query) + { + return DynamicValueOf(request.Query, name); + } + throw new InvalidOperationException(string.Format("Could not get value for {0} with type {1}", name, valueType)); + } + + private static TValue ParseValueUsing(string name, string value, Type valueType, Func parser) + { + var result = parser(Parameter.Of(name, value)); + try + { + return (TValue)result; + } + catch (InvalidCastException) + { + throw new InvalidOperationException( + string.Format("Could not parse parameter: '{0}' with value: '{1}'. " + + "Received: '{2}', expected: '{3}'.", + name, value, result.GetType(), valueType)); + } + } + + private static TValue DynamicValueOf(dynamic parameters, string name) + { + string value = parameters[name]; + try + { + TValue result = parameters[name]; + return result; + } + catch (InvalidCastException) + { + throw new InvalidOperationException(Strings.Format("Parameter: '{0}' value: '{1}' could not be parsed. " + + "Expected type: '{2}' is not supported", + name, value, typeof(TValue))); + } + catch (Exception e) + { + throw new InvalidOperationException(string.Format("Could not get '{0}' value of '{1}' type dynamicly", + name, typeof(TValue)), e); + } + } + + private static IDictionary> CreateParsers() + { + var parsers = ImmutableDictionary.CreateBuilder>(); + parsers.Put(typeof(string), value => value.Value); + parsers.Put(typeof(bool), SafeParse(bool.Parse)); + parsers.Put(typeof(bool?), SafeParse(bool.Parse)); + parsers.Put(typeof(byte), SafeParse(byte.Parse)); + parsers.Put(typeof(sbyte?), SafeParse(sbyte.Parse)); + parsers.Put(typeof(short), SafeParse(short.Parse)); + parsers.Put(typeof(short?), SafeParse(short.Parse)); + parsers.Put(typeof(ushort), SafeParse(ushort.Parse)); + parsers.Put(typeof(ushort?), SafeParse(ushort.Parse)); + parsers.Put(typeof(int), SafeParse(int.Parse)); + parsers.Put(typeof(int?), SafeParse(int.Parse)); + parsers.Put(typeof(uint), SafeParse(uint.Parse)); + parsers.Put(typeof(uint?), SafeParse(uint.Parse)); + parsers.Put(typeof(long), SafeParse(long.Parse)); + parsers.Put(typeof(long?), SafeParse(long.Parse)); + parsers.Put(typeof(ulong), SafeParse(ulong.Parse)); + parsers.Put(typeof(ulong?), SafeParse(ulong.Parse)); + parsers.Put(typeof(float), SafeParse(float.Parse)); + parsers.Put(typeof(float?), SafeParse(float.Parse)); + parsers.Put(typeof(double), SafeParse(double.Parse)); + parsers.Put(typeof(double?), SafeParse(double.Parse)); + parsers.Put(typeof(decimal), SafeParse(decimal.Parse)); + parsers.Put(typeof(decimal?), SafeParse(decimal.Parse)); + parsers.Put(typeof(DateTime), SafeParse(DateTime.Parse)); + parsers.Put(typeof(DateTime?), SafeParse(DateTime.Parse)); + parsers.Put(typeof(TimeSpan), SafeParse(TimeSpan.Parse)); + parsers.Put(typeof(TimeSpan?), SafeParse(TimeSpan.Parse)); + parsers.Put(typeof(ZonedDateTime), SafeParse(ParseZonedDateTime)); + parsers.Put(typeof(ZonedDateTime?), SafeParse(ParseZonedDateTime)); + parsers.Put(typeof(LocalDate), SafeParse(ParseLocalDate)); + parsers.Put(typeof(LocalDate?), SafeParse(ParseLocalDate)); + parsers.Put(typeof(LocalTime), SafeParse(ParseLocalTime)); + parsers.Put(typeof(LocalTime?), SafeParse(ParseLocalTime)); + + parsers.Put(typeof(IEnumerable), ImmutableListParse(value => value)); + parsers.Put(typeof(ICollection), ImmutableListParse(value => value)); + parsers.Put(typeof(IList), ImmutableListParse(value => value)); + parsers.Put(typeof(List), ListParse(value => value)); + parsers.Put(typeof(ISet), ImmutableListParse(value => value)); + parsers.Put(typeof(HashSet), SetParse(value => value)); + + parsers.Put(typeof(IEnumerable), NullableImmutableListParse(bool.Parse)); + parsers.Put(typeof(ICollection), NullableImmutableListParse(bool.Parse)); + parsers.Put(typeof(IList), NullableImmutableListParse(bool.Parse)); + parsers.Put(typeof(List), NullableListParse(bool.Parse)); + parsers.Put(typeof(ISet), NullableImmutableSetParse(bool.Parse)); + parsers.Put(typeof(HashSet), NullableSetParse(bool.Parse)); + + parsers.Put(typeof(IEnumerable), ImmutableListParse(byte.Parse)); + parsers.Put(typeof(ICollection), ImmutableListParse(byte.Parse)); + parsers.Put(typeof(IList), ImmutableListParse(byte.Parse)); + parsers.Put(typeof(List), ListParse(byte.Parse)); + parsers.Put(typeof(ISet), ImmutableSetParse(byte.Parse)); + parsers.Put(typeof(HashSet), SetParse(byte.Parse)); + + parsers.Put(typeof(IEnumerable), ImmutableListParse(sbyte.Parse)); + parsers.Put(typeof(ICollection), ImmutableListParse(sbyte.Parse)); + parsers.Put(typeof(IList), ImmutableListParse(sbyte.Parse)); + parsers.Put(typeof(List), ListParse(sbyte.Parse)); + parsers.Put(typeof(ISet), ImmutableSetParse(sbyte.Parse)); + parsers.Put(typeof(HashSet), SetParse(sbyte.Parse)); + + parsers.Put(typeof(IEnumerable), ImmutableListParse(short.Parse)); + parsers.Put(typeof(ICollection), ImmutableListParse(short.Parse)); + parsers.Put(typeof(IList), ImmutableListParse(short.Parse)); + parsers.Put(typeof(List), ListParse(short.Parse)); + parsers.Put(typeof(ISet), ImmutableSetParse(short.Parse)); + parsers.Put(typeof(HashSet), SetParse(short.Parse)); + + parsers.Put(typeof(IEnumerable), ImmutableListParse(ushort.Parse)); + parsers.Put(typeof(ICollection), ImmutableListParse(ushort.Parse)); + parsers.Put(typeof(IList), ImmutableListParse(ushort.Parse)); + parsers.Put(typeof(List), ListParse(ushort.Parse)); + parsers.Put(typeof(ISet), ImmutableSetParse(ushort.Parse)); + parsers.Put(typeof(HashSet), SetParse(ushort.Parse)); + + parsers.Put(typeof(IEnumerable), NullableImmutableListParse(int.Parse)); + parsers.Put(typeof(ICollection), NullableImmutableListParse(int.Parse)); + parsers.Put(typeof(IList), NullableImmutableListParse(int.Parse)); + parsers.Put(typeof(List), NullableListParse(int.Parse)); + parsers.Put(typeof(ISet), NullableImmutableSetParse(int.Parse)); + parsers.Put(typeof(HashSet), NullableSetParse(int.Parse)); + + parsers.Put(typeof(IEnumerable), ImmutableListParse(uint.Parse)); + parsers.Put(typeof(ICollection), ImmutableListParse(uint.Parse)); + parsers.Put(typeof(IList), ImmutableListParse(uint.Parse)); + parsers.Put(typeof(List), ListParse(uint.Parse)); + parsers.Put(typeof(ISet), ImmutableSetParse(uint.Parse)); + parsers.Put(typeof(HashSet), SetParse(uint.Parse)); + + parsers.Put(typeof(IEnumerable), NullableImmutableListParse(long.Parse)); + parsers.Put(typeof(ICollection), NullableImmutableListParse(long.Parse)); + parsers.Put(typeof(IList), NullableImmutableListParse(long.Parse)); + parsers.Put(typeof(List), NullableListParse(long.Parse)); + parsers.Put(typeof(ISet), NullableImmutableSetParse(long.Parse)); + parsers.Put(typeof(HashSet), NullableSetParse(long.Parse)); + + parsers.Put(typeof(IEnumerable), ImmutableListParse(ulong.Parse)); + parsers.Put(typeof(ICollection), ImmutableListParse(ulong.Parse)); + parsers.Put(typeof(IList), ImmutableListParse(ulong.Parse)); + parsers.Put(typeof(List), ListParse(ulong.Parse)); + parsers.Put(typeof(ISet), ImmutableSetParse(ulong.Parse)); + parsers.Put(typeof(HashSet), SetParse(ulong.Parse)); + + parsers.Put(typeof(IEnumerable), NullableImmutableListParse(float.Parse)); + parsers.Put(typeof(ICollection), NullableImmutableListParse(float.Parse)); + parsers.Put(typeof(IList), NullableImmutableListParse(float.Parse)); + parsers.Put(typeof(List), NullableListParse(float.Parse)); + parsers.Put(typeof(ISet), NullableImmutableSetParse(float.Parse)); + parsers.Put(typeof(HashSet), NullableSetParse(float.Parse)); + + parsers.Put(typeof(IEnumerable), NullableImmutableListParse(double.Parse)); + parsers.Put(typeof(ICollection), NullableImmutableListParse(double.Parse)); + parsers.Put(typeof(IList), NullableImmutableListParse(double.Parse)); + parsers.Put(typeof(List), NullableListParse(double.Parse)); + parsers.Put(typeof(ISet), NullableImmutableSetParse(double.Parse)); + parsers.Put(typeof(HashSet), NullableSetParse(double.Parse)); + + parsers.Put(typeof(IEnumerable), NullableImmutableListParse(decimal.Parse)); + parsers.Put(typeof(ICollection), NullableImmutableListParse(decimal.Parse)); + parsers.Put(typeof(IList), NullableImmutableListParse(decimal.Parse)); + parsers.Put(typeof(List), NullableListParse(decimal.Parse)); + parsers.Put(typeof(ISet), NullableImmutableSetParse(decimal.Parse)); + parsers.Put(typeof(HashSet), NullableSetParse(decimal.Parse)); + + parsers.Put(typeof(IEnumerable), NullableImmutableListParse(DateTime.Parse)); + parsers.Put(typeof(ICollection), NullableImmutableListParse(DateTime.Parse)); + parsers.Put(typeof(IList), NullableImmutableListParse(DateTime.Parse)); + parsers.Put(typeof(List), NullableListParse(DateTime.Parse)); + parsers.Put(typeof(ISet), NullableImmutableSetParse(DateTime.Parse)); + parsers.Put(typeof(HashSet), NullableSetParse(DateTime.Parse)); + + parsers.Put(typeof(IEnumerable), ImmutableListParse(TimeSpan.Parse)); + parsers.Put(typeof(ICollection), ImmutableListParse(TimeSpan.Parse)); + parsers.Put(typeof(IList), ImmutableListParse(TimeSpan.Parse)); + parsers.Put(typeof(List), ListParse(TimeSpan.Parse)); + parsers.Put(typeof(ISet), ImmutableSetParse(TimeSpan.Parse)); + parsers.Put(typeof(HashSet), SetParse(TimeSpan.Parse)); + + return parsers.ToImmutableDictionary(); + } + + private static Func SafeParse(Func parse) + { + return parameter => + { + try + { + return parse(parameter.Value); + } + catch (OverflowException) + { + throw ParameterOutOfRange(parameter, typeof(T)); + } + catch (FormatException) + { + throw InvalidParameterFormat(parameter, typeof(T)); + } + catch (Exception e) + { + throw new InvalidOperationException(Strings.Format("Unable to parse parameter: '{0}' with value: '{1}' to {2}", + parameter.Name, parameter.Value, typeof(T)), e); + } + }; + } + + private static Func NullableListParse(Func itemParser) where T: struct + { + return ListParse(it => it.ToNullable(itemParser)); + } + + private static Func ListParse(Func itemParser) + { + return parameter => + { + if (string.IsNullOrEmpty(parameter.Value)) + { + return new List(); + } + return ParseCollection(parameter.Value, itemParser).ToList(); + }; + } + + private static Func NullableImmutableListParse(Func itemParser) where T: struct + { + return ImmutableListParse(it => it.ToNullable(itemParser)); + } + + private static Func ImmutableListParse(Func itemParser) + { + return parameter => + { + if (string.IsNullOrEmpty(parameter.Value)) + { + return Lists.EmptyList(); + } + return ParseCollection(parameter.Value, itemParser).ToImmutableList(); + }; + } + + private static Func NullableSetParse(Func itemParser) where T: struct + { + return SetParse(it => it.ToNullable(itemParser)); + } + + private static Func SetParse(Func itemParser) + { + return parameter => + { + if (string.IsNullOrEmpty(parameter.Value)) + { + return new HashSet(); + } + return ParseCollection(parameter.Value, itemParser).ToSet(); + }; + } + + private static Func NullableImmutableSetParse(Func itemParser) where T: struct + { + return ImmutableSetParse(it => it.ToNullable(itemParser)); + } + + private static Func ImmutableSetParse(Func itemParser) + { + return parameter => + { + if (string.IsNullOrEmpty(parameter.Value)) + { + return Sets.EmptySet(); + } + return ParseCollection(parameter.Value, itemParser).ToImmutableHashSet(); + }; + } + + private static ZonedDateTime ParseZonedDateTime(string value) + { + var dateTime = DateTime.Parse(value); + return new ZonedDateTime(Instant.FromDateTimeUtc(dateTime.ToUniversalTime()), DateTimeZone.Utc); + } + + private static LocalDate ParseLocalDate(string value) + { + return LocalDatePattern.IsoPattern.Parse(value).Value; + } + + private static LocalTime ParseLocalTime(string value) + { + return LocalTimePattern.ExtendedIsoPattern.Parse(value).Value; + } + + private static ArgumentException ParameterOutOfRange(Parameter parameter, Type type) + { + return new ArgumentException(Strings.Format("Query: '{0}' value: '{1}' is out of range for: '{2}'", + parameter.Name, parameter.Value, type)); + } + + private static ArgumentException InvalidParameterFormat(Parameter parameter, Type type) + { + return new ArgumentException(Strings.Format("Query '{0}' value: '{1}' format is invalid for: '{2}'", + parameter.Name, parameter.Value, type)); + } + + private static IEnumerable ParseCollection(string value, Func itemParser) + { + var results = value.Split(new[] { ',' }, StringSplitOptions.None) + .Where(it => it != null) + .Select(it => it.Trim()) + .Select(itemParser); + return results; + } + + public static T? ToNullable(this string s, Func itemParser) where T : struct + { + T? result = new T?(); + try + { + if (!string.IsNullOrEmpty(s) && s.Trim().Length > 0) + { + result = itemParser(s); + } + } + catch (Exception e) + { + throw new InvalidOperationException(Strings.Format("Unable to parse value: '{0}' to nullable: '{1}'", s, typeof(T).ToString()), e); + } + return result; + } + + private class Parameter + { + internal string Name { get; private set; } + internal string Value { get; private set; } + + private Parameter(string name, string value) + { + Name = name; + Value = value; + } + + internal static Parameter Of(string name, string value) + { + return new Parameter(name, value); + } + } + } + + internal enum ParameterType + { + Undefined, + Query, + Path, + Header + } +} diff --git a/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/packages.config b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/packages.config new file mode 100644 index 000000000000..e3401566e5d2 --- /dev/null +++ b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/packages.config @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/samples/server/petstore/nancyfx/.openapi-generator/VERSION b/samples/server/petstore/nancyfx/.openapi-generator/VERSION index f9f7450d1359..83a328a9227e 100644 --- a/samples/server/petstore/nancyfx/.openapi-generator/VERSION +++ b/samples/server/petstore/nancyfx/.openapi-generator/VERSION @@ -1 +1 @@ -2.3.0-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/nancyfx/Org.OpenAPITools.sln b/samples/server/petstore/nancyfx/Org.OpenAPITools.sln new file mode 100644 index 000000000000..757078a1383c --- /dev/null +++ b/samples/server/petstore/nancyfx/Org.OpenAPITools.sln @@ -0,0 +1,25 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +VisualStudioVersion = 12.0.0.0 +MinimumVisualStudioVersion = 10.0.0.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools", "src\Org.OpenAPITools\Org.OpenAPITools.csproj", "{768B8DC6-54EE-4D40-9B20-7857E1D742A4}" +EndProject +Global +GlobalSection(SolutionConfigurationPlatforms) = preSolution +Debug|Any CPU = Debug|Any CPU +Release|Any CPU = Release|Any CPU +EndGlobalSection +GlobalSection(ProjectConfigurationPlatforms) = postSolution +{768B8DC6-54EE-4D40-9B20-7857E1D742A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU +{768B8DC6-54EE-4D40-9B20-7857E1D742A4}.Debug|Any CPU.Build.0 = Debug|Any CPU +{768B8DC6-54EE-4D40-9B20-7857E1D742A4}.Release|Any CPU.ActiveCfg = Release|Any CPU +{768B8DC6-54EE-4D40-9B20-7857E1D742A4}.Release|Any CPU.Build.0 = Release|Any CPU +{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU +{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU +{19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU +{19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.Build.0 = Release|Any CPU +EndGlobalSection +GlobalSection(SolutionProperties) = preSolution +HideSolutionNode = FALSE +EndGlobalSection +EndGlobal \ No newline at end of file diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/ApiResponse.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/ApiResponse.cs index db083b73bdc7..b10ee5765733 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/ApiResponse.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/ApiResponse.cs @@ -5,7 +5,7 @@ using Sharpility.Extensions; using NodaTime; -namespace Org.OpenAPITools.v2.Models +namespace Org.OpenAPITools._v2.Models { /// /// Describes the result of uploading an image resource diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Category.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Category.cs index 1bfb30abb752..23f20131922d 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Category.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Category.cs @@ -5,7 +5,7 @@ using Sharpility.Extensions; using NodaTime; -namespace Org.OpenAPITools.v2.Models +namespace Org.OpenAPITools._v2.Models { /// /// A category for a pet diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Order.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Order.cs index 7bdec1016958..cc5625e044a7 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Order.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Order.cs @@ -5,7 +5,7 @@ using Sharpility.Extensions; using NodaTime; -namespace Org.OpenAPITools.v2.Models +namespace Org.OpenAPITools._v2.Models { /// /// An order for a pets from the pet store @@ -30,7 +30,7 @@ public sealed class Order: IEquatable /// /// ShipDate /// - public ZonedDateTime? ShipDate { get; private set; } + public DateTime? ShipDate { get; private set; } /// /// Order Status @@ -52,7 +52,7 @@ public Order() { } - private Order(long? Id, long? PetId, int? Quantity, ZonedDateTime? ShipDate, StatusEnum? Status, bool? Complete) + private Order(long? Id, long? PetId, int? Quantity, DateTime? ShipDate, StatusEnum? Status, bool? Complete) { this.Id = Id; @@ -144,7 +144,7 @@ public sealed class OrderBuilder private long? _Id; private long? _PetId; private int? _Quantity; - private ZonedDateTime? _ShipDate; + private DateTime? _ShipDate; private StatusEnum? _Status; private bool? _Complete; @@ -192,7 +192,7 @@ public OrderBuilder Quantity(int? value) /// Sets value for Order.ShipDate property. /// /// ShipDate - public OrderBuilder ShipDate(ZonedDateTime? value) + public OrderBuilder ShipDate(DateTime? value) { _ShipDate = value; return this; diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Pet.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Pet.cs index a3f02e090883..7f33c53c9081 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Pet.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Pet.cs @@ -5,7 +5,7 @@ using Sharpility.Extensions; using NodaTime; -namespace Org.OpenAPITools.v2.Models +namespace Org.OpenAPITools._v2.Models { /// /// A pet for sale in the pet store diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Tag.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Tag.cs index 7ce321d25114..4fb84eef765a 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Tag.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Tag.cs @@ -5,7 +5,7 @@ using Sharpility.Extensions; using NodaTime; -namespace Org.OpenAPITools.v2.Models +namespace Org.OpenAPITools._v2.Models { /// /// A tag for a pet diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/User.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/User.cs index 04d33ca07f77..f4307685294c 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/User.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/User.cs @@ -5,7 +5,7 @@ using Sharpility.Extensions; using NodaTime; -namespace Org.OpenAPITools.v2.Models +namespace Org.OpenAPITools._v2.Models { /// /// A User who is purchasing from the pet store diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/PetModule.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/PetModule.cs index 9cdfe6b814e6..12233957857c 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/PetModule.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/PetModule.cs @@ -3,11 +3,11 @@ using Nancy.ModelBinding; using System.Collections.Generic; using Sharpility.Base; -using Org.OpenAPITools.v2.Models; -using Org.OpenAPITools.v2.Utils; +using Org.OpenAPITools._v2.Models; +using Org.OpenAPITools._v2.Utils; using NodaTime; -namespace Org.OpenAPITools.v2.Modules +namespace Org.OpenAPITools._v2.Modules { /// /// Status values that need to be considered for filter @@ -33,10 +33,10 @@ public PetModule(PetService service) : base("/v2") { Post["/pet"] = parameters => { - var pet = this.Bind(); - Preconditions.IsNotNull(pet, "Required parameter: 'pet' is missing at 'AddPet'"); + var body = this.Bind(); + Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'AddPet'"); - service.AddPet(Context, pet); + service.AddPet(Context, body); return new Response { ContentType = ""}; }; @@ -76,10 +76,10 @@ public PetModule(PetService service) : base("/v2") Put["/pet"] = parameters => { - var pet = this.Bind(); - Preconditions.IsNotNull(pet, "Required parameter: 'pet' is missing at 'UpdatePet'"); + var body = this.Bind(); + Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'UpdatePet'"); - service.UpdatePet(Context, pet); + service.UpdatePet(Context, body); return new Response { ContentType = ""}; }; @@ -115,9 +115,9 @@ public interface PetService /// /// /// Context of request - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// - void AddPet(NancyContext context, Pet pet); + void AddPet(NancyContext context, Pet body); /// /// @@ -156,9 +156,9 @@ public interface PetService /// /// /// Context of request - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// - void UpdatePet(NancyContext context, Pet pet); + void UpdatePet(NancyContext context, Pet body); /// /// @@ -186,9 +186,9 @@ public interface PetService /// public abstract class AbstractPetService: PetService { - public virtual void AddPet(NancyContext context, Pet pet) + public virtual void AddPet(NancyContext context, Pet body) { - AddPet(pet); + AddPet(body); } public virtual void DeletePet(NancyContext context, long? petId, string apiKey) @@ -211,9 +211,9 @@ public virtual Pet GetPetById(NancyContext context, long? petId) return GetPetById(petId); } - public virtual void UpdatePet(NancyContext context, Pet pet) + public virtual void UpdatePet(NancyContext context, Pet body) { - UpdatePet(pet); + UpdatePet(body); } public virtual void UpdatePetWithForm(NancyContext context, long? petId, string name, string status) @@ -226,7 +226,7 @@ public virtual ApiResponse UploadFile(NancyContext context, long? petId, string return UploadFile(petId, additionalMetadata, file); } - protected abstract void AddPet(Pet pet); + protected abstract void AddPet(Pet body); protected abstract void DeletePet(long? petId, string apiKey); @@ -236,7 +236,7 @@ public virtual ApiResponse UploadFile(NancyContext context, long? petId, string protected abstract Pet GetPetById(long? petId); - protected abstract void UpdatePet(Pet pet); + protected abstract void UpdatePet(Pet body); protected abstract void UpdatePetWithForm(long? petId, string name, string status); diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/StoreModule.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/StoreModule.cs index be42a7b8b520..0c75b02fd9ae 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/StoreModule.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/StoreModule.cs @@ -3,11 +3,11 @@ using Nancy.ModelBinding; using System.Collections.Generic; using Sharpility.Base; -using Org.OpenAPITools.v2.Models; -using Org.OpenAPITools.v2.Utils; +using Org.OpenAPITools._v2.Models; +using Org.OpenAPITools._v2.Utils; using NodaTime; -namespace Org.OpenAPITools.v2.Modules +namespace Org.OpenAPITools._v2.Modules { /// @@ -46,10 +46,10 @@ public StoreModule(StoreService service) : base("/v2") Post["/store/order"] = parameters => { - var order = this.Bind(); - Preconditions.IsNotNull(order, "Required parameter: 'order' is missing at 'PlaceOrder'"); + var body = this.Bind(); + Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'PlaceOrder'"); - return service.PlaceOrder(Context, order); + return service.PlaceOrder(Context, body); }; } } @@ -86,9 +86,9 @@ public interface StoreService /// /// /// Context of request - /// order placed for purchasing the pet + /// order placed for purchasing the pet /// Order - Order PlaceOrder(NancyContext context, Order order); + Order PlaceOrder(NancyContext context, Order body); } /// @@ -111,9 +111,9 @@ public virtual Order GetOrderById(NancyContext context, long? orderId) return GetOrderById(orderId); } - public virtual Order PlaceOrder(NancyContext context, Order order) + public virtual Order PlaceOrder(NancyContext context, Order body) { - return PlaceOrder(order); + return PlaceOrder(body); } protected abstract void DeleteOrder(string orderId); @@ -122,7 +122,7 @@ public virtual Order PlaceOrder(NancyContext context, Order order) protected abstract Order GetOrderById(long? orderId); - protected abstract Order PlaceOrder(Order order); + protected abstract Order PlaceOrder(Order body); } } diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/UserModule.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/UserModule.cs index c35bc62dae10..cc268b9a2c54 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/UserModule.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/UserModule.cs @@ -3,11 +3,11 @@ using Nancy.ModelBinding; using System.Collections.Generic; using Sharpility.Base; -using Org.OpenAPITools.v2.Models; -using Org.OpenAPITools.v2.Utils; +using Org.OpenAPITools._v2.Models; +using Org.OpenAPITools._v2.Utils; using NodaTime; -namespace Org.OpenAPITools.v2.Modules +namespace Org.OpenAPITools._v2.Modules { /// @@ -23,28 +23,28 @@ public UserModule(UserService service) : base("/v2") { Post["/user"] = parameters => { - var user = this.Bind(); - Preconditions.IsNotNull(user, "Required parameter: 'user' is missing at 'CreateUser'"); + var body = this.Bind(); + Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'CreateUser'"); - service.CreateUser(Context, user); + service.CreateUser(Context, body); return new Response { ContentType = ""}; }; Post["/user/createWithArray"] = parameters => { - var user = this.Bind>(); - Preconditions.IsNotNull(user, "Required parameter: 'user' is missing at 'CreateUsersWithArrayInput'"); + var body = this.Bind>(); + Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'CreateUsersWithArrayInput'"); - service.CreateUsersWithArrayInput(Context, user); + service.CreateUsersWithArrayInput(Context, body); return new Response { ContentType = ""}; }; Post["/user/createWithList"] = parameters => { - var user = this.Bind>(); - Preconditions.IsNotNull(user, "Required parameter: 'user' is missing at 'CreateUsersWithListInput'"); + var body = this.Bind>(); + Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'CreateUsersWithListInput'"); - service.CreateUsersWithListInput(Context, user); + service.CreateUsersWithListInput(Context, body); return new Response { ContentType = ""}; }; @@ -86,12 +86,12 @@ public UserModule(UserService service) : base("/v2") Put["/user/{username}"] = parameters => { var username = Parameters.ValueOf(parameters, Context.Request, "username", ParameterType.Path); - var user = this.Bind(); + var body = this.Bind(); Preconditions.IsNotNull(username, "Required parameter: 'username' is missing at 'UpdateUser'"); - Preconditions.IsNotNull(user, "Required parameter: 'user' is missing at 'UpdateUser'"); + Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'UpdateUser'"); - service.UpdateUser(Context, username, user); + service.UpdateUser(Context, username, body); return new Response { ContentType = ""}; }; } @@ -106,25 +106,25 @@ public interface UserService /// This can only be done by the logged in user. /// /// Context of request - /// Created user object + /// Created user object /// - void CreateUser(NancyContext context, User user); + void CreateUser(NancyContext context, User body); /// /// /// /// Context of request - /// List of user object + /// List of user object /// - void CreateUsersWithArrayInput(NancyContext context, List user); + void CreateUsersWithArrayInput(NancyContext context, List body); /// /// /// /// Context of request - /// List of user object + /// List of user object /// - void CreateUsersWithListInput(NancyContext context, List user); + void CreateUsersWithListInput(NancyContext context, List body); /// /// This can only be done by the logged in user. @@ -163,9 +163,9 @@ public interface UserService /// /// Context of request /// name that need to be deleted - /// Updated user object + /// Updated user object /// - void UpdateUser(NancyContext context, string username, User user); + void UpdateUser(NancyContext context, string username, User body); } /// @@ -173,19 +173,19 @@ public interface UserService /// public abstract class AbstractUserService: UserService { - public virtual void CreateUser(NancyContext context, User user) + public virtual void CreateUser(NancyContext context, User body) { - CreateUser(user); + CreateUser(body); } - public virtual void CreateUsersWithArrayInput(NancyContext context, List user) + public virtual void CreateUsersWithArrayInput(NancyContext context, List body) { - CreateUsersWithArrayInput(user); + CreateUsersWithArrayInput(body); } - public virtual void CreateUsersWithListInput(NancyContext context, List user) + public virtual void CreateUsersWithListInput(NancyContext context, List body) { - CreateUsersWithListInput(user); + CreateUsersWithListInput(body); } public virtual void DeleteUser(NancyContext context, string username) @@ -208,16 +208,16 @@ public virtual void LogoutUser(NancyContext context) LogoutUser(); } - public virtual void UpdateUser(NancyContext context, string username, User user) + public virtual void UpdateUser(NancyContext context, string username, User body) { - UpdateUser(username, user); + UpdateUser(username, body); } - protected abstract void CreateUser(User user); + protected abstract void CreateUser(User body); - protected abstract void CreateUsersWithArrayInput(List user); + protected abstract void CreateUsersWithArrayInput(List body); - protected abstract void CreateUsersWithListInput(List user); + protected abstract void CreateUsersWithListInput(List body); protected abstract void DeleteUser(string username); @@ -227,7 +227,7 @@ public virtual void UpdateUser(NancyContext context, string username, User user) protected abstract void LogoutUser(); - protected abstract void UpdateUser(string username, User user); + protected abstract void UpdateUser(string username, User body); } } diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Org.OpenAPITools.csproj index 04b710b25cbd..b26666605cd3 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -6,7 +6,7 @@ {768B8DC6-54EE-4D40-9B20-7857E1D742A4} Library Properties - Org.OpenAPITools.v2 + Org.OpenAPITools._v2 Org.OpenAPITools v4.5 512 diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Utils/LocalDateConverter.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Utils/LocalDateConverter.cs index 9e7cfd8a8570..dd90cbf5133d 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Utils/LocalDateConverter.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Utils/LocalDateConverter.cs @@ -5,7 +5,7 @@ using System; using System.Collections.Generic; -namespace Org.OpenAPITools.v2.Utils +namespace Org.OpenAPITools._v2.Utils { /// /// (De)serializes a to a string using diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Utils/Parameters.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Utils/Parameters.cs index 9bc5408abfea..847527a2dbb7 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Utils/Parameters.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Utils/Parameters.cs @@ -9,7 +9,7 @@ using Sharpility.Extensions; using Sharpility.Util; -namespace Org.OpenAPITools.v2.Utils +namespace Org.OpenAPITools._v2.Utils { internal static class Parameters { diff --git a/samples/server/petstore/nodejs-google-cloud-functions/.openapi-generator/VERSION b/samples/server/petstore/nodejs-google-cloud-functions/.openapi-generator/VERSION index d96260ba335d..83a328a9227e 100644 --- a/samples/server/petstore/nodejs-google-cloud-functions/.openapi-generator/VERSION +++ b/samples/server/petstore/nodejs-google-cloud-functions/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.2-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/nodejs/.openapi-generator/VERSION b/samples/server/petstore/nodejs/.openapi-generator/VERSION index d96260ba335d..83a328a9227e 100644 --- a/samples/server/petstore/nodejs/.openapi-generator/VERSION +++ b/samples/server/petstore/nodejs/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.2-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/php-laravel/.openapi-generator/VERSION b/samples/server/petstore/php-laravel/.openapi-generator/VERSION index 479c313e87b9..83a328a9227e 100644 --- a/samples/server/petstore/php-laravel/.openapi-generator/VERSION +++ b/samples/server/petstore/php-laravel/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.3-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/php-laravel/lib/.env b/samples/server/petstore/php-laravel/lib/.env deleted file mode 100644 index 7aaed2ba7b9c..000000000000 --- a/samples/server/petstore/php-laravel/lib/.env +++ /dev/null @@ -1,39 +0,0 @@ -APP_NAME=Laravel -APP_ENV=local -APP_KEY=base64:DLKuAaa5bAytB73eQNHV4KBfRzQxh9ix8J3gc0sbfGc= -APP_DEBUG=true -APP_URL=http://localhost - -LOG_CHANNEL=stack - -DB_CONNECTION=mysql -DB_HOST=127.0.0.1 -DB_PORT=3306 -DB_DATABASE=homestead -DB_USERNAME=homestead -DB_PASSWORD=secret - -BROADCAST_DRIVER=log -CACHE_DRIVER=file -SESSION_DRIVER=file -SESSION_LIFETIME=120 -QUEUE_DRIVER=sync - -REDIS_HOST=127.0.0.1 -REDIS_PASSWORD=null -REDIS_PORT=6379 - -MAIL_DRIVER=smtp -MAIL_HOST=smtp.mailtrap.io -MAIL_PORT=2525 -MAIL_USERNAME=null -MAIL_PASSWORD=null -MAIL_ENCRYPTION=null - -PUSHER_APP_ID= -PUSHER_APP_KEY= -PUSHER_APP_SECRET= -PUSHER_APP_CLUSTER=mt1 - -MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" -MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" diff --git a/samples/server/petstore/php-laravel/lib/app/Http/Controllers/AnotherFakeController.php b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/AnotherFakeController.php deleted file mode 100644 index 700d13d11e45..000000000000 --- a/samples/server/petstore/php-laravel/lib/app/Http/Controllers/AnotherFakeController.php +++ /dev/null @@ -1,57 +0,0 @@ - https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/php-laravel/ - */ - - -namespace App\Http\Controllers; - -use Illuminate\Support\Facades\Request; - -class AnotherFakeController extends Controller -{ - /** - * Constructor - */ - public function __construct() - { - } - - /** - * Operation call123TestSpecialTags - * - * To test special tags. - * - * - * @return Http response - */ - public function call123TestSpecialTags() - { - $input = Request::all(); - - //path params validation - - - //not path params validation - if (!isset($input['body'])) { - throw new \InvalidArgumentException('Missing the required parameter $body when calling call123TestSpecialTags'); - } - $body = $input['body']; - - - return response('How about implementing call123TestSpecialTags as a patch method ?'); - } -} diff --git a/samples/server/petstore/php-laravel/lib/app/Http/Controllers/FakeClassnameTags123Controller.php b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/FakeClassnameTags123Controller.php deleted file mode 100644 index 46ccd6e5fd6e..000000000000 --- a/samples/server/petstore/php-laravel/lib/app/Http/Controllers/FakeClassnameTags123Controller.php +++ /dev/null @@ -1,57 +0,0 @@ - https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/php-laravel/ - */ - - -namespace App\Http\Controllers; - -use Illuminate\Support\Facades\Request; - -class FakeClassnameTags123Controller extends Controller -{ - /** - * Constructor - */ - public function __construct() - { - } - - /** - * Operation testClassname - * - * To test class name in snake case. - * - * - * @return Http response - */ - public function testClassname() - { - $input = Request::all(); - - //path params validation - - - //not path params validation - if (!isset($input['body'])) { - throw new \InvalidArgumentException('Missing the required parameter $body when calling testClassname'); - } - $body = $input['body']; - - - return response('How about implementing testClassname as a patch method ?'); - } -} diff --git a/samples/server/petstore/php-laravel/lib/app/Http/Controllers/FakeController.php b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/FakeController.php deleted file mode 100644 index eddab9354c8f..000000000000 --- a/samples/server/petstore/php-laravel/lib/app/Http/Controllers/FakeController.php +++ /dev/null @@ -1,444 +0,0 @@ - https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/php-laravel/ - */ - - -namespace App\Http\Controllers; - -use Illuminate\Support\Facades\Request; - -class FakeController extends Controller -{ - /** - * Constructor - */ - public function __construct() - { - } - - /** - * Operation testClientModel - * - * To test \"client\" model. - * - * - * @return Http response - */ - public function testClientModel() - { - $input = Request::all(); - - //path params validation - - - //not path params validation - if (!isset($input['body'])) { - throw new \InvalidArgumentException('Missing the required parameter $body when calling testClientModel'); - } - $body = $input['body']; - - - return response('How about implementing testClientModel as a patch method ?'); - } - /** - * Operation testEndpointParameters - * - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트. - * - * - * @return Http response - */ - public function testEndpointParameters() - { - $input = Request::all(); - - //path params validation - - - //not path params validation - if (!isset($input['number'])) { - throw new \InvalidArgumentException('Missing the required parameter $number when calling testEndpointParameters'); - } - if ($input['number'] > 543.2) { - throw new \InvalidArgumentException('invalid value for $number when calling FakeController.testEndpointParameters, must be smaller than or equal to 543.2.'); - } - if ($input['number'] < 32.1) { - throw new \InvalidArgumentException('invalid value for $number when calling FakeController.testEndpointParameters, must be bigger than or equal to 32.1.'); - } - $number = $input['number']; - - if (!isset($input['double'])) { - throw new \InvalidArgumentException('Missing the required parameter $double when calling testEndpointParameters'); - } - if ($input['double'] > 123.4) { - throw new \InvalidArgumentException('invalid value for $double when calling FakeController.testEndpointParameters, must be smaller than or equal to 123.4.'); - } - if ($input['double'] < 67.8) { - throw new \InvalidArgumentException('invalid value for $double when calling FakeController.testEndpointParameters, must be bigger than or equal to 67.8.'); - } - $double = $input['double']; - - if (!isset($input['patternWithoutDelimiter'])) { - throw new \InvalidArgumentException('Missing the required parameter $patternWithoutDelimiter when calling testEndpointParameters'); - } - if (!preg_match("/^[A-Z].*/", $input['patternWithoutDelimiter'])) { - throw new \InvalidArgumentException('invalid value for $patternWithoutDelimiter when calling FakeController.testEndpointParameters, must conform to the pattern /^[A-Z].*/.'); - } - $patternWithoutDelimiter = $input['patternWithoutDelimiter']; - - if (!isset($input['byte'])) { - throw new \InvalidArgumentException('Missing the required parameter $byte when calling testEndpointParameters'); - } - $byte = $input['byte']; - - if ($input['integer'] > 100) { - throw new \InvalidArgumentException('invalid value for $integer when calling FakeController.testEndpointParameters, must be smaller than or equal to 100.'); - } - if ($input['integer'] < 10) { - throw new \InvalidArgumentException('invalid value for $integer when calling FakeController.testEndpointParameters, must be bigger than or equal to 10.'); - } - $integer = $input['integer']; - - if ($input['int32'] > 200) { - throw new \InvalidArgumentException('invalid value for $int32 when calling FakeController.testEndpointParameters, must be smaller than or equal to 200.'); - } - if ($input['int32'] < 20) { - throw new \InvalidArgumentException('invalid value for $int32 when calling FakeController.testEndpointParameters, must be bigger than or equal to 20.'); - } - $int32 = $input['int32']; - - $int64 = $input['int64']; - - if ($input['float'] > 987.6) { - throw new \InvalidArgumentException('invalid value for $float when calling FakeController.testEndpointParameters, must be smaller than or equal to 987.6.'); - } - $float = $input['float']; - - if (!preg_match("/[a-z]/i", $input['string'])) { - throw new \InvalidArgumentException('invalid value for $string when calling FakeController.testEndpointParameters, must conform to the pattern /[a-z]/i.'); - } - $string = $input['string']; - - $binary = $input['binary']; - - $date = $input['date']; - - $dateTime = $input['dateTime']; - - if (strlen($input['password']) > 64) { - throw new \InvalidArgumentException('invalid length for $password when calling FakeController.testEndpointParameters, must be smaller than or equal to 64.'); - } - if (strlen($input['password']) < 10) { - throw new \InvalidArgumentException('invalid length for $password when calling FakeController.testEndpointParameters, must be bigger than or equal to 10.'); - } - $password = $input['password']; - - $callback = $input['callback']; - - - return response('How about implementing testEndpointParameters as a post method ?'); - } - /** - * Operation testEnumParameters - * - * To test enum parameters. - * - * - * @return Http response - */ - public function testEnumParameters() - { - $input = Request::all(); - - //path params validation - - - //not path params validation - $enumHeaderStringArray = $input['enumHeaderStringArray']; - - $enumHeaderString = $input['enumHeaderString']; - - $enumQueryStringArray = $input['enumQueryStringArray']; - - $enumQueryString = $input['enumQueryString']; - - $enumQueryInteger = $input['enumQueryInteger']; - - $enumQueryDouble = $input['enumQueryDouble']; - - $enumFormStringArray = $input['enumFormStringArray']; - - $enumFormString = $input['enumFormString']; - - - return response('How about implementing testEnumParameters as a get method ?'); - } - /** - * Operation testGroupParameters - * - * Fake endpoint to test group parameters (optional). - * - * - * @return Http response - */ - public function testGroupParameters() - { - $input = Request::all(); - - //path params validation - - - //not path params validation - if (!isset($input['requiredStringGroup'])) { - throw new \InvalidArgumentException('Missing the required parameter $requiredStringGroup when calling testGroupParameters'); - } - $requiredStringGroup = $input['requiredStringGroup']; - - if (!isset($input['requiredBooleanGroup'])) { - throw new \InvalidArgumentException('Missing the required parameter $requiredBooleanGroup when calling testGroupParameters'); - } - $requiredBooleanGroup = $input['requiredBooleanGroup']; - - if (!isset($input['requiredInt64Group'])) { - throw new \InvalidArgumentException('Missing the required parameter $requiredInt64Group when calling testGroupParameters'); - } - $requiredInt64Group = $input['requiredInt64Group']; - - $stringGroup = $input['stringGroup']; - - $booleanGroup = $input['booleanGroup']; - - $int64Group = $input['int64Group']; - - - return response('How about implementing testGroupParameters as a delete method ?'); - } - /** - * Operation testBodyWithFileSchema - * - * . - * - * - * @return Http response - */ - public function testBodyWithFileSchema() - { - $input = Request::all(); - - //path params validation - - - //not path params validation - if (!isset($input['body'])) { - throw new \InvalidArgumentException('Missing the required parameter $body when calling testBodyWithFileSchema'); - } - $body = $input['body']; - - - return response('How about implementing testBodyWithFileSchema as a put method ?'); - } - /** - * Operation testBodyWithQueryParams - * - * . - * - * - * @return Http response - */ - public function testBodyWithQueryParams() - { - $input = Request::all(); - - //path params validation - - - //not path params validation - if (!isset($input['query'])) { - throw new \InvalidArgumentException('Missing the required parameter $query when calling testBodyWithQueryParams'); - } - $query = $input['query']; - - if (!isset($input['body'])) { - throw new \InvalidArgumentException('Missing the required parameter $body when calling testBodyWithQueryParams'); - } - $body = $input['body']; - - - return response('How about implementing testBodyWithQueryParams as a put method ?'); - } - /** - * Operation createXmlItem - * - * creates an XmlItem. - * - * - * @return Http response - */ - public function createXmlItem() - { - $input = Request::all(); - - //path params validation - - - //not path params validation - if (!isset($input['xmlItem'])) { - throw new \InvalidArgumentException('Missing the required parameter $xmlItem when calling createXmlItem'); - } - $xmlItem = $input['xmlItem']; - - - return response('How about implementing createXmlItem as a post method ?'); - } - /** - * Operation testInlineAdditionalProperties - * - * test inline additionalProperties. - * - * - * @return Http response - */ - public function testInlineAdditionalProperties() - { - $input = Request::all(); - - //path params validation - - - //not path params validation - if (!isset($input['param'])) { - throw new \InvalidArgumentException('Missing the required parameter $param when calling testInlineAdditionalProperties'); - } - $param = $input['param']; - - - return response('How about implementing testInlineAdditionalProperties as a post method ?'); - } - /** - * Operation testJsonFormData - * - * test json serialization of form data. - * - * - * @return Http response - */ - public function testJsonFormData() - { - $input = Request::all(); - - //path params validation - - - //not path params validation - if (!isset($input['param'])) { - throw new \InvalidArgumentException('Missing the required parameter $param when calling testJsonFormData'); - } - $param = $input['param']; - - if (!isset($input['param2'])) { - throw new \InvalidArgumentException('Missing the required parameter $param2 when calling testJsonFormData'); - } - $param2 = $input['param2']; - - - return response('How about implementing testJsonFormData as a get method ?'); - } - /** - * Operation fakeOuterBooleanSerialize - * - * . - * - * - * @return Http response - */ - public function fakeOuterBooleanSerialize() - { - $input = Request::all(); - - //path params validation - - - //not path params validation - $body = $input['body']; - - - return response('How about implementing fakeOuterBooleanSerialize as a post method ?'); - } - /** - * Operation fakeOuterCompositeSerialize - * - * . - * - * - * @return Http response - */ - public function fakeOuterCompositeSerialize() - { - $input = Request::all(); - - //path params validation - - - //not path params validation - $body = $input['body']; - - - return response('How about implementing fakeOuterCompositeSerialize as a post method ?'); - } - /** - * Operation fakeOuterNumberSerialize - * - * . - * - * - * @return Http response - */ - public function fakeOuterNumberSerialize() - { - $input = Request::all(); - - //path params validation - - - //not path params validation - $body = $input['body']; - - - return response('How about implementing fakeOuterNumberSerialize as a post method ?'); - } - /** - * Operation fakeOuterStringSerialize - * - * . - * - * - * @return Http response - */ - public function fakeOuterStringSerialize() - { - $input = Request::all(); - - //path params validation - - - //not path params validation - $body = $input['body']; - - - return response('How about implementing fakeOuterStringSerialize as a post method ?'); - } -} diff --git a/samples/server/petstore/php-laravel/lib/app/Http/Controllers/PetController.php b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/PetController.php index 5fc490b27cc1..2e19342299a3 100644 --- a/samples/server/petstore/php-laravel/lib/app/Http/Controllers/PetController.php +++ b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/PetController.php @@ -2,7 +2,7 @@ /** * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * @@ -30,26 +30,6 @@ public function __construct() { } - /** - * Operation uploadFileWithRequiredFile - * - * uploads an image (required). - * - * @param int $petId ID of pet to update (required) - * - * @return Http response - */ - public function uploadFileWithRequiredFile($petId) - { - $input = Request::all(); - - //path params validation - - - //not path params validation - - return response('How about implementing uploadFileWithRequiredFile as a post method ?'); - } /** * Operation addPet * @@ -66,10 +46,10 @@ public function addPet() //not path params validation - if (!isset($input['body'])) { - throw new \InvalidArgumentException('Missing the required parameter $body when calling addPet'); + if (!isset($input['pet'])) { + throw new \InvalidArgumentException('Missing the required parameter $pet when calling addPet'); } - $body = $input['body']; + $pet = $input['pet']; return response('How about implementing addPet as a post method ?'); @@ -90,10 +70,10 @@ public function updatePet() //not path params validation - if (!isset($input['body'])) { - throw new \InvalidArgumentException('Missing the required parameter $body when calling updatePet'); + if (!isset($input['pet'])) { + throw new \InvalidArgumentException('Missing the required parameter $pet when calling updatePet'); } - $body = $input['body']; + $pet = $input['pet']; return response('How about implementing updatePet as a put method ?'); @@ -143,6 +123,8 @@ public function findPetsByTags() } $tags = $input['tags']; + $maxCount = $input['maxCount']; + return response('How about implementing findPetsByTags as a get method ?'); } diff --git a/samples/server/petstore/php-laravel/lib/app/Http/Controllers/StoreController.php b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/StoreController.php index 6c7013f5b635..5f678fb4862e 100644 --- a/samples/server/petstore/php-laravel/lib/app/Http/Controllers/StoreController.php +++ b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/StoreController.php @@ -2,7 +2,7 @@ /** * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * @@ -65,10 +65,10 @@ public function placeOrder() //not path params validation - if (!isset($input['body'])) { - throw new \InvalidArgumentException('Missing the required parameter $body when calling placeOrder'); + if (!isset($input['order'])) { + throw new \InvalidArgumentException('Missing the required parameter $order when calling placeOrder'); } - $body = $input['body']; + $order = $input['order']; return response('How about implementing placeOrder as a post method ?'); diff --git a/samples/server/petstore/php-laravel/lib/app/Http/Controllers/UserController.php b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/UserController.php index 365502a3beec..f715969a161a 100644 --- a/samples/server/petstore/php-laravel/lib/app/Http/Controllers/UserController.php +++ b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/UserController.php @@ -2,7 +2,7 @@ /** * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * @@ -46,10 +46,10 @@ public function createUser() //not path params validation - if (!isset($input['body'])) { - throw new \InvalidArgumentException('Missing the required parameter $body when calling createUser'); + if (!isset($input['user'])) { + throw new \InvalidArgumentException('Missing the required parameter $user when calling createUser'); } - $body = $input['body']; + $user = $input['user']; return response('How about implementing createUser as a post method ?'); @@ -70,10 +70,10 @@ public function createUsersWithArrayInput() //not path params validation - if (!isset($input['body'])) { - throw new \InvalidArgumentException('Missing the required parameter $body when calling createUsersWithArrayInput'); + if (!isset($input['user'])) { + throw new \InvalidArgumentException('Missing the required parameter $user when calling createUsersWithArrayInput'); } - $body = $input['body']; + $user = $input['user']; return response('How about implementing createUsersWithArrayInput as a post method ?'); @@ -94,10 +94,10 @@ public function createUsersWithListInput() //not path params validation - if (!isset($input['body'])) { - throw new \InvalidArgumentException('Missing the required parameter $body when calling createUsersWithListInput'); + if (!isset($input['user'])) { + throw new \InvalidArgumentException('Missing the required parameter $user when calling createUsersWithListInput'); } - $body = $input['body']; + $user = $input['user']; return response('How about implementing createUsersWithListInput as a post method ?'); @@ -121,6 +121,9 @@ public function loginUser() if (!isset($input['username'])) { throw new \InvalidArgumentException('Missing the required parameter $username when calling loginUser'); } + if (!preg_match("/^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$/", $input['username'])) { + throw new \InvalidArgumentException('invalid value for $username when calling UserController.loginUser, must conform to the pattern /^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$/.'); + } $username = $input['username']; if (!isset($input['password'])) { diff --git a/samples/server/petstore/php-laravel/lib/app/Models/AdditionalPropertiesAnyType.php b/samples/server/petstore/php-laravel/lib/app/Models/AdditionalPropertiesAnyType.php deleted file mode 100644 index 6cd496f72ada..000000000000 --- a/samples/server/petstore/php-laravel/lib/app/Models/AdditionalPropertiesAnyType.php +++ /dev/null @@ -1,15 +0,0 @@ - https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/php-laravel/ */ -/** - * patch call123TestSpecialTags - * Summary: To test special tags - * Notes: To test special tags and operation ID starting with number - * Output-Formats: [application/json] - */ -Route::patch('/v2/another-fake/dummy', 'AnotherFakeController@call123TestSpecialTags'); -/** - * patch testClientModel - * Summary: To test \"client\" model - * Notes: To test \"client\" model - * Output-Formats: [application/json] - */ -Route::patch('/v2/fake', 'FakeController@testClientModel'); -/** - * post testEndpointParameters - * Summary: Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * Notes: Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - - */ -Route::post('/v2/fake', 'FakeController@testEndpointParameters'); -/** - * get testEnumParameters - * Summary: To test enum parameters - * Notes: To test enum parameters - - */ -Route::get('/v2/fake', 'FakeController@testEnumParameters'); -/** - * delete testGroupParameters - * Summary: Fake endpoint to test group parameters (optional) - * Notes: Fake endpoint to test group parameters (optional) - - */ -Route::delete('/v2/fake', 'FakeController@testGroupParameters'); -/** - * put testBodyWithFileSchema - * Summary: - * Notes: For this test, the body for this request much reference a schema named `File`. - - */ -Route::put('/v2/fake/body-with-file-schema', 'FakeController@testBodyWithFileSchema'); -/** - * put testBodyWithQueryParams - * Summary: - * Notes: - - */ -Route::put('/v2/fake/body-with-query-params', 'FakeController@testBodyWithQueryParams'); -/** - * post createXmlItem - * Summary: creates an XmlItem - * Notes: this route creates an XmlItem - - */ -Route::post('/v2/fake/create_xml_item', 'FakeController@createXmlItem'); -/** - * post testInlineAdditionalProperties - * Summary: test inline additionalProperties - * Notes: - - */ -Route::post('/v2/fake/inline-additionalProperties', 'FakeController@testInlineAdditionalProperties'); -/** - * get testJsonFormData - * Summary: test json serialization of form data - * Notes: - - */ -Route::get('/v2/fake/jsonFormData', 'FakeController@testJsonFormData'); -/** - * post fakeOuterBooleanSerialize - * Summary: - * Notes: Test serialization of outer boolean types - * Output-Formats: [*_/_*] - */ -Route::post('/v2/fake/outer/boolean', 'FakeController@fakeOuterBooleanSerialize'); -/** - * post fakeOuterCompositeSerialize - * Summary: - * Notes: Test serialization of object with outer number type - * Output-Formats: [*_/_*] - */ -Route::post('/v2/fake/outer/composite', 'FakeController@fakeOuterCompositeSerialize'); -/** - * post fakeOuterNumberSerialize - * Summary: - * Notes: Test serialization of outer number types - * Output-Formats: [*_/_*] - */ -Route::post('/v2/fake/outer/number', 'FakeController@fakeOuterNumberSerialize'); -/** - * post fakeOuterStringSerialize - * Summary: - * Notes: Test serialization of outer string types - * Output-Formats: [*_/_*] - */ -Route::post('/v2/fake/outer/string', 'FakeController@fakeOuterStringSerialize'); -/** - * patch testClassname - * Summary: To test class name in snake case - * Notes: To test class name in snake case - * Output-Formats: [application/json] - */ -Route::patch('/v2/fake_classname_test', 'FakeClassnameTags123Controller@testClassname'); -/** - * post uploadFileWithRequiredFile - * Summary: uploads an image (required) - * Notes: - * Output-Formats: [application/json] - */ -Route::post('/v2/fake/{petId}/uploadImageWithRequiredFile', 'PetController@uploadFileWithRequiredFile'); /** * post addPet * Summary: Add a new pet to the store @@ -204,14 +92,14 @@ * Notes: For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors */ -Route::delete('/v2/store/order/{order_id}', 'StoreController@deleteOrder'); +Route::delete('/v2/store/order/{orderId}', 'StoreController@deleteOrder'); /** * get getOrderById * Summary: Find purchase order by ID * Notes: For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * Output-Formats: [application/xml, application/json] */ -Route::get('/v2/store/order/{order_id}', 'StoreController@getOrderById'); +Route::get('/v2/store/order/{orderId}', 'StoreController@getOrderById'); /** * post createUser * Summary: Create user diff --git a/samples/server/petstore/php-laravel/lib/routes/channels.php b/samples/server/petstore/php-laravel/lib/routes/channels.php index ce848a9a1b03..2b716d453d0e 100644 --- a/samples/server/petstore/php-laravel/lib/routes/channels.php +++ b/samples/server/petstore/php-laravel/lib/routes/channels.php @@ -2,7 +2,7 @@ /** * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/server/petstore/php-laravel/lib/routes/console.php b/samples/server/petstore/php-laravel/lib/routes/console.php index 0ed63f6741a7..ba3d19e5167e 100644 --- a/samples/server/petstore/php-laravel/lib/routes/console.php +++ b/samples/server/petstore/php-laravel/lib/routes/console.php @@ -2,7 +2,7 @@ /** * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/server/petstore/php-laravel/lib/routes/web.php b/samples/server/petstore/php-laravel/lib/routes/web.php index 325aca0792e7..090c7e1570d5 100644 --- a/samples/server/petstore/php-laravel/lib/routes/web.php +++ b/samples/server/petstore/php-laravel/lib/routes/web.php @@ -2,7 +2,7 @@ /** * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/server/petstore/php-lumen/lib/app/Http/Controllers/AnotherFakeApi.php b/samples/server/petstore/php-lumen/lib/app/Http/Controllers/AnotherFakeApi.php index 322f09736fa5..004b28e98d2f 100644 --- a/samples/server/petstore/php-lumen/lib/app/Http/Controllers/AnotherFakeApi.php +++ b/samples/server/petstore/php-lumen/lib/app/Http/Controllers/AnotherFakeApi.php @@ -42,10 +42,10 @@ public function call123TestSpecialTags() //not path params validation - if (!isset($input['body'])) { - throw new \InvalidArgumentException('Missing the required parameter $body when calling call123TestSpecialTags'); + if (!isset($input['client'])) { + throw new \InvalidArgumentException('Missing the required parameter $client when calling call123TestSpecialTags'); } - $body = $input['body']; + $client = $input['client']; return response('How about implementing call123TestSpecialTags as a patch method ?'); diff --git a/samples/server/petstore/php-lumen/lib/app/Http/Controllers/DefaultApi.php b/samples/server/petstore/php-lumen/lib/app/Http/Controllers/DefaultApi.php index ea3c1a8802ee..9d93c275f906 100644 --- a/samples/server/petstore/php-lumen/lib/app/Http/Controllers/DefaultApi.php +++ b/samples/server/petstore/php-lumen/lib/app/Http/Controllers/DefaultApi.php @@ -4,7 +4,7 @@ * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/server/petstore/php-lumen/lib/app/Http/Controllers/FakeApi.php b/samples/server/petstore/php-lumen/lib/app/Http/Controllers/FakeApi.php index d65f0ce9d580..f83024fbe14a 100644 --- a/samples/server/petstore/php-lumen/lib/app/Http/Controllers/FakeApi.php +++ b/samples/server/petstore/php-lumen/lib/app/Http/Controllers/FakeApi.php @@ -42,10 +42,10 @@ public function testClientModel() //not path params validation - if (!isset($input['body'])) { - throw new \InvalidArgumentException('Missing the required parameter $body when calling testClientModel'); + if (!isset($input['client'])) { + throw new \InvalidArgumentException('Missing the required parameter $client when calling testClientModel'); } - $body = $input['body']; + $client = $input['client']; return response('How about implementing testClientModel as a patch method ?'); @@ -239,10 +239,10 @@ public function testBodyWithFileSchema() //not path params validation - if (!isset($input['body'])) { - throw new \InvalidArgumentException('Missing the required parameter $body when calling testBodyWithFileSchema'); + if (!isset($input['file_schema_test_class'])) { + throw new \InvalidArgumentException('Missing the required parameter $file_schema_test_class when calling testBodyWithFileSchema'); } - $body = $input['body']; + $file_schema_test_class = $input['file_schema_test_class']; return response('How about implementing testBodyWithFileSchema as a put method ?'); @@ -268,23 +268,23 @@ public function testBodyWithQueryParams() } $query = $input['query']; - if (!isset($input['body'])) { - throw new \InvalidArgumentException('Missing the required parameter $body when calling testBodyWithQueryParams'); + if (!isset($input['user'])) { + throw new \InvalidArgumentException('Missing the required parameter $user when calling testBodyWithQueryParams'); } - $body = $input['body']; + $user = $input['user']; return response('How about implementing testBodyWithQueryParams as a put method ?'); } /** - * Operation createXmlItem + * Operation fakeHealthGet * - * creates an XmlItem. + * Health check endpoint. * * * @return Http response */ - public function createXmlItem() + public function fakeHealthGet() { $input = Request::all(); @@ -292,13 +292,8 @@ public function createXmlItem() //not path params validation - if (!isset($input['xml_item'])) { - throw new \InvalidArgumentException('Missing the required parameter $xml_item when calling createXmlItem'); - } - $xml_item = $input['xml_item']; - - return response('How about implementing createXmlItem as a post method ?'); + return response('How about implementing fakeHealthGet as a get method ?'); } /** * Operation testInlineAdditionalProperties @@ -316,10 +311,10 @@ public function testInlineAdditionalProperties() //not path params validation - if (!isset($input['param'])) { - throw new \InvalidArgumentException('Missing the required parameter $param when calling testInlineAdditionalProperties'); + if (!isset($input['request_body'])) { + throw new \InvalidArgumentException('Missing the required parameter $request_body when calling testInlineAdditionalProperties'); } - $param = $input['param']; + $request_body = $input['request_body']; return response('How about implementing testInlineAdditionalProperties as a post method ?'); @@ -390,7 +385,7 @@ public function fakeOuterCompositeSerialize() //not path params validation - $body = $input['body']; + $outer_composite = $input['outer_composite']; return response('How about implementing fakeOuterCompositeSerialize as a post method ?'); diff --git a/samples/server/petstore/php-lumen/lib/app/Http/Controllers/FakeClassnameTags123Api.php b/samples/server/petstore/php-lumen/lib/app/Http/Controllers/FakeClassnameTags123Api.php index 1b60b7d6361c..3182bb76ec4e 100644 --- a/samples/server/petstore/php-lumen/lib/app/Http/Controllers/FakeClassnameTags123Api.php +++ b/samples/server/petstore/php-lumen/lib/app/Http/Controllers/FakeClassnameTags123Api.php @@ -42,10 +42,10 @@ public function testClassname() //not path params validation - if (!isset($input['body'])) { - throw new \InvalidArgumentException('Missing the required parameter $body when calling testClassname'); + if (!isset($input['client'])) { + throw new \InvalidArgumentException('Missing the required parameter $client when calling testClassname'); } - $body = $input['body']; + $client = $input['client']; return response('How about implementing testClassname as a patch method ?'); diff --git a/samples/server/petstore/php-lumen/lib/app/Http/Controllers/PetApi.php b/samples/server/petstore/php-lumen/lib/app/Http/Controllers/PetApi.php index 5667a6f98523..2054fe253327 100644 --- a/samples/server/petstore/php-lumen/lib/app/Http/Controllers/PetApi.php +++ b/samples/server/petstore/php-lumen/lib/app/Http/Controllers/PetApi.php @@ -62,10 +62,10 @@ public function addPet() //not path params validation - if (!isset($input['body'])) { - throw new \InvalidArgumentException('Missing the required parameter $body when calling addPet'); + if (!isset($input['pet'])) { + throw new \InvalidArgumentException('Missing the required parameter $pet when calling addPet'); } - $body = $input['body']; + $pet = $input['pet']; return response('How about implementing addPet as a post method ?'); @@ -86,10 +86,10 @@ public function updatePet() //not path params validation - if (!isset($input['body'])) { - throw new \InvalidArgumentException('Missing the required parameter $body when calling updatePet'); + if (!isset($input['pet'])) { + throw new \InvalidArgumentException('Missing the required parameter $pet when calling updatePet'); } - $body = $input['body']; + $pet = $input['pet']; return response('How about implementing updatePet as a put method ?'); diff --git a/samples/server/petstore/php-lumen/lib/app/Http/Controllers/StoreApi.php b/samples/server/petstore/php-lumen/lib/app/Http/Controllers/StoreApi.php index 76caa0054843..c8a3a41e8fdb 100644 --- a/samples/server/petstore/php-lumen/lib/app/Http/Controllers/StoreApi.php +++ b/samples/server/petstore/php-lumen/lib/app/Http/Controllers/StoreApi.php @@ -61,10 +61,10 @@ public function placeOrder() //not path params validation - if (!isset($input['body'])) { - throw new \InvalidArgumentException('Missing the required parameter $body when calling placeOrder'); + if (!isset($input['order'])) { + throw new \InvalidArgumentException('Missing the required parameter $order when calling placeOrder'); } - $body = $input['body']; + $order = $input['order']; return response('How about implementing placeOrder as a post method ?'); diff --git a/samples/server/petstore/php-lumen/lib/app/Http/Controllers/UserApi.php b/samples/server/petstore/php-lumen/lib/app/Http/Controllers/UserApi.php index e6667053a095..e740ca3c9a86 100644 --- a/samples/server/petstore/php-lumen/lib/app/Http/Controllers/UserApi.php +++ b/samples/server/petstore/php-lumen/lib/app/Http/Controllers/UserApi.php @@ -42,10 +42,10 @@ public function createUser() //not path params validation - if (!isset($input['body'])) { - throw new \InvalidArgumentException('Missing the required parameter $body when calling createUser'); + if (!isset($input['user'])) { + throw new \InvalidArgumentException('Missing the required parameter $user when calling createUser'); } - $body = $input['body']; + $user = $input['user']; return response('How about implementing createUser as a post method ?'); @@ -66,10 +66,10 @@ public function createUsersWithArrayInput() //not path params validation - if (!isset($input['body'])) { - throw new \InvalidArgumentException('Missing the required parameter $body when calling createUsersWithArrayInput'); + if (!isset($input['user'])) { + throw new \InvalidArgumentException('Missing the required parameter $user when calling createUsersWithArrayInput'); } - $body = $input['body']; + $user = $input['user']; return response('How about implementing createUsersWithArrayInput as a post method ?'); @@ -90,10 +90,10 @@ public function createUsersWithListInput() //not path params validation - if (!isset($input['body'])) { - throw new \InvalidArgumentException('Missing the required parameter $body when calling createUsersWithListInput'); + if (!isset($input['user'])) { + throw new \InvalidArgumentException('Missing the required parameter $user when calling createUsersWithListInput'); } - $body = $input['body']; + $user = $input['user']; return response('How about implementing createUsersWithListInput as a post method ?'); diff --git a/samples/server/petstore/php-lumen/lib/routes/web.php b/samples/server/petstore/php-lumen/lib/routes/web.php index f694f4c48d9d..b49d23d01218 100644 --- a/samples/server/petstore/php-lumen/lib/routes/web.php +++ b/samples/server/petstore/php-lumen/lib/routes/web.php @@ -27,6 +27,12 @@ * Notes: To test special tags and operation ID starting with number */ $router->patch('/v2/another-fake/dummy', 'AnotherFakeApi@call123TestSpecialTags'); +/** + * get fooGet + * Summary: + * Notes: + */ +$router->get('/v2/foo', 'DefaultApi@fooGet'); /** * patch testClientModel * Summary: To test \"client\" model @@ -64,11 +70,11 @@ */ $router->put('/v2/fake/body-with-query-params', 'FakeApi@testBodyWithQueryParams'); /** - * post createXmlItem - * Summary: creates an XmlItem - * Notes: this route creates an XmlItem + * get fakeHealthGet + * Summary: Health check endpoint + * Notes: */ -$router->post('/v2/fake/create_xml_item', 'FakeApi@createXmlItem'); +$router->get('/v2/fake/health', 'FakeApi@fakeHealthGet'); /** * post testInlineAdditionalProperties * Summary: test inline additionalProperties diff --git a/samples/server/petstore/php-silex/OpenAPIServer/index.php b/samples/server/petstore/php-silex/OpenAPIServer/index.php index ef5c65d8e739..69cb573fe029 100644 --- a/samples/server/petstore/php-silex/OpenAPIServer/index.php +++ b/samples/server/petstore/php-silex/OpenAPIServer/index.php @@ -26,6 +26,7 @@ $app->GET('/v2/pet/findByTags', function(Application $app, Request $request) { $tags = $request->get('tags'); + $max_count = $request->get('max_count'); return new Response('How about implementing findPetsByTags as a GET method ?'); }); diff --git a/samples/server/petstore/php-slim/README.md b/samples/server/petstore/php-slim/README.md index 3df90ccbeda4..bb6f5e893b44 100644 --- a/samples/server/petstore/php-slim/README.md +++ b/samples/server/petstore/php-slim/README.md @@ -93,7 +93,7 @@ Switch on option in `./index.php`: ## API Endpoints -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://petstore.swagger.io/v2* > Important! Do not modify abstract API controllers directly! Instead extend them by implementation classes like: @@ -119,21 +119,6 @@ For instance, when abstract class located at `./lib/Api/AbstractPetApi.php` you Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*AbstractAnotherFakeApi* | **call123TestSpecialTags** | **PATCH** /another-fake/dummy | To test special tags -*AbstractFakeApi* | **createXmlItem** | **POST** /fake/create_xml_item | creates an XmlItem -*AbstractFakeApi* | **fakeOuterBooleanSerialize** | **POST** /fake/outer/boolean | -*AbstractFakeApi* | **fakeOuterCompositeSerialize** | **POST** /fake/outer/composite | -*AbstractFakeApi* | **fakeOuterNumberSerialize** | **POST** /fake/outer/number | -*AbstractFakeApi* | **fakeOuterStringSerialize** | **POST** /fake/outer/string | -*AbstractFakeApi* | **testBodyWithFileSchema** | **PUT** /fake/body-with-file-schema | -*AbstractFakeApi* | **testBodyWithQueryParams** | **PUT** /fake/body-with-query-params | -*AbstractFakeApi* | **testClientModel** | **PATCH** /fake | To test \"client\" model -*AbstractFakeApi* | **testEndpointParameters** | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -*AbstractFakeApi* | **testEnumParameters** | **GET** /fake | To test enum parameters -*AbstractFakeApi* | **testGroupParameters** | **DELETE** /fake | Fake endpoint to test group parameters (optional) -*AbstractFakeApi* | **testInlineAdditionalProperties** | **POST** /fake/inline-additionalProperties | test inline additionalProperties -*AbstractFakeApi* | **testJsonFormData** | **GET** /fake/jsonFormData | test json serialization of form data -*AbstractFakeClassnameTags123Api* | **testClassname** | **PATCH** /fake_classname_test | To test class name in snake case *AbstractPetApi* | **addPet** | **POST** /pet | Add a new pet to the store *AbstractPetApi* | **findPetsByStatus** | **GET** /pet/findByStatus | Finds Pets by status *AbstractPetApi* | **findPetsByTags** | **GET** /pet/findByTags | Finds Pets by tags @@ -142,11 +127,10 @@ Class | Method | HTTP request | Description *AbstractPetApi* | **getPetById** | **GET** /pet/{petId} | Find pet by ID *AbstractPetApi* | **updatePetWithForm** | **POST** /pet/{petId} | Updates a pet in the store with form data *AbstractPetApi* | **uploadFile** | **POST** /pet/{petId}/uploadImage | uploads an image -*AbstractPetApi* | **uploadFileWithRequiredFile** | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) *AbstractStoreApi* | **getInventory** | **GET** /store/inventory | Returns pet inventories by status *AbstractStoreApi* | **placeOrder** | **POST** /store/order | Place an order for a pet -*AbstractStoreApi* | **deleteOrder** | **DELETE** /store/order/{order_id} | Delete purchase order by ID -*AbstractStoreApi* | **getOrderById** | **GET** /store/order/{order_id} | Find purchase order by ID +*AbstractStoreApi* | **deleteOrder** | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*AbstractStoreApi* | **getOrderById** | **GET** /store/order/{orderId} | Find purchase order by ID *AbstractUserApi* | **createUser** | **POST** /user | Create user *AbstractUserApi* | **createUsersWithArrayInput** | **POST** /user/createWithArray | Creates list of users with given input array *AbstractUserApi* | **createUsersWithListInput** | **POST** /user/createWithList | Creates list of users with given input array @@ -159,52 +143,14 @@ Class | Method | HTTP request | Description ## Models -* OpenAPIServer\Model\AdditionalPropertiesAnyType -* OpenAPIServer\Model\AdditionalPropertiesArray -* OpenAPIServer\Model\AdditionalPropertiesBoolean -* OpenAPIServer\Model\AdditionalPropertiesClass -* OpenAPIServer\Model\AdditionalPropertiesInteger -* OpenAPIServer\Model\AdditionalPropertiesNumber -* OpenAPIServer\Model\AdditionalPropertiesObject -* OpenAPIServer\Model\AdditionalPropertiesString -* OpenAPIServer\Model\Animal * OpenAPIServer\Model\ApiResponse -* OpenAPIServer\Model\ArrayOfArrayOfNumberOnly -* OpenAPIServer\Model\ArrayOfNumberOnly -* OpenAPIServer\Model\ArrayTest -* OpenAPIServer\Model\Capitalization -* OpenAPIServer\Model\Cat -* OpenAPIServer\Model\CatAllOf * OpenAPIServer\Model\Category -* OpenAPIServer\Model\ClassModel -* OpenAPIServer\Model\Client -* OpenAPIServer\Model\Dog -* OpenAPIServer\Model\DogAllOf -* OpenAPIServer\Model\EnumArrays -* OpenAPIServer\Model\EnumClass -* OpenAPIServer\Model\EnumTest -* OpenAPIServer\Model\File -* OpenAPIServer\Model\FileSchemaTestClass -* OpenAPIServer\Model\FormatTest -* OpenAPIServer\Model\HasOnlyReadOnly -* OpenAPIServer\Model\MapTest -* OpenAPIServer\Model\MixedPropertiesAndAdditionalPropertiesClass -* OpenAPIServer\Model\Model200Response -* OpenAPIServer\Model\ModelList -* OpenAPIServer\Model\ModelReturn -* OpenAPIServer\Model\Name -* OpenAPIServer\Model\NumberOnly +* OpenAPIServer\Model\InlineObject +* OpenAPIServer\Model\InlineObject1 * OpenAPIServer\Model\Order -* OpenAPIServer\Model\OuterComposite -* OpenAPIServer\Model\OuterEnum * OpenAPIServer\Model\Pet -* OpenAPIServer\Model\ReadOnlyFirst -* OpenAPIServer\Model\SpecialModelName * OpenAPIServer\Model\Tag -* OpenAPIServer\Model\TypeHolderDefault -* OpenAPIServer\Model\TypeHolderExample * OpenAPIServer\Model\User -* OpenAPIServer\Model\XmlItem ## Authentication @@ -212,12 +158,9 @@ Class | Method | HTTP request | Description ### Security schema `api_key` > Important! To make ApiKey authentication work you need to extend [\OpenAPIServer\Auth\AbstractAuthenticator](./lib/Auth/AbstractAuthenticator.php) class by [\OpenAPIServer\Auth\ApiKeyAuthenticator](./src/Auth/ApiKeyAuthenticator.php) class. -### Security schema `api_key_query` +### Security schema `auth_cookie` > Important! To make ApiKey authentication work you need to extend [\OpenAPIServer\Auth\AbstractAuthenticator](./lib/Auth/AbstractAuthenticator.php) class by [\OpenAPIServer\Auth\ApiKeyAuthenticator](./src/Auth/ApiKeyAuthenticator.php) class. -### Security schema `http_basic_test` -> Important! To make Basic authentication work you need to extend [\OpenAPIServer\Auth\AbstractAuthenticator](./lib/Auth/AbstractAuthenticator.php) class by [\OpenAPIServer\Auth\BasicAuthenticator](./src/Auth/BasicAuthenticator.php) class. - ### Security schema `petstore_auth` > Important! To make OAuth authentication work you need to extend [\OpenAPIServer\Auth\AbstractAuthenticator](./lib/Auth/AbstractAuthenticator.php) class by [\OpenAPIServer\Auth\OAuthAuthenticator](./src/Auth/OAuthAuthenticator.php) class. diff --git a/samples/server/petstore/php-slim/lib/Api/AbstractPetApi.php b/samples/server/petstore/php-slim/lib/Api/AbstractPetApi.php index 9ff00017cb5e..381b1b2627d8 100644 --- a/samples/server/petstore/php-slim/lib/Api/AbstractPetApi.php +++ b/samples/server/petstore/php-slim/lib/Api/AbstractPetApi.php @@ -12,7 +12,7 @@ /** * OpenAPI Petstore * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * The version of the OpenAPI document: 1.0.0 * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -137,6 +137,7 @@ public function findPetsByTags(ServerRequestInterface $request, ResponseInterfac { $queryParams = $request->getQueryParams(); $tags = $request->getQueryParam('tags'); + $maxCount = $request->getQueryParam('maxCount'); $message = "How about implementing findPetsByTags as a GET method in OpenAPIServer\Api\PetApi class?"; throw new Exception($message); @@ -229,27 +230,4 @@ public function uploadFile(ServerRequestInterface $request, ResponseInterface $r return $response->write($message)->withStatus(501); } - - /** - * POST uploadFileWithRequiredFile - * Summary: uploads an image (required) - * Output-Formats: [application/json] - * - * @param ServerRequestInterface $request Request - * @param ResponseInterface $response Response - * @param array|null $args Path arguments - * - * @return ResponseInterface - * @throws Exception to force implementation class to override this method - */ - public function uploadFileWithRequiredFile(ServerRequestInterface $request, ResponseInterface $response, array $args) - { - $petId = $args['petId']; - $additionalMetadata = $request->getParsedBodyParam('additionalMetadata'); - $requiredFile = (key_exists('requiredFile', $request->getUploadedFiles())) ? $request->getUploadedFiles()['requiredFile'] : null; - $message = "How about implementing uploadFileWithRequiredFile as a POST method in OpenAPIServer\Api\PetApi class?"; - throw new Exception($message); - - return $response->write($message)->withStatus(501); - } } diff --git a/samples/server/petstore/php-slim/lib/Api/AbstractStoreApi.php b/samples/server/petstore/php-slim/lib/Api/AbstractStoreApi.php index b23947798074..01f8c4d02288 100644 --- a/samples/server/petstore/php-slim/lib/Api/AbstractStoreApi.php +++ b/samples/server/petstore/php-slim/lib/Api/AbstractStoreApi.php @@ -12,7 +12,7 @@ /** * OpenAPI Petstore * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * The version of the OpenAPI document: 1.0.0 * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -69,7 +69,7 @@ public function __construct(ContainerInterface $container) */ public function deleteOrder(ServerRequestInterface $request, ResponseInterface $response, array $args) { - $orderId = $args['order_id']; + $orderId = $args['orderId']; $message = "How about implementing deleteOrder as a DELETE method in OpenAPIServer\Api\StoreApi class?"; throw new Exception($message); @@ -112,7 +112,7 @@ public function getInventory(ServerRequestInterface $request, ResponseInterface */ public function getOrderById(ServerRequestInterface $request, ResponseInterface $response, array $args) { - $orderId = $args['order_id']; + $orderId = $args['orderId']; $message = "How about implementing getOrderById as a GET method in OpenAPIServer\Api\StoreApi class?"; throw new Exception($message); diff --git a/samples/server/petstore/php-slim/lib/Api/AbstractUserApi.php b/samples/server/petstore/php-slim/lib/Api/AbstractUserApi.php index 0f6e36f54d5e..52c540cd1a48 100644 --- a/samples/server/petstore/php-slim/lib/Api/AbstractUserApi.php +++ b/samples/server/petstore/php-slim/lib/Api/AbstractUserApi.php @@ -12,7 +12,7 @@ /** * OpenAPI Petstore * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * The version of the OpenAPI document: 1.0.0 * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/server/petstore/php-slim/lib/Auth/AbstractAuthenticator.php b/samples/server/petstore/php-slim/lib/Auth/AbstractAuthenticator.php index 52f6f7008563..9a180451a673 100644 --- a/samples/server/petstore/php-slim/lib/Auth/AbstractAuthenticator.php +++ b/samples/server/petstore/php-slim/lib/Auth/AbstractAuthenticator.php @@ -12,7 +12,7 @@ /** * OpenAPI Petstore * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * The version of the OpenAPI document: 1.0.0 * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/server/petstore/php-slim/lib/Model/InlineObject.php b/samples/server/petstore/php-slim/lib/Model/InlineObject.php new file mode 100644 index 000000000000..d173f6ff42f4 --- /dev/null +++ b/samples/server/petstore/php-slim/lib/Model/InlineObject.php @@ -0,0 +1,33 @@ + 'PATCH', - 'basePathWithoutHost' => '/v2', - 'path' => '/another-fake/dummy', - 'apiPackage' => 'OpenAPIServer\Api', - 'classname' => 'AbstractAnotherFakeApi', - 'userClassname' => 'AnotherFakeApi', - 'operationId' => 'call123TestSpecialTags', - 'authMethods' => [ - ], - ], - [ - 'httpMethod' => 'POST', - 'basePathWithoutHost' => '/v2', - 'path' => '/fake/create_xml_item', - 'apiPackage' => 'OpenAPIServer\Api', - 'classname' => 'AbstractFakeApi', - 'userClassname' => 'FakeApi', - 'operationId' => 'createXmlItem', - 'authMethods' => [ - ], - ], - [ - 'httpMethod' => 'POST', - 'basePathWithoutHost' => '/v2', - 'path' => '/fake/outer/boolean', - 'apiPackage' => 'OpenAPIServer\Api', - 'classname' => 'AbstractFakeApi', - 'userClassname' => 'FakeApi', - 'operationId' => 'fakeOuterBooleanSerialize', - 'authMethods' => [ - ], - ], - [ - 'httpMethod' => 'POST', - 'basePathWithoutHost' => '/v2', - 'path' => '/fake/outer/composite', - 'apiPackage' => 'OpenAPIServer\Api', - 'classname' => 'AbstractFakeApi', - 'userClassname' => 'FakeApi', - 'operationId' => 'fakeOuterCompositeSerialize', - 'authMethods' => [ - ], - ], - [ - 'httpMethod' => 'POST', - 'basePathWithoutHost' => '/v2', - 'path' => '/fake/outer/number', - 'apiPackage' => 'OpenAPIServer\Api', - 'classname' => 'AbstractFakeApi', - 'userClassname' => 'FakeApi', - 'operationId' => 'fakeOuterNumberSerialize', - 'authMethods' => [ - ], - ], - [ - 'httpMethod' => 'POST', - 'basePathWithoutHost' => '/v2', - 'path' => '/fake/outer/string', - 'apiPackage' => 'OpenAPIServer\Api', - 'classname' => 'AbstractFakeApi', - 'userClassname' => 'FakeApi', - 'operationId' => 'fakeOuterStringSerialize', - 'authMethods' => [ - ], - ], - [ - 'httpMethod' => 'PUT', - 'basePathWithoutHost' => '/v2', - 'path' => '/fake/body-with-file-schema', - 'apiPackage' => 'OpenAPIServer\Api', - 'classname' => 'AbstractFakeApi', - 'userClassname' => 'FakeApi', - 'operationId' => 'testBodyWithFileSchema', - 'authMethods' => [ - ], - ], - [ - 'httpMethod' => 'PUT', - 'basePathWithoutHost' => '/v2', - 'path' => '/fake/body-with-query-params', - 'apiPackage' => 'OpenAPIServer\Api', - 'classname' => 'AbstractFakeApi', - 'userClassname' => 'FakeApi', - 'operationId' => 'testBodyWithQueryParams', - 'authMethods' => [ - ], - ], - [ - 'httpMethod' => 'PATCH', - 'basePathWithoutHost' => '/v2', - 'path' => '/fake', - 'apiPackage' => 'OpenAPIServer\Api', - 'classname' => 'AbstractFakeApi', - 'userClassname' => 'FakeApi', - 'operationId' => 'testClientModel', - 'authMethods' => [ - ], - ], - [ - 'httpMethod' => 'POST', - 'basePathWithoutHost' => '/v2', - 'path' => '/fake', - 'apiPackage' => 'OpenAPIServer\Api', - 'classname' => 'AbstractFakeApi', - 'userClassname' => 'FakeApi', - 'operationId' => 'testEndpointParameters', - 'authMethods' => [ - // http security schema named 'http_basic_test' - [ - 'type' => 'http', - 'isBasic' => true, - 'isApiKey' => false, - 'isOAuth' => false, - ], - ], - ], - [ - 'httpMethod' => 'GET', - 'basePathWithoutHost' => '/v2', - 'path' => '/fake', - 'apiPackage' => 'OpenAPIServer\Api', - 'classname' => 'AbstractFakeApi', - 'userClassname' => 'FakeApi', - 'operationId' => 'testEnumParameters', - 'authMethods' => [ - ], - ], - [ - 'httpMethod' => 'DELETE', - 'basePathWithoutHost' => '/v2', - 'path' => '/fake', - 'apiPackage' => 'OpenAPIServer\Api', - 'classname' => 'AbstractFakeApi', - 'userClassname' => 'FakeApi', - 'operationId' => 'testGroupParameters', - 'authMethods' => [ - ], - ], - [ - 'httpMethod' => 'POST', - 'basePathWithoutHost' => '/v2', - 'path' => '/fake/inline-additionalProperties', - 'apiPackage' => 'OpenAPIServer\Api', - 'classname' => 'AbstractFakeApi', - 'userClassname' => 'FakeApi', - 'operationId' => 'testInlineAdditionalProperties', - 'authMethods' => [ - ], - ], - [ - 'httpMethod' => 'GET', - 'basePathWithoutHost' => '/v2', - 'path' => '/fake/jsonFormData', - 'apiPackage' => 'OpenAPIServer\Api', - 'classname' => 'AbstractFakeApi', - 'userClassname' => 'FakeApi', - 'operationId' => 'testJsonFormData', - 'authMethods' => [ - ], - ], - [ - 'httpMethod' => 'PATCH', - 'basePathWithoutHost' => '/v2', - 'path' => '/fake_classname_test', - 'apiPackage' => 'OpenAPIServer\Api', - 'classname' => 'AbstractFakeClassnameTags123Api', - 'userClassname' => 'FakeClassnameTags123Api', - 'operationId' => 'testClassname', - 'authMethods' => [ - // apiKey security schema named 'api_key_query' - [ - 'type' => 'apiKey', - 'isBasic' => false, - 'isApiKey' => true, - 'isOAuth' => false, - 'keyParamName' => 'api_key_query', - 'isKeyInHeader' => false, - 'isKeyInQuery' => true, - 'isKeyInCookie' => false, - ], - ], - ], [ 'httpMethod' => 'POST', 'basePathWithoutHost' => '/v2', @@ -269,7 +86,6 @@ class SlimRouter 'isApiKey' => false, 'isOAuth' => true, 'scopes' => [ - 'write:pets', // modify pets in your account 'read:pets', // read your pets ], ], @@ -291,7 +107,6 @@ class SlimRouter 'isApiKey' => false, 'isOAuth' => true, 'scopes' => [ - 'write:pets', // modify pets in your account 'read:pets', // read your pets ], ], @@ -407,28 +222,6 @@ class SlimRouter ], ], ], - [ - 'httpMethod' => 'POST', - 'basePathWithoutHost' => '/v2', - 'path' => '/fake/{petId}/uploadImageWithRequiredFile', - 'apiPackage' => 'OpenAPIServer\Api', - 'classname' => 'AbstractPetApi', - 'userClassname' => 'PetApi', - 'operationId' => 'uploadFileWithRequiredFile', - 'authMethods' => [ - // oauth2 security schema named 'petstore_auth' - [ - 'type' => 'oauth2', - 'isBasic' => false, - 'isApiKey' => false, - 'isOAuth' => true, - 'scopes' => [ - 'write:pets', // modify pets in your account - 'read:pets', // read your pets - ], - ], - ], - ], [ 'httpMethod' => 'GET', 'basePathWithoutHost' => '/v2', @@ -465,7 +258,7 @@ class SlimRouter [ 'httpMethod' => 'DELETE', 'basePathWithoutHost' => '/v2', - 'path' => '/store/order/{order_id}', + 'path' => '/store/order/{orderId}', 'apiPackage' => 'OpenAPIServer\Api', 'classname' => 'AbstractStoreApi', 'userClassname' => 'StoreApi', @@ -476,7 +269,7 @@ class SlimRouter [ 'httpMethod' => 'GET', 'basePathWithoutHost' => '/v2', - 'path' => '/store/order/{order_id}', + 'path' => '/store/order/{orderId}', 'apiPackage' => 'OpenAPIServer\Api', 'classname' => 'AbstractStoreApi', 'userClassname' => 'StoreApi', @@ -493,6 +286,17 @@ class SlimRouter 'userClassname' => 'UserApi', 'operationId' => 'createUser', 'authMethods' => [ + // apiKey security schema named 'auth_cookie' + [ + 'type' => 'apiKey', + 'isBasic' => false, + 'isApiKey' => true, + 'isOAuth' => false, + 'keyParamName' => 'AUTH_KEY', + 'isKeyInHeader' => false, + 'isKeyInQuery' => false, + 'isKeyInCookie' => true, + ], ], ], [ @@ -504,6 +308,17 @@ class SlimRouter 'userClassname' => 'UserApi', 'operationId' => 'createUsersWithArrayInput', 'authMethods' => [ + // apiKey security schema named 'auth_cookie' + [ + 'type' => 'apiKey', + 'isBasic' => false, + 'isApiKey' => true, + 'isOAuth' => false, + 'keyParamName' => 'AUTH_KEY', + 'isKeyInHeader' => false, + 'isKeyInQuery' => false, + 'isKeyInCookie' => true, + ], ], ], [ @@ -515,6 +330,17 @@ class SlimRouter 'userClassname' => 'UserApi', 'operationId' => 'createUsersWithListInput', 'authMethods' => [ + // apiKey security schema named 'auth_cookie' + [ + 'type' => 'apiKey', + 'isBasic' => false, + 'isApiKey' => true, + 'isOAuth' => false, + 'keyParamName' => 'AUTH_KEY', + 'isKeyInHeader' => false, + 'isKeyInQuery' => false, + 'isKeyInCookie' => true, + ], ], ], [ @@ -537,6 +363,17 @@ class SlimRouter 'userClassname' => 'UserApi', 'operationId' => 'logoutUser', 'authMethods' => [ + // apiKey security schema named 'auth_cookie' + [ + 'type' => 'apiKey', + 'isBasic' => false, + 'isApiKey' => true, + 'isOAuth' => false, + 'keyParamName' => 'AUTH_KEY', + 'isKeyInHeader' => false, + 'isKeyInQuery' => false, + 'isKeyInCookie' => true, + ], ], ], [ @@ -548,6 +385,17 @@ class SlimRouter 'userClassname' => 'UserApi', 'operationId' => 'deleteUser', 'authMethods' => [ + // apiKey security schema named 'auth_cookie' + [ + 'type' => 'apiKey', + 'isBasic' => false, + 'isApiKey' => true, + 'isOAuth' => false, + 'keyParamName' => 'AUTH_KEY', + 'isKeyInHeader' => false, + 'isKeyInQuery' => false, + 'isKeyInCookie' => true, + ], ], ], [ @@ -570,6 +418,17 @@ class SlimRouter 'userClassname' => 'UserApi', 'operationId' => 'updateUser', 'authMethods' => [ + // apiKey security schema named 'auth_cookie' + [ + 'type' => 'apiKey', + 'isBasic' => false, + 'isApiKey' => true, + 'isOAuth' => false, + 'keyParamName' => 'AUTH_KEY', + 'isKeyInHeader' => false, + 'isKeyInQuery' => false, + 'isKeyInCookie' => true, + ], ], ], ]; diff --git a/samples/server/petstore/php-slim/test/Model/InlineObject1Test.php b/samples/server/petstore/php-slim/test/Model/InlineObject1Test.php new file mode 100644 index 000000000000..655410672ad9 --- /dev/null +++ b/samples/server/petstore/php-slim/test/Model/InlineObject1Test.php @@ -0,0 +1,91 @@ +headers->get('authorization'); // Read out all input parameter values into variables - $body = $request->getContent(); + $pet = $request->getContent(); // Use the default value if no value was provided // Deserialize the input values that needs it try { - $body = $this->deserialize($body, 'OpenAPI\Server\Model\Pet', $inputFormat); + $pet = $this->deserialize($pet, 'OpenAPI\Server\Model\Pet', $inputFormat); } catch (SerializerRuntimeException $exception) { return $this->createBadRequestResponse($exception->getMessage()); } @@ -90,7 +90,7 @@ public function addPetAction(Request $request) $asserts[] = new Assert\NotNull(); $asserts[] = new Assert\Type("OpenAPI\Server\Model\Pet"); $asserts[] = new Assert\Valid(); - $response = $this->validate($body, $asserts); + $response = $this->validate($pet, $asserts); if ($response instanceof Response) { return $response; } @@ -105,7 +105,7 @@ public function addPetAction(Request $request) // Make the call to the business logic $responseCode = 204; $responseHeaders = []; - $result = $handler->addPet($body, $responseCode, $responseHeaders); + $result = $handler->addPet($pet, $responseCode, $responseHeaders); // Find default response message $message = ''; @@ -329,12 +329,14 @@ public function findPetsByTagsAction(Request $request) // Read out all input parameter values into variables $tags = $request->query->get('tags'); + $maxCount = $request->query->get('maxCount'); // Use the default value if no value was provided // Deserialize the input values that needs it try { $tags = $this->deserialize($tags, 'array', 'string'); + $maxCount = $this->deserialize($maxCount, 'int', 'string'); } catch (SerializerRuntimeException $exception) { return $this->createBadRequestResponse($exception->getMessage()); } @@ -349,6 +351,12 @@ public function findPetsByTagsAction(Request $request) if ($response instanceof Response) { return $response; } + $asserts = []; + $asserts[] = new Assert\Type("int"); + $response = $this->validate($maxCount, $asserts); + if ($response instanceof Response) { + return $response; + } try { @@ -360,7 +368,7 @@ public function findPetsByTagsAction(Request $request) // Make the call to the business logic $responseCode = 200; $responseHeaders = []; - $result = $handler->findPetsByTags($tags, $responseCode, $responseHeaders); + $result = $handler->findPetsByTags($tags, $maxCount, $responseCode, $responseHeaders); // Find default response message $message = 'successful operation'; @@ -503,13 +511,13 @@ public function updatePetAction(Request $request) $securitypetstore_auth = $request->headers->get('authorization'); // Read out all input parameter values into variables - $body = $request->getContent(); + $pet = $request->getContent(); // Use the default value if no value was provided // Deserialize the input values that needs it try { - $body = $this->deserialize($body, 'OpenAPI\Server\Model\Pet', $inputFormat); + $pet = $this->deserialize($pet, 'OpenAPI\Server\Model\Pet', $inputFormat); } catch (SerializerRuntimeException $exception) { return $this->createBadRequestResponse($exception->getMessage()); } @@ -519,7 +527,7 @@ public function updatePetAction(Request $request) $asserts[] = new Assert\NotNull(); $asserts[] = new Assert\Type("OpenAPI\Server\Model\Pet"); $asserts[] = new Assert\Valid(); - $response = $this->validate($body, $asserts); + $response = $this->validate($pet, $asserts); if ($response instanceof Response) { return $response; } @@ -534,7 +542,7 @@ public function updatePetAction(Request $request) // Make the call to the business logic $responseCode = 204; $responseHeaders = []; - $result = $handler->updatePet($body, $responseCode, $responseHeaders); + $result = $handler->updatePet($pet, $responseCode, $responseHeaders); // Find default response message $message = ''; diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/Controller/StoreController.php b/samples/server/petstore/php-symfony/SymfonyBundle-php/Controller/StoreController.php index 8fbf32d50cb5..bb80ccb66d56 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/Controller/StoreController.php +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Controller/StoreController.php @@ -283,7 +283,7 @@ public function getOrderByIdAction(Request $request, $orderId) public function placeOrderAction(Request $request) { // Make sure that the client is providing something that we can consume - $consumes = []; + $consumes = ['application/json']; $inputFormat = $request->headers->has('Content-Type')?$request->headers->get('Content-Type'):$consumes[0]; if (!in_array($inputFormat, $consumes)) { // We can't consume the content that the client is sending us @@ -302,13 +302,13 @@ public function placeOrderAction(Request $request) // Handle authentication // Read out all input parameter values into variables - $body = $request->getContent(); + $order = $request->getContent(); // Use the default value if no value was provided // Deserialize the input values that needs it try { - $body = $this->deserialize($body, 'OpenAPI\Server\Model\Order', $inputFormat); + $order = $this->deserialize($order, 'OpenAPI\Server\Model\Order', $inputFormat); } catch (SerializerRuntimeException $exception) { return $this->createBadRequestResponse($exception->getMessage()); } @@ -318,7 +318,7 @@ public function placeOrderAction(Request $request) $asserts[] = new Assert\NotNull(); $asserts[] = new Assert\Type("OpenAPI\Server\Model\Order"); $asserts[] = new Assert\Valid(); - $response = $this->validate($body, $asserts); + $response = $this->validate($order, $asserts); if ($response instanceof Response) { return $response; } @@ -331,7 +331,7 @@ public function placeOrderAction(Request $request) // Make the call to the business logic $responseCode = 200; $responseHeaders = []; - $result = $handler->placeOrder($body, $responseCode, $responseHeaders); + $result = $handler->placeOrder($order, $responseCode, $responseHeaders); // Find default response message $message = 'successful operation'; diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/Controller/UserController.php b/samples/server/petstore/php-symfony/SymfonyBundle-php/Controller/UserController.php index b67fc2809823..736c755ded28 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/Controller/UserController.php +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Controller/UserController.php @@ -60,7 +60,7 @@ class UserController extends Controller public function createUserAction(Request $request) { // Make sure that the client is providing something that we can consume - $consumes = []; + $consumes = ['application/json']; $inputFormat = $request->headers->has('Content-Type')?$request->headers->get('Content-Type'):$consumes[0]; if (!in_array($inputFormat, $consumes)) { // We can't consume the content that the client is sending us @@ -68,15 +68,18 @@ public function createUserAction(Request $request) } // Handle authentication + // Authentication 'auth_cookie' required + // Set key with prefix in cookies + $securityauth_cookie = $request->cookies->get('AUTH_KEY'); // Read out all input parameter values into variables - $body = $request->getContent(); + $user = $request->getContent(); // Use the default value if no value was provided // Deserialize the input values that needs it try { - $body = $this->deserialize($body, 'OpenAPI\Server\Model\User', $inputFormat); + $user = $this->deserialize($user, 'OpenAPI\Server\Model\User', $inputFormat); } catch (SerializerRuntimeException $exception) { return $this->createBadRequestResponse($exception->getMessage()); } @@ -86,7 +89,7 @@ public function createUserAction(Request $request) $asserts[] = new Assert\NotNull(); $asserts[] = new Assert\Type("OpenAPI\Server\Model\User"); $asserts[] = new Assert\Valid(); - $response = $this->validate($body, $asserts); + $response = $this->validate($user, $asserts); if ($response instanceof Response) { return $response; } @@ -95,11 +98,13 @@ public function createUserAction(Request $request) try { $handler = $this->getApiHandler(); + // Set authentication method 'auth_cookie' + $handler->setauth_cookie($securityauth_cookie); // Make the call to the business logic $responseCode = 204; $responseHeaders = []; - $result = $handler->createUser($body, $responseCode, $responseHeaders); + $result = $handler->createUser($user, $responseCode, $responseHeaders); // Find default response message $message = 'successful operation'; @@ -137,7 +142,7 @@ public function createUserAction(Request $request) public function createUsersWithArrayInputAction(Request $request) { // Make sure that the client is providing something that we can consume - $consumes = []; + $consumes = ['application/json']; $inputFormat = $request->headers->has('Content-Type')?$request->headers->get('Content-Type'):$consumes[0]; if (!in_array($inputFormat, $consumes)) { // We can't consume the content that the client is sending us @@ -145,15 +150,18 @@ public function createUsersWithArrayInputAction(Request $request) } // Handle authentication + // Authentication 'auth_cookie' required + // Set key with prefix in cookies + $securityauth_cookie = $request->cookies->get('AUTH_KEY'); // Read out all input parameter values into variables - $body = $request->getContent(); + $user = $request->getContent(); // Use the default value if no value was provided // Deserialize the input values that needs it try { - $body = $this->deserialize($body, 'array', $inputFormat); + $user = $this->deserialize($user, 'array', $inputFormat); } catch (SerializerRuntimeException $exception) { return $this->createBadRequestResponse($exception->getMessage()); } @@ -165,7 +173,7 @@ public function createUsersWithArrayInputAction(Request $request) new Assert\Type("OpenAPI\Server\Model\User"), new Assert\Valid(), ]); - $response = $this->validate($body, $asserts); + $response = $this->validate($user, $asserts); if ($response instanceof Response) { return $response; } @@ -174,11 +182,13 @@ public function createUsersWithArrayInputAction(Request $request) try { $handler = $this->getApiHandler(); + // Set authentication method 'auth_cookie' + $handler->setauth_cookie($securityauth_cookie); // Make the call to the business logic $responseCode = 204; $responseHeaders = []; - $result = $handler->createUsersWithArrayInput($body, $responseCode, $responseHeaders); + $result = $handler->createUsersWithArrayInput($user, $responseCode, $responseHeaders); // Find default response message $message = 'successful operation'; @@ -216,7 +226,7 @@ public function createUsersWithArrayInputAction(Request $request) public function createUsersWithListInputAction(Request $request) { // Make sure that the client is providing something that we can consume - $consumes = []; + $consumes = ['application/json']; $inputFormat = $request->headers->has('Content-Type')?$request->headers->get('Content-Type'):$consumes[0]; if (!in_array($inputFormat, $consumes)) { // We can't consume the content that the client is sending us @@ -224,15 +234,18 @@ public function createUsersWithListInputAction(Request $request) } // Handle authentication + // Authentication 'auth_cookie' required + // Set key with prefix in cookies + $securityauth_cookie = $request->cookies->get('AUTH_KEY'); // Read out all input parameter values into variables - $body = $request->getContent(); + $user = $request->getContent(); // Use the default value if no value was provided // Deserialize the input values that needs it try { - $body = $this->deserialize($body, 'array', $inputFormat); + $user = $this->deserialize($user, 'array', $inputFormat); } catch (SerializerRuntimeException $exception) { return $this->createBadRequestResponse($exception->getMessage()); } @@ -244,7 +257,7 @@ public function createUsersWithListInputAction(Request $request) new Assert\Type("OpenAPI\Server\Model\User"), new Assert\Valid(), ]); - $response = $this->validate($body, $asserts); + $response = $this->validate($user, $asserts); if ($response instanceof Response) { return $response; } @@ -253,11 +266,13 @@ public function createUsersWithListInputAction(Request $request) try { $handler = $this->getApiHandler(); + // Set authentication method 'auth_cookie' + $handler->setauth_cookie($securityauth_cookie); // Make the call to the business logic $responseCode = 204; $responseHeaders = []; - $result = $handler->createUsersWithListInput($body, $responseCode, $responseHeaders); + $result = $handler->createUsersWithListInput($user, $responseCode, $responseHeaders); // Find default response message $message = 'successful operation'; @@ -295,6 +310,9 @@ public function createUsersWithListInputAction(Request $request) public function deleteUserAction(Request $request, $username) { // Handle authentication + // Authentication 'auth_cookie' required + // Set key with prefix in cookies + $securityauth_cookie = $request->cookies->get('AUTH_KEY'); // Read out all input parameter values into variables @@ -320,6 +338,8 @@ public function deleteUserAction(Request $request, $username) try { $handler = $this->getApiHandler(); + // Set authentication method 'auth_cookie' + $handler->setauth_cookie($securityauth_cookie); // Make the call to the business logic $responseCode = 204; @@ -476,6 +496,7 @@ public function loginUserAction(Request $request) $asserts = []; $asserts[] = new Assert\NotNull(); $asserts[] = new Assert\Type("string"); + $asserts[] = new Assert\Regex("/^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$/"); $response = $this->validate($username, $asserts); if ($response instanceof Response) { return $response; @@ -538,6 +559,9 @@ public function loginUserAction(Request $request) public function logoutUserAction(Request $request) { // Handle authentication + // Authentication 'auth_cookie' required + // Set key with prefix in cookies + $securityauth_cookie = $request->cookies->get('AUTH_KEY'); // Read out all input parameter values into variables @@ -549,6 +573,8 @@ public function logoutUserAction(Request $request) try { $handler = $this->getApiHandler(); + // Set authentication method 'auth_cookie' + $handler->setauth_cookie($securityauth_cookie); // Make the call to the business logic $responseCode = 204; @@ -591,7 +617,7 @@ public function logoutUserAction(Request $request) public function updateUserAction(Request $request, $username) { // Make sure that the client is providing something that we can consume - $consumes = []; + $consumes = ['application/json']; $inputFormat = $request->headers->has('Content-Type')?$request->headers->get('Content-Type'):$consumes[0]; if (!in_array($inputFormat, $consumes)) { // We can't consume the content that the client is sending us @@ -599,16 +625,19 @@ public function updateUserAction(Request $request, $username) } // Handle authentication + // Authentication 'auth_cookie' required + // Set key with prefix in cookies + $securityauth_cookie = $request->cookies->get('AUTH_KEY'); // Read out all input parameter values into variables - $body = $request->getContent(); + $user = $request->getContent(); // Use the default value if no value was provided // Deserialize the input values that needs it try { $username = $this->deserialize($username, 'string', 'string'); - $body = $this->deserialize($body, 'OpenAPI\Server\Model\User', $inputFormat); + $user = $this->deserialize($user, 'OpenAPI\Server\Model\User', $inputFormat); } catch (SerializerRuntimeException $exception) { return $this->createBadRequestResponse($exception->getMessage()); } @@ -625,7 +654,7 @@ public function updateUserAction(Request $request, $username) $asserts[] = new Assert\NotNull(); $asserts[] = new Assert\Type("OpenAPI\Server\Model\User"); $asserts[] = new Assert\Valid(); - $response = $this->validate($body, $asserts); + $response = $this->validate($user, $asserts); if ($response instanceof Response) { return $response; } @@ -634,11 +663,13 @@ public function updateUserAction(Request $request, $username) try { $handler = $this->getApiHandler(); + // Set authentication method 'auth_cookie' + $handler->setauth_cookie($securityauth_cookie); // Make the call to the business logic $responseCode = 204; $responseHeaders = []; - $result = $handler->updateUser($username, $body, $responseCode, $responseHeaders); + $result = $handler->updateUser($username, $user, $responseCode, $responseHeaders); // Find default response message $message = ''; diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/Category.php b/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/Category.php index b4c6f965236e..cbaceb8d16e2 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/Category.php +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/Category.php @@ -56,6 +56,7 @@ class Category * @SerializedName("name") * @Assert\Type("string") * @Type("string") + * @Assert\Regex("/^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$/") */ protected $name; diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/InlineObject.php b/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/InlineObject.php new file mode 100644 index 000000000000..3f5e8ff73390 --- /dev/null +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/InlineObject.php @@ -0,0 +1,123 @@ +name = isset($data['name']) ? $data['name'] : null; + $this->status = isset($data['status']) ? $data['status'] : null; + } + + /** + * Gets name. + * + * @return string|null + */ + public function getName() + { + return $this->name; + } + + /** + * Sets name. + * + * @param string|null $name Updated name of the pet + * + * @return $this + */ + public function setName($name = null) + { + $this->name = $name; + + return $this; + } + + /** + * Gets status. + * + * @return string|null + */ + public function getStatus() + { + return $this->status; + } + + /** + * Sets status. + * + * @param string|null $status Updated status of the pet + * + * @return $this + */ + public function setStatus($status = null) + { + $this->status = $status; + + return $this; + } +} + + diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/InlineObject1.php b/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/InlineObject1.php new file mode 100644 index 000000000000..577331c4675d --- /dev/null +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/InlineObject1.php @@ -0,0 +1,123 @@ +additionalMetadata = isset($data['additionalMetadata']) ? $data['additionalMetadata'] : null; + $this->file = isset($data['file']) ? $data['file'] : null; + } + + /** + * Gets additionalMetadata. + * + * @return string|null + */ + public function getAdditionalMetadata() + { + return $this->additionalMetadata; + } + + /** + * Sets additionalMetadata. + * + * @param string|null $additionalMetadata Additional data to pass to server + * + * @return $this + */ + public function setAdditionalMetadata($additionalMetadata = null) + { + $this->additionalMetadata = $additionalMetadata; + + return $this; + } + + /** + * Gets file. + * + * @return UploadedFile|null + */ + public function getFile() + { + return $this->file; + } + + /** + * Sets file. + * + * @param UploadedFile|null $file file to upload + * + * @return $this + */ + public function setFile(UploadedFile $file = null) + { + $this->file = $file; + + return $this; + } +} + + diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/README.md b/samples/server/petstore/php-symfony/SymfonyBundle-php/README.md index 6c1bb9e07a54..8bf887799e03 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/README.md +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/README.md @@ -93,7 +93,7 @@ class PetApi implements PetApiInterface // An interface is autogenerated /** * Implementation of PetApiInterface#addPet */ - public function addPet(Pet $body) + public function addPet(Pet $pet) { // Implement the operation ... } @@ -150,6 +150,8 @@ Class | Method | HTTP request | Description - [ApiResponse](Resources/docs/Model/ApiResponse.md) - [Category](Resources/docs/Model/Category.md) + - [InlineObject](Resources/docs/Model/InlineObject.md) + - [InlineObject1](Resources/docs/Model/InlineObject1.md) - [Order](Resources/docs/Model/Order.md) - [Pet](Resources/docs/Model/Pet.md) - [Tag](Resources/docs/Model/Tag.md) @@ -165,6 +167,12 @@ Class | Method | HTTP request | Description - **API key parameter name**: api_key - **Location**: HTTP header +## auth_cookie + +- **Type**: API key +- **API key parameter name**: AUTH_KEY +- **Location**: + ## petstore_auth - **Type**: OAuth diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/Resources/docs/Api/PetApiInterface.md b/samples/server/petstore/php-symfony/SymfonyBundle-php/Resources/docs/Api/PetApiInterface.md index 41b9776c01c7..d02dea6985fd 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/Resources/docs/Api/PetApiInterface.md +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Resources/docs/Api/PetApiInterface.md @@ -27,7 +27,7 @@ services: ``` ## **addPet** -> addPet($body) +> addPet($pet) Add a new pet to the store @@ -56,7 +56,7 @@ class PetApi implements PetApiInterface /** * Implementation of PetApiInterface#addPet */ - public function addPet(Pet $body) + public function addPet(Pet $pet) { // Implement the operation ... } @@ -69,7 +69,7 @@ class PetApi implements PetApiInterface Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OpenAPI\Server\Model\Pet**](../Model/Pet.md)| Pet object that needs to be added to the store | + **pet** | [**OpenAPI\Server\Model\Pet**](../Model/Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -210,7 +210,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) ## **findPetsByTags** -> OpenAPI\Server\Model\Pet findPetsByTags($tags) +> OpenAPI\Server\Model\Pet findPetsByTags($tags, $maxCount) Finds Pets by tags @@ -241,7 +241,7 @@ class PetApi implements PetApiInterface /** * Implementation of PetApiInterface#findPetsByTags */ - public function findPetsByTags(array $tags) + public function findPetsByTags(array $tags, $maxCount = null) { // Implement the operation ... } @@ -255,6 +255,7 @@ class PetApi implements PetApiInterface Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **tags** | [**string**](../Model/string.md)| Tags to filter by | + **maxCount** | **int**| Maximum number of items to return | [optional] ### Return type @@ -334,7 +335,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) ## **updatePet** -> updatePet($body) +> updatePet($pet) Update an existing pet @@ -363,7 +364,7 @@ class PetApi implements PetApiInterface /** * Implementation of PetApiInterface#updatePet */ - public function updatePet(Pet $body) + public function updatePet(Pet $pet) { // Implement the operation ... } @@ -376,7 +377,7 @@ class PetApi implements PetApiInterface Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OpenAPI\Server\Model\Pet**](../Model/Pet.md)| Pet object that needs to be added to the store | + **pet** | [**OpenAPI\Server\Model\Pet**](../Model/Pet.md)| Pet object that needs to be added to the store | ### Return type diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/Resources/docs/Api/StoreApiInterface.md b/samples/server/petstore/php-symfony/SymfonyBundle-php/Resources/docs/Api/StoreApiInterface.md index 0a1f4154f6d4..3d3e3b18c3ef 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/Resources/docs/Api/StoreApiInterface.md +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Resources/docs/Api/StoreApiInterface.md @@ -190,7 +190,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) ## **placeOrder** -> OpenAPI\Server\Model\Order placeOrder($body) +> OpenAPI\Server\Model\Order placeOrder($order) Place an order for a pet @@ -211,7 +211,7 @@ class StoreApi implements StoreApiInterface /** * Implementation of StoreApiInterface#placeOrder */ - public function placeOrder(Order $body) + public function placeOrder(Order $order) { // Implement the operation ... } @@ -224,7 +224,7 @@ class StoreApi implements StoreApiInterface Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OpenAPI\Server\Model\Order**](../Model/Order.md)| order placed for purchasing the pet | + **order** | [**OpenAPI\Server\Model\Order**](../Model/Order.md)| order placed for purchasing the pet | ### Return type @@ -236,7 +236,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/xml, application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/Resources/docs/Api/UserApiInterface.md b/samples/server/petstore/php-symfony/SymfonyBundle-php/Resources/docs/Api/UserApiInterface.md index 571e9dcbf291..eb65fc1f8055 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/Resources/docs/Api/UserApiInterface.md +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Resources/docs/Api/UserApiInterface.md @@ -27,7 +27,7 @@ services: ``` ## **createUser** -> createUser($body) +> createUser($user) Create user @@ -45,12 +45,20 @@ use OpenAPI\Server\Api\UserApiInterface; class UserApi implements UserApiInterface { + /** + * Configure API key authorization: auth_cookie + */ + public function setauth_cookie($apiKey) + { + // Retrieve logged in user from $apiKey ... + } + // ... /** * Implementation of UserApiInterface#createUser */ - public function createUser(User $body) + public function createUser(User $user) { // Implement the operation ... } @@ -63,7 +71,7 @@ class UserApi implements UserApiInterface Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OpenAPI\Server\Model\User**](../Model/User.md)| Created user object | + **user** | [**OpenAPI\Server\Model\User**](../Model/User.md)| Created user object | ### Return type @@ -71,17 +79,17 @@ void (empty response body) ### Authorization -No authorization required +[auth_cookie](../../README.md#auth_cookie) ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) ## **createUsersWithArrayInput** -> createUsersWithArrayInput($body) +> createUsersWithArrayInput($user) Creates list of users with given input array @@ -97,12 +105,20 @@ use OpenAPI\Server\Api\UserApiInterface; class UserApi implements UserApiInterface { + /** + * Configure API key authorization: auth_cookie + */ + public function setauth_cookie($apiKey) + { + // Retrieve logged in user from $apiKey ... + } + // ... /** * Implementation of UserApiInterface#createUsersWithArrayInput */ - public function createUsersWithArrayInput(array $body) + public function createUsersWithArrayInput(array $user) { // Implement the operation ... } @@ -115,7 +131,7 @@ class UserApi implements UserApiInterface Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OpenAPI\Server\Model\User**](../Model/User.md)| List of user object | + **user** | [**OpenAPI\Server\Model\User**](../Model/User.md)| List of user object | ### Return type @@ -123,17 +139,17 @@ void (empty response body) ### Authorization -No authorization required +[auth_cookie](../../README.md#auth_cookie) ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) ## **createUsersWithListInput** -> createUsersWithListInput($body) +> createUsersWithListInput($user) Creates list of users with given input array @@ -149,12 +165,20 @@ use OpenAPI\Server\Api\UserApiInterface; class UserApi implements UserApiInterface { + /** + * Configure API key authorization: auth_cookie + */ + public function setauth_cookie($apiKey) + { + // Retrieve logged in user from $apiKey ... + } + // ... /** * Implementation of UserApiInterface#createUsersWithListInput */ - public function createUsersWithListInput(array $body) + public function createUsersWithListInput(array $user) { // Implement the operation ... } @@ -167,7 +191,7 @@ class UserApi implements UserApiInterface Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OpenAPI\Server\Model\User**](../Model/User.md)| List of user object | + **user** | [**OpenAPI\Server\Model\User**](../Model/User.md)| List of user object | ### Return type @@ -175,11 +199,11 @@ void (empty response body) ### Authorization -No authorization required +[auth_cookie](../../README.md#auth_cookie) ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) @@ -203,6 +227,14 @@ use OpenAPI\Server\Api\UserApiInterface; class UserApi implements UserApiInterface { + /** + * Configure API key authorization: auth_cookie + */ + public function setauth_cookie($apiKey) + { + // Retrieve logged in user from $apiKey ... + } + // ... /** @@ -229,7 +261,7 @@ void (empty response body) ### Authorization -No authorization required +[auth_cookie](../../README.md#auth_cookie) ### HTTP request headers @@ -360,6 +392,14 @@ use OpenAPI\Server\Api\UserApiInterface; class UserApi implements UserApiInterface { + /** + * Configure API key authorization: auth_cookie + */ + public function setauth_cookie($apiKey) + { + // Retrieve logged in user from $apiKey ... + } + // ... /** @@ -383,7 +423,7 @@ void (empty response body) ### Authorization -No authorization required +[auth_cookie](../../README.md#auth_cookie) ### HTTP request headers @@ -393,7 +433,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) ## **updateUser** -> updateUser($username, $body) +> updateUser($username, $user) Updated user @@ -411,12 +451,20 @@ use OpenAPI\Server\Api\UserApiInterface; class UserApi implements UserApiInterface { + /** + * Configure API key authorization: auth_cookie + */ + public function setauth_cookie($apiKey) + { + // Retrieve logged in user from $apiKey ... + } + // ... /** * Implementation of UserApiInterface#updateUser */ - public function updateUser($username, User $body) + public function updateUser($username, User $user) { // Implement the operation ... } @@ -430,7 +478,7 @@ class UserApi implements UserApiInterface Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **string**| name that need to be deleted | - **body** | [**OpenAPI\Server\Model\User**](../Model/User.md)| Updated user object | + **user** | [**OpenAPI\Server\Model\User**](../Model/User.md)| Updated user object | ### Return type @@ -438,11 +486,11 @@ void (empty response body) ### Authorization -No authorization required +[auth_cookie](../../README.md#auth_cookie) ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/Resources/docs/Model/InlineObject.md b/samples/server/petstore/php-symfony/SymfonyBundle-php/Resources/docs/Model/InlineObject.md new file mode 100644 index 000000000000..101275879be3 --- /dev/null +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Resources/docs/Model/InlineObject.md @@ -0,0 +1,11 @@ +# InlineObject + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | Updated name of the pet | [optional] +**status** | **string** | Updated status of the pet | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/Resources/docs/Model/InlineObject1.md b/samples/server/petstore/php-symfony/SymfonyBundle-php/Resources/docs/Model/InlineObject1.md new file mode 100644 index 000000000000..a69b83edc6a1 --- /dev/null +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Resources/docs/Model/InlineObject1.md @@ -0,0 +1,11 @@ +# InlineObject1 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**additionalMetadata** | **string** | Additional data to pass to server | [optional] +**file** | [**UploadedFile**](UploadedFile.md) | file to upload | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/Tests/Model/InlineObject1Test.php b/samples/server/petstore/php-symfony/SymfonyBundle-php/Tests/Model/InlineObject1Test.php new file mode 100644 index 000000000000..af4791b2ea81 --- /dev/null +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Tests/Model/InlineObject1Test.php @@ -0,0 +1,94 @@ + "csv", "paramType" => "query", }, + { + "name" => "max_count", + "description" => "Maximum number of items to return", + "dataType" => "Integer", + "allowableValues" => "", + "paramType" => "query", + }, ]}) do cross_origin # the guts live here diff --git a/samples/server/petstore/ruby-sinatra/openapi.yaml b/samples/server/petstore/ruby-sinatra/openapi.yaml index c0b60f85ddeb..0dfee0f45349 100644 --- a/samples/server/petstore/ruby-sinatra/openapi.yaml +++ b/samples/server/petstore/ruby-sinatra/openapi.yaml @@ -1,11 +1,15 @@ -openapi: 3.0.1 +openapi: 3.0.0 info: - description: This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + description: This is a sample server Petstore server. For this sample, you can use + the api key `special-key` to test the authorization filters. license: name: Apache-2.0 url: http://www.apache.org/licenses/LICENSE-2.0.html title: OpenAPI Petstore version: 1.0.0 +externalDocs: + description: Find out more about Swagger + url: http://swagger.io servers: - url: http://petstore.swagger.io/v2 tags: @@ -20,18 +24,9 @@ paths: post: operationId: addPet requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - description: Pet object that needs to be added to the store - required: true + $ref: '#/components/requestBodies/Pet' responses: 405: - content: {} description: Invalid input security: - petstore_auth: @@ -43,24 +38,13 @@ paths: put: operationId: updatePet requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - description: Pet object that needs to be added to the store - required: true + $ref: '#/components/requestBodies/Pet' responses: 400: - content: {} description: Invalid ID supplied 404: - content: {} description: Pet not found 405: - content: {} description: Validation exception security: - petstore_auth: @@ -104,11 +88,9 @@ paths: type: array description: successful operation 400: - content: {} description: Invalid status value security: - petstore_auth: - - write:pets - read:pets summary: Finds Pets by status tags: @@ -116,7 +98,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + description: Multiple tags can be provided with comma separated strings. Use + tag1, tag2, tag3 for testing. operationId: findPetsByTags parameters: - description: Tags to filter by @@ -129,6 +112,15 @@ paths: type: string type: array style: form + - description: Maximum number of items to return + explode: true + in: query + name: maxCount + required: false + schema: + format: int32 + type: integer + style: form responses: 200: content: @@ -144,11 +136,9 @@ paths: type: array description: successful operation 400: - content: {} description: Invalid tag value security: - petstore_auth: - - write:pets - read:pets summary: Finds Pets by tags tags: @@ -157,20 +147,24 @@ paths: delete: operationId: deletePet parameters: - - in: header + - explode: false + in: header name: api_key + required: false schema: type: string + style: simple - description: Pet id to delete + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: 400: - content: {} description: Invalid pet value security: - petstore_auth: @@ -184,12 +178,14 @@ paths: operationId: getPetById parameters: - description: ID of pet to return + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: 200: content: @@ -201,10 +197,8 @@ paths: $ref: '#/components/schemas/Pet' description: successful operation 400: - content: {} description: Invalid ID supplied 404: - content: {} description: Pet not found security: - api_key: [] @@ -215,13 +209,16 @@ paths: operationId: updatePetWithForm parameters: - description: ID of pet that needs to be updated + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: + $ref: '#/components/requestBodies/inline_object' content: application/x-www-form-urlencoded: schema: @@ -232,9 +229,9 @@ paths: status: description: Updated status of the pet type: string + type: object responses: 405: - content: {} description: Invalid input security: - petstore_auth: @@ -248,13 +245,16 @@ paths: operationId: uploadFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: + $ref: '#/components/requestBodies/inline_object_1' content: multipart/form-data: schema: @@ -266,6 +266,7 @@ paths: description: file to upload format: binary type: string + type: object responses: 200: content: @@ -304,7 +305,7 @@ paths: operationId: placeOrder requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/Order' description: order placed for purchasing the pet @@ -320,37 +321,39 @@ paths: $ref: '#/components/schemas/Order' description: successful operation 400: - content: {} description: Invalid Order summary: Place an order for a pet tags: - store /store/order/{orderId}: delete: - description: For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + description: For valid response try integer IDs with value < 1000. Anything + above 1000 or nonintegers will generate API errors operationId: deleteOrder parameters: - description: ID of the order that needs to be deleted + explode: false in: path name: orderId required: true schema: type: string + style: simple responses: 400: - content: {} description: Invalid ID supplied 404: - content: {} description: Order not found summary: Delete purchase order by ID tags: - store get: - description: For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generated exceptions operationId: getOrderById parameters: - description: ID of pet that needs to be fetched + explode: false in: path name: orderId required: true @@ -359,6 +362,7 @@ paths: maximum: 5 minimum: 1 type: integer + style: simple responses: 200: content: @@ -370,10 +374,8 @@ paths: $ref: '#/components/schemas/Order' description: successful operation 400: - content: {} description: Invalid ID supplied 404: - content: {} description: Order not found summary: Find purchase order by ID tags: @@ -384,15 +386,16 @@ paths: operationId: createUser requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' description: Created user object required: true responses: default: - content: {} description: successful operation + security: + - auth_cookie: [] summary: Create user tags: - user @@ -400,18 +403,12 @@ paths: post: operationId: createUsersWithArrayInput requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true + $ref: '#/components/requestBodies/UserArray' responses: default: - content: {} description: successful operation + security: + - auth_cookie: [] summary: Creates list of users with given input array tags: - user @@ -419,18 +416,12 @@ paths: post: operationId: createUsersWithListInput requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true + $ref: '#/components/requestBodies/UserArray' responses: default: - content: {} description: successful operation + security: + - auth_cookie: [] summary: Creates list of users with given input array tags: - user @@ -439,17 +430,22 @@ paths: operationId: loginUser parameters: - description: The user name for login + explode: true in: query name: username required: true schema: + pattern: ^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$ type: string + style: form - description: The password for login in clear text + explode: true in: query name: password required: true schema: type: string + style: form responses: 200: content: @@ -461,18 +457,29 @@ paths: type: string description: successful operation headers: + Set-Cookie: + description: Cookie authentication key for use with the `auth_cookie` + apiKey authentication. + explode: false + schema: + example: AUTH_KEY=abcde12345; Path=/; HttpOnly + type: string + style: simple X-Rate-Limit: description: calls per hour allowed by the user + explode: false schema: format: int32 type: integer + style: simple X-Expires-After: description: date in UTC when toekn expires + explode: false schema: format: date-time type: string + style: simple 400: - content: {} description: Invalid username/password supplied summary: Logs user into the system tags: @@ -482,8 +489,9 @@ paths: operationId: logoutUser responses: default: - content: {} description: successful operation + security: + - auth_cookie: [] summary: Logs out current logged in user session tags: - user @@ -493,18 +501,20 @@ paths: operationId: deleteUser parameters: - description: The name that needs to be deleted + explode: false in: path name: username required: true schema: type: string + style: simple responses: 400: - content: {} description: Invalid username supplied 404: - content: {} description: User not found + security: + - auth_cookie: [] summary: Delete user tags: - user @@ -512,11 +522,13 @@ paths: operationId: getUserByName parameters: - description: The name that needs to be fetched. Use user1 for testing. + explode: false in: path name: username required: true schema: type: string + style: simple responses: 200: content: @@ -528,10 +540,8 @@ paths: $ref: '#/components/schemas/User' description: successful operation 400: - content: {} description: Invalid username supplied 404: - content: {} description: User not found summary: Get user by user name tags: @@ -541,29 +551,61 @@ paths: operationId: updateUser parameters: - description: name that need to be deleted + explode: false in: path name: username required: true schema: type: string + style: simple requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' description: Updated user object required: true responses: 400: - content: {} description: Invalid user supplied 404: - content: {} description: User not found + security: + - auth_cookie: [] summary: Updated user tags: - user components: + requestBodies: + UserArray: + content: + application/json: + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + inline_object: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/inline_object' + inline_object_1: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/inline_object_1' schemas: Order: description: An order for a pets from the pet store @@ -611,6 +653,7 @@ components: format: int64 type: integer name: + pattern: ^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$ type: string title: Pet category type: object @@ -736,6 +779,25 @@ components: type: string title: An uploaded response type: object + inline_object: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + type: object + inline_object_1: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + type: object securitySchemes: petstore_auth: flows: @@ -749,3 +811,7 @@ components: in: header name: api_key type: apiKey + auth_cookie: + in: cookie + name: AUTH_KEY + type: apiKey diff --git a/samples/server/petstore/scala-finch/.openapi-generator/VERSION b/samples/server/petstore/scala-finch/.openapi-generator/VERSION index afa636560641..83a328a9227e 100644 --- a/samples/server/petstore/scala-finch/.openapi-generator/VERSION +++ b/samples/server/petstore/scala-finch/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/scala-finch/src/main/scala/DataAccessor.scala b/samples/server/petstore/scala-finch/src/main/scala/DataAccessor.scala index a3ed3acc25d1..c19d3a2e307f 100644 --- a/samples/server/petstore/scala-finch/src/main/scala/DataAccessor.scala +++ b/samples/server/petstore/scala-finch/src/main/scala/DataAccessor.scala @@ -18,7 +18,7 @@ trait DataAccessor { * * @return A Unit */ - def Pet_addPet(body: Pet): Either[CommonError,Unit] = Left(TODO) + def Pet_addPet(pet: Pet): Either[CommonError,Unit] = Left(TODO) /** * @@ -36,7 +36,7 @@ trait DataAccessor { * * @return A Seq[Pet] */ - def Pet_findPetsByTags(tags: Seq[String]): Either[CommonError,Seq[Pet]] = Left(TODO) + def Pet_findPetsByTags(tags: Seq[String], maxCount: Option[Int]): Either[CommonError,Seq[Pet]] = Left(TODO) /** * @@ -48,7 +48,7 @@ trait DataAccessor { * * @return A Unit */ - def Pet_updatePet(body: Pet): Either[CommonError,Unit] = Left(TODO) + def Pet_updatePet(pet: Pet): Either[CommonError,Unit] = Left(TODO) /** * @@ -84,31 +84,31 @@ trait DataAccessor { * * @return A Order */ - def Store_placeOrder(body: Order): Either[CommonError,Order] = Left(TODO) + def Store_placeOrder(order: Order): Either[CommonError,Order] = Left(TODO) /** * * @return A Unit */ - def User_createUser(body: User): Either[CommonError,Unit] = Left(TODO) + def User_createUser(user: User, authParamauth_cookie: String): Either[CommonError,Unit] = Left(TODO) /** * * @return A Unit */ - def User_createUsersWithArrayInput(body: Seq[User]): Either[CommonError,Unit] = Left(TODO) + def User_createUsersWithArrayInput(user: Seq[User], authParamauth_cookie: String): Either[CommonError,Unit] = Left(TODO) /** * * @return A Unit */ - def User_createUsersWithListInput(body: Seq[User]): Either[CommonError,Unit] = Left(TODO) + def User_createUsersWithListInput(user: Seq[User], authParamauth_cookie: String): Either[CommonError,Unit] = Left(TODO) /** * * @return A Unit */ - def User_deleteUser(username: String): Either[CommonError,Unit] = Left(TODO) + def User_deleteUser(username: String, authParamauth_cookie: String): Either[CommonError,Unit] = Left(TODO) /** * @@ -126,12 +126,12 @@ trait DataAccessor { * * @return A Unit */ - def User_logoutUser(): Either[CommonError,Unit] = Left(TODO) + def User_logoutUser(authParamauth_cookie: String): Either[CommonError,Unit] = Left(TODO) /** * * @return A Unit */ - def User_updateUser(username: String, body: User): Either[CommonError,Unit] = Left(TODO) + def User_updateUser(username: String, user: User, authParamauth_cookie: String): Either[CommonError,Unit] = Left(TODO) } \ No newline at end of file diff --git a/samples/server/petstore/scala-finch/src/main/scala/org/openapitools/apis/PetApi.scala b/samples/server/petstore/scala-finch/src/main/scala/org/openapitools/apis/PetApi.scala index 4739fcd42cd1..fe61f5dd708f 100644 --- a/samples/server/petstore/scala-finch/src/main/scala/org/openapitools/apis/PetApi.scala +++ b/samples/server/petstore/scala-finch/src/main/scala/org/openapitools/apis/PetApi.scala @@ -60,8 +60,8 @@ object PetApi { * @return An endpoint representing a Unit */ private def addPet(da: DataAccessor): Endpoint[Unit] = - post("pet" :: jsonBody[Pet]) { (body: Pet) => - da.Pet_addPet(body) match { + post("pet" :: jsonBody[Pet]) { (pet: Pet) => + da.Pet_addPet(pet) match { case Left(error) => checkError(error) case Right(data) => Ok(data) } @@ -102,8 +102,8 @@ object PetApi { * @return An endpoint representing a Seq[Pet] */ private def findPetsByTags(da: DataAccessor): Endpoint[Seq[Pet]] = - get("pet" :: "findByTags" :: params("tags")) { (tags: Seq[String]) => - da.Pet_findPetsByTags(tags) match { + get("pet" :: "findByTags" :: params("tags") :: paramOption("maxCount").map(_.map(_.toInt))) { (tags: Seq[String], maxCount: Option[Int]) => + da.Pet_findPetsByTags(tags, maxCount) match { case Left(error) => checkError(error) case Right(data) => Ok(data) } @@ -130,8 +130,8 @@ object PetApi { * @return An endpoint representing a Unit */ private def updatePet(da: DataAccessor): Endpoint[Unit] = - put("pet" :: jsonBody[Pet]) { (body: Pet) => - da.Pet_updatePet(body) match { + put("pet" :: jsonBody[Pet]) { (pet: Pet) => + da.Pet_updatePet(pet) match { case Left(error) => checkError(error) case Right(data) => Ok(data) } diff --git a/samples/server/petstore/scala-finch/src/main/scala/org/openapitools/apis/StoreApi.scala b/samples/server/petstore/scala-finch/src/main/scala/org/openapitools/apis/StoreApi.scala index 83d674624ce6..7fff45a72260 100644 --- a/samples/server/petstore/scala-finch/src/main/scala/org/openapitools/apis/StoreApi.scala +++ b/samples/server/petstore/scala-finch/src/main/scala/org/openapitools/apis/StoreApi.scala @@ -96,8 +96,8 @@ object StoreApi { * @return An endpoint representing a Order */ private def placeOrder(da: DataAccessor): Endpoint[Order] = - post("store" :: "order" :: jsonBody[Order]) { (body: Order) => - da.Store_placeOrder(body) match { + post("store" :: "order" :: jsonBody[Order]) { (order: Order) => + da.Store_placeOrder(order) match { case Left(error) => checkError(error) case Right(data) => Ok(data) } diff --git a/samples/server/petstore/scala-finch/src/main/scala/org/openapitools/apis/UserApi.scala b/samples/server/petstore/scala-finch/src/main/scala/org/openapitools/apis/UserApi.scala index e16a0fbcdb8a..88028a90d2d9 100644 --- a/samples/server/petstore/scala-finch/src/main/scala/org/openapitools/apis/UserApi.scala +++ b/samples/server/petstore/scala-finch/src/main/scala/org/openapitools/apis/UserApi.scala @@ -59,8 +59,8 @@ object UserApi { * @return An endpoint representing a Unit */ private def createUser(da: DataAccessor): Endpoint[Unit] = - post("user" :: jsonBody[User]) { (body: User) => - da.User_createUser(body) match { + post("user" :: jsonBody[User]) { (user: User, authParamauth_cookie: String) => + da.User_createUser(user, authParamauth_cookie) match { case Left(error) => checkError(error) case Right(data) => Ok(data) } @@ -73,8 +73,8 @@ object UserApi { * @return An endpoint representing a Unit */ private def createUsersWithArrayInput(da: DataAccessor): Endpoint[Unit] = - post("user" :: "createWithArray" :: jsonBody[Seq[User]]) { (body: Seq[User]) => - da.User_createUsersWithArrayInput(body) match { + post("user" :: "createWithArray" :: jsonBody[Seq[User]]) { (user: Seq[User], authParamauth_cookie: String) => + da.User_createUsersWithArrayInput(user, authParamauth_cookie) match { case Left(error) => checkError(error) case Right(data) => Ok(data) } @@ -87,8 +87,8 @@ object UserApi { * @return An endpoint representing a Unit */ private def createUsersWithListInput(da: DataAccessor): Endpoint[Unit] = - post("user" :: "createWithList" :: jsonBody[Seq[User]]) { (body: Seq[User]) => - da.User_createUsersWithListInput(body) match { + post("user" :: "createWithList" :: jsonBody[Seq[User]]) { (user: Seq[User], authParamauth_cookie: String) => + da.User_createUsersWithListInput(user, authParamauth_cookie) match { case Left(error) => checkError(error) case Right(data) => Ok(data) } @@ -101,8 +101,8 @@ object UserApi { * @return An endpoint representing a Unit */ private def deleteUser(da: DataAccessor): Endpoint[Unit] = - delete("user" :: string) { (username: String) => - da.User_deleteUser(username) match { + delete("user" :: string) { (username: String, authParamauth_cookie: String) => + da.User_deleteUser(username, authParamauth_cookie) match { case Left(error) => checkError(error) case Right(data) => Ok(data) } @@ -143,8 +143,8 @@ object UserApi { * @return An endpoint representing a Unit */ private def logoutUser(da: DataAccessor): Endpoint[Unit] = - get("user" :: "logout") { () => - da.User_logoutUser() match { + get("user" :: "logout") { (authParamauth_cookie: String) => + da.User_logoutUser(authParamauth_cookie) match { case Left(error) => checkError(error) case Right(data) => Ok(data) } @@ -157,8 +157,8 @@ object UserApi { * @return An endpoint representing a Unit */ private def updateUser(da: DataAccessor): Endpoint[Unit] = - put("user" :: string :: jsonBody[User]) { (username: String, body: User) => - da.User_updateUser(username, body) match { + put("user" :: string :: jsonBody[User]) { (username: String, user: User, authParamauth_cookie: String) => + da.User_updateUser(username, user, authParamauth_cookie) match { case Left(error) => checkError(error) case Right(data) => Ok(data) } diff --git a/samples/server/petstore/scala-finch/src/main/scala/org/openapitools/models/InlineObject.scala b/samples/server/petstore/scala-finch/src/main/scala/org/openapitools/models/InlineObject.scala new file mode 100644 index 000000000000..8b032dce3779 --- /dev/null +++ b/samples/server/petstore/scala-finch/src/main/scala/org/openapitools/models/InlineObject.scala @@ -0,0 +1,24 @@ +package org.openapitools.models + +import io.circe._ +import io.finch.circe._ +import io.circe.generic.semiauto._ +import io.circe.java8.time._ +import org.openapitools._ + +/** + * + * @param name Updated name of the pet + * @param status Updated status of the pet + */ +case class InlineObject(name: Option[String], + status: Option[String] + ) + +object InlineObject { + /** + * Creates the codec for converting InlineObject from and to JSON. + */ + implicit val decoder: Decoder[InlineObject] = deriveDecoder + implicit val encoder: ObjectEncoder[InlineObject] = deriveEncoder +} diff --git a/samples/server/petstore/scala-finch/src/main/scala/org/openapitools/models/InlineObject1.scala b/samples/server/petstore/scala-finch/src/main/scala/org/openapitools/models/InlineObject1.scala new file mode 100644 index 000000000000..0c71edaf9e64 --- /dev/null +++ b/samples/server/petstore/scala-finch/src/main/scala/org/openapitools/models/InlineObject1.scala @@ -0,0 +1,25 @@ +package org.openapitools.models + +import io.circe._ +import io.finch.circe._ +import io.circe.generic.semiauto._ +import io.circe.java8.time._ +import org.openapitools._ +import java.io.File + +/** + * + * @param additionalMetadata Additional data to pass to server + * @param file file to upload + */ +case class InlineObject1(additionalMetadata: Option[String], + file: Option[File] + ) + +object InlineObject1 { + /** + * Creates the codec for converting InlineObject1 from and to JSON. + */ + implicit val decoder: Decoder[InlineObject1] = deriveDecoder + implicit val encoder: ObjectEncoder[InlineObject1] = deriveEncoder +} diff --git a/samples/server/petstore/scala-lagom-server/.openapi-generator/VERSION b/samples/server/petstore/scala-lagom-server/.openapi-generator/VERSION index f9f7450d1359..83a328a9227e 100644 --- a/samples/server/petstore/scala-lagom-server/.openapi-generator/VERSION +++ b/samples/server/petstore/scala-lagom-server/.openapi-generator/VERSION @@ -1 +1 @@ -2.3.0-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/scala-lagom-server/README.md b/samples/server/petstore/scala-lagom-server/README.md index 938d7331cb7d..e80ddccb7e17 100644 --- a/samples/server/petstore/scala-lagom-server/README.md +++ b/samples/server/petstore/scala-lagom-server/README.md @@ -1,9 +1,9 @@ -# Swagger generated scala-lagomApi +# OpenAPI generated scala-lagomApi ## Overview -This server was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the -[OpenAPI-Spec](https://github.com/swagger-api/swagger-core/wiki) from a remote server, you can easily generate a server stub. This -is an example of building a swagger-enabled lagon-api. +This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the +[OpenAPI-Spec](https://openapis.org) from a remote server, you can easily generate a server stub. This +is an example of building a OpenAPI-enabled lagon-api. This example uses the [lagomframework](https://www.lagomframework.com) lagomframework. diff --git a/samples/server/petstore/scala-lagom-server/build.sbt b/samples/server/petstore/scala-lagom-server/build.sbt index ea9dd5789f03..b6ab43cf17b3 100644 --- a/samples/server/petstore/scala-lagom-server/build.sbt +++ b/samples/server/petstore/scala-lagom-server/build.sbt @@ -2,7 +2,7 @@ version := "1.0.0" name := "scala-lagom-server" -organization := "io.swagger" +organization := "org.openapitools" scalaVersion := "2.11.8" diff --git a/samples/server/petstore/scala-lagom-server/src/main/scala/io/swagger/client/api/PetApi.scala b/samples/server/petstore/scala-lagom-server/src/main/scala/io/swagger/client/api/PetApi.scala index 6ee03b22acac..559f0820c428 100644 --- a/samples/server/petstore/scala-lagom-server/src/main/scala/io/swagger/client/api/PetApi.scala +++ b/samples/server/petstore/scala-lagom-server/src/main/scala/io/swagger/client/api/PetApi.scala @@ -1,12 +1,12 @@ /** - * Swagger Petstore - * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * The version of the OpenAPI document: 1.0.0 + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/scala-lagom-server/src/main/scala/io/swagger/client/api/StoreApi.scala b/samples/server/petstore/scala-lagom-server/src/main/scala/io/swagger/client/api/StoreApi.scala index ff42a995e9ae..2386c182986d 100644 --- a/samples/server/petstore/scala-lagom-server/src/main/scala/io/swagger/client/api/StoreApi.scala +++ b/samples/server/petstore/scala-lagom-server/src/main/scala/io/swagger/client/api/StoreApi.scala @@ -1,12 +1,12 @@ /** - * Swagger Petstore - * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * The version of the OpenAPI document: 1.0.0 + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/scala-lagom-server/src/main/scala/io/swagger/client/api/UserApi.scala b/samples/server/petstore/scala-lagom-server/src/main/scala/io/swagger/client/api/UserApi.scala index b62b48d87504..211db9974bfb 100644 --- a/samples/server/petstore/scala-lagom-server/src/main/scala/io/swagger/client/api/UserApi.scala +++ b/samples/server/petstore/scala-lagom-server/src/main/scala/io/swagger/client/api/UserApi.scala @@ -1,12 +1,12 @@ /** - * Swagger Petstore - * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * The version of the OpenAPI document: 1.0.0 + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. */ @@ -75,7 +75,7 @@ trait UserApi extends Service { * Get user by user name * * - * @param username The name that needs to be fetched. Use user1 for testing. + * @param username The name that needs to be fetched. Use user1 for testing. * @return User */ def getUserByName(username: String): ServiceCall[NotUsed ,User] diff --git a/samples/server/petstore/scala-lagom-server/src/main/scala/io/swagger/client/model/ApiResponse.scala b/samples/server/petstore/scala-lagom-server/src/main/scala/io/swagger/client/model/ApiResponse.scala index 884853e5c25b..28448672d579 100644 --- a/samples/server/petstore/scala-lagom-server/src/main/scala/io/swagger/client/model/ApiResponse.scala +++ b/samples/server/petstore/scala-lagom-server/src/main/scala/io/swagger/client/model/ApiResponse.scala @@ -1,12 +1,12 @@ /** - * Swagger Petstore - * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * The version of the OpenAPI document: 1.0.0 + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. */ @@ -15,7 +15,7 @@ import play.api.libs.json._ case class ApiResponse ( code: Option[Int], - _type: Option[String], + `type`: Option[String], message: Option[String] ) diff --git a/samples/server/petstore/scala-lagom-server/src/main/scala/io/swagger/client/model/Category.scala b/samples/server/petstore/scala-lagom-server/src/main/scala/io/swagger/client/model/Category.scala index c50c6e71c64d..68f37da0d9e2 100644 --- a/samples/server/petstore/scala-lagom-server/src/main/scala/io/swagger/client/model/Category.scala +++ b/samples/server/petstore/scala-lagom-server/src/main/scala/io/swagger/client/model/Category.scala @@ -1,12 +1,12 @@ /** - * Swagger Petstore - * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * The version of the OpenAPI document: 1.0.0 + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/scala-lagom-server/src/main/scala/io/swagger/client/model/Order.scala b/samples/server/petstore/scala-lagom-server/src/main/scala/io/swagger/client/model/Order.scala index c79ffb780e54..1f86d47b25be 100644 --- a/samples/server/petstore/scala-lagom-server/src/main/scala/io/swagger/client/model/Order.scala +++ b/samples/server/petstore/scala-lagom-server/src/main/scala/io/swagger/client/model/Order.scala @@ -1,12 +1,12 @@ /** - * Swagger Petstore - * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * The version of the OpenAPI document: 1.0.0 + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/scala-lagom-server/src/main/scala/io/swagger/client/model/Pet.scala b/samples/server/petstore/scala-lagom-server/src/main/scala/io/swagger/client/model/Pet.scala index acc6c25afc38..56798d01eef0 100644 --- a/samples/server/petstore/scala-lagom-server/src/main/scala/io/swagger/client/model/Pet.scala +++ b/samples/server/petstore/scala-lagom-server/src/main/scala/io/swagger/client/model/Pet.scala @@ -1,12 +1,12 @@ /** - * Swagger Petstore - * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * The version of the OpenAPI document: 1.0.0 + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/scala-lagom-server/src/main/scala/io/swagger/client/model/Tag.scala b/samples/server/petstore/scala-lagom-server/src/main/scala/io/swagger/client/model/Tag.scala index 65aa9c628bcd..8d8da70ff8ae 100644 --- a/samples/server/petstore/scala-lagom-server/src/main/scala/io/swagger/client/model/Tag.scala +++ b/samples/server/petstore/scala-lagom-server/src/main/scala/io/swagger/client/model/Tag.scala @@ -1,12 +1,12 @@ /** - * Swagger Petstore - * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * The version of the OpenAPI document: 1.0.0 + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/scala-lagom-server/src/main/scala/io/swagger/client/model/User.scala b/samples/server/petstore/scala-lagom-server/src/main/scala/io/swagger/client/model/User.scala index b21cd2e7e770..f5de40df3690 100644 --- a/samples/server/petstore/scala-lagom-server/src/main/scala/io/swagger/client/model/User.scala +++ b/samples/server/petstore/scala-lagom-server/src/main/scala/io/swagger/client/model/User.scala @@ -1,12 +1,12 @@ /** - * Swagger Petstore - * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * The version of the OpenAPI document: 1.0.0 + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/scala-play-server/.openapi-generator/VERSION b/samples/server/petstore/scala-play-server/.openapi-generator/VERSION index afa636560641..83a328a9227e 100644 --- a/samples/server/petstore/scala-play-server/.openapi-generator/VERSION +++ b/samples/server/petstore/scala-play-server/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/scala-play-server/README.md b/samples/server/petstore/scala-play-server/README.md index 7f342575759e..49ea9ab131d9 100644 --- a/samples/server/petstore/scala-play-server/README.md +++ b/samples/server/petstore/scala-play-server/README.md @@ -2,7 +2,7 @@ This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -This Scala Play Framework project was generated by the OpenAPI generator tool at 2019-03-26T16:21:58.590+08:00[Asia/Hong_Kong]. +This Scala Play Framework project was generated by the OpenAPI generator tool at 2019-08-09T14:06:10.426796+03:00[Europe/Tallinn]. ## API diff --git a/samples/server/petstore/scala-play-server/app/api/PetApi.scala b/samples/server/petstore/scala-play-server/app/api/PetApi.scala index 1f7eaed70b40..747858e64488 100644 --- a/samples/server/petstore/scala-play-server/app/api/PetApi.scala +++ b/samples/server/petstore/scala-play-server/app/api/PetApi.scala @@ -4,7 +4,7 @@ import model.ApiResponse import model.Pet import play.api.libs.Files.TemporaryFile -@javax.annotation.Generated(value = Array("org.openapitools.codegen.languages.ScalaPlayFrameworkServerCodegen"), date = "2019-03-26T16:21:58.590+08:00[Asia/Hong_Kong]") +@javax.annotation.Generated(value = Array("org.openapitools.codegen.languages.ScalaPlayFrameworkServerCodegen"), date = "2019-08-09T14:06:10.426796+03:00[Europe/Tallinn]") trait PetApi { /** * Add a new pet to the store diff --git a/samples/server/petstore/scala-play-server/app/api/PetApiController.scala b/samples/server/petstore/scala-play-server/app/api/PetApiController.scala index 33f07975634d..ff9cb49840fd 100644 --- a/samples/server/petstore/scala-play-server/app/api/PetApiController.scala +++ b/samples/server/petstore/scala-play-server/app/api/PetApiController.scala @@ -8,7 +8,7 @@ import model.ApiResponse import model.Pet import play.api.libs.Files.TemporaryFile -@javax.annotation.Generated(value = Array("org.openapitools.codegen.languages.ScalaPlayFrameworkServerCodegen"), date = "2019-03-26T16:21:58.590+08:00[Asia/Hong_Kong]") +@javax.annotation.Generated(value = Array("org.openapitools.codegen.languages.ScalaPlayFrameworkServerCodegen"), date = "2019-08-09T14:06:10.426796+03:00[Europe/Tallinn]") @Singleton class PetApiController @Inject()(cc: ControllerComponents, api: PetApi) extends AbstractController(cc) { /** diff --git a/samples/server/petstore/scala-play-server/app/api/PetApiImpl.scala b/samples/server/petstore/scala-play-server/app/api/PetApiImpl.scala index d3a8ea67b1bb..b722827b5c45 100644 --- a/samples/server/petstore/scala-play-server/app/api/PetApiImpl.scala +++ b/samples/server/petstore/scala-play-server/app/api/PetApiImpl.scala @@ -7,7 +7,7 @@ import play.api.libs.Files.TemporaryFile /** * Provides a default implementation for [[PetApi]]. */ -@javax.annotation.Generated(value = Array("org.openapitools.codegen.languages.ScalaPlayFrameworkServerCodegen"), date = "2019-03-26T16:21:58.590+08:00[Asia/Hong_Kong]") +@javax.annotation.Generated(value = Array("org.openapitools.codegen.languages.ScalaPlayFrameworkServerCodegen"), date = "2019-08-09T14:06:10.426796+03:00[Europe/Tallinn]") class PetApiImpl extends PetApi { /** * @inheritdoc diff --git a/samples/server/petstore/scala-play-server/app/api/StoreApi.scala b/samples/server/petstore/scala-play-server/app/api/StoreApi.scala index 11ee20112683..42fb377a6a6a 100644 --- a/samples/server/petstore/scala-play-server/app/api/StoreApi.scala +++ b/samples/server/petstore/scala-play-server/app/api/StoreApi.scala @@ -2,7 +2,7 @@ package api import model.Order -@javax.annotation.Generated(value = Array("org.openapitools.codegen.languages.ScalaPlayFrameworkServerCodegen"), date = "2019-03-26T16:21:58.590+08:00[Asia/Hong_Kong]") +@javax.annotation.Generated(value = Array("org.openapitools.codegen.languages.ScalaPlayFrameworkServerCodegen"), date = "2019-08-09T14:06:10.426796+03:00[Europe/Tallinn]") trait StoreApi { /** * Delete purchase order by ID diff --git a/samples/server/petstore/scala-play-server/app/api/StoreApiController.scala b/samples/server/petstore/scala-play-server/app/api/StoreApiController.scala index 161cf5805c68..810cd73f0c6a 100644 --- a/samples/server/petstore/scala-play-server/app/api/StoreApiController.scala +++ b/samples/server/petstore/scala-play-server/app/api/StoreApiController.scala @@ -6,7 +6,7 @@ import play.api.libs.json._ import play.api.mvc._ import model.Order -@javax.annotation.Generated(value = Array("org.openapitools.codegen.languages.ScalaPlayFrameworkServerCodegen"), date = "2019-03-26T16:21:58.590+08:00[Asia/Hong_Kong]") +@javax.annotation.Generated(value = Array("org.openapitools.codegen.languages.ScalaPlayFrameworkServerCodegen"), date = "2019-08-09T14:06:10.426796+03:00[Europe/Tallinn]") @Singleton class StoreApiController @Inject()(cc: ControllerComponents, api: StoreApi) extends AbstractController(cc) { /** diff --git a/samples/server/petstore/scala-play-server/app/api/StoreApiImpl.scala b/samples/server/petstore/scala-play-server/app/api/StoreApiImpl.scala index 8a996a93e462..5ba774ae3e62 100644 --- a/samples/server/petstore/scala-play-server/app/api/StoreApiImpl.scala +++ b/samples/server/petstore/scala-play-server/app/api/StoreApiImpl.scala @@ -5,7 +5,7 @@ import model.Order /** * Provides a default implementation for [[StoreApi]]. */ -@javax.annotation.Generated(value = Array("org.openapitools.codegen.languages.ScalaPlayFrameworkServerCodegen"), date = "2019-03-26T16:21:58.590+08:00[Asia/Hong_Kong]") +@javax.annotation.Generated(value = Array("org.openapitools.codegen.languages.ScalaPlayFrameworkServerCodegen"), date = "2019-08-09T14:06:10.426796+03:00[Europe/Tallinn]") class StoreApiImpl extends StoreApi { /** * @inheritdoc diff --git a/samples/server/petstore/scala-play-server/app/api/UserApi.scala b/samples/server/petstore/scala-play-server/app/api/UserApi.scala index 41b24e87562a..e132895ceda4 100644 --- a/samples/server/petstore/scala-play-server/app/api/UserApi.scala +++ b/samples/server/petstore/scala-play-server/app/api/UserApi.scala @@ -2,7 +2,7 @@ package api import model.User -@javax.annotation.Generated(value = Array("org.openapitools.codegen.languages.ScalaPlayFrameworkServerCodegen"), date = "2019-03-26T16:21:58.590+08:00[Asia/Hong_Kong]") +@javax.annotation.Generated(value = Array("org.openapitools.codegen.languages.ScalaPlayFrameworkServerCodegen"), date = "2019-08-09T14:06:10.426796+03:00[Europe/Tallinn]") trait UserApi { /** * Create user diff --git a/samples/server/petstore/scala-play-server/app/api/UserApiController.scala b/samples/server/petstore/scala-play-server/app/api/UserApiController.scala index 05550df7c665..489170381c75 100644 --- a/samples/server/petstore/scala-play-server/app/api/UserApiController.scala +++ b/samples/server/petstore/scala-play-server/app/api/UserApiController.scala @@ -6,7 +6,7 @@ import play.api.libs.json._ import play.api.mvc._ import model.User -@javax.annotation.Generated(value = Array("org.openapitools.codegen.languages.ScalaPlayFrameworkServerCodegen"), date = "2019-03-26T16:21:58.590+08:00[Asia/Hong_Kong]") +@javax.annotation.Generated(value = Array("org.openapitools.codegen.languages.ScalaPlayFrameworkServerCodegen"), date = "2019-08-09T14:06:10.426796+03:00[Europe/Tallinn]") @Singleton class UserApiController @Inject()(cc: ControllerComponents, api: UserApi) extends AbstractController(cc) { /** diff --git a/samples/server/petstore/scala-play-server/app/api/UserApiImpl.scala b/samples/server/petstore/scala-play-server/app/api/UserApiImpl.scala index 01ce46e98e55..6b778fb490f7 100644 --- a/samples/server/petstore/scala-play-server/app/api/UserApiImpl.scala +++ b/samples/server/petstore/scala-play-server/app/api/UserApiImpl.scala @@ -5,7 +5,7 @@ import model.User /** * Provides a default implementation for [[UserApi]]. */ -@javax.annotation.Generated(value = Array("org.openapitools.codegen.languages.ScalaPlayFrameworkServerCodegen"), date = "2019-03-26T16:21:58.590+08:00[Asia/Hong_Kong]") +@javax.annotation.Generated(value = Array("org.openapitools.codegen.languages.ScalaPlayFrameworkServerCodegen"), date = "2019-08-09T14:06:10.426796+03:00[Europe/Tallinn]") class UserApiImpl extends UserApi { /** * @inheritdoc diff --git a/samples/server/petstore/scala-play-server/app/model/ApiResponse.scala b/samples/server/petstore/scala-play-server/app/model/ApiResponse.scala index 529462aa0864..971fa75ad1fe 100644 --- a/samples/server/petstore/scala-play-server/app/model/ApiResponse.scala +++ b/samples/server/petstore/scala-play-server/app/model/ApiResponse.scala @@ -5,7 +5,7 @@ import play.api.libs.json._ /** * Describes the result of uploading an image resource */ -@javax.annotation.Generated(value = Array("org.openapitools.codegen.languages.ScalaPlayFrameworkServerCodegen"), date = "2019-03-26T16:21:58.590+08:00[Asia/Hong_Kong]") +@javax.annotation.Generated(value = Array("org.openapitools.codegen.languages.ScalaPlayFrameworkServerCodegen"), date = "2019-08-09T14:06:10.426796+03:00[Europe/Tallinn]") case class ApiResponse( code: Option[Int], `type`: Option[String], diff --git a/samples/server/petstore/scala-play-server/app/model/Category.scala b/samples/server/petstore/scala-play-server/app/model/Category.scala index 006c0e561dea..f6407cdecd88 100644 --- a/samples/server/petstore/scala-play-server/app/model/Category.scala +++ b/samples/server/petstore/scala-play-server/app/model/Category.scala @@ -5,7 +5,7 @@ import play.api.libs.json._ /** * A category for a pet */ -@javax.annotation.Generated(value = Array("org.openapitools.codegen.languages.ScalaPlayFrameworkServerCodegen"), date = "2019-03-26T16:21:58.590+08:00[Asia/Hong_Kong]") +@javax.annotation.Generated(value = Array("org.openapitools.codegen.languages.ScalaPlayFrameworkServerCodegen"), date = "2019-08-09T14:06:10.426796+03:00[Europe/Tallinn]") case class Category( id: Option[Long], name: Option[String] diff --git a/samples/server/petstore/scala-play-server/app/model/Order.scala b/samples/server/petstore/scala-play-server/app/model/Order.scala index b82378a3791a..269573f6710f 100644 --- a/samples/server/petstore/scala-play-server/app/model/Order.scala +++ b/samples/server/petstore/scala-play-server/app/model/Order.scala @@ -7,7 +7,7 @@ import java.time.OffsetDateTime * An order for a pets from the pet store * @param status Order Status */ -@javax.annotation.Generated(value = Array("org.openapitools.codegen.languages.ScalaPlayFrameworkServerCodegen"), date = "2019-03-26T16:21:58.590+08:00[Asia/Hong_Kong]") +@javax.annotation.Generated(value = Array("org.openapitools.codegen.languages.ScalaPlayFrameworkServerCodegen"), date = "2019-08-09T14:06:10.426796+03:00[Europe/Tallinn]") case class Order( id: Option[Long], petId: Option[Long], diff --git a/samples/server/petstore/scala-play-server/app/model/Pet.scala b/samples/server/petstore/scala-play-server/app/model/Pet.scala index 207929809288..113625576b2d 100644 --- a/samples/server/petstore/scala-play-server/app/model/Pet.scala +++ b/samples/server/petstore/scala-play-server/app/model/Pet.scala @@ -6,7 +6,7 @@ import play.api.libs.json._ * A pet for sale in the pet store * @param status pet status in the store */ -@javax.annotation.Generated(value = Array("org.openapitools.codegen.languages.ScalaPlayFrameworkServerCodegen"), date = "2019-03-26T16:21:58.590+08:00[Asia/Hong_Kong]") +@javax.annotation.Generated(value = Array("org.openapitools.codegen.languages.ScalaPlayFrameworkServerCodegen"), date = "2019-08-09T14:06:10.426796+03:00[Europe/Tallinn]") case class Pet( id: Option[Long], category: Option[Category], diff --git a/samples/server/petstore/scala-play-server/app/model/Tag.scala b/samples/server/petstore/scala-play-server/app/model/Tag.scala index 2d8a1f21fcb8..e50ef4d64401 100644 --- a/samples/server/petstore/scala-play-server/app/model/Tag.scala +++ b/samples/server/petstore/scala-play-server/app/model/Tag.scala @@ -5,7 +5,7 @@ import play.api.libs.json._ /** * A tag for a pet */ -@javax.annotation.Generated(value = Array("org.openapitools.codegen.languages.ScalaPlayFrameworkServerCodegen"), date = "2019-03-26T16:21:58.590+08:00[Asia/Hong_Kong]") +@javax.annotation.Generated(value = Array("org.openapitools.codegen.languages.ScalaPlayFrameworkServerCodegen"), date = "2019-08-09T14:06:10.426796+03:00[Europe/Tallinn]") case class Tag( id: Option[Long], name: Option[String] diff --git a/samples/server/petstore/scala-play-server/app/model/User.scala b/samples/server/petstore/scala-play-server/app/model/User.scala index 4d92a101a9e5..6881ed54662a 100644 --- a/samples/server/petstore/scala-play-server/app/model/User.scala +++ b/samples/server/petstore/scala-play-server/app/model/User.scala @@ -6,7 +6,7 @@ import play.api.libs.json._ * A User who is purchasing from the pet store * @param userStatus User Status */ -@javax.annotation.Generated(value = Array("org.openapitools.codegen.languages.ScalaPlayFrameworkServerCodegen"), date = "2019-03-26T16:21:58.590+08:00[Asia/Hong_Kong]") +@javax.annotation.Generated(value = Array("org.openapitools.codegen.languages.ScalaPlayFrameworkServerCodegen"), date = "2019-08-09T14:06:10.426796+03:00[Europe/Tallinn]") case class User( id: Option[Long], username: Option[String], diff --git a/samples/server/petstore/scala-play-server/app/org/openapitools/Module.scala b/samples/server/petstore/scala-play-server/app/org/openapitools/Module.scala index f135171d48d1..02ee908afd84 100644 --- a/samples/server/petstore/scala-play-server/app/org/openapitools/Module.scala +++ b/samples/server/petstore/scala-play-server/app/org/openapitools/Module.scala @@ -4,7 +4,7 @@ import api._ import play.api.inject.{Binding, Module => PlayModule} import play.api.{Configuration, Environment} -@javax.annotation.Generated(value = Array("org.openapitools.codegen.languages.ScalaPlayFrameworkServerCodegen"), date = "2019-03-26T16:21:58.590+08:00[Asia/Hong_Kong]") +@javax.annotation.Generated(value = Array("org.openapitools.codegen.languages.ScalaPlayFrameworkServerCodegen"), date = "2019-08-09T14:06:10.426796+03:00[Europe/Tallinn]") class Module extends PlayModule { override def bindings(environment: Environment, configuration: Configuration): Seq[Binding[_]] = Seq( bind[PetApi].to[PetApiImpl], diff --git a/samples/server/petstore/scalatra/.openapi-generator/VERSION b/samples/server/petstore/scalatra/.openapi-generator/VERSION index 096bf47efe31..83a328a9227e 100644 --- a/samples/server/petstore/scalatra/.openapi-generator/VERSION +++ b/samples/server/petstore/scalatra/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.0-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/scalatra/src/main/scala/JettyMain.scala b/samples/server/petstore/scalatra/src/main/scala/JettyMain.scala index 9f9e5c93f808..e812796c15ce 100644 --- a/samples/server/petstore/scalatra/src/main/scala/JettyMain.scala +++ b/samples/server/petstore/scalatra/src/main/scala/JettyMain.scala @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * Contact: team@openapitools.org * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/server/petstore/scalatra/src/main/scala/ScalatraBootstrap.scala b/samples/server/petstore/scalatra/src/main/scala/ScalatraBootstrap.scala index bdab3861475b..b949318aebc4 100644 --- a/samples/server/petstore/scalatra/src/main/scala/ScalatraBootstrap.scala +++ b/samples/server/petstore/scalatra/src/main/scala/ScalatraBootstrap.scala @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * Contact: team@openapitools.org * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/server/petstore/scalatra/src/main/scala/ServletApp.scala b/samples/server/petstore/scalatra/src/main/scala/ServletApp.scala index 82268ea76e9f..3079a335a697 100644 --- a/samples/server/petstore/scalatra/src/main/scala/ServletApp.scala +++ b/samples/server/petstore/scalatra/src/main/scala/ServletApp.scala @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * Contact: team@openapitools.org * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/api/PetApi.scala b/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/api/PetApi.scala index 8ecf1d6283a8..d0c8f610bb57 100644 --- a/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/api/PetApi.scala +++ b/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/api/PetApi.scala @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * Contact: team@openapitools.org * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -68,7 +68,7 @@ class PetApi(implicit val swagger: Swagger) extends ScalatraServlet val findPetsByStatusOperation = (apiOperation[List[Pet]]("findPetsByStatus") summary "Finds Pets by status" - parameters(queryParam[List[String]]("status").description("")) + parameters(queryParam[List[String]]("status").description("").defaultValue(new ListBuffer[String]() )) ) get("/pet/findByStatus", operation(findPetsByStatusOperation)) { @@ -88,7 +88,7 @@ class PetApi(implicit val swagger: Swagger) extends ScalatraServlet val findPetsByTagsOperation = (apiOperation[List[Pet]]("findPetsByTags") summary "Finds Pets by tags" - parameters(queryParam[List[String]]("tags").description("")) + parameters(queryParam[List[String]]("tags").description("").defaultValue(new ListBuffer[String]() ), queryParam[Int]("maxCount").description("").optional) ) get("/pet/findByTags", operation(findPetsByTagsOperation)) { @@ -102,6 +102,9 @@ class PetApi(implicit val swagger: Swagger) extends ScalatraServlet Seq() //println("tags: " + tags) + val maxCount = params.getAs[Int]("maxCount") + + //println("maxCount: " + maxCount) } diff --git a/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/api/StoreApi.scala b/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/api/StoreApi.scala index 3419f02abfbf..e640f4a3e28b 100644 --- a/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/api/StoreApi.scala +++ b/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/api/StoreApi.scala @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * Contact: team@openapitools.org * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/api/UserApi.scala b/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/api/UserApi.scala index 90ee1e201d58..8cdc75071cf0 100644 --- a/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/api/UserApi.scala +++ b/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/api/UserApi.scala @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * Contact: team@openapitools.org * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/model/ApiResponse.scala b/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/model/ApiResponse.scala index e14b6bbaaf56..05dc357b10b4 100644 --- a/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/model/ApiResponse.scala +++ b/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/model/ApiResponse.scala @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * Contact: team@openapitools.org * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/model/Category.scala b/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/model/Category.scala index 148704eeb083..fb2ef7844d1b 100644 --- a/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/model/Category.scala +++ b/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/model/Category.scala @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * Contact: team@openapitools.org * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/model/InlineObject.scala b/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/model/InlineObject.scala new file mode 100644 index 000000000000..9a521c62250e --- /dev/null +++ b/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/model/InlineObject.scala @@ -0,0 +1,21 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: team@openapitools.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + */ + +package org.openapitools.server.model + +case class InlineObject( + /* Updated name of the pet */ + name: Option[String], + + /* Updated status of the pet */ + status: Option[String] + + ) diff --git a/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/model/InlineObject1.scala b/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/model/InlineObject1.scala new file mode 100644 index 000000000000..aa938e897132 --- /dev/null +++ b/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/model/InlineObject1.scala @@ -0,0 +1,22 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: team@openapitools.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + */ + +package org.openapitools.server.model +import java.io.File + +case class InlineObject1( + /* Additional data to pass to server */ + additionalMetadata: Option[String], + + /* file to upload */ + file: Option[File] + + ) diff --git a/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/model/Order.scala b/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/model/Order.scala index 9394dc1b8eba..c1f267005ab8 100644 --- a/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/model/Order.scala +++ b/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/model/Order.scala @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * Contact: team@openapitools.org * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/model/Pet.scala b/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/model/Pet.scala index 7296720147c2..062ed9dd53f9 100644 --- a/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/model/Pet.scala +++ b/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/model/Pet.scala @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * Contact: team@openapitools.org * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/model/Tag.scala b/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/model/Tag.scala index 4002f962d088..458f5335bde5 100644 --- a/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/model/Tag.scala +++ b/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/model/Tag.scala @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * Contact: team@openapitools.org * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/model/User.scala b/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/model/User.scala index ef69c5ffed26..b4edb94c0a77 100644 --- a/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/model/User.scala +++ b/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/model/User.scala @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * Contact: team@openapitools.org * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).