forked from loafle/openapi-generator-original
Fix escaping in R (#14572)
This commit is contained in:
parent
62f52ad520
commit
12e76ec14f
@ -60,7 +60,7 @@
|
|||||||
|
|
||||||
{{#composedSchemas.anyOf}}
|
{{#composedSchemas.anyOf}}
|
||||||
{{^isNull}}
|
{{^isNull}}
|
||||||
{{{dataType}}}_result <- tryCatch({
|
`{{{dataType}}}_result` <- tryCatch({
|
||||||
{{#isPrimitiveType}}
|
{{#isPrimitiveType}}
|
||||||
instance <- jsonlite::fromJSON(input, simplifyVector = FALSE)
|
instance <- jsonlite::fromJSON(input, simplifyVector = FALSE)
|
||||||
if (typeof(instance) != "{{{dataType}}}") {
|
if (typeof(instance) != "{{{dataType}}}") {
|
||||||
@ -68,18 +68,18 @@
|
|||||||
}
|
}
|
||||||
{{/isPrimitiveType}}
|
{{/isPrimitiveType}}
|
||||||
{{^isPrimitiveType}}
|
{{^isPrimitiveType}}
|
||||||
{{{dataType}}}$public_methods$validateJSON(input)
|
`{{{dataType}}}`$public_methods$validateJSON(input)
|
||||||
{{{dataType}}}_instance <- {{{dataType}}}$new()
|
`{{{dataType}}}_instance` <- `{{{dataType}}}`$new()
|
||||||
{{/isPrimitiveType}}
|
{{/isPrimitiveType}}
|
||||||
self$actual_instance <- {{{dataType}}}_instance$fromJSON(input)
|
self$actual_instance <- `{{{dataType}}}_instance`$fromJSON(input)
|
||||||
self$actual_type <- "{{{dataType}}}"
|
self$actual_type <- "{{{dataType}}}"
|
||||||
return(self)
|
return(self)
|
||||||
},
|
},
|
||||||
error = function(err) err
|
error = function(err) err
|
||||||
)
|
)
|
||||||
|
|
||||||
if (!is.null({{{dataType}}}_result["error"])) {
|
if (!is.null(`{{{dataType}}}_result`["error"])) {
|
||||||
error_messages <- append(error_messages, {{{dataType}}}_result["message"])
|
error_messages <- append(error_messages, `{{{dataType}}}_result`["message"])
|
||||||
}
|
}
|
||||||
|
|
||||||
{{/isNull}}
|
{{/isNull}}
|
||||||
|
@ -289,9 +289,9 @@
|
|||||||
self$`{{name}}` <- this_object$`{{baseName}}`
|
self$`{{name}}` <- this_object$`{{baseName}}`
|
||||||
{{/isPrimitiveType}}
|
{{/isPrimitiveType}}
|
||||||
{{^isPrimitiveType}}
|
{{^isPrimitiveType}}
|
||||||
{{#lambda.lowercase}}{{{name}}}{{/lambda.lowercase}}_object <- {{dataType}}$new()
|
`{{#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))
|
`{{#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
|
self$`{{name}}` <- `{{#lambda.lowercase}}{{{name}}}{{/lambda.lowercase}}_object`
|
||||||
{{/isPrimitiveType}}
|
{{/isPrimitiveType}}
|
||||||
{{/isContainer}}
|
{{/isContainer}}
|
||||||
}
|
}
|
||||||
@ -421,7 +421,7 @@
|
|||||||
self$`{{name}}` <- this_object$`{{name}}`
|
self$`{{name}}` <- this_object$`{{name}}`
|
||||||
{{/isPrimitiveType}}
|
{{/isPrimitiveType}}
|
||||||
{{^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}}
|
{{/isPrimitiveType}}
|
||||||
{{/isContainer}}
|
{{/isContainer}}
|
||||||
{{/vars}}
|
{{/vars}}
|
||||||
|
@ -99,7 +99,7 @@
|
|||||||
{{/useOneOfDiscriminatorLookup}}
|
{{/useOneOfDiscriminatorLookup}}
|
||||||
{{#composedSchemas.oneOf}}
|
{{#composedSchemas.oneOf}}
|
||||||
{{^isNull}}
|
{{^isNull}}
|
||||||
{{{dataType}}}_result <- tryCatch({
|
`{{{dataType}}}_result` <- tryCatch({
|
||||||
{{#isPrimitiveType}}
|
{{#isPrimitiveType}}
|
||||||
instance <- jsonlite::fromJSON(input, simplifyVector = FALSE)
|
instance <- jsonlite::fromJSON(input, simplifyVector = FALSE)
|
||||||
if (typeof(instance) != "{{{dataType}}}") {
|
if (typeof(instance) != "{{{dataType}}}") {
|
||||||
@ -107,9 +107,9 @@
|
|||||||
}
|
}
|
||||||
{{/isPrimitiveType}}
|
{{/isPrimitiveType}}
|
||||||
{{^isPrimitiveType}}
|
{{^isPrimitiveType}}
|
||||||
{{{dataType}}}$public_methods$validateJSON(input)
|
`{{{dataType}}}`$public_methods$validateJSON(input)
|
||||||
{{{dataType}}}_instance <- {{{dataType}}}$new()
|
`{{{dataType}}}_instance` <- `{{{dataType}}}`$new()
|
||||||
instance <- {{{dataType}}}_instance$fromJSON(input)
|
instance <- `{{{dataType}}}_instance`$fromJSON(input)
|
||||||
{{/isPrimitiveType}}
|
{{/isPrimitiveType}}
|
||||||
instance_type <- "{{{dataType}}}"
|
instance_type <- "{{{dataType}}}"
|
||||||
matched_schemas <- append(matched_schemas, "{{{dataType}}}")
|
matched_schemas <- append(matched_schemas, "{{{dataType}}}")
|
||||||
@ -118,8 +118,8 @@
|
|||||||
error = function(err) err
|
error = function(err) err
|
||||||
)
|
)
|
||||||
|
|
||||||
if (!is.null({{{dataType}}}_result["error"])) {
|
if (!is.null(`{{{dataType}}}_result`["error"])) {
|
||||||
error_messages <- append(error_messages, {{{dataType}}}_result["message"])
|
error_messages <- append(error_messages, `{{{dataType}}}_result`["message"])
|
||||||
}
|
}
|
||||||
|
|
||||||
{{/isNull}}
|
{{/isNull}}
|
||||||
|
@ -61,32 +61,32 @@ AnyOfPig <- R6::R6Class(
|
|||||||
fromJSON = function(input) {
|
fromJSON = function(input) {
|
||||||
error_messages <- list()
|
error_messages <- list()
|
||||||
|
|
||||||
BasquePig_result <- tryCatch({
|
`BasquePig_result` <- tryCatch({
|
||||||
BasquePig$public_methods$validateJSON(input)
|
`BasquePig`$public_methods$validateJSON(input)
|
||||||
BasquePig_instance <- BasquePig$new()
|
`BasquePig_instance` <- `BasquePig`$new()
|
||||||
self$actual_instance <- BasquePig_instance$fromJSON(input)
|
self$actual_instance <- `BasquePig_instance`$fromJSON(input)
|
||||||
self$actual_type <- "BasquePig"
|
self$actual_type <- "BasquePig"
|
||||||
return(self)
|
return(self)
|
||||||
},
|
},
|
||||||
error = function(err) err
|
error = function(err) err
|
||||||
)
|
)
|
||||||
|
|
||||||
if (!is.null(BasquePig_result["error"])) {
|
if (!is.null(`BasquePig_result`["error"])) {
|
||||||
error_messages <- append(error_messages, BasquePig_result["message"])
|
error_messages <- append(error_messages, `BasquePig_result`["message"])
|
||||||
}
|
}
|
||||||
|
|
||||||
DanishPig_result <- tryCatch({
|
`DanishPig_result` <- tryCatch({
|
||||||
DanishPig$public_methods$validateJSON(input)
|
`DanishPig`$public_methods$validateJSON(input)
|
||||||
DanishPig_instance <- DanishPig$new()
|
`DanishPig_instance` <- `DanishPig`$new()
|
||||||
self$actual_instance <- DanishPig_instance$fromJSON(input)
|
self$actual_instance <- `DanishPig_instance`$fromJSON(input)
|
||||||
self$actual_type <- "DanishPig"
|
self$actual_type <- "DanishPig"
|
||||||
return(self)
|
return(self)
|
||||||
},
|
},
|
||||||
error = function(err) err
|
error = function(err) err
|
||||||
)
|
)
|
||||||
|
|
||||||
if (!is.null(DanishPig_result["error"])) {
|
if (!is.null(`DanishPig_result`["error"])) {
|
||||||
error_messages <- append(error_messages, DanishPig_result["message"])
|
error_messages <- append(error_messages, `DanishPig_result`["message"])
|
||||||
}
|
}
|
||||||
|
|
||||||
# no match
|
# no match
|
||||||
|
@ -64,7 +64,7 @@ AnyOfPrimitiveTypeTest <- R6::R6Class(
|
|||||||
error_messages <- list()
|
error_messages <- list()
|
||||||
instance <- NULL
|
instance <- NULL
|
||||||
|
|
||||||
integer_result <- tryCatch({
|
`integer_result` <- tryCatch({
|
||||||
instance <- jsonlite::fromJSON(input, simplifyVector = FALSE)
|
instance <- jsonlite::fromJSON(input, simplifyVector = FALSE)
|
||||||
if (typeof(instance) != "integer") {
|
if (typeof(instance) != "integer") {
|
||||||
stop(sprintf("Data type doesn't match. Expected: %s. Actual: %s.", "integer", typeof(instance)))
|
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
|
error = function(err) err
|
||||||
)
|
)
|
||||||
|
|
||||||
if (!is.null(integer_result["error"])) {
|
if (!is.null(`integer_result`["error"])) {
|
||||||
error_messages <- append(error_messages, integer_result["message"])
|
error_messages <- append(error_messages, `integer_result`["message"])
|
||||||
}
|
}
|
||||||
|
|
||||||
character_result <- tryCatch({
|
`character_result` <- tryCatch({
|
||||||
instance <- jsonlite::fromJSON(input, simplifyVector = FALSE)
|
instance <- jsonlite::fromJSON(input, simplifyVector = FALSE)
|
||||||
if (typeof(instance) != "character") {
|
if (typeof(instance) != "character") {
|
||||||
stop(sprintf("Data type doesn't match. Expected: %s. Actual: %s.", "character", typeof(instance)))
|
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
|
error = function(err) err
|
||||||
)
|
)
|
||||||
|
|
||||||
if (!is.null(character_result["error"])) {
|
if (!is.null(`character_result`["error"])) {
|
||||||
error_messages <- append(error_messages, character_result["message"])
|
error_messages <- append(error_messages, `character_result`["message"])
|
||||||
}
|
}
|
||||||
|
|
||||||
if (matched == 1) {
|
if (matched == 1) {
|
||||||
|
@ -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))
|
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_result` <- tryCatch({
|
||||||
Whale$public_methods$validateJSON(input)
|
`Whale`$public_methods$validateJSON(input)
|
||||||
Whale_instance <- Whale$new()
|
`Whale_instance` <- `Whale`$new()
|
||||||
instance <- Whale_instance$fromJSON(input)
|
instance <- `Whale_instance`$fromJSON(input)
|
||||||
instance_type <- "Whale"
|
instance_type <- "Whale"
|
||||||
matched_schemas <- append(matched_schemas, "Whale")
|
matched_schemas <- append(matched_schemas, "Whale")
|
||||||
matched <- matched + 1
|
matched <- matched + 1
|
||||||
@ -101,14 +101,14 @@ Mammal <- R6::R6Class(
|
|||||||
error = function(err) err
|
error = function(err) err
|
||||||
)
|
)
|
||||||
|
|
||||||
if (!is.null(Whale_result["error"])) {
|
if (!is.null(`Whale_result`["error"])) {
|
||||||
error_messages <- append(error_messages, Whale_result["message"])
|
error_messages <- append(error_messages, `Whale_result`["message"])
|
||||||
}
|
}
|
||||||
|
|
||||||
Zebra_result <- tryCatch({
|
`Zebra_result` <- tryCatch({
|
||||||
Zebra$public_methods$validateJSON(input)
|
`Zebra`$public_methods$validateJSON(input)
|
||||||
Zebra_instance <- Zebra$new()
|
`Zebra_instance` <- `Zebra`$new()
|
||||||
instance <- Zebra_instance$fromJSON(input)
|
instance <- `Zebra_instance`$fromJSON(input)
|
||||||
instance_type <- "Zebra"
|
instance_type <- "Zebra"
|
||||||
matched_schemas <- append(matched_schemas, "Zebra")
|
matched_schemas <- append(matched_schemas, "Zebra")
|
||||||
matched <- matched + 1
|
matched <- matched + 1
|
||||||
@ -116,8 +116,8 @@ Mammal <- R6::R6Class(
|
|||||||
error = function(err) err
|
error = function(err) err
|
||||||
)
|
)
|
||||||
|
|
||||||
if (!is.null(Zebra_result["error"])) {
|
if (!is.null(`Zebra_result`["error"])) {
|
||||||
error_messages <- append(error_messages, Zebra_result["message"])
|
error_messages <- append(error_messages, `Zebra_result`["message"])
|
||||||
}
|
}
|
||||||
|
|
||||||
if (matched == 1) {
|
if (matched == 1) {
|
||||||
|
@ -85,9 +85,9 @@ NestedOneOf <- R6::R6Class(
|
|||||||
self$`size` <- this_object$`size`
|
self$`size` <- this_object$`size`
|
||||||
}
|
}
|
||||||
if (!is.null(this_object$`nested_pig`)) {
|
if (!is.null(this_object$`nested_pig`)) {
|
||||||
nested_pig_object <- Pig$new()
|
`nested_pig_object` <- Pig$new()
|
||||||
nested_pig_object$fromJSON(jsonlite::toJSON(this_object$nested_pig, auto_unbox = TRUE, digits = NA))
|
`nested_pig_object`$fromJSON(jsonlite::toJSON(this_object$`nested_pig`, auto_unbox = TRUE, digits = NA))
|
||||||
self$`nested_pig` <- nested_pig_object
|
self$`nested_pig` <- `nested_pig_object`
|
||||||
}
|
}
|
||||||
# process additional properties/fields in the payload
|
# process additional properties/fields in the payload
|
||||||
for (key in names(this_object)) {
|
for (key in names(this_object)) {
|
||||||
@ -143,7 +143,7 @@ NestedOneOf <- R6::R6Class(
|
|||||||
fromJSONString = function(input_json) {
|
fromJSONString = function(input_json) {
|
||||||
this_object <- jsonlite::fromJSON(input_json)
|
this_object <- jsonlite::fromJSON(input_json)
|
||||||
self$`size` <- this_object$`size`
|
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
|
# process additional properties/fields in the payload
|
||||||
for (key in names(this_object)) {
|
for (key in names(this_object)) {
|
||||||
if (!(key %in% self$`_field_list`)) { # json key not in list of fields
|
if (!(key %in% self$`_field_list`)) { # json key not in list of fields
|
||||||
|
@ -64,7 +64,7 @@ OneOfPrimitiveTypeTest <- R6::R6Class(
|
|||||||
error_messages <- list()
|
error_messages <- list()
|
||||||
instance <- NULL
|
instance <- NULL
|
||||||
|
|
||||||
integer_result <- tryCatch({
|
`integer_result` <- tryCatch({
|
||||||
instance <- jsonlite::fromJSON(input, simplifyVector = FALSE)
|
instance <- jsonlite::fromJSON(input, simplifyVector = FALSE)
|
||||||
if (typeof(instance) != "integer") {
|
if (typeof(instance) != "integer") {
|
||||||
stop(sprintf("Data type doesn't match. Expected: %s. Actual: %s.", "integer", typeof(instance)))
|
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
|
error = function(err) err
|
||||||
)
|
)
|
||||||
|
|
||||||
if (!is.null(integer_result["error"])) {
|
if (!is.null(`integer_result`["error"])) {
|
||||||
error_messages <- append(error_messages, integer_result["message"])
|
error_messages <- append(error_messages, `integer_result`["message"])
|
||||||
}
|
}
|
||||||
|
|
||||||
character_result <- tryCatch({
|
`character_result` <- tryCatch({
|
||||||
instance <- jsonlite::fromJSON(input, simplifyVector = FALSE)
|
instance <- jsonlite::fromJSON(input, simplifyVector = FALSE)
|
||||||
if (typeof(instance) != "character") {
|
if (typeof(instance) != "character") {
|
||||||
stop(sprintf("Data type doesn't match. Expected: %s. Actual: %s.", "character", typeof(instance)))
|
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
|
error = function(err) err
|
||||||
)
|
)
|
||||||
|
|
||||||
if (!is.null(character_result["error"])) {
|
if (!is.null(`character_result`["error"])) {
|
||||||
error_messages <- append(error_messages, character_result["message"])
|
error_messages <- append(error_messages, `character_result`["message"])
|
||||||
}
|
}
|
||||||
|
|
||||||
if (matched == 1) {
|
if (matched == 1) {
|
||||||
|
@ -138,9 +138,9 @@ Pet <- R6::R6Class(
|
|||||||
self$`id` <- this_object$`id`
|
self$`id` <- this_object$`id`
|
||||||
}
|
}
|
||||||
if (!is.null(this_object$`category`)) {
|
if (!is.null(this_object$`category`)) {
|
||||||
category_object <- Category$new()
|
`category_object` <- Category$new()
|
||||||
category_object$fromJSON(jsonlite::toJSON(this_object$category, auto_unbox = TRUE, digits = NA))
|
`category_object`$fromJSON(jsonlite::toJSON(this_object$`category`, auto_unbox = TRUE, digits = NA))
|
||||||
self$`category` <- category_object
|
self$`category` <- `category_object`
|
||||||
}
|
}
|
||||||
if (!is.null(this_object$`name`)) {
|
if (!is.null(this_object$`name`)) {
|
||||||
self$`name` <- this_object$`name`
|
self$`name` <- this_object$`name`
|
||||||
@ -243,7 +243,7 @@ Pet <- R6::R6Class(
|
|||||||
fromJSONString = function(input_json) {
|
fromJSONString = function(input_json) {
|
||||||
this_object <- jsonlite::fromJSON(input_json)
|
this_object <- jsonlite::fromJSON(input_json)
|
||||||
self$`id` <- this_object$`id`
|
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$`name` <- this_object$`name`
|
||||||
self$`photoUrls` <- ApiClient$new()$deserializeObj(this_object$`photoUrls`, "array[character]", loadNamespace("petstore"))
|
self$`photoUrls` <- ApiClient$new()$deserializeObj(this_object$`photoUrls`, "array[character]", loadNamespace("petstore"))
|
||||||
self$`tags` <- ApiClient$new()$deserializeObj(this_object$`tags`, "array[Tag]", loadNamespace("petstore"))
|
self$`tags` <- ApiClient$new()$deserializeObj(this_object$`tags`, "array[Tag]", loadNamespace("petstore"))
|
||||||
|
@ -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))
|
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_result` <- tryCatch({
|
||||||
BasquePig$public_methods$validateJSON(input)
|
`BasquePig`$public_methods$validateJSON(input)
|
||||||
BasquePig_instance <- BasquePig$new()
|
`BasquePig_instance` <- `BasquePig`$new()
|
||||||
instance <- BasquePig_instance$fromJSON(input)
|
instance <- `BasquePig_instance`$fromJSON(input)
|
||||||
instance_type <- "BasquePig"
|
instance_type <- "BasquePig"
|
||||||
matched_schemas <- append(matched_schemas, "BasquePig")
|
matched_schemas <- append(matched_schemas, "BasquePig")
|
||||||
matched <- matched + 1
|
matched <- matched + 1
|
||||||
@ -101,14 +101,14 @@ Pig <- R6::R6Class(
|
|||||||
error = function(err) err
|
error = function(err) err
|
||||||
)
|
)
|
||||||
|
|
||||||
if (!is.null(BasquePig_result["error"])) {
|
if (!is.null(`BasquePig_result`["error"])) {
|
||||||
error_messages <- append(error_messages, BasquePig_result["message"])
|
error_messages <- append(error_messages, `BasquePig_result`["message"])
|
||||||
}
|
}
|
||||||
|
|
||||||
DanishPig_result <- tryCatch({
|
`DanishPig_result` <- tryCatch({
|
||||||
DanishPig$public_methods$validateJSON(input)
|
`DanishPig`$public_methods$validateJSON(input)
|
||||||
DanishPig_instance <- DanishPig$new()
|
`DanishPig_instance` <- `DanishPig`$new()
|
||||||
instance <- DanishPig_instance$fromJSON(input)
|
instance <- `DanishPig_instance`$fromJSON(input)
|
||||||
instance_type <- "DanishPig"
|
instance_type <- "DanishPig"
|
||||||
matched_schemas <- append(matched_schemas, "DanishPig")
|
matched_schemas <- append(matched_schemas, "DanishPig")
|
||||||
matched <- matched + 1
|
matched <- matched + 1
|
||||||
@ -116,8 +116,8 @@ Pig <- R6::R6Class(
|
|||||||
error = function(err) err
|
error = function(err) err
|
||||||
)
|
)
|
||||||
|
|
||||||
if (!is.null(DanishPig_result["error"])) {
|
if (!is.null(`DanishPig_result`["error"])) {
|
||||||
error_messages <- append(error_messages, DanishPig_result["message"])
|
error_messages <- append(error_messages, `DanishPig_result`["message"])
|
||||||
}
|
}
|
||||||
|
|
||||||
if (matched == 1) {
|
if (matched == 1) {
|
||||||
|
@ -79,9 +79,9 @@ UpdatePetRequest <- R6::R6Class(
|
|||||||
fromJSON = function(input_json) {
|
fromJSON = function(input_json) {
|
||||||
this_object <- jsonlite::fromJSON(input_json)
|
this_object <- jsonlite::fromJSON(input_json)
|
||||||
if (!is.null(this_object$`jsonData`)) {
|
if (!is.null(this_object$`jsonData`)) {
|
||||||
jsondata_object <- Pet$new()
|
`jsondata_object` <- Pet$new()
|
||||||
jsondata_object$fromJSON(jsonlite::toJSON(this_object$jsonData, auto_unbox = TRUE, digits = NA))
|
`jsondata_object`$fromJSON(jsonlite::toJSON(this_object$`jsonData`, auto_unbox = TRUE, digits = NA))
|
||||||
self$`jsonData` <- jsondata_object
|
self$`jsonData` <- `jsondata_object`
|
||||||
}
|
}
|
||||||
if (!is.null(this_object$`binaryDataN2Information`)) {
|
if (!is.null(this_object$`binaryDataN2Information`)) {
|
||||||
self$`binaryDataN2Information` <- this_object$`binaryDataN2Information`
|
self$`binaryDataN2Information` <- this_object$`binaryDataN2Information`
|
||||||
@ -139,7 +139,7 @@ UpdatePetRequest <- R6::R6Class(
|
|||||||
#' @export
|
#' @export
|
||||||
fromJSONString = function(input_json) {
|
fromJSONString = function(input_json) {
|
||||||
this_object <- jsonlite::fromJSON(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$`binaryDataN2Information` <- this_object$`binaryDataN2Information`
|
||||||
# process additional properties/fields in the payload
|
# process additional properties/fields in the payload
|
||||||
for (key in names(this_object)) {
|
for (key in names(this_object)) {
|
||||||
|
@ -61,32 +61,32 @@ AnyOfPig <- R6::R6Class(
|
|||||||
fromJSON = function(input) {
|
fromJSON = function(input) {
|
||||||
error_messages <- list()
|
error_messages <- list()
|
||||||
|
|
||||||
BasquePig_result <- tryCatch({
|
`BasquePig_result` <- tryCatch({
|
||||||
BasquePig$public_methods$validateJSON(input)
|
`BasquePig`$public_methods$validateJSON(input)
|
||||||
BasquePig_instance <- BasquePig$new()
|
`BasquePig_instance` <- `BasquePig`$new()
|
||||||
self$actual_instance <- BasquePig_instance$fromJSON(input)
|
self$actual_instance <- `BasquePig_instance`$fromJSON(input)
|
||||||
self$actual_type <- "BasquePig"
|
self$actual_type <- "BasquePig"
|
||||||
return(self)
|
return(self)
|
||||||
},
|
},
|
||||||
error = function(err) err
|
error = function(err) err
|
||||||
)
|
)
|
||||||
|
|
||||||
if (!is.null(BasquePig_result["error"])) {
|
if (!is.null(`BasquePig_result`["error"])) {
|
||||||
error_messages <- append(error_messages, BasquePig_result["message"])
|
error_messages <- append(error_messages, `BasquePig_result`["message"])
|
||||||
}
|
}
|
||||||
|
|
||||||
DanishPig_result <- tryCatch({
|
`DanishPig_result` <- tryCatch({
|
||||||
DanishPig$public_methods$validateJSON(input)
|
`DanishPig`$public_methods$validateJSON(input)
|
||||||
DanishPig_instance <- DanishPig$new()
|
`DanishPig_instance` <- `DanishPig`$new()
|
||||||
self$actual_instance <- DanishPig_instance$fromJSON(input)
|
self$actual_instance <- `DanishPig_instance`$fromJSON(input)
|
||||||
self$actual_type <- "DanishPig"
|
self$actual_type <- "DanishPig"
|
||||||
return(self)
|
return(self)
|
||||||
},
|
},
|
||||||
error = function(err) err
|
error = function(err) err
|
||||||
)
|
)
|
||||||
|
|
||||||
if (!is.null(DanishPig_result["error"])) {
|
if (!is.null(`DanishPig_result`["error"])) {
|
||||||
error_messages <- append(error_messages, DanishPig_result["message"])
|
error_messages <- append(error_messages, `DanishPig_result`["message"])
|
||||||
}
|
}
|
||||||
|
|
||||||
# no match
|
# no match
|
||||||
|
@ -64,7 +64,7 @@ AnyOfPrimitiveTypeTest <- R6::R6Class(
|
|||||||
error_messages <- list()
|
error_messages <- list()
|
||||||
instance <- NULL
|
instance <- NULL
|
||||||
|
|
||||||
integer_result <- tryCatch({
|
`integer_result` <- tryCatch({
|
||||||
instance <- jsonlite::fromJSON(input, simplifyVector = FALSE)
|
instance <- jsonlite::fromJSON(input, simplifyVector = FALSE)
|
||||||
if (typeof(instance) != "integer") {
|
if (typeof(instance) != "integer") {
|
||||||
stop(sprintf("Data type doesn't match. Expected: %s. Actual: %s.", "integer", typeof(instance)))
|
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
|
error = function(err) err
|
||||||
)
|
)
|
||||||
|
|
||||||
if (!is.null(integer_result["error"])) {
|
if (!is.null(`integer_result`["error"])) {
|
||||||
error_messages <- append(error_messages, integer_result["message"])
|
error_messages <- append(error_messages, `integer_result`["message"])
|
||||||
}
|
}
|
||||||
|
|
||||||
character_result <- tryCatch({
|
`character_result` <- tryCatch({
|
||||||
instance <- jsonlite::fromJSON(input, simplifyVector = FALSE)
|
instance <- jsonlite::fromJSON(input, simplifyVector = FALSE)
|
||||||
if (typeof(instance) != "character") {
|
if (typeof(instance) != "character") {
|
||||||
stop(sprintf("Data type doesn't match. Expected: %s. Actual: %s.", "character", typeof(instance)))
|
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
|
error = function(err) err
|
||||||
)
|
)
|
||||||
|
|
||||||
if (!is.null(character_result["error"])) {
|
if (!is.null(`character_result`["error"])) {
|
||||||
error_messages <- append(error_messages, character_result["message"])
|
error_messages <- append(error_messages, `character_result`["message"])
|
||||||
}
|
}
|
||||||
|
|
||||||
if (matched == 1) {
|
if (matched == 1) {
|
||||||
|
@ -64,10 +64,10 @@ Mammal <- R6::R6Class(
|
|||||||
error_messages <- list()
|
error_messages <- list()
|
||||||
instance <- NULL
|
instance <- NULL
|
||||||
|
|
||||||
Whale_result <- tryCatch({
|
`Whale_result` <- tryCatch({
|
||||||
Whale$public_methods$validateJSON(input)
|
`Whale`$public_methods$validateJSON(input)
|
||||||
Whale_instance <- Whale$new()
|
`Whale_instance` <- `Whale`$new()
|
||||||
instance <- Whale_instance$fromJSON(input)
|
instance <- `Whale_instance`$fromJSON(input)
|
||||||
instance_type <- "Whale"
|
instance_type <- "Whale"
|
||||||
matched_schemas <- append(matched_schemas, "Whale")
|
matched_schemas <- append(matched_schemas, "Whale")
|
||||||
matched <- matched + 1
|
matched <- matched + 1
|
||||||
@ -75,14 +75,14 @@ Mammal <- R6::R6Class(
|
|||||||
error = function(err) err
|
error = function(err) err
|
||||||
)
|
)
|
||||||
|
|
||||||
if (!is.null(Whale_result["error"])) {
|
if (!is.null(`Whale_result`["error"])) {
|
||||||
error_messages <- append(error_messages, Whale_result["message"])
|
error_messages <- append(error_messages, `Whale_result`["message"])
|
||||||
}
|
}
|
||||||
|
|
||||||
Zebra_result <- tryCatch({
|
`Zebra_result` <- tryCatch({
|
||||||
Zebra$public_methods$validateJSON(input)
|
`Zebra`$public_methods$validateJSON(input)
|
||||||
Zebra_instance <- Zebra$new()
|
`Zebra_instance` <- `Zebra`$new()
|
||||||
instance <- Zebra_instance$fromJSON(input)
|
instance <- `Zebra_instance`$fromJSON(input)
|
||||||
instance_type <- "Zebra"
|
instance_type <- "Zebra"
|
||||||
matched_schemas <- append(matched_schemas, "Zebra")
|
matched_schemas <- append(matched_schemas, "Zebra")
|
||||||
matched <- matched + 1
|
matched <- matched + 1
|
||||||
@ -90,8 +90,8 @@ Mammal <- R6::R6Class(
|
|||||||
error = function(err) err
|
error = function(err) err
|
||||||
)
|
)
|
||||||
|
|
||||||
if (!is.null(Zebra_result["error"])) {
|
if (!is.null(`Zebra_result`["error"])) {
|
||||||
error_messages <- append(error_messages, Zebra_result["message"])
|
error_messages <- append(error_messages, `Zebra_result`["message"])
|
||||||
}
|
}
|
||||||
|
|
||||||
if (matched == 1) {
|
if (matched == 1) {
|
||||||
|
@ -71,9 +71,9 @@ NestedOneOf <- R6::R6Class(
|
|||||||
self$`size` <- this_object$`size`
|
self$`size` <- this_object$`size`
|
||||||
}
|
}
|
||||||
if (!is.null(this_object$`nested_pig`)) {
|
if (!is.null(this_object$`nested_pig`)) {
|
||||||
nested_pig_object <- Pig$new()
|
`nested_pig_object` <- Pig$new()
|
||||||
nested_pig_object$fromJSON(jsonlite::toJSON(this_object$nested_pig, auto_unbox = TRUE, digits = NA))
|
`nested_pig_object`$fromJSON(jsonlite::toJSON(this_object$`nested_pig`, auto_unbox = TRUE, digits = NA))
|
||||||
self$`nested_pig` <- nested_pig_object
|
self$`nested_pig` <- `nested_pig_object`
|
||||||
}
|
}
|
||||||
self
|
self
|
||||||
},
|
},
|
||||||
@ -117,7 +117,7 @@ NestedOneOf <- R6::R6Class(
|
|||||||
fromJSONString = function(input_json) {
|
fromJSONString = function(input_json) {
|
||||||
this_object <- jsonlite::fromJSON(input_json)
|
this_object <- jsonlite::fromJSON(input_json)
|
||||||
self$`size` <- this_object$`size`
|
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
|
self
|
||||||
},
|
},
|
||||||
#' Validate JSON input with respect to NestedOneOf
|
#' Validate JSON input with respect to NestedOneOf
|
||||||
|
@ -64,7 +64,7 @@ OneOfPrimitiveTypeTest <- R6::R6Class(
|
|||||||
error_messages <- list()
|
error_messages <- list()
|
||||||
instance <- NULL
|
instance <- NULL
|
||||||
|
|
||||||
integer_result <- tryCatch({
|
`integer_result` <- tryCatch({
|
||||||
instance <- jsonlite::fromJSON(input, simplifyVector = FALSE)
|
instance <- jsonlite::fromJSON(input, simplifyVector = FALSE)
|
||||||
if (typeof(instance) != "integer") {
|
if (typeof(instance) != "integer") {
|
||||||
stop(sprintf("Data type doesn't match. Expected: %s. Actual: %s.", "integer", typeof(instance)))
|
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
|
error = function(err) err
|
||||||
)
|
)
|
||||||
|
|
||||||
if (!is.null(integer_result["error"])) {
|
if (!is.null(`integer_result`["error"])) {
|
||||||
error_messages <- append(error_messages, integer_result["message"])
|
error_messages <- append(error_messages, `integer_result`["message"])
|
||||||
}
|
}
|
||||||
|
|
||||||
character_result <- tryCatch({
|
`character_result` <- tryCatch({
|
||||||
instance <- jsonlite::fromJSON(input, simplifyVector = FALSE)
|
instance <- jsonlite::fromJSON(input, simplifyVector = FALSE)
|
||||||
if (typeof(instance) != "character") {
|
if (typeof(instance) != "character") {
|
||||||
stop(sprintf("Data type doesn't match. Expected: %s. Actual: %s.", "character", typeof(instance)))
|
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
|
error = function(err) err
|
||||||
)
|
)
|
||||||
|
|
||||||
if (!is.null(character_result["error"])) {
|
if (!is.null(`character_result`["error"])) {
|
||||||
error_messages <- append(error_messages, character_result["message"])
|
error_messages <- append(error_messages, `character_result`["message"])
|
||||||
}
|
}
|
||||||
|
|
||||||
if (matched == 1) {
|
if (matched == 1) {
|
||||||
|
@ -124,9 +124,9 @@ Pet <- R6::R6Class(
|
|||||||
self$`id` <- this_object$`id`
|
self$`id` <- this_object$`id`
|
||||||
}
|
}
|
||||||
if (!is.null(this_object$`category`)) {
|
if (!is.null(this_object$`category`)) {
|
||||||
category_object <- Category$new()
|
`category_object` <- Category$new()
|
||||||
category_object$fromJSON(jsonlite::toJSON(this_object$category, auto_unbox = TRUE, digits = NA))
|
`category_object`$fromJSON(jsonlite::toJSON(this_object$`category`, auto_unbox = TRUE, digits = NA))
|
||||||
self$`category` <- category_object
|
self$`category` <- `category_object`
|
||||||
}
|
}
|
||||||
if (!is.null(this_object$`name`)) {
|
if (!is.null(this_object$`name`)) {
|
||||||
self$`name` <- this_object$`name`
|
self$`name` <- this_object$`name`
|
||||||
@ -217,7 +217,7 @@ Pet <- R6::R6Class(
|
|||||||
fromJSONString = function(input_json) {
|
fromJSONString = function(input_json) {
|
||||||
this_object <- jsonlite::fromJSON(input_json)
|
this_object <- jsonlite::fromJSON(input_json)
|
||||||
self$`id` <- this_object$`id`
|
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$`name` <- this_object$`name`
|
||||||
self$`photoUrls` <- ApiClient$new()$deserializeObj(this_object$`photoUrls`, "array[character]", loadNamespace("petstore"))
|
self$`photoUrls` <- ApiClient$new()$deserializeObj(this_object$`photoUrls`, "array[character]", loadNamespace("petstore"))
|
||||||
self$`tags` <- ApiClient$new()$deserializeObj(this_object$`tags`, "array[Tag]", loadNamespace("petstore"))
|
self$`tags` <- ApiClient$new()$deserializeObj(this_object$`tags`, "array[Tag]", loadNamespace("petstore"))
|
||||||
|
@ -64,10 +64,10 @@ Pig <- R6::R6Class(
|
|||||||
error_messages <- list()
|
error_messages <- list()
|
||||||
instance <- NULL
|
instance <- NULL
|
||||||
|
|
||||||
BasquePig_result <- tryCatch({
|
`BasquePig_result` <- tryCatch({
|
||||||
BasquePig$public_methods$validateJSON(input)
|
`BasquePig`$public_methods$validateJSON(input)
|
||||||
BasquePig_instance <- BasquePig$new()
|
`BasquePig_instance` <- `BasquePig`$new()
|
||||||
instance <- BasquePig_instance$fromJSON(input)
|
instance <- `BasquePig_instance`$fromJSON(input)
|
||||||
instance_type <- "BasquePig"
|
instance_type <- "BasquePig"
|
||||||
matched_schemas <- append(matched_schemas, "BasquePig")
|
matched_schemas <- append(matched_schemas, "BasquePig")
|
||||||
matched <- matched + 1
|
matched <- matched + 1
|
||||||
@ -75,14 +75,14 @@ Pig <- R6::R6Class(
|
|||||||
error = function(err) err
|
error = function(err) err
|
||||||
)
|
)
|
||||||
|
|
||||||
if (!is.null(BasquePig_result["error"])) {
|
if (!is.null(`BasquePig_result`["error"])) {
|
||||||
error_messages <- append(error_messages, BasquePig_result["message"])
|
error_messages <- append(error_messages, `BasquePig_result`["message"])
|
||||||
}
|
}
|
||||||
|
|
||||||
DanishPig_result <- tryCatch({
|
`DanishPig_result` <- tryCatch({
|
||||||
DanishPig$public_methods$validateJSON(input)
|
`DanishPig`$public_methods$validateJSON(input)
|
||||||
DanishPig_instance <- DanishPig$new()
|
`DanishPig_instance` <- `DanishPig`$new()
|
||||||
instance <- DanishPig_instance$fromJSON(input)
|
instance <- `DanishPig_instance`$fromJSON(input)
|
||||||
instance_type <- "DanishPig"
|
instance_type <- "DanishPig"
|
||||||
matched_schemas <- append(matched_schemas, "DanishPig")
|
matched_schemas <- append(matched_schemas, "DanishPig")
|
||||||
matched <- matched + 1
|
matched <- matched + 1
|
||||||
@ -90,8 +90,8 @@ Pig <- R6::R6Class(
|
|||||||
error = function(err) err
|
error = function(err) err
|
||||||
)
|
)
|
||||||
|
|
||||||
if (!is.null(DanishPig_result["error"])) {
|
if (!is.null(`DanishPig_result`["error"])) {
|
||||||
error_messages <- append(error_messages, DanishPig_result["message"])
|
error_messages <- append(error_messages, `DanishPig_result`["message"])
|
||||||
}
|
}
|
||||||
|
|
||||||
if (matched == 1) {
|
if (matched == 1) {
|
||||||
|
@ -65,9 +65,9 @@ UpdatePetRequest <- R6::R6Class(
|
|||||||
fromJSON = function(input_json) {
|
fromJSON = function(input_json) {
|
||||||
this_object <- jsonlite::fromJSON(input_json)
|
this_object <- jsonlite::fromJSON(input_json)
|
||||||
if (!is.null(this_object$`jsonData`)) {
|
if (!is.null(this_object$`jsonData`)) {
|
||||||
jsondata_object <- Pet$new()
|
`jsondata_object` <- Pet$new()
|
||||||
jsondata_object$fromJSON(jsonlite::toJSON(this_object$jsonData, auto_unbox = TRUE, digits = NA))
|
`jsondata_object`$fromJSON(jsonlite::toJSON(this_object$`jsonData`, auto_unbox = TRUE, digits = NA))
|
||||||
self$`jsonData` <- jsondata_object
|
self$`jsonData` <- `jsondata_object`
|
||||||
}
|
}
|
||||||
if (!is.null(this_object$`binaryDataN2Information`)) {
|
if (!is.null(this_object$`binaryDataN2Information`)) {
|
||||||
self$`binaryDataN2Information` <- this_object$`binaryDataN2Information`
|
self$`binaryDataN2Information` <- this_object$`binaryDataN2Information`
|
||||||
@ -113,7 +113,7 @@ UpdatePetRequest <- R6::R6Class(
|
|||||||
#' @export
|
#' @export
|
||||||
fromJSONString = function(input_json) {
|
fromJSONString = function(input_json) {
|
||||||
this_object <- jsonlite::fromJSON(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$`binaryDataN2Information` <- this_object$`binaryDataN2Information`
|
||||||
self
|
self
|
||||||
},
|
},
|
||||||
|
@ -61,32 +61,32 @@ AnyOfPig <- R6::R6Class(
|
|||||||
fromJSON = function(input) {
|
fromJSON = function(input) {
|
||||||
error_messages <- list()
|
error_messages <- list()
|
||||||
|
|
||||||
BasquePig_result <- tryCatch({
|
`BasquePig_result` <- tryCatch({
|
||||||
BasquePig$public_methods$validateJSON(input)
|
`BasquePig`$public_methods$validateJSON(input)
|
||||||
BasquePig_instance <- BasquePig$new()
|
`BasquePig_instance` <- `BasquePig`$new()
|
||||||
self$actual_instance <- BasquePig_instance$fromJSON(input)
|
self$actual_instance <- `BasquePig_instance`$fromJSON(input)
|
||||||
self$actual_type <- "BasquePig"
|
self$actual_type <- "BasquePig"
|
||||||
return(self)
|
return(self)
|
||||||
},
|
},
|
||||||
error = function(err) err
|
error = function(err) err
|
||||||
)
|
)
|
||||||
|
|
||||||
if (!is.null(BasquePig_result["error"])) {
|
if (!is.null(`BasquePig_result`["error"])) {
|
||||||
error_messages <- append(error_messages, BasquePig_result["message"])
|
error_messages <- append(error_messages, `BasquePig_result`["message"])
|
||||||
}
|
}
|
||||||
|
|
||||||
DanishPig_result <- tryCatch({
|
`DanishPig_result` <- tryCatch({
|
||||||
DanishPig$public_methods$validateJSON(input)
|
`DanishPig`$public_methods$validateJSON(input)
|
||||||
DanishPig_instance <- DanishPig$new()
|
`DanishPig_instance` <- `DanishPig`$new()
|
||||||
self$actual_instance <- DanishPig_instance$fromJSON(input)
|
self$actual_instance <- `DanishPig_instance`$fromJSON(input)
|
||||||
self$actual_type <- "DanishPig"
|
self$actual_type <- "DanishPig"
|
||||||
return(self)
|
return(self)
|
||||||
},
|
},
|
||||||
error = function(err) err
|
error = function(err) err
|
||||||
)
|
)
|
||||||
|
|
||||||
if (!is.null(DanishPig_result["error"])) {
|
if (!is.null(`DanishPig_result`["error"])) {
|
||||||
error_messages <- append(error_messages, DanishPig_result["message"])
|
error_messages <- append(error_messages, `DanishPig_result`["message"])
|
||||||
}
|
}
|
||||||
|
|
||||||
# no match
|
# no match
|
||||||
|
@ -64,7 +64,7 @@ AnyOfPrimitiveTypeTest <- R6::R6Class(
|
|||||||
error_messages <- list()
|
error_messages <- list()
|
||||||
instance <- NULL
|
instance <- NULL
|
||||||
|
|
||||||
integer_result <- tryCatch({
|
`integer_result` <- tryCatch({
|
||||||
instance <- jsonlite::fromJSON(input, simplifyVector = FALSE)
|
instance <- jsonlite::fromJSON(input, simplifyVector = FALSE)
|
||||||
if (typeof(instance) != "integer") {
|
if (typeof(instance) != "integer") {
|
||||||
stop(sprintf("Data type doesn't match. Expected: %s. Actual: %s.", "integer", typeof(instance)))
|
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
|
error = function(err) err
|
||||||
)
|
)
|
||||||
|
|
||||||
if (!is.null(integer_result["error"])) {
|
if (!is.null(`integer_result`["error"])) {
|
||||||
error_messages <- append(error_messages, integer_result["message"])
|
error_messages <- append(error_messages, `integer_result`["message"])
|
||||||
}
|
}
|
||||||
|
|
||||||
character_result <- tryCatch({
|
`character_result` <- tryCatch({
|
||||||
instance <- jsonlite::fromJSON(input, simplifyVector = FALSE)
|
instance <- jsonlite::fromJSON(input, simplifyVector = FALSE)
|
||||||
if (typeof(instance) != "character") {
|
if (typeof(instance) != "character") {
|
||||||
stop(sprintf("Data type doesn't match. Expected: %s. Actual: %s.", "character", typeof(instance)))
|
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
|
error = function(err) err
|
||||||
)
|
)
|
||||||
|
|
||||||
if (!is.null(character_result["error"])) {
|
if (!is.null(`character_result`["error"])) {
|
||||||
error_messages <- append(error_messages, character_result["message"])
|
error_messages <- append(error_messages, `character_result`["message"])
|
||||||
}
|
}
|
||||||
|
|
||||||
if (matched == 1) {
|
if (matched == 1) {
|
||||||
|
@ -64,10 +64,10 @@ Mammal <- R6::R6Class(
|
|||||||
error_messages <- list()
|
error_messages <- list()
|
||||||
instance <- NULL
|
instance <- NULL
|
||||||
|
|
||||||
Whale_result <- tryCatch({
|
`Whale_result` <- tryCatch({
|
||||||
Whale$public_methods$validateJSON(input)
|
`Whale`$public_methods$validateJSON(input)
|
||||||
Whale_instance <- Whale$new()
|
`Whale_instance` <- `Whale`$new()
|
||||||
instance <- Whale_instance$fromJSON(input)
|
instance <- `Whale_instance`$fromJSON(input)
|
||||||
instance_type <- "Whale"
|
instance_type <- "Whale"
|
||||||
matched_schemas <- append(matched_schemas, "Whale")
|
matched_schemas <- append(matched_schemas, "Whale")
|
||||||
matched <- matched + 1
|
matched <- matched + 1
|
||||||
@ -75,14 +75,14 @@ Mammal <- R6::R6Class(
|
|||||||
error = function(err) err
|
error = function(err) err
|
||||||
)
|
)
|
||||||
|
|
||||||
if (!is.null(Whale_result["error"])) {
|
if (!is.null(`Whale_result`["error"])) {
|
||||||
error_messages <- append(error_messages, Whale_result["message"])
|
error_messages <- append(error_messages, `Whale_result`["message"])
|
||||||
}
|
}
|
||||||
|
|
||||||
Zebra_result <- tryCatch({
|
`Zebra_result` <- tryCatch({
|
||||||
Zebra$public_methods$validateJSON(input)
|
`Zebra`$public_methods$validateJSON(input)
|
||||||
Zebra_instance <- Zebra$new()
|
`Zebra_instance` <- `Zebra`$new()
|
||||||
instance <- Zebra_instance$fromJSON(input)
|
instance <- `Zebra_instance`$fromJSON(input)
|
||||||
instance_type <- "Zebra"
|
instance_type <- "Zebra"
|
||||||
matched_schemas <- append(matched_schemas, "Zebra")
|
matched_schemas <- append(matched_schemas, "Zebra")
|
||||||
matched <- matched + 1
|
matched <- matched + 1
|
||||||
@ -90,8 +90,8 @@ Mammal <- R6::R6Class(
|
|||||||
error = function(err) err
|
error = function(err) err
|
||||||
)
|
)
|
||||||
|
|
||||||
if (!is.null(Zebra_result["error"])) {
|
if (!is.null(`Zebra_result`["error"])) {
|
||||||
error_messages <- append(error_messages, Zebra_result["message"])
|
error_messages <- append(error_messages, `Zebra_result`["message"])
|
||||||
}
|
}
|
||||||
|
|
||||||
if (matched == 1) {
|
if (matched == 1) {
|
||||||
|
@ -85,9 +85,9 @@ NestedOneOf <- R6::R6Class(
|
|||||||
self$`size` <- this_object$`size`
|
self$`size` <- this_object$`size`
|
||||||
}
|
}
|
||||||
if (!is.null(this_object$`nested_pig`)) {
|
if (!is.null(this_object$`nested_pig`)) {
|
||||||
nested_pig_object <- Pig$new()
|
`nested_pig_object` <- Pig$new()
|
||||||
nested_pig_object$fromJSON(jsonlite::toJSON(this_object$nested_pig, auto_unbox = TRUE, digits = NA))
|
`nested_pig_object`$fromJSON(jsonlite::toJSON(this_object$`nested_pig`, auto_unbox = TRUE, digits = NA))
|
||||||
self$`nested_pig` <- nested_pig_object
|
self$`nested_pig` <- `nested_pig_object`
|
||||||
}
|
}
|
||||||
# process additional properties/fields in the payload
|
# process additional properties/fields in the payload
|
||||||
for (key in names(this_object)) {
|
for (key in names(this_object)) {
|
||||||
@ -143,7 +143,7 @@ NestedOneOf <- R6::R6Class(
|
|||||||
fromJSONString = function(input_json) {
|
fromJSONString = function(input_json) {
|
||||||
this_object <- jsonlite::fromJSON(input_json)
|
this_object <- jsonlite::fromJSON(input_json)
|
||||||
self$`size` <- this_object$`size`
|
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
|
# process additional properties/fields in the payload
|
||||||
for (key in names(this_object)) {
|
for (key in names(this_object)) {
|
||||||
if (!(key %in% self$`_field_list`)) { # json key not in list of fields
|
if (!(key %in% self$`_field_list`)) { # json key not in list of fields
|
||||||
|
@ -64,7 +64,7 @@ OneOfPrimitiveTypeTest <- R6::R6Class(
|
|||||||
error_messages <- list()
|
error_messages <- list()
|
||||||
instance <- NULL
|
instance <- NULL
|
||||||
|
|
||||||
integer_result <- tryCatch({
|
`integer_result` <- tryCatch({
|
||||||
instance <- jsonlite::fromJSON(input, simplifyVector = FALSE)
|
instance <- jsonlite::fromJSON(input, simplifyVector = FALSE)
|
||||||
if (typeof(instance) != "integer") {
|
if (typeof(instance) != "integer") {
|
||||||
stop(sprintf("Data type doesn't match. Expected: %s. Actual: %s.", "integer", typeof(instance)))
|
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
|
error = function(err) err
|
||||||
)
|
)
|
||||||
|
|
||||||
if (!is.null(integer_result["error"])) {
|
if (!is.null(`integer_result`["error"])) {
|
||||||
error_messages <- append(error_messages, integer_result["message"])
|
error_messages <- append(error_messages, `integer_result`["message"])
|
||||||
}
|
}
|
||||||
|
|
||||||
character_result <- tryCatch({
|
`character_result` <- tryCatch({
|
||||||
instance <- jsonlite::fromJSON(input, simplifyVector = FALSE)
|
instance <- jsonlite::fromJSON(input, simplifyVector = FALSE)
|
||||||
if (typeof(instance) != "character") {
|
if (typeof(instance) != "character") {
|
||||||
stop(sprintf("Data type doesn't match. Expected: %s. Actual: %s.", "character", typeof(instance)))
|
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
|
error = function(err) err
|
||||||
)
|
)
|
||||||
|
|
||||||
if (!is.null(character_result["error"])) {
|
if (!is.null(`character_result`["error"])) {
|
||||||
error_messages <- append(error_messages, character_result["message"])
|
error_messages <- append(error_messages, `character_result`["message"])
|
||||||
}
|
}
|
||||||
|
|
||||||
if (matched == 1) {
|
if (matched == 1) {
|
||||||
|
@ -138,9 +138,9 @@ Pet <- R6::R6Class(
|
|||||||
self$`id` <- this_object$`id`
|
self$`id` <- this_object$`id`
|
||||||
}
|
}
|
||||||
if (!is.null(this_object$`category`)) {
|
if (!is.null(this_object$`category`)) {
|
||||||
category_object <- Category$new()
|
`category_object` <- Category$new()
|
||||||
category_object$fromJSON(jsonlite::toJSON(this_object$category, auto_unbox = TRUE, digits = NA))
|
`category_object`$fromJSON(jsonlite::toJSON(this_object$`category`, auto_unbox = TRUE, digits = NA))
|
||||||
self$`category` <- category_object
|
self$`category` <- `category_object`
|
||||||
}
|
}
|
||||||
if (!is.null(this_object$`name`)) {
|
if (!is.null(this_object$`name`)) {
|
||||||
self$`name` <- this_object$`name`
|
self$`name` <- this_object$`name`
|
||||||
@ -243,7 +243,7 @@ Pet <- R6::R6Class(
|
|||||||
fromJSONString = function(input_json) {
|
fromJSONString = function(input_json) {
|
||||||
this_object <- jsonlite::fromJSON(input_json)
|
this_object <- jsonlite::fromJSON(input_json)
|
||||||
self$`id` <- this_object$`id`
|
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$`name` <- this_object$`name`
|
||||||
self$`photoUrls` <- ApiClient$new()$deserializeObj(this_object$`photoUrls`, "array[character]", loadNamespace("petstore"))
|
self$`photoUrls` <- ApiClient$new()$deserializeObj(this_object$`photoUrls`, "array[character]", loadNamespace("petstore"))
|
||||||
self$`tags` <- ApiClient$new()$deserializeObj(this_object$`tags`, "array[Tag]", loadNamespace("petstore"))
|
self$`tags` <- ApiClient$new()$deserializeObj(this_object$`tags`, "array[Tag]", loadNamespace("petstore"))
|
||||||
|
@ -64,10 +64,10 @@ Pig <- R6::R6Class(
|
|||||||
error_messages <- list()
|
error_messages <- list()
|
||||||
instance <- NULL
|
instance <- NULL
|
||||||
|
|
||||||
BasquePig_result <- tryCatch({
|
`BasquePig_result` <- tryCatch({
|
||||||
BasquePig$public_methods$validateJSON(input)
|
`BasquePig`$public_methods$validateJSON(input)
|
||||||
BasquePig_instance <- BasquePig$new()
|
`BasquePig_instance` <- `BasquePig`$new()
|
||||||
instance <- BasquePig_instance$fromJSON(input)
|
instance <- `BasquePig_instance`$fromJSON(input)
|
||||||
instance_type <- "BasquePig"
|
instance_type <- "BasquePig"
|
||||||
matched_schemas <- append(matched_schemas, "BasquePig")
|
matched_schemas <- append(matched_schemas, "BasquePig")
|
||||||
matched <- matched + 1
|
matched <- matched + 1
|
||||||
@ -75,14 +75,14 @@ Pig <- R6::R6Class(
|
|||||||
error = function(err) err
|
error = function(err) err
|
||||||
)
|
)
|
||||||
|
|
||||||
if (!is.null(BasquePig_result["error"])) {
|
if (!is.null(`BasquePig_result`["error"])) {
|
||||||
error_messages <- append(error_messages, BasquePig_result["message"])
|
error_messages <- append(error_messages, `BasquePig_result`["message"])
|
||||||
}
|
}
|
||||||
|
|
||||||
DanishPig_result <- tryCatch({
|
`DanishPig_result` <- tryCatch({
|
||||||
DanishPig$public_methods$validateJSON(input)
|
`DanishPig`$public_methods$validateJSON(input)
|
||||||
DanishPig_instance <- DanishPig$new()
|
`DanishPig_instance` <- `DanishPig`$new()
|
||||||
instance <- DanishPig_instance$fromJSON(input)
|
instance <- `DanishPig_instance`$fromJSON(input)
|
||||||
instance_type <- "DanishPig"
|
instance_type <- "DanishPig"
|
||||||
matched_schemas <- append(matched_schemas, "DanishPig")
|
matched_schemas <- append(matched_schemas, "DanishPig")
|
||||||
matched <- matched + 1
|
matched <- matched + 1
|
||||||
@ -90,8 +90,8 @@ Pig <- R6::R6Class(
|
|||||||
error = function(err) err
|
error = function(err) err
|
||||||
)
|
)
|
||||||
|
|
||||||
if (!is.null(DanishPig_result["error"])) {
|
if (!is.null(`DanishPig_result`["error"])) {
|
||||||
error_messages <- append(error_messages, DanishPig_result["message"])
|
error_messages <- append(error_messages, `DanishPig_result`["message"])
|
||||||
}
|
}
|
||||||
|
|
||||||
if (matched == 1) {
|
if (matched == 1) {
|
||||||
|
@ -79,9 +79,9 @@ UpdatePetRequest <- R6::R6Class(
|
|||||||
fromJSON = function(input_json) {
|
fromJSON = function(input_json) {
|
||||||
this_object <- jsonlite::fromJSON(input_json)
|
this_object <- jsonlite::fromJSON(input_json)
|
||||||
if (!is.null(this_object$`jsonData`)) {
|
if (!is.null(this_object$`jsonData`)) {
|
||||||
jsondata_object <- Pet$new()
|
`jsondata_object` <- Pet$new()
|
||||||
jsondata_object$fromJSON(jsonlite::toJSON(this_object$jsonData, auto_unbox = TRUE, digits = NA))
|
`jsondata_object`$fromJSON(jsonlite::toJSON(this_object$`jsonData`, auto_unbox = TRUE, digits = NA))
|
||||||
self$`jsonData` <- jsondata_object
|
self$`jsonData` <- `jsondata_object`
|
||||||
}
|
}
|
||||||
if (!is.null(this_object$`binaryDataN2Information`)) {
|
if (!is.null(this_object$`binaryDataN2Information`)) {
|
||||||
self$`binaryDataN2Information` <- this_object$`binaryDataN2Information`
|
self$`binaryDataN2Information` <- this_object$`binaryDataN2Information`
|
||||||
@ -139,7 +139,7 @@ UpdatePetRequest <- R6::R6Class(
|
|||||||
#' @export
|
#' @export
|
||||||
fromJSONString = function(input_json) {
|
fromJSONString = function(input_json) {
|
||||||
this_object <- jsonlite::fromJSON(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$`binaryDataN2Information` <- this_object$`binaryDataN2Information`
|
||||||
# process additional properties/fields in the payload
|
# process additional properties/fields in the payload
|
||||||
for (key in names(this_object)) {
|
for (key in names(this_object)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user