From 12e76ec14f827cc126acca22203eb4d382402e7d Mon Sep 17 00:00:00 2001 From: Antoine Vandecreme Date: Thu, 16 Feb 2023 09:02:03 +0100 Subject: [PATCH] Fix escaping in R (#14572) --- .../src/main/resources/r/modelAnyOf.mustache | 12 +++++----- .../main/resources/r/modelGeneric.mustache | 8 +++---- .../src/main/resources/r/modelOneOf.mustache | 12 +++++----- .../petstore/R-httr2-wrapper/R/any_of_pig.R | 24 +++++++++---------- .../R/any_of_primitive_type_test.R | 12 +++++----- .../petstore/R-httr2-wrapper/R/mammal.R | 24 +++++++++---------- .../R-httr2-wrapper/R/nested_one_of.R | 8 +++---- .../R/one_of_primitive_type_test.R | 12 +++++----- .../client/petstore/R-httr2-wrapper/R/pet.R | 8 +++---- .../client/petstore/R-httr2-wrapper/R/pig.R | 24 +++++++++---------- .../R-httr2-wrapper/R/update_pet_request.R | 8 +++---- .../client/petstore/R-httr2/R/any_of_pig.R | 24 +++++++++---------- .../R-httr2/R/any_of_primitive_type_test.R | 12 +++++----- samples/client/petstore/R-httr2/R/mammal.R | 24 +++++++++---------- .../client/petstore/R-httr2/R/nested_one_of.R | 8 +++---- .../R-httr2/R/one_of_primitive_type_test.R | 12 +++++----- samples/client/petstore/R-httr2/R/pet.R | 8 +++---- samples/client/petstore/R-httr2/R/pig.R | 24 +++++++++---------- .../petstore/R-httr2/R/update_pet_request.R | 8 +++---- samples/client/petstore/R/R/any_of_pig.R | 24 +++++++++---------- .../petstore/R/R/any_of_primitive_type_test.R | 12 +++++----- samples/client/petstore/R/R/mammal.R | 24 +++++++++---------- samples/client/petstore/R/R/nested_one_of.R | 8 +++---- .../petstore/R/R/one_of_primitive_type_test.R | 12 +++++----- samples/client/petstore/R/R/pet.R | 8 +++---- samples/client/petstore/R/R/pig.R | 24 +++++++++---------- .../client/petstore/R/R/update_pet_request.R | 8 +++---- 27 files changed, 196 insertions(+), 196 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/r/modelAnyOf.mustache b/modules/openapi-generator/src/main/resources/r/modelAnyOf.mustache index f16a9cd2d1b..3c8e5d74147 100644 --- a/modules/openapi-generator/src/main/resources/r/modelAnyOf.mustache +++ b/modules/openapi-generator/src/main/resources/r/modelAnyOf.mustache @@ -60,7 +60,7 @@ {{#composedSchemas.anyOf}} {{^isNull}} - {{{dataType}}}_result <- tryCatch({ + `{{{dataType}}}_result` <- tryCatch({ {{#isPrimitiveType}} instance <- jsonlite::fromJSON(input, simplifyVector = FALSE) if (typeof(instance) != "{{{dataType}}}") { @@ -68,18 +68,18 @@ } {{/isPrimitiveType}} {{^isPrimitiveType}} - {{{dataType}}}$public_methods$validateJSON(input) - {{{dataType}}}_instance <- {{{dataType}}}$new() + `{{{dataType}}}`$public_methods$validateJSON(input) + `{{{dataType}}}_instance` <- `{{{dataType}}}`$new() {{/isPrimitiveType}} - self$actual_instance <- {{{dataType}}}_instance$fromJSON(input) + self$actual_instance <- `{{{dataType}}}_instance`$fromJSON(input) self$actual_type <- "{{{dataType}}}" return(self) }, error = function(err) err ) - if (!is.null({{{dataType}}}_result["error"])) { - error_messages <- append(error_messages, {{{dataType}}}_result["message"]) + if (!is.null(`{{{dataType}}}_result`["error"])) { + error_messages <- append(error_messages, `{{{dataType}}}_result`["message"]) } {{/isNull}} diff --git a/modules/openapi-generator/src/main/resources/r/modelGeneric.mustache b/modules/openapi-generator/src/main/resources/r/modelGeneric.mustache index 6d404195a03..f967537e294 100644 --- a/modules/openapi-generator/src/main/resources/r/modelGeneric.mustache +++ b/modules/openapi-generator/src/main/resources/r/modelGeneric.mustache @@ -289,9 +289,9 @@ self$`{{name}}` <- this_object$`{{baseName}}` {{/isPrimitiveType}} {{^isPrimitiveType}} - {{#lambda.lowercase}}{{{name}}}{{/lambda.lowercase}}_object <- {{dataType}}$new() - {{#lambda.lowercase}}{{{name}}}{{/lambda.lowercase}}_object$fromJSON(jsonlite::toJSON(this_object${{baseName}}, auto_unbox = TRUE, digits = NA)) - self$`{{name}}` <- {{#lambda.lowercase}}{{{name}}}{{/lambda.lowercase}}_object + `{{#lambda.lowercase}}{{{name}}}{{/lambda.lowercase}}_object` <- {{dataType}}$new() + `{{#lambda.lowercase}}{{{name}}}{{/lambda.lowercase}}_object`$fromJSON(jsonlite::toJSON(this_object$`{{baseName}}`, auto_unbox = TRUE, digits = NA)) + self$`{{name}}` <- `{{#lambda.lowercase}}{{{name}}}{{/lambda.lowercase}}_object` {{/isPrimitiveType}} {{/isContainer}} } @@ -421,7 +421,7 @@ self$`{{name}}` <- this_object$`{{name}}` {{/isPrimitiveType}} {{^isPrimitiveType}} - self$`{{name}}` <- {{dataType}}$new()$fromJSON(jsonlite::toJSON(this_object${{name}}, auto_unbox = TRUE, digits = NA)) + self$`{{name}}` <- {{dataType}}$new()$fromJSON(jsonlite::toJSON(this_object$`{{name}}`, auto_unbox = TRUE, digits = NA)) {{/isPrimitiveType}} {{/isContainer}} {{/vars}} diff --git a/modules/openapi-generator/src/main/resources/r/modelOneOf.mustache b/modules/openapi-generator/src/main/resources/r/modelOneOf.mustache index f692ca1288b..4c70d776623 100644 --- a/modules/openapi-generator/src/main/resources/r/modelOneOf.mustache +++ b/modules/openapi-generator/src/main/resources/r/modelOneOf.mustache @@ -99,7 +99,7 @@ {{/useOneOfDiscriminatorLookup}} {{#composedSchemas.oneOf}} {{^isNull}} - {{{dataType}}}_result <- tryCatch({ + `{{{dataType}}}_result` <- tryCatch({ {{#isPrimitiveType}} instance <- jsonlite::fromJSON(input, simplifyVector = FALSE) if (typeof(instance) != "{{{dataType}}}") { @@ -107,9 +107,9 @@ } {{/isPrimitiveType}} {{^isPrimitiveType}} - {{{dataType}}}$public_methods$validateJSON(input) - {{{dataType}}}_instance <- {{{dataType}}}$new() - instance <- {{{dataType}}}_instance$fromJSON(input) + `{{{dataType}}}`$public_methods$validateJSON(input) + `{{{dataType}}}_instance` <- `{{{dataType}}}`$new() + instance <- `{{{dataType}}}_instance`$fromJSON(input) {{/isPrimitiveType}} instance_type <- "{{{dataType}}}" matched_schemas <- append(matched_schemas, "{{{dataType}}}") @@ -118,8 +118,8 @@ error = function(err) err ) - if (!is.null({{{dataType}}}_result["error"])) { - error_messages <- append(error_messages, {{{dataType}}}_result["message"]) + if (!is.null(`{{{dataType}}}_result`["error"])) { + error_messages <- append(error_messages, `{{{dataType}}}_result`["message"]) } {{/isNull}} diff --git a/samples/client/petstore/R-httr2-wrapper/R/any_of_pig.R b/samples/client/petstore/R-httr2-wrapper/R/any_of_pig.R index 34736dc7f38..53213832fc9 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/any_of_pig.R +++ b/samples/client/petstore/R-httr2-wrapper/R/any_of_pig.R @@ -61,32 +61,32 @@ AnyOfPig <- R6::R6Class( fromJSON = function(input) { error_messages <- list() - BasquePig_result <- tryCatch({ - BasquePig$public_methods$validateJSON(input) - BasquePig_instance <- BasquePig$new() - self$actual_instance <- BasquePig_instance$fromJSON(input) + `BasquePig_result` <- tryCatch({ + `BasquePig`$public_methods$validateJSON(input) + `BasquePig_instance` <- `BasquePig`$new() + self$actual_instance <- `BasquePig_instance`$fromJSON(input) self$actual_type <- "BasquePig" return(self) }, error = function(err) err ) - if (!is.null(BasquePig_result["error"])) { - error_messages <- append(error_messages, BasquePig_result["message"]) + if (!is.null(`BasquePig_result`["error"])) { + error_messages <- append(error_messages, `BasquePig_result`["message"]) } - DanishPig_result <- tryCatch({ - DanishPig$public_methods$validateJSON(input) - DanishPig_instance <- DanishPig$new() - self$actual_instance <- DanishPig_instance$fromJSON(input) + `DanishPig_result` <- tryCatch({ + `DanishPig`$public_methods$validateJSON(input) + `DanishPig_instance` <- `DanishPig`$new() + self$actual_instance <- `DanishPig_instance`$fromJSON(input) self$actual_type <- "DanishPig" return(self) }, error = function(err) err ) - if (!is.null(DanishPig_result["error"])) { - error_messages <- append(error_messages, DanishPig_result["message"]) + if (!is.null(`DanishPig_result`["error"])) { + error_messages <- append(error_messages, `DanishPig_result`["message"]) } # no match diff --git a/samples/client/petstore/R-httr2-wrapper/R/any_of_primitive_type_test.R b/samples/client/petstore/R-httr2-wrapper/R/any_of_primitive_type_test.R index c34326a3161..9b8d2a4d15b 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/any_of_primitive_type_test.R +++ b/samples/client/petstore/R-httr2-wrapper/R/any_of_primitive_type_test.R @@ -64,7 +64,7 @@ AnyOfPrimitiveTypeTest <- R6::R6Class( error_messages <- list() instance <- NULL - integer_result <- tryCatch({ + `integer_result` <- tryCatch({ instance <- jsonlite::fromJSON(input, simplifyVector = FALSE) if (typeof(instance) != "integer") { stop(sprintf("Data type doesn't match. Expected: %s. Actual: %s.", "integer", typeof(instance))) @@ -76,11 +76,11 @@ AnyOfPrimitiveTypeTest <- R6::R6Class( error = function(err) err ) - if (!is.null(integer_result["error"])) { - error_messages <- append(error_messages, integer_result["message"]) + if (!is.null(`integer_result`["error"])) { + error_messages <- append(error_messages, `integer_result`["message"]) } - character_result <- tryCatch({ + `character_result` <- tryCatch({ instance <- jsonlite::fromJSON(input, simplifyVector = FALSE) if (typeof(instance) != "character") { stop(sprintf("Data type doesn't match. Expected: %s. Actual: %s.", "character", typeof(instance))) @@ -92,8 +92,8 @@ AnyOfPrimitiveTypeTest <- R6::R6Class( error = function(err) err ) - if (!is.null(character_result["error"])) { - error_messages <- append(error_messages, character_result["message"]) + if (!is.null(`character_result`["error"])) { + error_messages <- append(error_messages, `character_result`["message"]) } if (matched == 1) { diff --git a/samples/client/petstore/R-httr2-wrapper/R/mammal.R b/samples/client/petstore/R-httr2-wrapper/R/mammal.R index b96d79926ca..cfefc92a83f 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/mammal.R +++ b/samples/client/petstore/R-httr2-wrapper/R/mammal.R @@ -90,10 +90,10 @@ Mammal <- R6::R6Class( error_messages <- append(error_messages, sprintf("Failed to lookup discriminator value for Mammal. Error message: %s. JSON input: %s", oneof_lookup_result["message"], input)) } - Whale_result <- tryCatch({ - Whale$public_methods$validateJSON(input) - Whale_instance <- Whale$new() - instance <- Whale_instance$fromJSON(input) + `Whale_result` <- tryCatch({ + `Whale`$public_methods$validateJSON(input) + `Whale_instance` <- `Whale`$new() + instance <- `Whale_instance`$fromJSON(input) instance_type <- "Whale" matched_schemas <- append(matched_schemas, "Whale") matched <- matched + 1 @@ -101,14 +101,14 @@ Mammal <- R6::R6Class( error = function(err) err ) - if (!is.null(Whale_result["error"])) { - error_messages <- append(error_messages, Whale_result["message"]) + if (!is.null(`Whale_result`["error"])) { + error_messages <- append(error_messages, `Whale_result`["message"]) } - Zebra_result <- tryCatch({ - Zebra$public_methods$validateJSON(input) - Zebra_instance <- Zebra$new() - instance <- Zebra_instance$fromJSON(input) + `Zebra_result` <- tryCatch({ + `Zebra`$public_methods$validateJSON(input) + `Zebra_instance` <- `Zebra`$new() + instance <- `Zebra_instance`$fromJSON(input) instance_type <- "Zebra" matched_schemas <- append(matched_schemas, "Zebra") matched <- matched + 1 @@ -116,8 +116,8 @@ Mammal <- R6::R6Class( error = function(err) err ) - if (!is.null(Zebra_result["error"])) { - error_messages <- append(error_messages, Zebra_result["message"]) + if (!is.null(`Zebra_result`["error"])) { + error_messages <- append(error_messages, `Zebra_result`["message"]) } if (matched == 1) { diff --git a/samples/client/petstore/R-httr2-wrapper/R/nested_one_of.R b/samples/client/petstore/R-httr2-wrapper/R/nested_one_of.R index d2a670b4edd..8fbdf43b466 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/nested_one_of.R +++ b/samples/client/petstore/R-httr2-wrapper/R/nested_one_of.R @@ -85,9 +85,9 @@ NestedOneOf <- R6::R6Class( self$`size` <- this_object$`size` } if (!is.null(this_object$`nested_pig`)) { - nested_pig_object <- Pig$new() - nested_pig_object$fromJSON(jsonlite::toJSON(this_object$nested_pig, auto_unbox = TRUE, digits = NA)) - self$`nested_pig` <- nested_pig_object + `nested_pig_object` <- Pig$new() + `nested_pig_object`$fromJSON(jsonlite::toJSON(this_object$`nested_pig`, auto_unbox = TRUE, digits = NA)) + self$`nested_pig` <- `nested_pig_object` } # process additional properties/fields in the payload for (key in names(this_object)) { @@ -143,7 +143,7 @@ NestedOneOf <- R6::R6Class( fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`size` <- this_object$`size` - self$`nested_pig` <- Pig$new()$fromJSON(jsonlite::toJSON(this_object$nested_pig, auto_unbox = TRUE, digits = NA)) + self$`nested_pig` <- Pig$new()$fromJSON(jsonlite::toJSON(this_object$`nested_pig`, auto_unbox = TRUE, digits = NA)) # process additional properties/fields in the payload for (key in names(this_object)) { if (!(key %in% self$`_field_list`)) { # json key not in list of fields diff --git a/samples/client/petstore/R-httr2-wrapper/R/one_of_primitive_type_test.R b/samples/client/petstore/R-httr2-wrapper/R/one_of_primitive_type_test.R index faf3f7850ab..da4d226dd3b 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/one_of_primitive_type_test.R +++ b/samples/client/petstore/R-httr2-wrapper/R/one_of_primitive_type_test.R @@ -64,7 +64,7 @@ OneOfPrimitiveTypeTest <- R6::R6Class( error_messages <- list() instance <- NULL - integer_result <- tryCatch({ + `integer_result` <- tryCatch({ instance <- jsonlite::fromJSON(input, simplifyVector = FALSE) if (typeof(instance) != "integer") { stop(sprintf("Data type doesn't match. Expected: %s. Actual: %s.", "integer", typeof(instance))) @@ -76,11 +76,11 @@ OneOfPrimitiveTypeTest <- R6::R6Class( error = function(err) err ) - if (!is.null(integer_result["error"])) { - error_messages <- append(error_messages, integer_result["message"]) + if (!is.null(`integer_result`["error"])) { + error_messages <- append(error_messages, `integer_result`["message"]) } - character_result <- tryCatch({ + `character_result` <- tryCatch({ instance <- jsonlite::fromJSON(input, simplifyVector = FALSE) if (typeof(instance) != "character") { stop(sprintf("Data type doesn't match. Expected: %s. Actual: %s.", "character", typeof(instance))) @@ -92,8 +92,8 @@ OneOfPrimitiveTypeTest <- R6::R6Class( error = function(err) err ) - if (!is.null(character_result["error"])) { - error_messages <- append(error_messages, character_result["message"]) + if (!is.null(`character_result`["error"])) { + error_messages <- append(error_messages, `character_result`["message"]) } if (matched == 1) { diff --git a/samples/client/petstore/R-httr2-wrapper/R/pet.R b/samples/client/petstore/R-httr2-wrapper/R/pet.R index 42db1ecb885..ea3b23ce968 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/pet.R +++ b/samples/client/petstore/R-httr2-wrapper/R/pet.R @@ -138,9 +138,9 @@ Pet <- R6::R6Class( self$`id` <- this_object$`id` } if (!is.null(this_object$`category`)) { - category_object <- Category$new() - category_object$fromJSON(jsonlite::toJSON(this_object$category, auto_unbox = TRUE, digits = NA)) - self$`category` <- category_object + `category_object` <- Category$new() + `category_object`$fromJSON(jsonlite::toJSON(this_object$`category`, auto_unbox = TRUE, digits = NA)) + self$`category` <- `category_object` } if (!is.null(this_object$`name`)) { self$`name` <- this_object$`name` @@ -243,7 +243,7 @@ Pet <- R6::R6Class( fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`id` <- this_object$`id` - self$`category` <- Category$new()$fromJSON(jsonlite::toJSON(this_object$category, auto_unbox = TRUE, digits = NA)) + self$`category` <- Category$new()$fromJSON(jsonlite::toJSON(this_object$`category`, auto_unbox = TRUE, digits = NA)) self$`name` <- this_object$`name` self$`photoUrls` <- ApiClient$new()$deserializeObj(this_object$`photoUrls`, "array[character]", loadNamespace("petstore")) self$`tags` <- ApiClient$new()$deserializeObj(this_object$`tags`, "array[Tag]", loadNamespace("petstore")) diff --git a/samples/client/petstore/R-httr2-wrapper/R/pig.R b/samples/client/petstore/R-httr2-wrapper/R/pig.R index a7139f4795b..e44ae074ecc 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/pig.R +++ b/samples/client/petstore/R-httr2-wrapper/R/pig.R @@ -90,10 +90,10 @@ Pig <- R6::R6Class( error_messages <- append(error_messages, sprintf("Failed to lookup discriminator value for Pig. Error message: %s. JSON input: %s", oneof_lookup_result["message"], input)) } - BasquePig_result <- tryCatch({ - BasquePig$public_methods$validateJSON(input) - BasquePig_instance <- BasquePig$new() - instance <- BasquePig_instance$fromJSON(input) + `BasquePig_result` <- tryCatch({ + `BasquePig`$public_methods$validateJSON(input) + `BasquePig_instance` <- `BasquePig`$new() + instance <- `BasquePig_instance`$fromJSON(input) instance_type <- "BasquePig" matched_schemas <- append(matched_schemas, "BasquePig") matched <- matched + 1 @@ -101,14 +101,14 @@ Pig <- R6::R6Class( error = function(err) err ) - if (!is.null(BasquePig_result["error"])) { - error_messages <- append(error_messages, BasquePig_result["message"]) + if (!is.null(`BasquePig_result`["error"])) { + error_messages <- append(error_messages, `BasquePig_result`["message"]) } - DanishPig_result <- tryCatch({ - DanishPig$public_methods$validateJSON(input) - DanishPig_instance <- DanishPig$new() - instance <- DanishPig_instance$fromJSON(input) + `DanishPig_result` <- tryCatch({ + `DanishPig`$public_methods$validateJSON(input) + `DanishPig_instance` <- `DanishPig`$new() + instance <- `DanishPig_instance`$fromJSON(input) instance_type <- "DanishPig" matched_schemas <- append(matched_schemas, "DanishPig") matched <- matched + 1 @@ -116,8 +116,8 @@ Pig <- R6::R6Class( error = function(err) err ) - if (!is.null(DanishPig_result["error"])) { - error_messages <- append(error_messages, DanishPig_result["message"]) + if (!is.null(`DanishPig_result`["error"])) { + error_messages <- append(error_messages, `DanishPig_result`["message"]) } if (matched == 1) { diff --git a/samples/client/petstore/R-httr2-wrapper/R/update_pet_request.R b/samples/client/petstore/R-httr2-wrapper/R/update_pet_request.R index 2fc96ab4fff..c29abc945ab 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/update_pet_request.R +++ b/samples/client/petstore/R-httr2-wrapper/R/update_pet_request.R @@ -79,9 +79,9 @@ UpdatePetRequest <- R6::R6Class( fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`jsonData`)) { - jsondata_object <- Pet$new() - jsondata_object$fromJSON(jsonlite::toJSON(this_object$jsonData, auto_unbox = TRUE, digits = NA)) - self$`jsonData` <- jsondata_object + `jsondata_object` <- Pet$new() + `jsondata_object`$fromJSON(jsonlite::toJSON(this_object$`jsonData`, auto_unbox = TRUE, digits = NA)) + self$`jsonData` <- `jsondata_object` } if (!is.null(this_object$`binaryDataN2Information`)) { self$`binaryDataN2Information` <- this_object$`binaryDataN2Information` @@ -139,7 +139,7 @@ UpdatePetRequest <- R6::R6Class( #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) - self$`jsonData` <- Pet$new()$fromJSON(jsonlite::toJSON(this_object$jsonData, auto_unbox = TRUE, digits = NA)) + self$`jsonData` <- Pet$new()$fromJSON(jsonlite::toJSON(this_object$`jsonData`, auto_unbox = TRUE, digits = NA)) self$`binaryDataN2Information` <- this_object$`binaryDataN2Information` # process additional properties/fields in the payload for (key in names(this_object)) { diff --git a/samples/client/petstore/R-httr2/R/any_of_pig.R b/samples/client/petstore/R-httr2/R/any_of_pig.R index 34736dc7f38..53213832fc9 100644 --- a/samples/client/petstore/R-httr2/R/any_of_pig.R +++ b/samples/client/petstore/R-httr2/R/any_of_pig.R @@ -61,32 +61,32 @@ AnyOfPig <- R6::R6Class( fromJSON = function(input) { error_messages <- list() - BasquePig_result <- tryCatch({ - BasquePig$public_methods$validateJSON(input) - BasquePig_instance <- BasquePig$new() - self$actual_instance <- BasquePig_instance$fromJSON(input) + `BasquePig_result` <- tryCatch({ + `BasquePig`$public_methods$validateJSON(input) + `BasquePig_instance` <- `BasquePig`$new() + self$actual_instance <- `BasquePig_instance`$fromJSON(input) self$actual_type <- "BasquePig" return(self) }, error = function(err) err ) - if (!is.null(BasquePig_result["error"])) { - error_messages <- append(error_messages, BasquePig_result["message"]) + if (!is.null(`BasquePig_result`["error"])) { + error_messages <- append(error_messages, `BasquePig_result`["message"]) } - DanishPig_result <- tryCatch({ - DanishPig$public_methods$validateJSON(input) - DanishPig_instance <- DanishPig$new() - self$actual_instance <- DanishPig_instance$fromJSON(input) + `DanishPig_result` <- tryCatch({ + `DanishPig`$public_methods$validateJSON(input) + `DanishPig_instance` <- `DanishPig`$new() + self$actual_instance <- `DanishPig_instance`$fromJSON(input) self$actual_type <- "DanishPig" return(self) }, error = function(err) err ) - if (!is.null(DanishPig_result["error"])) { - error_messages <- append(error_messages, DanishPig_result["message"]) + if (!is.null(`DanishPig_result`["error"])) { + error_messages <- append(error_messages, `DanishPig_result`["message"]) } # no match diff --git a/samples/client/petstore/R-httr2/R/any_of_primitive_type_test.R b/samples/client/petstore/R-httr2/R/any_of_primitive_type_test.R index c34326a3161..9b8d2a4d15b 100644 --- a/samples/client/petstore/R-httr2/R/any_of_primitive_type_test.R +++ b/samples/client/petstore/R-httr2/R/any_of_primitive_type_test.R @@ -64,7 +64,7 @@ AnyOfPrimitiveTypeTest <- R6::R6Class( error_messages <- list() instance <- NULL - integer_result <- tryCatch({ + `integer_result` <- tryCatch({ instance <- jsonlite::fromJSON(input, simplifyVector = FALSE) if (typeof(instance) != "integer") { stop(sprintf("Data type doesn't match. Expected: %s. Actual: %s.", "integer", typeof(instance))) @@ -76,11 +76,11 @@ AnyOfPrimitiveTypeTest <- R6::R6Class( error = function(err) err ) - if (!is.null(integer_result["error"])) { - error_messages <- append(error_messages, integer_result["message"]) + if (!is.null(`integer_result`["error"])) { + error_messages <- append(error_messages, `integer_result`["message"]) } - character_result <- tryCatch({ + `character_result` <- tryCatch({ instance <- jsonlite::fromJSON(input, simplifyVector = FALSE) if (typeof(instance) != "character") { stop(sprintf("Data type doesn't match. Expected: %s. Actual: %s.", "character", typeof(instance))) @@ -92,8 +92,8 @@ AnyOfPrimitiveTypeTest <- R6::R6Class( error = function(err) err ) - if (!is.null(character_result["error"])) { - error_messages <- append(error_messages, character_result["message"]) + if (!is.null(`character_result`["error"])) { + error_messages <- append(error_messages, `character_result`["message"]) } if (matched == 1) { diff --git a/samples/client/petstore/R-httr2/R/mammal.R b/samples/client/petstore/R-httr2/R/mammal.R index a5af6d76d64..13bb0da875e 100644 --- a/samples/client/petstore/R-httr2/R/mammal.R +++ b/samples/client/petstore/R-httr2/R/mammal.R @@ -64,10 +64,10 @@ Mammal <- R6::R6Class( error_messages <- list() instance <- NULL - Whale_result <- tryCatch({ - Whale$public_methods$validateJSON(input) - Whale_instance <- Whale$new() - instance <- Whale_instance$fromJSON(input) + `Whale_result` <- tryCatch({ + `Whale`$public_methods$validateJSON(input) + `Whale_instance` <- `Whale`$new() + instance <- `Whale_instance`$fromJSON(input) instance_type <- "Whale" matched_schemas <- append(matched_schemas, "Whale") matched <- matched + 1 @@ -75,14 +75,14 @@ Mammal <- R6::R6Class( error = function(err) err ) - if (!is.null(Whale_result["error"])) { - error_messages <- append(error_messages, Whale_result["message"]) + if (!is.null(`Whale_result`["error"])) { + error_messages <- append(error_messages, `Whale_result`["message"]) } - Zebra_result <- tryCatch({ - Zebra$public_methods$validateJSON(input) - Zebra_instance <- Zebra$new() - instance <- Zebra_instance$fromJSON(input) + `Zebra_result` <- tryCatch({ + `Zebra`$public_methods$validateJSON(input) + `Zebra_instance` <- `Zebra`$new() + instance <- `Zebra_instance`$fromJSON(input) instance_type <- "Zebra" matched_schemas <- append(matched_schemas, "Zebra") matched <- matched + 1 @@ -90,8 +90,8 @@ Mammal <- R6::R6Class( error = function(err) err ) - if (!is.null(Zebra_result["error"])) { - error_messages <- append(error_messages, Zebra_result["message"]) + if (!is.null(`Zebra_result`["error"])) { + error_messages <- append(error_messages, `Zebra_result`["message"]) } if (matched == 1) { diff --git a/samples/client/petstore/R-httr2/R/nested_one_of.R b/samples/client/petstore/R-httr2/R/nested_one_of.R index a2c5fc4b83c..a62902ac4fb 100644 --- a/samples/client/petstore/R-httr2/R/nested_one_of.R +++ b/samples/client/petstore/R-httr2/R/nested_one_of.R @@ -71,9 +71,9 @@ NestedOneOf <- R6::R6Class( self$`size` <- this_object$`size` } if (!is.null(this_object$`nested_pig`)) { - nested_pig_object <- Pig$new() - nested_pig_object$fromJSON(jsonlite::toJSON(this_object$nested_pig, auto_unbox = TRUE, digits = NA)) - self$`nested_pig` <- nested_pig_object + `nested_pig_object` <- Pig$new() + `nested_pig_object`$fromJSON(jsonlite::toJSON(this_object$`nested_pig`, auto_unbox = TRUE, digits = NA)) + self$`nested_pig` <- `nested_pig_object` } self }, @@ -117,7 +117,7 @@ NestedOneOf <- R6::R6Class( fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`size` <- this_object$`size` - self$`nested_pig` <- Pig$new()$fromJSON(jsonlite::toJSON(this_object$nested_pig, auto_unbox = TRUE, digits = NA)) + self$`nested_pig` <- Pig$new()$fromJSON(jsonlite::toJSON(this_object$`nested_pig`, auto_unbox = TRUE, digits = NA)) self }, #' Validate JSON input with respect to NestedOneOf diff --git a/samples/client/petstore/R-httr2/R/one_of_primitive_type_test.R b/samples/client/petstore/R-httr2/R/one_of_primitive_type_test.R index faf3f7850ab..da4d226dd3b 100644 --- a/samples/client/petstore/R-httr2/R/one_of_primitive_type_test.R +++ b/samples/client/petstore/R-httr2/R/one_of_primitive_type_test.R @@ -64,7 +64,7 @@ OneOfPrimitiveTypeTest <- R6::R6Class( error_messages <- list() instance <- NULL - integer_result <- tryCatch({ + `integer_result` <- tryCatch({ instance <- jsonlite::fromJSON(input, simplifyVector = FALSE) if (typeof(instance) != "integer") { stop(sprintf("Data type doesn't match. Expected: %s. Actual: %s.", "integer", typeof(instance))) @@ -76,11 +76,11 @@ OneOfPrimitiveTypeTest <- R6::R6Class( error = function(err) err ) - if (!is.null(integer_result["error"])) { - error_messages <- append(error_messages, integer_result["message"]) + if (!is.null(`integer_result`["error"])) { + error_messages <- append(error_messages, `integer_result`["message"]) } - character_result <- tryCatch({ + `character_result` <- tryCatch({ instance <- jsonlite::fromJSON(input, simplifyVector = FALSE) if (typeof(instance) != "character") { stop(sprintf("Data type doesn't match. Expected: %s. Actual: %s.", "character", typeof(instance))) @@ -92,8 +92,8 @@ OneOfPrimitiveTypeTest <- R6::R6Class( error = function(err) err ) - if (!is.null(character_result["error"])) { - error_messages <- append(error_messages, character_result["message"]) + if (!is.null(`character_result`["error"])) { + error_messages <- append(error_messages, `character_result`["message"]) } if (matched == 1) { diff --git a/samples/client/petstore/R-httr2/R/pet.R b/samples/client/petstore/R-httr2/R/pet.R index 7070dc689ea..7ce7c633677 100644 --- a/samples/client/petstore/R-httr2/R/pet.R +++ b/samples/client/petstore/R-httr2/R/pet.R @@ -124,9 +124,9 @@ Pet <- R6::R6Class( self$`id` <- this_object$`id` } if (!is.null(this_object$`category`)) { - category_object <- Category$new() - category_object$fromJSON(jsonlite::toJSON(this_object$category, auto_unbox = TRUE, digits = NA)) - self$`category` <- category_object + `category_object` <- Category$new() + `category_object`$fromJSON(jsonlite::toJSON(this_object$`category`, auto_unbox = TRUE, digits = NA)) + self$`category` <- `category_object` } if (!is.null(this_object$`name`)) { self$`name` <- this_object$`name` @@ -217,7 +217,7 @@ Pet <- R6::R6Class( fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`id` <- this_object$`id` - self$`category` <- Category$new()$fromJSON(jsonlite::toJSON(this_object$category, auto_unbox = TRUE, digits = NA)) + self$`category` <- Category$new()$fromJSON(jsonlite::toJSON(this_object$`category`, auto_unbox = TRUE, digits = NA)) self$`name` <- this_object$`name` self$`photoUrls` <- ApiClient$new()$deserializeObj(this_object$`photoUrls`, "array[character]", loadNamespace("petstore")) self$`tags` <- ApiClient$new()$deserializeObj(this_object$`tags`, "array[Tag]", loadNamespace("petstore")) diff --git a/samples/client/petstore/R-httr2/R/pig.R b/samples/client/petstore/R-httr2/R/pig.R index d497bc28039..05bfeebe4ce 100644 --- a/samples/client/petstore/R-httr2/R/pig.R +++ b/samples/client/petstore/R-httr2/R/pig.R @@ -64,10 +64,10 @@ Pig <- R6::R6Class( error_messages <- list() instance <- NULL - BasquePig_result <- tryCatch({ - BasquePig$public_methods$validateJSON(input) - BasquePig_instance <- BasquePig$new() - instance <- BasquePig_instance$fromJSON(input) + `BasquePig_result` <- tryCatch({ + `BasquePig`$public_methods$validateJSON(input) + `BasquePig_instance` <- `BasquePig`$new() + instance <- `BasquePig_instance`$fromJSON(input) instance_type <- "BasquePig" matched_schemas <- append(matched_schemas, "BasquePig") matched <- matched + 1 @@ -75,14 +75,14 @@ Pig <- R6::R6Class( error = function(err) err ) - if (!is.null(BasquePig_result["error"])) { - error_messages <- append(error_messages, BasquePig_result["message"]) + if (!is.null(`BasquePig_result`["error"])) { + error_messages <- append(error_messages, `BasquePig_result`["message"]) } - DanishPig_result <- tryCatch({ - DanishPig$public_methods$validateJSON(input) - DanishPig_instance <- DanishPig$new() - instance <- DanishPig_instance$fromJSON(input) + `DanishPig_result` <- tryCatch({ + `DanishPig`$public_methods$validateJSON(input) + `DanishPig_instance` <- `DanishPig`$new() + instance <- `DanishPig_instance`$fromJSON(input) instance_type <- "DanishPig" matched_schemas <- append(matched_schemas, "DanishPig") matched <- matched + 1 @@ -90,8 +90,8 @@ Pig <- R6::R6Class( error = function(err) err ) - if (!is.null(DanishPig_result["error"])) { - error_messages <- append(error_messages, DanishPig_result["message"]) + if (!is.null(`DanishPig_result`["error"])) { + error_messages <- append(error_messages, `DanishPig_result`["message"]) } if (matched == 1) { diff --git a/samples/client/petstore/R-httr2/R/update_pet_request.R b/samples/client/petstore/R-httr2/R/update_pet_request.R index a2da076f8de..62f5c794883 100644 --- a/samples/client/petstore/R-httr2/R/update_pet_request.R +++ b/samples/client/petstore/R-httr2/R/update_pet_request.R @@ -65,9 +65,9 @@ UpdatePetRequest <- R6::R6Class( fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`jsonData`)) { - jsondata_object <- Pet$new() - jsondata_object$fromJSON(jsonlite::toJSON(this_object$jsonData, auto_unbox = TRUE, digits = NA)) - self$`jsonData` <- jsondata_object + `jsondata_object` <- Pet$new() + `jsondata_object`$fromJSON(jsonlite::toJSON(this_object$`jsonData`, auto_unbox = TRUE, digits = NA)) + self$`jsonData` <- `jsondata_object` } if (!is.null(this_object$`binaryDataN2Information`)) { self$`binaryDataN2Information` <- this_object$`binaryDataN2Information` @@ -113,7 +113,7 @@ UpdatePetRequest <- R6::R6Class( #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) - self$`jsonData` <- Pet$new()$fromJSON(jsonlite::toJSON(this_object$jsonData, auto_unbox = TRUE, digits = NA)) + self$`jsonData` <- Pet$new()$fromJSON(jsonlite::toJSON(this_object$`jsonData`, auto_unbox = TRUE, digits = NA)) self$`binaryDataN2Information` <- this_object$`binaryDataN2Information` self }, diff --git a/samples/client/petstore/R/R/any_of_pig.R b/samples/client/petstore/R/R/any_of_pig.R index 34736dc7f38..53213832fc9 100644 --- a/samples/client/petstore/R/R/any_of_pig.R +++ b/samples/client/petstore/R/R/any_of_pig.R @@ -61,32 +61,32 @@ AnyOfPig <- R6::R6Class( fromJSON = function(input) { error_messages <- list() - BasquePig_result <- tryCatch({ - BasquePig$public_methods$validateJSON(input) - BasquePig_instance <- BasquePig$new() - self$actual_instance <- BasquePig_instance$fromJSON(input) + `BasquePig_result` <- tryCatch({ + `BasquePig`$public_methods$validateJSON(input) + `BasquePig_instance` <- `BasquePig`$new() + self$actual_instance <- `BasquePig_instance`$fromJSON(input) self$actual_type <- "BasquePig" return(self) }, error = function(err) err ) - if (!is.null(BasquePig_result["error"])) { - error_messages <- append(error_messages, BasquePig_result["message"]) + if (!is.null(`BasquePig_result`["error"])) { + error_messages <- append(error_messages, `BasquePig_result`["message"]) } - DanishPig_result <- tryCatch({ - DanishPig$public_methods$validateJSON(input) - DanishPig_instance <- DanishPig$new() - self$actual_instance <- DanishPig_instance$fromJSON(input) + `DanishPig_result` <- tryCatch({ + `DanishPig`$public_methods$validateJSON(input) + `DanishPig_instance` <- `DanishPig`$new() + self$actual_instance <- `DanishPig_instance`$fromJSON(input) self$actual_type <- "DanishPig" return(self) }, error = function(err) err ) - if (!is.null(DanishPig_result["error"])) { - error_messages <- append(error_messages, DanishPig_result["message"]) + if (!is.null(`DanishPig_result`["error"])) { + error_messages <- append(error_messages, `DanishPig_result`["message"]) } # no match diff --git a/samples/client/petstore/R/R/any_of_primitive_type_test.R b/samples/client/petstore/R/R/any_of_primitive_type_test.R index c34326a3161..9b8d2a4d15b 100644 --- a/samples/client/petstore/R/R/any_of_primitive_type_test.R +++ b/samples/client/petstore/R/R/any_of_primitive_type_test.R @@ -64,7 +64,7 @@ AnyOfPrimitiveTypeTest <- R6::R6Class( error_messages <- list() instance <- NULL - integer_result <- tryCatch({ + `integer_result` <- tryCatch({ instance <- jsonlite::fromJSON(input, simplifyVector = FALSE) if (typeof(instance) != "integer") { stop(sprintf("Data type doesn't match. Expected: %s. Actual: %s.", "integer", typeof(instance))) @@ -76,11 +76,11 @@ AnyOfPrimitiveTypeTest <- R6::R6Class( error = function(err) err ) - if (!is.null(integer_result["error"])) { - error_messages <- append(error_messages, integer_result["message"]) + if (!is.null(`integer_result`["error"])) { + error_messages <- append(error_messages, `integer_result`["message"]) } - character_result <- tryCatch({ + `character_result` <- tryCatch({ instance <- jsonlite::fromJSON(input, simplifyVector = FALSE) if (typeof(instance) != "character") { stop(sprintf("Data type doesn't match. Expected: %s. Actual: %s.", "character", typeof(instance))) @@ -92,8 +92,8 @@ AnyOfPrimitiveTypeTest <- R6::R6Class( error = function(err) err ) - if (!is.null(character_result["error"])) { - error_messages <- append(error_messages, character_result["message"]) + if (!is.null(`character_result`["error"])) { + error_messages <- append(error_messages, `character_result`["message"]) } if (matched == 1) { diff --git a/samples/client/petstore/R/R/mammal.R b/samples/client/petstore/R/R/mammal.R index a5af6d76d64..13bb0da875e 100644 --- a/samples/client/petstore/R/R/mammal.R +++ b/samples/client/petstore/R/R/mammal.R @@ -64,10 +64,10 @@ Mammal <- R6::R6Class( error_messages <- list() instance <- NULL - Whale_result <- tryCatch({ - Whale$public_methods$validateJSON(input) - Whale_instance <- Whale$new() - instance <- Whale_instance$fromJSON(input) + `Whale_result` <- tryCatch({ + `Whale`$public_methods$validateJSON(input) + `Whale_instance` <- `Whale`$new() + instance <- `Whale_instance`$fromJSON(input) instance_type <- "Whale" matched_schemas <- append(matched_schemas, "Whale") matched <- matched + 1 @@ -75,14 +75,14 @@ Mammal <- R6::R6Class( error = function(err) err ) - if (!is.null(Whale_result["error"])) { - error_messages <- append(error_messages, Whale_result["message"]) + if (!is.null(`Whale_result`["error"])) { + error_messages <- append(error_messages, `Whale_result`["message"]) } - Zebra_result <- tryCatch({ - Zebra$public_methods$validateJSON(input) - Zebra_instance <- Zebra$new() - instance <- Zebra_instance$fromJSON(input) + `Zebra_result` <- tryCatch({ + `Zebra`$public_methods$validateJSON(input) + `Zebra_instance` <- `Zebra`$new() + instance <- `Zebra_instance`$fromJSON(input) instance_type <- "Zebra" matched_schemas <- append(matched_schemas, "Zebra") matched <- matched + 1 @@ -90,8 +90,8 @@ Mammal <- R6::R6Class( error = function(err) err ) - if (!is.null(Zebra_result["error"])) { - error_messages <- append(error_messages, Zebra_result["message"]) + if (!is.null(`Zebra_result`["error"])) { + error_messages <- append(error_messages, `Zebra_result`["message"]) } if (matched == 1) { diff --git a/samples/client/petstore/R/R/nested_one_of.R b/samples/client/petstore/R/R/nested_one_of.R index d2a670b4edd..8fbdf43b466 100644 --- a/samples/client/petstore/R/R/nested_one_of.R +++ b/samples/client/petstore/R/R/nested_one_of.R @@ -85,9 +85,9 @@ NestedOneOf <- R6::R6Class( self$`size` <- this_object$`size` } if (!is.null(this_object$`nested_pig`)) { - nested_pig_object <- Pig$new() - nested_pig_object$fromJSON(jsonlite::toJSON(this_object$nested_pig, auto_unbox = TRUE, digits = NA)) - self$`nested_pig` <- nested_pig_object + `nested_pig_object` <- Pig$new() + `nested_pig_object`$fromJSON(jsonlite::toJSON(this_object$`nested_pig`, auto_unbox = TRUE, digits = NA)) + self$`nested_pig` <- `nested_pig_object` } # process additional properties/fields in the payload for (key in names(this_object)) { @@ -143,7 +143,7 @@ NestedOneOf <- R6::R6Class( fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`size` <- this_object$`size` - self$`nested_pig` <- Pig$new()$fromJSON(jsonlite::toJSON(this_object$nested_pig, auto_unbox = TRUE, digits = NA)) + self$`nested_pig` <- Pig$new()$fromJSON(jsonlite::toJSON(this_object$`nested_pig`, auto_unbox = TRUE, digits = NA)) # process additional properties/fields in the payload for (key in names(this_object)) { if (!(key %in% self$`_field_list`)) { # json key not in list of fields diff --git a/samples/client/petstore/R/R/one_of_primitive_type_test.R b/samples/client/petstore/R/R/one_of_primitive_type_test.R index faf3f7850ab..da4d226dd3b 100644 --- a/samples/client/petstore/R/R/one_of_primitive_type_test.R +++ b/samples/client/petstore/R/R/one_of_primitive_type_test.R @@ -64,7 +64,7 @@ OneOfPrimitiveTypeTest <- R6::R6Class( error_messages <- list() instance <- NULL - integer_result <- tryCatch({ + `integer_result` <- tryCatch({ instance <- jsonlite::fromJSON(input, simplifyVector = FALSE) if (typeof(instance) != "integer") { stop(sprintf("Data type doesn't match. Expected: %s. Actual: %s.", "integer", typeof(instance))) @@ -76,11 +76,11 @@ OneOfPrimitiveTypeTest <- R6::R6Class( error = function(err) err ) - if (!is.null(integer_result["error"])) { - error_messages <- append(error_messages, integer_result["message"]) + if (!is.null(`integer_result`["error"])) { + error_messages <- append(error_messages, `integer_result`["message"]) } - character_result <- tryCatch({ + `character_result` <- tryCatch({ instance <- jsonlite::fromJSON(input, simplifyVector = FALSE) if (typeof(instance) != "character") { stop(sprintf("Data type doesn't match. Expected: %s. Actual: %s.", "character", typeof(instance))) @@ -92,8 +92,8 @@ OneOfPrimitiveTypeTest <- R6::R6Class( error = function(err) err ) - if (!is.null(character_result["error"])) { - error_messages <- append(error_messages, character_result["message"]) + if (!is.null(`character_result`["error"])) { + error_messages <- append(error_messages, `character_result`["message"]) } if (matched == 1) { diff --git a/samples/client/petstore/R/R/pet.R b/samples/client/petstore/R/R/pet.R index 42db1ecb885..ea3b23ce968 100644 --- a/samples/client/petstore/R/R/pet.R +++ b/samples/client/petstore/R/R/pet.R @@ -138,9 +138,9 @@ Pet <- R6::R6Class( self$`id` <- this_object$`id` } if (!is.null(this_object$`category`)) { - category_object <- Category$new() - category_object$fromJSON(jsonlite::toJSON(this_object$category, auto_unbox = TRUE, digits = NA)) - self$`category` <- category_object + `category_object` <- Category$new() + `category_object`$fromJSON(jsonlite::toJSON(this_object$`category`, auto_unbox = TRUE, digits = NA)) + self$`category` <- `category_object` } if (!is.null(this_object$`name`)) { self$`name` <- this_object$`name` @@ -243,7 +243,7 @@ Pet <- R6::R6Class( fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) self$`id` <- this_object$`id` - self$`category` <- Category$new()$fromJSON(jsonlite::toJSON(this_object$category, auto_unbox = TRUE, digits = NA)) + self$`category` <- Category$new()$fromJSON(jsonlite::toJSON(this_object$`category`, auto_unbox = TRUE, digits = NA)) self$`name` <- this_object$`name` self$`photoUrls` <- ApiClient$new()$deserializeObj(this_object$`photoUrls`, "array[character]", loadNamespace("petstore")) self$`tags` <- ApiClient$new()$deserializeObj(this_object$`tags`, "array[Tag]", loadNamespace("petstore")) diff --git a/samples/client/petstore/R/R/pig.R b/samples/client/petstore/R/R/pig.R index d497bc28039..05bfeebe4ce 100644 --- a/samples/client/petstore/R/R/pig.R +++ b/samples/client/petstore/R/R/pig.R @@ -64,10 +64,10 @@ Pig <- R6::R6Class( error_messages <- list() instance <- NULL - BasquePig_result <- tryCatch({ - BasquePig$public_methods$validateJSON(input) - BasquePig_instance <- BasquePig$new() - instance <- BasquePig_instance$fromJSON(input) + `BasquePig_result` <- tryCatch({ + `BasquePig`$public_methods$validateJSON(input) + `BasquePig_instance` <- `BasquePig`$new() + instance <- `BasquePig_instance`$fromJSON(input) instance_type <- "BasquePig" matched_schemas <- append(matched_schemas, "BasquePig") matched <- matched + 1 @@ -75,14 +75,14 @@ Pig <- R6::R6Class( error = function(err) err ) - if (!is.null(BasquePig_result["error"])) { - error_messages <- append(error_messages, BasquePig_result["message"]) + if (!is.null(`BasquePig_result`["error"])) { + error_messages <- append(error_messages, `BasquePig_result`["message"]) } - DanishPig_result <- tryCatch({ - DanishPig$public_methods$validateJSON(input) - DanishPig_instance <- DanishPig$new() - instance <- DanishPig_instance$fromJSON(input) + `DanishPig_result` <- tryCatch({ + `DanishPig`$public_methods$validateJSON(input) + `DanishPig_instance` <- `DanishPig`$new() + instance <- `DanishPig_instance`$fromJSON(input) instance_type <- "DanishPig" matched_schemas <- append(matched_schemas, "DanishPig") matched <- matched + 1 @@ -90,8 +90,8 @@ Pig <- R6::R6Class( error = function(err) err ) - if (!is.null(DanishPig_result["error"])) { - error_messages <- append(error_messages, DanishPig_result["message"]) + if (!is.null(`DanishPig_result`["error"])) { + error_messages <- append(error_messages, `DanishPig_result`["message"]) } if (matched == 1) { diff --git a/samples/client/petstore/R/R/update_pet_request.R b/samples/client/petstore/R/R/update_pet_request.R index 2fc96ab4fff..c29abc945ab 100644 --- a/samples/client/petstore/R/R/update_pet_request.R +++ b/samples/client/petstore/R/R/update_pet_request.R @@ -79,9 +79,9 @@ UpdatePetRequest <- R6::R6Class( fromJSON = function(input_json) { this_object <- jsonlite::fromJSON(input_json) if (!is.null(this_object$`jsonData`)) { - jsondata_object <- Pet$new() - jsondata_object$fromJSON(jsonlite::toJSON(this_object$jsonData, auto_unbox = TRUE, digits = NA)) - self$`jsonData` <- jsondata_object + `jsondata_object` <- Pet$new() + `jsondata_object`$fromJSON(jsonlite::toJSON(this_object$`jsonData`, auto_unbox = TRUE, digits = NA)) + self$`jsonData` <- `jsondata_object` } if (!is.null(this_object$`binaryDataN2Information`)) { self$`binaryDataN2Information` <- this_object$`binaryDataN2Information` @@ -139,7 +139,7 @@ UpdatePetRequest <- R6::R6Class( #' @export fromJSONString = function(input_json) { this_object <- jsonlite::fromJSON(input_json) - self$`jsonData` <- Pet$new()$fromJSON(jsonlite::toJSON(this_object$jsonData, auto_unbox = TRUE, digits = NA)) + self$`jsonData` <- Pet$new()$fromJSON(jsonlite::toJSON(this_object$`jsonData`, auto_unbox = TRUE, digits = NA)) self$`binaryDataN2Information` <- this_object$`binaryDataN2Information` # process additional properties/fields in the payload for (key in names(this_object)) {