From 3c0ba3e744ceb9c2c98a75f213678d685904c599 Mon Sep 17 00:00:00 2001 From: Veda Bhaskara Ramanth Addala Date: Mon, 2 Sep 2019 09:55:32 +0530 Subject: [PATCH 1/3] fix(qlik): fix for minor serialization bug --- .../src/main/resources/r/api.mustache | 4 +- .../src/main/resources/r/model.mustache | 81 +++++++++++++------ 2 files changed, 58 insertions(+), 27 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/r/api.mustache b/modules/openapi-generator/src/main/resources/r/api.mustache index 7f21323c95f7..02c0190c63e3 100644 --- a/modules/openapi-generator/src/main/resources/r/api.mustache +++ b/modules/openapi-generator/src/main/resources/r/api.mustache @@ -164,7 +164,9 @@ resp <- apiResponse$response if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { apiResponse$content - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + apiResponse + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { apiResponse } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { apiResponse diff --git a/modules/openapi-generator/src/main/resources/r/model.mustache b/modules/openapi-generator/src/main/resources/r/model.mustache index 3b83d4695620..ee20e432e742 100644 --- a/modules/openapi-generator/src/main/resources/r/model.mustache +++ b/modules/openapi-generator/src/main/resources/r/model.mustache @@ -23,7 +23,7 @@ local.optional.var <- list(...) {{#requiredVars}} if (!missing(`{{baseName}}`)) { - {{^isListContainer}} + {{^isContainer}} {{#isInteger}} stopifnot(is.numeric(`{{baseName}}`), length(`{{baseName}}`) == 1) {{/isInteger}} @@ -48,8 +48,8 @@ {{^isPrimitiveType}} stopifnot(R6::is.R6(`{{baseName}}`)) {{/isPrimitiveType}} - {{/isListContainer}} - {{#isListContainer}} + {{/isContainer}} + {{#isContainer}} {{#isPrimitiveType}} stopifnot(is.vector(`{{baseName}}`), length(`{{baseName}}`) != 0) sapply(`{{baseName}}`, function(x) stopifnot(is.character(x))) @@ -58,13 +58,13 @@ stopifnot(is.vector(`{{baseName}}`), length(`{{baseName}}`) != 0) sapply(`{{baseName}}`, function(x) stopifnot(R6::is.R6(x))) {{/isPrimitiveType}} - {{/isListContainer}} + {{/isContainer}} self$`{{baseName}}` <- `{{baseName}}` } {{/requiredVars}} {{#optionalVars}} if (!is.null(`{{baseName}}`)) { - {{^isListContainer}} + {{^isContainer}} {{#isInteger}} stopifnot(is.numeric(`{{baseName}}`), length(`{{baseName}}`) == 1) {{/isInteger}} @@ -89,8 +89,8 @@ {{^isPrimitiveType}} stopifnot(R6::is.R6(`{{baseName}}`)) {{/isPrimitiveType}} - {{/isListContainer}} - {{#isListContainer}} + {{/isContainer}} + {{#isContainer}} {{#isPrimitiveType}} stopifnot(is.vector(`{{baseName}}`), length(`{{baseName}}`) != 0) sapply(`{{baseName}}`, function(x) stopifnot(is.character(x))) @@ -99,7 +99,7 @@ stopifnot(is.vector(`{{baseName}}`), length(`{{baseName}}`) != 0) sapply(`{{baseName}}`, function(x) stopifnot(R6::is.R6(x))) {{/isPrimitiveType}} - {{/isListContainer}} + {{/isContainer}} self$`{{baseName}}` <- `{{baseName}}` } {{/optionalVars}} @@ -109,22 +109,32 @@ {{#vars}} if (!is.null(self$`{{baseName}}`)) { {{classname}}Object[['{{baseName}}']] <- - {{#isListContainer}} - {{#isPrimitiveType}} + {{#isContainer}} + {{#isListContainer}} + {{#isPrimitiveType}} self$`{{baseName}}` + {{/isPrimitiveType}} + {{^isPrimitiveType}} + lapply(self$`{{baseName}}`, function(x) x$toJSON()) {{/isPrimitiveType}} - {{^isPrimitiveType}} - sapply(self$`{{baseName}}`, function(x) x$toJSON()) - {{/isPrimitiveType}} - {{/isListContainer}} - {{^isListContainer}} - {{#isPrimitiveType}} + {{/isListContainer}} + {{#isMapContainer}} + {{#isPrimitiveType}} self$`{{baseName}}` - {{/isPrimitiveType}} - {{^isPrimitiveType}} + {{/isPrimitiveType}} + {{^isPrimitiveType}} + lapply(self$`{{baseName}}`, function(x) x$toJSON()) + {{/isPrimitiveType}} + {{/isMapContainer}} + {{/isContainer}} + {{^isContainer}} + {{#isPrimitiveType}} + self$`{{baseName}}` + {{/isPrimitiveType}} + {{^isPrimitiveType}} self$`{{baseName}}`$toJSON() - {{/isPrimitiveType}} - {{/isListContainer}} + {{/isPrimitiveType}} + {{/isContainer}} } {{/vars}} @@ -156,6 +166,7 @@ if (!is.null(self$`{{baseName}}`)) { sprintf( '"{{baseName}}": + {{#isContainer}} {{#isListContainer}} {{#isPrimitiveType}} {{#isNumeric}}[%d]{{/isNumeric}}{{^isNumeric}}[%s]{{/isNumeric}} @@ -163,31 +174,49 @@ {{^isPrimitiveType}}[%s] {{/isPrimitiveType}} {{/isListContainer}} - {{^isListContainer}} + {{#isMapContainer}} + {{#isPrimitiveType}} + {{#isNumeric}}%d{{/isNumeric}}{{^isNumeric}}"%s"{{/isNumeric}} + {{/isPrimitiveType}} + {{^isPrimitiveType}}%s + {{/isPrimitiveType}} + {{/isMapContainer}} + {{/isContainer}} + {{^isContainer}} {{#isPrimitiveType}} {{#isNumeric}}%d{{/isNumeric}}{{^isNumeric}}"%s"{{/isNumeric}} {{/isPrimitiveType}} {{^isPrimitiveType}}%s {{/isPrimitiveType}} - {{/isListContainer}}', + {{/isContainer}}', + {{#isContainer}} {{#isListContainer}} {{#isPrimitiveType}} paste(unlist(lapply(self$`{{{baseName}}}`, function(x) paste0('"', x, '"'))), collapse=",") {{/isPrimitiveType}} {{^isPrimitiveType}} - paste(unlist(lapply(self$`{{{baseName}}}`, function(x) jsonlite::toJSON(x$toJSON(), auto_unbox=TRUE, digits = NA))), collapse=",") + paste(sapply(self$`{{{baseName}}}`, function(x) jsonlite::toJSON(x$toJSON(), auto_unbox=TRUE, digits = NA)), collapse=",") {{/isPrimitiveType}} {{/isListContainer}} - {{^isListContainer}} + {{#isMapContainer}} + {{#isPrimitiveType}} + jsonlite::toJSON(lapply(self$`{{{baseName}}}`, function(x){ x }), auto_unbox = TRUE, digits=NA) + {{/isPrimitiveType}} + {{^isPrimitiveType}} + jsonlite::toJSON(lapply(self$`{{{baseName}}}`, function(x){ x$toJSON() }), auto_unbox = TRUE, digits=NA) + {{/isPrimitiveType}} + {{/isMapContainer}} + {{/isContainer}} + {{^isContainer}} {{#isPrimitiveType}} self$`{{baseName}}` {{/isPrimitiveType}} {{^isPrimitiveType}} jsonlite::toJSON(self$`{{baseName}}`$toJSON(), auto_unbox=TRUE, digits = NA) {{/isPrimitiveType}} - {{/isListContainer}} + {{/isContainer}} )}{{#hasMore}},{{/hasMore}} - {{/vars}} + {{/vars}} ) jsoncontent <- paste(jsoncontent, collapse = ",") paste('{', jsoncontent, '}', sep = "") From 506b76bf7137bff250df0d96661d947feef9a7a9 Mon Sep 17 00:00:00 2001 From: Veda Bhaskara Ramanth Addala Date: Mon, 2 Sep 2019 11:32:36 +0530 Subject: [PATCH 2/3] fix(r): add petsore generated classes --- samples/client/petstore/R/R/pet.R | 4 ++-- samples/client/petstore/R/R/pet_api.R | 32 ++++++++++++++++++------- samples/client/petstore/R/R/store_api.R | 16 +++++++++---- samples/client/petstore/R/R/user_api.R | 32 ++++++++++++++++++------- 4 files changed, 62 insertions(+), 22 deletions(-) diff --git a/samples/client/petstore/R/R/pet.R b/samples/client/petstore/R/R/pet.R index fd38160a957a..1b2f6161dd8c 100644 --- a/samples/client/petstore/R/R/pet.R +++ b/samples/client/petstore/R/R/pet.R @@ -84,7 +84,7 @@ Pet <- R6::R6Class( } if (!is.null(self$`tags`)) { PetObject[['tags']] <- - sapply(self$`tags`, function(x) x$toJSON()) + lapply(self$`tags`, function(x) x$toJSON()) } if (!is.null(self$`status`)) { PetObject[['status']] <- @@ -151,7 +151,7 @@ Pet <- R6::R6Class( '"tags": [%s] ', - paste(unlist(lapply(self$`tags`, function(x) jsonlite::toJSON(x$toJSON(), auto_unbox=TRUE, digits = NA))), collapse=",") + paste(sapply(self$`tags`, function(x) jsonlite::toJSON(x$toJSON(), auto_unbox=TRUE, digits = NA)), collapse=",") )}, if (!is.null(self$`status`)) { sprintf( diff --git a/samples/client/petstore/R/R/pet_api.R b/samples/client/petstore/R/R/pet_api.R index 7b653e00c9bb..019db52dd404 100644 --- a/samples/client/petstore/R/R/pet_api.R +++ b/samples/client/petstore/R/R/pet_api.R @@ -336,7 +336,9 @@ PetApi <- R6::R6Class( resp <- apiResponse$response if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { apiResponse$content - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + apiResponse + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { apiResponse } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { apiResponse @@ -384,7 +386,9 @@ PetApi <- R6::R6Class( resp <- apiResponse$response if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { apiResponse$content - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + apiResponse + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { apiResponse } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { apiResponse @@ -432,7 +436,9 @@ PetApi <- R6::R6Class( resp <- apiResponse$response if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { apiResponse$content - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + apiResponse + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { apiResponse } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { apiResponse @@ -482,7 +488,9 @@ PetApi <- R6::R6Class( resp <- apiResponse$response if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { apiResponse$content - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + apiResponse + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { apiResponse } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { apiResponse @@ -532,7 +540,9 @@ PetApi <- R6::R6Class( resp <- apiResponse$response if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { apiResponse$content - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + apiResponse + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { apiResponse } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { apiResponse @@ -586,7 +596,9 @@ PetApi <- R6::R6Class( resp <- apiResponse$response if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { apiResponse$content - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + apiResponse + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { apiResponse } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { apiResponse @@ -634,7 +646,9 @@ PetApi <- R6::R6Class( resp <- apiResponse$response if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { apiResponse$content - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + apiResponse + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { apiResponse } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { apiResponse @@ -685,7 +699,9 @@ PetApi <- R6::R6Class( resp <- apiResponse$response if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { apiResponse$content - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + apiResponse + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { apiResponse } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { apiResponse diff --git a/samples/client/petstore/R/R/store_api.R b/samples/client/petstore/R/R/store_api.R index e15d156052c6..2259a29b6c56 100644 --- a/samples/client/petstore/R/R/store_api.R +++ b/samples/client/petstore/R/R/store_api.R @@ -179,7 +179,9 @@ StoreApi <- R6::R6Class( resp <- apiResponse$response if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { apiResponse$content - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + apiResponse + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { apiResponse } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { apiResponse @@ -223,7 +225,9 @@ StoreApi <- R6::R6Class( resp <- apiResponse$response if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { apiResponse$content - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + apiResponse + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { apiResponse } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { apiResponse @@ -269,7 +273,9 @@ StoreApi <- R6::R6Class( resp <- apiResponse$response if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { apiResponse$content - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + apiResponse + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { apiResponse } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { apiResponse @@ -319,7 +325,9 @@ StoreApi <- R6::R6Class( resp <- apiResponse$response if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { apiResponse$content - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + apiResponse + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { apiResponse } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { apiResponse diff --git a/samples/client/petstore/R/R/user_api.R b/samples/client/petstore/R/R/user_api.R index f6a685f4de86..0f14318b0a3c 100644 --- a/samples/client/petstore/R/R/user_api.R +++ b/samples/client/petstore/R/R/user_api.R @@ -296,7 +296,9 @@ UserApi <- R6::R6Class( resp <- apiResponse$response if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { apiResponse$content - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + apiResponse + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { apiResponse } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { apiResponse @@ -342,7 +344,9 @@ UserApi <- R6::R6Class( resp <- apiResponse$response if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { apiResponse$content - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + apiResponse + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { apiResponse } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { apiResponse @@ -389,7 +393,9 @@ UserApi <- R6::R6Class( resp <- apiResponse$response if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { apiResponse$content - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + apiResponse + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { apiResponse } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { apiResponse @@ -436,7 +442,9 @@ UserApi <- R6::R6Class( resp <- apiResponse$response if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { apiResponse$content - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + apiResponse + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { apiResponse } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { apiResponse @@ -480,7 +488,9 @@ UserApi <- R6::R6Class( resp <- apiResponse$response if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { apiResponse$content - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + apiResponse + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { apiResponse } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { apiResponse @@ -530,7 +540,9 @@ UserApi <- R6::R6Class( resp <- apiResponse$response if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { apiResponse$content - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + apiResponse + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { apiResponse } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { apiResponse @@ -584,7 +596,9 @@ UserApi <- R6::R6Class( resp <- apiResponse$response if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { apiResponse$content - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + apiResponse + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { apiResponse } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { apiResponse @@ -620,7 +634,9 @@ UserApi <- R6::R6Class( resp <- apiResponse$response if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { apiResponse$content - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + apiResponse + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { apiResponse } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { apiResponse From 95778fb634e5c302bd8ac793e5861b53b7efa809 Mon Sep 17 00:00:00 2001 From: Veda Bhaskara Ramanth Addala Date: Mon, 2 Sep 2019 11:54:36 +0530 Subject: [PATCH 3/3] fix(r): indendation fixes --- .../src/main/resources/r/api.mustache | 4 +-- samples/client/petstore/R/R/pet_api.R | 32 +++++++++---------- samples/client/petstore/R/R/store_api.R | 16 +++++----- samples/client/petstore/R/R/user_api.R | 32 +++++++++---------- 4 files changed, 42 insertions(+), 42 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/r/api.mustache b/modules/openapi-generator/src/main/resources/r/api.mustache index 02c0190c63e3..0fc38a78916b 100644 --- a/modules/openapi-generator/src/main/resources/r/api.mustache +++ b/modules/openapi-generator/src/main/resources/r/api.mustache @@ -164,9 +164,9 @@ resp <- apiResponse$response if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { apiResponse$content - } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { apiResponse - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { apiResponse } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { apiResponse diff --git a/samples/client/petstore/R/R/pet_api.R b/samples/client/petstore/R/R/pet_api.R index 019db52dd404..7b038534f040 100644 --- a/samples/client/petstore/R/R/pet_api.R +++ b/samples/client/petstore/R/R/pet_api.R @@ -336,9 +336,9 @@ PetApi <- R6::R6Class( resp <- apiResponse$response if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { apiResponse$content - } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { apiResponse - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { apiResponse } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { apiResponse @@ -386,9 +386,9 @@ PetApi <- R6::R6Class( resp <- apiResponse$response if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { apiResponse$content - } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { apiResponse - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { apiResponse } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { apiResponse @@ -436,9 +436,9 @@ PetApi <- R6::R6Class( resp <- apiResponse$response if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { apiResponse$content - } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { apiResponse - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { apiResponse } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { apiResponse @@ -488,9 +488,9 @@ PetApi <- R6::R6Class( resp <- apiResponse$response if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { apiResponse$content - } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { apiResponse - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { apiResponse } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { apiResponse @@ -540,9 +540,9 @@ PetApi <- R6::R6Class( resp <- apiResponse$response if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { apiResponse$content - } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { apiResponse - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { apiResponse } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { apiResponse @@ -596,9 +596,9 @@ PetApi <- R6::R6Class( resp <- apiResponse$response if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { apiResponse$content - } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { apiResponse - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { apiResponse } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { apiResponse @@ -646,9 +646,9 @@ PetApi <- R6::R6Class( resp <- apiResponse$response if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { apiResponse$content - } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { apiResponse - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { apiResponse } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { apiResponse @@ -699,9 +699,9 @@ PetApi <- R6::R6Class( resp <- apiResponse$response if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { apiResponse$content - } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { apiResponse - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { apiResponse } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { apiResponse diff --git a/samples/client/petstore/R/R/store_api.R b/samples/client/petstore/R/R/store_api.R index 2259a29b6c56..d46e165c71bd 100644 --- a/samples/client/petstore/R/R/store_api.R +++ b/samples/client/petstore/R/R/store_api.R @@ -179,9 +179,9 @@ StoreApi <- R6::R6Class( resp <- apiResponse$response if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { apiResponse$content - } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { apiResponse - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { apiResponse } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { apiResponse @@ -225,9 +225,9 @@ StoreApi <- R6::R6Class( resp <- apiResponse$response if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { apiResponse$content - } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { apiResponse - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { apiResponse } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { apiResponse @@ -273,9 +273,9 @@ StoreApi <- R6::R6Class( resp <- apiResponse$response if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { apiResponse$content - } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { apiResponse - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { apiResponse } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { apiResponse @@ -325,9 +325,9 @@ StoreApi <- R6::R6Class( resp <- apiResponse$response if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { apiResponse$content - } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { apiResponse - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { apiResponse } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { apiResponse diff --git a/samples/client/petstore/R/R/user_api.R b/samples/client/petstore/R/R/user_api.R index 0f14318b0a3c..8eb742c60365 100644 --- a/samples/client/petstore/R/R/user_api.R +++ b/samples/client/petstore/R/R/user_api.R @@ -296,9 +296,9 @@ UserApi <- R6::R6Class( resp <- apiResponse$response if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { apiResponse$content - } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { apiResponse - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { apiResponse } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { apiResponse @@ -344,9 +344,9 @@ UserApi <- R6::R6Class( resp <- apiResponse$response if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { apiResponse$content - } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { apiResponse - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { apiResponse } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { apiResponse @@ -393,9 +393,9 @@ UserApi <- R6::R6Class( resp <- apiResponse$response if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { apiResponse$content - } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { apiResponse - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { apiResponse } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { apiResponse @@ -442,9 +442,9 @@ UserApi <- R6::R6Class( resp <- apiResponse$response if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { apiResponse$content - } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { apiResponse - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { apiResponse } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { apiResponse @@ -488,9 +488,9 @@ UserApi <- R6::R6Class( resp <- apiResponse$response if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { apiResponse$content - } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { apiResponse - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { apiResponse } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { apiResponse @@ -540,9 +540,9 @@ UserApi <- R6::R6Class( resp <- apiResponse$response if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { apiResponse$content - } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { apiResponse - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { apiResponse } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { apiResponse @@ -596,9 +596,9 @@ UserApi <- R6::R6Class( resp <- apiResponse$response if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { apiResponse$content - } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { apiResponse - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { apiResponse } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { apiResponse @@ -634,9 +634,9 @@ UserApi <- R6::R6Class( resp <- apiResponse$response if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { apiResponse$content - } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { apiResponse - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { apiResponse } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { apiResponse