add additional properties support in r client (#13317)

This commit is contained in:
William Cheng 2022-08-31 15:06:40 +08:00 committed by GitHub
parent d63caf2539
commit cebdbb6a11
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
65 changed files with 785 additions and 116 deletions

View File

@ -10,3 +10,4 @@ additionalProperties:
returnExceptionOnFailure: true returnExceptionOnFailure: true
errorObjectType: "ModelApiResponse" errorObjectType: "ModelApiResponse"
operationIdNaming: PascalCase #default operationIdNaming: PascalCase #default
disallowAdditionalPropertiesIfNotPresent: false

View File

@ -13,3 +13,4 @@ additionalProperties:
operationIdNaming: snake_case operationIdNaming: snake_case
generateWrapper: true generateWrapper: true
useOneOfDiscriminatorLookup: true useOneOfDiscriminatorLookup: true
disallowAdditionalPropertiesIfNotPresent: false

View File

@ -18,6 +18,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
| Option | Description | Values | Default | | Option | Description | Values | Default |
| ------ | ----------- | ------ | ------- | | ------ | ----------- | ------ | ------- |
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|errorObjectType|Error object type.| |null| |errorObjectType|Error object type.| |null|
|exceptionPackage|Specify the exception handling package|<dl><dt>**default**</dt><dd>Use stop() for raising exceptions.</dd><dt>**rlang**</dt><dd>Use rlang package for exceptions.</dd></dl>|default| |exceptionPackage|Specify the exception handling package|<dl><dt>**default**</dt><dd>Use stop() for raising exceptions.</dd><dt>**rlang**</dt><dd>Use rlang package for exceptions.</dd></dl>|default|
|generateWrapper|Generate a wrapper class (single point of access) for the R client. This option only works with `httr2` library.| |false| |generateWrapper|Generate a wrapper class (single point of access) for the R client. This option only works with `httr2` library.| |false|

View File

@ -216,6 +216,20 @@ public class RClientCodegen extends DefaultCodegen implements CodegenConfig {
setLibrary(HTTR); setLibrary(HTTR);
cliOptions.add(CliOption.newBoolean(GENERATE_WRAPPER, "Generate a wrapper class (single point of access) for the R client. This option only works with `httr2` library.")); cliOptions.add(CliOption.newBoolean(GENERATE_WRAPPER, "Generate a wrapper class (single point of access) for the R client. This option only works with `httr2` library."));
// option to change how we process + set the data in the 'additionalProperties' keyword.
CliOption disallowAdditionalPropertiesIfNotPresentOpt = CliOption.newBoolean(
CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT,
CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT_DESC).defaultValue(Boolean.TRUE.toString());
Map<String, String> disallowAdditionalPropertiesIfNotPresentOpts = new HashMap<>();
disallowAdditionalPropertiesIfNotPresentOpts.put("false",
"The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.");
disallowAdditionalPropertiesIfNotPresentOpts.put("true",
"Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.");
disallowAdditionalPropertiesIfNotPresentOpt.setEnum(disallowAdditionalPropertiesIfNotPresentOpts);
cliOptions.add(disallowAdditionalPropertiesIfNotPresentOpt);
this.setDisallowAdditionalPropertiesIfNotPresent(true);
} }
@Override @Override
@ -272,6 +286,11 @@ public class RClientCodegen extends DefaultCodegen implements CodegenConfig {
additionalProperties.put(CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP, useOneOfDiscriminatorLookup); additionalProperties.put(CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP, useOneOfDiscriminatorLookup);
} }
if (additionalProperties.containsKey(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT)) {
this.setDisallowAdditionalPropertiesIfNotPresent(Boolean.parseBoolean(additionalProperties
.get(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT).toString()));
}
additionalProperties.put(CodegenConstants.PACKAGE_NAME, packageName); additionalProperties.put(CodegenConstants.PACKAGE_NAME, packageName);
additionalProperties.put(CodegenConstants.PACKAGE_VERSION, packageVersion); additionalProperties.put(CodegenConstants.PACKAGE_VERSION, packageVersion);
additionalProperties.put(CodegenConstants.EXCEPTION_ON_FAILURE, returnExceptionOnFailure); additionalProperties.put(CodegenConstants.EXCEPTION_ON_FAILURE, returnExceptionOnFailure);

View File

@ -10,6 +10,9 @@
{{#vars}} {{#vars}}
#' @field {{name}} {{title}} {{{vendorExtensions.x-r-doc-type}}}{{^required}} [optional]{{/required}} #' @field {{name}} {{title}} {{{vendorExtensions.x-r-doc-type}}}{{^required}} [optional]{{/required}}
{{/vars}} {{/vars}}
{{#isAdditionalPropertiesTrue}}
#' @field additional_properties named list(character) [optional]
{{/isAdditionalPropertiesTrue}}
#' @importFrom R6 R6Class #' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON #' @importFrom jsonlite fromJSON toJSON
#' @export #' @export
@ -22,6 +25,9 @@
{{#vars}} {{#vars}}
`{{{name}}}` = NULL, `{{{name}}}` = NULL,
{{/vars}} {{/vars}}
{{#isAdditionalPropertiesTrue}}
`additional_properties` = NULL,
{{/isAdditionalPropertiesTrue}}
#' Initialize a new {{{classname}}} class. #' Initialize a new {{{classname}}} class.
#' #'
#' @description #' @description
@ -33,10 +39,13 @@
{{#optionalVars}} {{#optionalVars}}
#' @param {{name}} {{#lambdaRdocEscape}}{{{description}}}{{/lambdaRdocEscape}}{{^description}}{{{name}}}{{/description}}{{#defaultValue}}. Default to {{{.}}}.{{/defaultValue}} #' @param {{name}} {{#lambdaRdocEscape}}{{{description}}}{{/lambdaRdocEscape}}{{^description}}{{{name}}}{{/description}}{{#defaultValue}}. Default to {{{.}}}.{{/defaultValue}}
{{/optionalVars}} {{/optionalVars}}
{{#isAdditionalPropertiesTrue}}
#' @param additional_properties additonal properties (optional)
{{/isAdditionalPropertiesTrue}}
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(
{{#requiredVars}}`{{name}}`, {{/requiredVars}}{{#optionalVars}}`{{name}}` = {{{defaultValue}}}{{^defaultValue}}NULL{{/defaultValue}}, {{/optionalVars}}... {{#requiredVars}}`{{name}}`, {{/requiredVars}}{{#optionalVars}}`{{name}}` = {{{defaultValue}}}{{^defaultValue}}NULL{{/defaultValue}}, {{/optionalVars}}{{#isAdditionalPropertiesTrue}}additional_properties = NULL, {{/isAdditionalPropertiesTrue}}...
) { ) {
{{#requiredVars}} {{#requiredVars}}
if (!missing(`{{name}}`)) { if (!missing(`{{name}}`)) {
@ -126,6 +135,13 @@
self$`{{name}}` <- `{{name}}` self$`{{name}}` <- `{{name}}`
} }
{{/optionalVars}} {{/optionalVars}}
{{#isAdditionalPropertiesTrue}}
if (!is.null(additional_properties)) {
for (key in names(additional_properties)) {
self$additional_properties[[key]] <- additional_properties[[key]]
}
}
{{/isAdditionalPropertiesTrue}}
}, },
#' To JSON string #' To JSON string
#' #'
@ -167,7 +183,12 @@
{{/isContainer}} {{/isContainer}}
} }
{{/vars}} {{/vars}}
{{#isAdditionalPropertiesTrue}}
for (key in names(self$additional_properties)) {
{{classname}}Object[[key]] <- self$additional_properties[[key]]
}
{{/isAdditionalPropertiesTrue}}
{{classname}}Object {{classname}}Object
}, },
#' Deserialize JSON string into an instance of {{{classname}}} #' Deserialize JSON string into an instance of {{{classname}}}
@ -266,7 +287,14 @@
{{/vars}} {{/vars}}
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
{{#isAdditionalPropertiesTrue}}
json_obj <- jsonlite::fromJSON(json_string)
for (key in names(self$additional_properties)) {
json_obj[[key]] <- self$additional_properties[[key]]
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
{{/isAdditionalPropertiesTrue}}
}, },
#' Deserialize JSON string into an instance of {{{classname}}} #' Deserialize JSON string into an instance of {{{classname}}}
#' #'

View File

@ -12,6 +12,7 @@
#' @field code integer [optional] #' @field code integer [optional]
#' @field type character [optional] #' @field type character [optional]
#' @field message character [optional] #' @field message character [optional]
#' @field additional_properties named list(character) [optional]
#' @importFrom R6 R6Class #' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON #' @importFrom jsonlite fromJSON toJSON
#' @export #' @export
@ -23,6 +24,7 @@ AllofTagApiResponse <- R6::R6Class(
`code` = NULL, `code` = NULL,
`type` = NULL, `type` = NULL,
`message` = NULL, `message` = NULL,
`additional_properties` = NULL,
#' Initialize a new AllofTagApiResponse class. #' Initialize a new AllofTagApiResponse class.
#' #'
#' @description #' @description
@ -33,10 +35,11 @@ AllofTagApiResponse <- R6::R6Class(
#' @param code code #' @param code code
#' @param type type #' @param type type
#' @param message message #' @param message message
#' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(
`id` = NULL, `name` = NULL, `code` = NULL, `type` = NULL, `message` = NULL, ... `id` = NULL, `name` = NULL, `code` = NULL, `type` = NULL, `message` = NULL, additional_properties = NULL, ...
) { ) {
if (!is.null(`id`)) { if (!is.null(`id`)) {
stopifnot(is.numeric(`id`), length(`id`) == 1) stopifnot(is.numeric(`id`), length(`id`) == 1)
@ -58,6 +61,11 @@ AllofTagApiResponse <- R6::R6Class(
stopifnot(is.character(`message`), length(`message`) == 1) stopifnot(is.character(`message`), length(`message`) == 1)
self$`message` <- `message` self$`message` <- `message`
} }
if (!is.null(additional_properties)) {
for (key in names(additional_properties)) {
self$additional_properties[[key]] <- additional_properties[[key]]
}
}
}, },
#' To JSON string #' To JSON string
#' #'
@ -88,6 +96,9 @@ AllofTagApiResponse <- R6::R6Class(
AllofTagApiResponseObject[["message"]] <- AllofTagApiResponseObject[["message"]] <-
self$`message` self$`message`
} }
for (key in names(self$additional_properties)) {
AllofTagApiResponseObject[[key]] <- self$additional_properties[[key]]
}
AllofTagApiResponseObject AllofTagApiResponseObject
}, },
@ -169,7 +180,12 @@ AllofTagApiResponse <- R6::R6Class(
} }
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
json_obj <- jsonlite::fromJSON(json_string)
for (key in names(self$additional_properties)) {
json_obj[[key]] <- self$additional_properties[[key]]
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
}, },
#' Deserialize JSON string into an instance of AllofTagApiResponse #' Deserialize JSON string into an instance of AllofTagApiResponse
#' #'

View File

@ -9,6 +9,7 @@
#' @format An \code{R6Class} generator object #' @format An \code{R6Class} generator object
#' @field className character #' @field className character
#' @field color character [optional] #' @field color character [optional]
#' @field additional_properties named list(character) [optional]
#' @importFrom R6 R6Class #' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON #' @importFrom jsonlite fromJSON toJSON
#' @export #' @export
@ -17,6 +18,7 @@ Animal <- R6::R6Class(
public = list( public = list(
`className` = NULL, `className` = NULL,
`color` = NULL, `color` = NULL,
`additional_properties` = NULL,
#' Initialize a new Animal class. #' Initialize a new Animal class.
#' #'
#' @description #' @description
@ -24,10 +26,11 @@ Animal <- R6::R6Class(
#' #'
#' @param className className #' @param className className
#' @param color color. Default to "red". #' @param color color. Default to "red".
#' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(
`className`, `color` = "red", ... `className`, `color` = "red", additional_properties = NULL, ...
) { ) {
if (!missing(`className`)) { if (!missing(`className`)) {
stopifnot(is.character(`className`), length(`className`) == 1) stopifnot(is.character(`className`), length(`className`) == 1)
@ -37,6 +40,11 @@ Animal <- R6::R6Class(
stopifnot(is.character(`color`), length(`color`) == 1) stopifnot(is.character(`color`), length(`color`) == 1)
self$`color` <- `color` self$`color` <- `color`
} }
if (!is.null(additional_properties)) {
for (key in names(additional_properties)) {
self$additional_properties[[key]] <- additional_properties[[key]]
}
}
}, },
#' To JSON string #' To JSON string
#' #'
@ -55,6 +63,9 @@ Animal <- R6::R6Class(
AnimalObject[["color"]] <- AnimalObject[["color"]] <-
self$`color` self$`color`
} }
for (key in names(self$additional_properties)) {
AnimalObject[[key]] <- self$additional_properties[[key]]
}
AnimalObject AnimalObject
}, },
@ -103,7 +114,12 @@ Animal <- R6::R6Class(
} }
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
json_obj <- jsonlite::fromJSON(json_string)
for (key in names(self$additional_properties)) {
json_obj[[key]] <- self$additional_properties[[key]]
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
}, },
#' Deserialize JSON string into an instance of Animal #' Deserialize JSON string into an instance of Animal
#' #'

View File

@ -9,6 +9,7 @@
#' @format An \code{R6Class} generator object #' @format An \code{R6Class} generator object
#' @field className character #' @field className character
#' @field color character #' @field color character
#' @field additional_properties named list(character) [optional]
#' @importFrom R6 R6Class #' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON #' @importFrom jsonlite fromJSON toJSON
#' @export #' @export
@ -17,6 +18,7 @@ BasquePig <- R6::R6Class(
public = list( public = list(
`className` = NULL, `className` = NULL,
`color` = NULL, `color` = NULL,
`additional_properties` = NULL,
#' Initialize a new BasquePig class. #' Initialize a new BasquePig class.
#' #'
#' @description #' @description
@ -24,10 +26,11 @@ BasquePig <- R6::R6Class(
#' #'
#' @param className className #' @param className className
#' @param color color #' @param color color
#' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(
`className`, `color`, ... `className`, `color`, additional_properties = NULL, ...
) { ) {
if (!missing(`className`)) { if (!missing(`className`)) {
stopifnot(is.character(`className`), length(`className`) == 1) stopifnot(is.character(`className`), length(`className`) == 1)
@ -37,6 +40,11 @@ BasquePig <- R6::R6Class(
stopifnot(is.character(`color`), length(`color`) == 1) stopifnot(is.character(`color`), length(`color`) == 1)
self$`color` <- `color` self$`color` <- `color`
} }
if (!is.null(additional_properties)) {
for (key in names(additional_properties)) {
self$additional_properties[[key]] <- additional_properties[[key]]
}
}
}, },
#' To JSON string #' To JSON string
#' #'
@ -55,6 +63,9 @@ BasquePig <- R6::R6Class(
BasquePigObject[["color"]] <- BasquePigObject[["color"]] <-
self$`color` self$`color`
} }
for (key in names(self$additional_properties)) {
BasquePigObject[[key]] <- self$additional_properties[[key]]
}
BasquePigObject BasquePigObject
}, },
@ -103,7 +114,12 @@ BasquePig <- R6::R6Class(
} }
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
json_obj <- jsonlite::fromJSON(json_string)
for (key in names(self$additional_properties)) {
json_obj[[key]] <- self$additional_properties[[key]]
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
}, },
#' Deserialize JSON string into an instance of BasquePig #' Deserialize JSON string into an instance of BasquePig
#' #'

View File

@ -10,6 +10,7 @@
#' @field className character #' @field className character
#' @field color character [optional] #' @field color character [optional]
#' @field declawed character [optional] #' @field declawed character [optional]
#' @field additional_properties named list(character) [optional]
#' @importFrom R6 R6Class #' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON #' @importFrom jsonlite fromJSON toJSON
#' @export #' @export
@ -20,6 +21,7 @@ Cat <- R6::R6Class(
`className` = NULL, `className` = NULL,
`color` = NULL, `color` = NULL,
`declawed` = NULL, `declawed` = NULL,
`additional_properties` = NULL,
#' Initialize a new Cat class. #' Initialize a new Cat class.
#' #'
#' @description #' @description
@ -28,10 +30,11 @@ Cat <- R6::R6Class(
#' @param className className #' @param className className
#' @param color color. Default to "red". #' @param color color. Default to "red".
#' @param declawed declawed #' @param declawed declawed
#' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(
`className`, `color` = "red", `declawed` = NULL, ... `className`, `color` = "red", `declawed` = NULL, additional_properties = NULL, ...
) { ) {
if (!missing(`className`)) { if (!missing(`className`)) {
stopifnot(is.character(`className`), length(`className`) == 1) stopifnot(is.character(`className`), length(`className`) == 1)
@ -45,6 +48,11 @@ Cat <- R6::R6Class(
stopifnot(is.logical(`declawed`), length(`declawed`) == 1) stopifnot(is.logical(`declawed`), length(`declawed`) == 1)
self$`declawed` <- `declawed` self$`declawed` <- `declawed`
} }
if (!is.null(additional_properties)) {
for (key in names(additional_properties)) {
self$additional_properties[[key]] <- additional_properties[[key]]
}
}
}, },
#' To JSON string #' To JSON string
#' #'
@ -67,6 +75,9 @@ Cat <- R6::R6Class(
CatObject[["declawed"]] <- CatObject[["declawed"]] <-
self$`declawed` self$`declawed`
} }
for (key in names(self$additional_properties)) {
CatObject[[key]] <- self$additional_properties[[key]]
}
CatObject CatObject
}, },
@ -126,7 +137,12 @@ Cat <- R6::R6Class(
} }
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
json_obj <- jsonlite::fromJSON(json_string)
for (key in names(self$additional_properties)) {
json_obj[[key]] <- self$additional_properties[[key]]
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
}, },
#' Deserialize JSON string into an instance of Cat #' Deserialize JSON string into an instance of Cat
#' #'

View File

@ -8,6 +8,7 @@
#' @description CatAllOf Class #' @description CatAllOf Class
#' @format An \code{R6Class} generator object #' @format An \code{R6Class} generator object
#' @field declawed character [optional] #' @field declawed character [optional]
#' @field additional_properties named list(character) [optional]
#' @importFrom R6 R6Class #' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON #' @importFrom jsonlite fromJSON toJSON
#' @export #' @export
@ -15,21 +16,28 @@ CatAllOf <- R6::R6Class(
"CatAllOf", "CatAllOf",
public = list( public = list(
`declawed` = NULL, `declawed` = NULL,
`additional_properties` = NULL,
#' Initialize a new CatAllOf class. #' Initialize a new CatAllOf class.
#' #'
#' @description #' @description
#' Initialize a new CatAllOf class. #' Initialize a new CatAllOf class.
#' #'
#' @param declawed declawed #' @param declawed declawed
#' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(
`declawed` = NULL, ... `declawed` = NULL, additional_properties = NULL, ...
) { ) {
if (!is.null(`declawed`)) { if (!is.null(`declawed`)) {
stopifnot(is.logical(`declawed`), length(`declawed`) == 1) stopifnot(is.logical(`declawed`), length(`declawed`) == 1)
self$`declawed` <- `declawed` self$`declawed` <- `declawed`
} }
if (!is.null(additional_properties)) {
for (key in names(additional_properties)) {
self$additional_properties[[key]] <- additional_properties[[key]]
}
}
}, },
#' To JSON string #' To JSON string
#' #'
@ -44,6 +52,9 @@ CatAllOf <- R6::R6Class(
CatAllOfObject[["declawed"]] <- CatAllOfObject[["declawed"]] <-
self$`declawed` self$`declawed`
} }
for (key in names(self$additional_properties)) {
CatAllOfObject[[key]] <- self$additional_properties[[key]]
}
CatAllOfObject CatAllOfObject
}, },
@ -81,7 +92,12 @@ CatAllOf <- R6::R6Class(
} }
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
json_obj <- jsonlite::fromJSON(json_string)
for (key in names(self$additional_properties)) {
json_obj[[key]] <- self$additional_properties[[key]]
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
}, },
#' Deserialize JSON string into an instance of CatAllOf #' Deserialize JSON string into an instance of CatAllOf
#' #'

View File

@ -9,6 +9,7 @@
#' @format An \code{R6Class} generator object #' @format An \code{R6Class} generator object
#' @field id integer [optional] #' @field id integer [optional]
#' @field name character [optional] #' @field name character [optional]
#' @field additional_properties named list(character) [optional]
#' @importFrom R6 R6Class #' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON #' @importFrom jsonlite fromJSON toJSON
#' @export #' @export
@ -17,6 +18,7 @@ Category <- R6::R6Class(
public = list( public = list(
`id` = NULL, `id` = NULL,
`name` = NULL, `name` = NULL,
`additional_properties` = NULL,
#' Initialize a new Category class. #' Initialize a new Category class.
#' #'
#' @description #' @description
@ -24,10 +26,11 @@ Category <- R6::R6Class(
#' #'
#' @param id id #' @param id id
#' @param name name #' @param name name
#' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(
`id` = NULL, `name` = NULL, ... `id` = NULL, `name` = NULL, additional_properties = NULL, ...
) { ) {
if (!is.null(`id`)) { if (!is.null(`id`)) {
stopifnot(is.numeric(`id`), length(`id`) == 1) stopifnot(is.numeric(`id`), length(`id`) == 1)
@ -37,6 +40,11 @@ Category <- R6::R6Class(
stopifnot(is.character(`name`), length(`name`) == 1) stopifnot(is.character(`name`), length(`name`) == 1)
self$`name` <- `name` self$`name` <- `name`
} }
if (!is.null(additional_properties)) {
for (key in names(additional_properties)) {
self$additional_properties[[key]] <- additional_properties[[key]]
}
}
}, },
#' To JSON string #' To JSON string
#' #'
@ -55,6 +63,9 @@ Category <- R6::R6Class(
CategoryObject[["name"]] <- CategoryObject[["name"]] <-
self$`name` self$`name`
} }
for (key in names(self$additional_properties)) {
CategoryObject[[key]] <- self$additional_properties[[key]]
}
CategoryObject CategoryObject
}, },
@ -103,7 +114,12 @@ Category <- R6::R6Class(
} }
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
json_obj <- jsonlite::fromJSON(json_string)
for (key in names(self$additional_properties)) {
json_obj[[key]] <- self$additional_properties[[key]]
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
}, },
#' Deserialize JSON string into an instance of Category #' Deserialize JSON string into an instance of Category
#' #'

View File

@ -9,6 +9,7 @@
#' @format An \code{R6Class} generator object #' @format An \code{R6Class} generator object
#' @field className character #' @field className character
#' @field size integer #' @field size integer
#' @field additional_properties named list(character) [optional]
#' @importFrom R6 R6Class #' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON #' @importFrom jsonlite fromJSON toJSON
#' @export #' @export
@ -17,6 +18,7 @@ DanishPig <- R6::R6Class(
public = list( public = list(
`className` = NULL, `className` = NULL,
`size` = NULL, `size` = NULL,
`additional_properties` = NULL,
#' Initialize a new DanishPig class. #' Initialize a new DanishPig class.
#' #'
#' @description #' @description
@ -24,10 +26,11 @@ DanishPig <- R6::R6Class(
#' #'
#' @param className className #' @param className className
#' @param size size #' @param size size
#' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(
`className`, `size`, ... `className`, `size`, additional_properties = NULL, ...
) { ) {
if (!missing(`className`)) { if (!missing(`className`)) {
stopifnot(is.character(`className`), length(`className`) == 1) stopifnot(is.character(`className`), length(`className`) == 1)
@ -37,6 +40,11 @@ DanishPig <- R6::R6Class(
stopifnot(is.numeric(`size`), length(`size`) == 1) stopifnot(is.numeric(`size`), length(`size`) == 1)
self$`size` <- `size` self$`size` <- `size`
} }
if (!is.null(additional_properties)) {
for (key in names(additional_properties)) {
self$additional_properties[[key]] <- additional_properties[[key]]
}
}
}, },
#' To JSON string #' To JSON string
#' #'
@ -55,6 +63,9 @@ DanishPig <- R6::R6Class(
DanishPigObject[["size"]] <- DanishPigObject[["size"]] <-
self$`size` self$`size`
} }
for (key in names(self$additional_properties)) {
DanishPigObject[[key]] <- self$additional_properties[[key]]
}
DanishPigObject DanishPigObject
}, },
@ -103,7 +114,12 @@ DanishPig <- R6::R6Class(
} }
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
json_obj <- jsonlite::fromJSON(json_string)
for (key in names(self$additional_properties)) {
json_obj[[key]] <- self$additional_properties[[key]]
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
}, },
#' Deserialize JSON string into an instance of DanishPig #' Deserialize JSON string into an instance of DanishPig
#' #'

View File

@ -10,6 +10,7 @@
#' @field className character #' @field className character
#' @field color character [optional] #' @field color character [optional]
#' @field breed character [optional] #' @field breed character [optional]
#' @field additional_properties named list(character) [optional]
#' @importFrom R6 R6Class #' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON #' @importFrom jsonlite fromJSON toJSON
#' @export #' @export
@ -20,6 +21,7 @@ Dog <- R6::R6Class(
`className` = NULL, `className` = NULL,
`color` = NULL, `color` = NULL,
`breed` = NULL, `breed` = NULL,
`additional_properties` = NULL,
#' Initialize a new Dog class. #' Initialize a new Dog class.
#' #'
#' @description #' @description
@ -28,10 +30,11 @@ Dog <- R6::R6Class(
#' @param className className #' @param className className
#' @param color color. Default to "red". #' @param color color. Default to "red".
#' @param breed breed #' @param breed breed
#' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(
`className`, `color` = "red", `breed` = NULL, ... `className`, `color` = "red", `breed` = NULL, additional_properties = NULL, ...
) { ) {
if (!missing(`className`)) { if (!missing(`className`)) {
stopifnot(is.character(`className`), length(`className`) == 1) stopifnot(is.character(`className`), length(`className`) == 1)
@ -45,6 +48,11 @@ Dog <- R6::R6Class(
stopifnot(is.character(`breed`), length(`breed`) == 1) stopifnot(is.character(`breed`), length(`breed`) == 1)
self$`breed` <- `breed` self$`breed` <- `breed`
} }
if (!is.null(additional_properties)) {
for (key in names(additional_properties)) {
self$additional_properties[[key]] <- additional_properties[[key]]
}
}
}, },
#' To JSON string #' To JSON string
#' #'
@ -67,6 +75,9 @@ Dog <- R6::R6Class(
DogObject[["breed"]] <- DogObject[["breed"]] <-
self$`breed` self$`breed`
} }
for (key in names(self$additional_properties)) {
DogObject[[key]] <- self$additional_properties[[key]]
}
DogObject DogObject
}, },
@ -126,7 +137,12 @@ Dog <- R6::R6Class(
} }
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
json_obj <- jsonlite::fromJSON(json_string)
for (key in names(self$additional_properties)) {
json_obj[[key]] <- self$additional_properties[[key]]
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
}, },
#' Deserialize JSON string into an instance of Dog #' Deserialize JSON string into an instance of Dog
#' #'

View File

@ -8,6 +8,7 @@
#' @description DogAllOf Class #' @description DogAllOf Class
#' @format An \code{R6Class} generator object #' @format An \code{R6Class} generator object
#' @field breed character [optional] #' @field breed character [optional]
#' @field additional_properties named list(character) [optional]
#' @importFrom R6 R6Class #' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON #' @importFrom jsonlite fromJSON toJSON
#' @export #' @export
@ -15,21 +16,28 @@ DogAllOf <- R6::R6Class(
"DogAllOf", "DogAllOf",
public = list( public = list(
`breed` = NULL, `breed` = NULL,
`additional_properties` = NULL,
#' Initialize a new DogAllOf class. #' Initialize a new DogAllOf class.
#' #'
#' @description #' @description
#' Initialize a new DogAllOf class. #' Initialize a new DogAllOf class.
#' #'
#' @param breed breed #' @param breed breed
#' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(
`breed` = NULL, ... `breed` = NULL, additional_properties = NULL, ...
) { ) {
if (!is.null(`breed`)) { if (!is.null(`breed`)) {
stopifnot(is.character(`breed`), length(`breed`) == 1) stopifnot(is.character(`breed`), length(`breed`) == 1)
self$`breed` <- `breed` self$`breed` <- `breed`
} }
if (!is.null(additional_properties)) {
for (key in names(additional_properties)) {
self$additional_properties[[key]] <- additional_properties[[key]]
}
}
}, },
#' To JSON string #' To JSON string
#' #'
@ -44,6 +52,9 @@ DogAllOf <- R6::R6Class(
DogAllOfObject[["breed"]] <- DogAllOfObject[["breed"]] <-
self$`breed` self$`breed`
} }
for (key in names(self$additional_properties)) {
DogAllOfObject[[key]] <- self$additional_properties[[key]]
}
DogAllOfObject DogAllOfObject
}, },
@ -81,7 +92,12 @@ DogAllOf <- R6::R6Class(
} }
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
json_obj <- jsonlite::fromJSON(json_string)
for (key in names(self$additional_properties)) {
json_obj[[key]] <- self$additional_properties[[key]]
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
}, },
#' Deserialize JSON string into an instance of DogAllOf #' Deserialize JSON string into an instance of DogAllOf
#' #'

View File

@ -10,6 +10,7 @@
#' @field code integer [optional] #' @field code integer [optional]
#' @field type character [optional] #' @field type character [optional]
#' @field message character [optional] #' @field message character [optional]
#' @field additional_properties named list(character) [optional]
#' @importFrom R6 R6Class #' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON #' @importFrom jsonlite fromJSON toJSON
#' @export #' @export
@ -19,6 +20,7 @@ ModelApiResponse <- R6::R6Class(
`code` = NULL, `code` = NULL,
`type` = NULL, `type` = NULL,
`message` = NULL, `message` = NULL,
`additional_properties` = NULL,
#' Initialize a new ModelApiResponse class. #' Initialize a new ModelApiResponse class.
#' #'
#' @description #' @description
@ -27,10 +29,11 @@ ModelApiResponse <- R6::R6Class(
#' @param code code #' @param code code
#' @param type type #' @param type type
#' @param message message #' @param message message
#' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(
`code` = NULL, `type` = NULL, `message` = NULL, ... `code` = NULL, `type` = NULL, `message` = NULL, additional_properties = NULL, ...
) { ) {
if (!is.null(`code`)) { if (!is.null(`code`)) {
stopifnot(is.numeric(`code`), length(`code`) == 1) stopifnot(is.numeric(`code`), length(`code`) == 1)
@ -44,6 +47,11 @@ ModelApiResponse <- R6::R6Class(
stopifnot(is.character(`message`), length(`message`) == 1) stopifnot(is.character(`message`), length(`message`) == 1)
self$`message` <- `message` self$`message` <- `message`
} }
if (!is.null(additional_properties)) {
for (key in names(additional_properties)) {
self$additional_properties[[key]] <- additional_properties[[key]]
}
}
}, },
#' To JSON string #' To JSON string
#' #'
@ -66,6 +74,9 @@ ModelApiResponse <- R6::R6Class(
ModelApiResponseObject[["message"]] <- ModelApiResponseObject[["message"]] <-
self$`message` self$`message`
} }
for (key in names(self$additional_properties)) {
ModelApiResponseObject[[key]] <- self$additional_properties[[key]]
}
ModelApiResponseObject ModelApiResponseObject
}, },
@ -125,7 +136,12 @@ ModelApiResponse <- R6::R6Class(
} }
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
json_obj <- jsonlite::fromJSON(json_string)
for (key in names(self$additional_properties)) {
json_obj[[key]] <- self$additional_properties[[key]]
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
}, },
#' Deserialize JSON string into an instance of ModelApiResponse #' Deserialize JSON string into an instance of ModelApiResponse
#' #'

View File

@ -9,6 +9,7 @@
#' @format An \code{R6Class} generator object #' @format An \code{R6Class} generator object
#' @field size integer [optional] #' @field size integer [optional]
#' @field nested_pig \link{Pig} [optional] #' @field nested_pig \link{Pig} [optional]
#' @field additional_properties named list(character) [optional]
#' @importFrom R6 R6Class #' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON #' @importFrom jsonlite fromJSON toJSON
#' @export #' @export
@ -17,6 +18,7 @@ NestedOneOf <- R6::R6Class(
public = list( public = list(
`size` = NULL, `size` = NULL,
`nested_pig` = NULL, `nested_pig` = NULL,
`additional_properties` = NULL,
#' Initialize a new NestedOneOf class. #' Initialize a new NestedOneOf class.
#' #'
#' @description #' @description
@ -24,10 +26,11 @@ NestedOneOf <- R6::R6Class(
#' #'
#' @param size size #' @param size size
#' @param nested_pig nested_pig #' @param nested_pig nested_pig
#' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(
`size` = NULL, `nested_pig` = NULL, ... `size` = NULL, `nested_pig` = NULL, additional_properties = NULL, ...
) { ) {
if (!is.null(`size`)) { if (!is.null(`size`)) {
stopifnot(is.numeric(`size`), length(`size`) == 1) stopifnot(is.numeric(`size`), length(`size`) == 1)
@ -37,6 +40,11 @@ NestedOneOf <- R6::R6Class(
stopifnot(R6::is.R6(`nested_pig`)) stopifnot(R6::is.R6(`nested_pig`))
self$`nested_pig` <- `nested_pig` self$`nested_pig` <- `nested_pig`
} }
if (!is.null(additional_properties)) {
for (key in names(additional_properties)) {
self$additional_properties[[key]] <- additional_properties[[key]]
}
}
}, },
#' To JSON string #' To JSON string
#' #'
@ -55,6 +63,9 @@ NestedOneOf <- R6::R6Class(
NestedOneOfObject[["nested_pig"]] <- NestedOneOfObject[["nested_pig"]] <-
self$`nested_pig`$toJSON() self$`nested_pig`$toJSON()
} }
for (key in names(self$additional_properties)) {
NestedOneOfObject[[key]] <- self$additional_properties[[key]]
}
NestedOneOfObject NestedOneOfObject
}, },
@ -105,7 +116,12 @@ NestedOneOf <- R6::R6Class(
} }
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
json_obj <- jsonlite::fromJSON(json_string)
for (key in names(self$additional_properties)) {
json_obj[[key]] <- self$additional_properties[[key]]
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
}, },
#' Deserialize JSON string into an instance of NestedOneOf #' Deserialize JSON string into an instance of NestedOneOf
#' #'

View File

@ -13,6 +13,7 @@
#' @field shipDate character [optional] #' @field shipDate character [optional]
#' @field status character [optional] #' @field status character [optional]
#' @field complete character [optional] #' @field complete character [optional]
#' @field additional_properties named list(character) [optional]
#' @importFrom R6 R6Class #' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON #' @importFrom jsonlite fromJSON toJSON
#' @export #' @export
@ -25,6 +26,7 @@ Order <- R6::R6Class(
`shipDate` = NULL, `shipDate` = NULL,
`status` = NULL, `status` = NULL,
`complete` = NULL, `complete` = NULL,
`additional_properties` = NULL,
#' Initialize a new Order class. #' Initialize a new Order class.
#' #'
#' @description #' @description
@ -36,10 +38,11 @@ Order <- R6::R6Class(
#' @param shipDate shipDate #' @param shipDate shipDate
#' @param status Order Status #' @param status Order Status
#' @param complete complete. Default to FALSE. #' @param complete complete. Default to FALSE.
#' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(
`id` = NULL, `petId` = NULL, `quantity` = NULL, `shipDate` = NULL, `status` = NULL, `complete` = FALSE, ... `id` = NULL, `petId` = NULL, `quantity` = NULL, `shipDate` = NULL, `status` = NULL, `complete` = FALSE, additional_properties = NULL, ...
) { ) {
if (!is.null(`id`)) { if (!is.null(`id`)) {
stopifnot(is.numeric(`id`), length(`id`) == 1) stopifnot(is.numeric(`id`), length(`id`) == 1)
@ -65,6 +68,11 @@ Order <- R6::R6Class(
stopifnot(is.logical(`complete`), length(`complete`) == 1) stopifnot(is.logical(`complete`), length(`complete`) == 1)
self$`complete` <- `complete` self$`complete` <- `complete`
} }
if (!is.null(additional_properties)) {
for (key in names(additional_properties)) {
self$additional_properties[[key]] <- additional_properties[[key]]
}
}
}, },
#' To JSON string #' To JSON string
#' #'
@ -99,6 +107,9 @@ Order <- R6::R6Class(
OrderObject[["complete"]] <- OrderObject[["complete"]] <-
self$`complete` self$`complete`
} }
for (key in names(self$additional_properties)) {
OrderObject[[key]] <- self$additional_properties[[key]]
}
OrderObject OrderObject
}, },
@ -191,7 +202,12 @@ Order <- R6::R6Class(
} }
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
json_obj <- jsonlite::fromJSON(json_string)
for (key in names(self$additional_properties)) {
json_obj[[key]] <- self$additional_properties[[key]]
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
}, },
#' Deserialize JSON string into an instance of Order #' Deserialize JSON string into an instance of Order
#' #'

View File

@ -13,6 +13,7 @@
#' @field photoUrls list(character) #' @field photoUrls list(character)
#' @field tags list(\link{Tag}) [optional] #' @field tags list(\link{Tag}) [optional]
#' @field status character [optional] #' @field status character [optional]
#' @field additional_properties named list(character) [optional]
#' @importFrom R6 R6Class #' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON #' @importFrom jsonlite fromJSON toJSON
#' @export #' @export
@ -25,6 +26,7 @@ Pet <- R6::R6Class(
`photoUrls` = NULL, `photoUrls` = NULL,
`tags` = NULL, `tags` = NULL,
`status` = NULL, `status` = NULL,
`additional_properties` = NULL,
#' Initialize a new Pet class. #' Initialize a new Pet class.
#' #'
#' @description #' @description
@ -36,10 +38,11 @@ Pet <- R6::R6Class(
#' @param category category #' @param category category
#' @param tags tags #' @param tags tags
#' @param status pet status in the store #' @param status pet status in the store
#' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(
`name`, `photoUrls`, `id` = NULL, `category` = NULL, `tags` = NULL, `status` = NULL, ... `name`, `photoUrls`, `id` = NULL, `category` = NULL, `tags` = NULL, `status` = NULL, additional_properties = NULL, ...
) { ) {
if (!missing(`name`)) { if (!missing(`name`)) {
stopifnot(is.character(`name`), length(`name`) == 1) stopifnot(is.character(`name`), length(`name`) == 1)
@ -67,6 +70,11 @@ Pet <- R6::R6Class(
stopifnot(is.character(`status`), length(`status`) == 1) stopifnot(is.character(`status`), length(`status`) == 1)
self$`status` <- `status` self$`status` <- `status`
} }
if (!is.null(additional_properties)) {
for (key in names(additional_properties)) {
self$additional_properties[[key]] <- additional_properties[[key]]
}
}
}, },
#' To JSON string #' To JSON string
#' #'
@ -101,6 +109,9 @@ Pet <- R6::R6Class(
PetObject[["status"]] <- PetObject[["status"]] <-
self$`status` self$`status`
} }
for (key in names(self$additional_properties)) {
PetObject[[key]] <- self$additional_properties[[key]]
}
PetObject PetObject
}, },
@ -195,7 +206,12 @@ Pet <- R6::R6Class(
} }
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
json_obj <- jsonlite::fromJSON(json_string)
for (key in names(self$additional_properties)) {
json_obj[[key]] <- self$additional_properties[[key]]
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
}, },
#' Deserialize JSON string into an instance of Pet #' Deserialize JSON string into an instance of Pet
#' #'

View File

@ -13,6 +13,7 @@
#' @field 123_number character [optional] #' @field 123_number character [optional]
#' @field array[test] character [optional] #' @field array[test] character [optional]
#' @field empty_string character [optional] #' @field empty_string character [optional]
#' @field additional_properties named list(character) [optional]
#' @importFrom R6 R6Class #' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON #' @importFrom jsonlite fromJSON toJSON
#' @export #' @export
@ -25,6 +26,7 @@ Special <- R6::R6Class(
`123_number` = NULL, `123_number` = NULL,
`array[test]` = NULL, `array[test]` = NULL,
`empty_string` = NULL, `empty_string` = NULL,
`additional_properties` = NULL,
#' Initialize a new Special class. #' Initialize a new Special class.
#' #'
#' @description #' @description
@ -36,10 +38,11 @@ Special <- R6::R6Class(
#' @param 123_number 123_number #' @param 123_number 123_number
#' @param array[test] array[test] #' @param array[test] array[test]
#' @param empty_string empty_string #' @param empty_string empty_string
#' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(
`item_self` = NULL, `item_private` = NULL, `item_super` = NULL, `123_number` = NULL, `array[test]` = NULL, `empty_string` = NULL, ... `item_self` = NULL, `item_private` = NULL, `item_super` = NULL, `123_number` = NULL, `array[test]` = NULL, `empty_string` = NULL, additional_properties = NULL, ...
) { ) {
if (!is.null(`item_self`)) { if (!is.null(`item_self`)) {
stopifnot(is.numeric(`item_self`), length(`item_self`) == 1) stopifnot(is.numeric(`item_self`), length(`item_self`) == 1)
@ -65,6 +68,11 @@ Special <- R6::R6Class(
stopifnot(is.character(`empty_string`), length(`empty_string`) == 1) stopifnot(is.character(`empty_string`), length(`empty_string`) == 1)
self$`empty_string` <- `empty_string` self$`empty_string` <- `empty_string`
} }
if (!is.null(additional_properties)) {
for (key in names(additional_properties)) {
self$additional_properties[[key]] <- additional_properties[[key]]
}
}
}, },
#' To JSON string #' To JSON string
#' #'
@ -99,6 +107,9 @@ Special <- R6::R6Class(
SpecialObject[["empty_string"]] <- SpecialObject[["empty_string"]] <-
self$`empty_string` self$`empty_string`
} }
for (key in names(self$additional_properties)) {
SpecialObject[[key]] <- self$additional_properties[[key]]
}
SpecialObject SpecialObject
}, },
@ -191,7 +202,12 @@ Special <- R6::R6Class(
} }
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
json_obj <- jsonlite::fromJSON(json_string)
for (key in names(self$additional_properties)) {
json_obj[[key]] <- self$additional_properties[[key]]
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
}, },
#' Deserialize JSON string into an instance of Special #' Deserialize JSON string into an instance of Special
#' #'

View File

@ -9,6 +9,7 @@
#' @format An \code{R6Class} generator object #' @format An \code{R6Class} generator object
#' @field id integer [optional] #' @field id integer [optional]
#' @field name character [optional] #' @field name character [optional]
#' @field additional_properties named list(character) [optional]
#' @importFrom R6 R6Class #' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON #' @importFrom jsonlite fromJSON toJSON
#' @export #' @export
@ -17,6 +18,7 @@ Tag <- R6::R6Class(
public = list( public = list(
`id` = NULL, `id` = NULL,
`name` = NULL, `name` = NULL,
`additional_properties` = NULL,
#' Initialize a new Tag class. #' Initialize a new Tag class.
#' #'
#' @description #' @description
@ -24,10 +26,11 @@ Tag <- R6::R6Class(
#' #'
#' @param id id #' @param id id
#' @param name name #' @param name name
#' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(
`id` = NULL, `name` = NULL, ... `id` = NULL, `name` = NULL, additional_properties = NULL, ...
) { ) {
if (!is.null(`id`)) { if (!is.null(`id`)) {
stopifnot(is.numeric(`id`), length(`id`) == 1) stopifnot(is.numeric(`id`), length(`id`) == 1)
@ -37,6 +40,11 @@ Tag <- R6::R6Class(
stopifnot(is.character(`name`), length(`name`) == 1) stopifnot(is.character(`name`), length(`name`) == 1)
self$`name` <- `name` self$`name` <- `name`
} }
if (!is.null(additional_properties)) {
for (key in names(additional_properties)) {
self$additional_properties[[key]] <- additional_properties[[key]]
}
}
}, },
#' To JSON string #' To JSON string
#' #'
@ -55,6 +63,9 @@ Tag <- R6::R6Class(
TagObject[["name"]] <- TagObject[["name"]] <-
self$`name` self$`name`
} }
for (key in names(self$additional_properties)) {
TagObject[[key]] <- self$additional_properties[[key]]
}
TagObject TagObject
}, },
@ -103,7 +114,12 @@ Tag <- R6::R6Class(
} }
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
json_obj <- jsonlite::fromJSON(json_string)
for (key in names(self$additional_properties)) {
json_obj[[key]] <- self$additional_properties[[key]]
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
}, },
#' Deserialize JSON string into an instance of Tag #' Deserialize JSON string into an instance of Tag
#' #'

View File

@ -9,6 +9,7 @@
#' @format An \code{R6Class} generator object #' @format An \code{R6Class} generator object
#' @field jsonData \link{Pet} [optional] #' @field jsonData \link{Pet} [optional]
#' @field binaryDataN2Information data.frame [optional] #' @field binaryDataN2Information data.frame [optional]
#' @field additional_properties named list(character) [optional]
#' @importFrom R6 R6Class #' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON #' @importFrom jsonlite fromJSON toJSON
#' @export #' @export
@ -17,6 +18,7 @@ UpdatePetRequest <- R6::R6Class(
public = list( public = list(
`jsonData` = NULL, `jsonData` = NULL,
`binaryDataN2Information` = NULL, `binaryDataN2Information` = NULL,
`additional_properties` = NULL,
#' Initialize a new UpdatePetRequest class. #' Initialize a new UpdatePetRequest class.
#' #'
#' @description #' @description
@ -24,10 +26,11 @@ UpdatePetRequest <- R6::R6Class(
#' #'
#' @param jsonData jsonData #' @param jsonData jsonData
#' @param binaryDataN2Information binaryDataN2Information #' @param binaryDataN2Information binaryDataN2Information
#' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(
`jsonData` = NULL, `binaryDataN2Information` = NULL, ... `jsonData` = NULL, `binaryDataN2Information` = NULL, additional_properties = NULL, ...
) { ) {
if (!is.null(`jsonData`)) { if (!is.null(`jsonData`)) {
stopifnot(R6::is.R6(`jsonData`)) stopifnot(R6::is.R6(`jsonData`))
@ -36,6 +39,11 @@ UpdatePetRequest <- R6::R6Class(
if (!is.null(`binaryDataN2Information`)) { if (!is.null(`binaryDataN2Information`)) {
self$`binaryDataN2Information` <- `binaryDataN2Information` self$`binaryDataN2Information` <- `binaryDataN2Information`
} }
if (!is.null(additional_properties)) {
for (key in names(additional_properties)) {
self$additional_properties[[key]] <- additional_properties[[key]]
}
}
}, },
#' To JSON string #' To JSON string
#' #'
@ -54,6 +62,9 @@ UpdatePetRequest <- R6::R6Class(
UpdatePetRequestObject[["binaryDataN2Information"]] <- UpdatePetRequestObject[["binaryDataN2Information"]] <-
self$`binaryDataN2Information` self$`binaryDataN2Information`
} }
for (key in names(self$additional_properties)) {
UpdatePetRequestObject[[key]] <- self$additional_properties[[key]]
}
UpdatePetRequestObject UpdatePetRequestObject
}, },
@ -104,7 +115,12 @@ UpdatePetRequest <- R6::R6Class(
} }
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
json_obj <- jsonlite::fromJSON(json_string)
for (key in names(self$additional_properties)) {
json_obj[[key]] <- self$additional_properties[[key]]
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
}, },
#' Deserialize JSON string into an instance of UpdatePetRequest #' Deserialize JSON string into an instance of UpdatePetRequest
#' #'

View File

@ -15,6 +15,7 @@
#' @field password character [optional] #' @field password character [optional]
#' @field phone character [optional] #' @field phone character [optional]
#' @field userStatus integer [optional] #' @field userStatus integer [optional]
#' @field additional_properties named list(character) [optional]
#' @importFrom R6 R6Class #' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON #' @importFrom jsonlite fromJSON toJSON
#' @export #' @export
@ -29,6 +30,7 @@ User <- R6::R6Class(
`password` = NULL, `password` = NULL,
`phone` = NULL, `phone` = NULL,
`userStatus` = NULL, `userStatus` = NULL,
`additional_properties` = NULL,
#' Initialize a new User class. #' Initialize a new User class.
#' #'
#' @description #' @description
@ -42,10 +44,11 @@ User <- R6::R6Class(
#' @param password password #' @param password password
#' @param phone phone #' @param phone phone
#' @param userStatus User Status #' @param userStatus User Status
#' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(
`id` = NULL, `username` = NULL, `firstName` = NULL, `lastName` = NULL, `email` = NULL, `password` = NULL, `phone` = NULL, `userStatus` = NULL, ... `id` = NULL, `username` = NULL, `firstName` = NULL, `lastName` = NULL, `email` = NULL, `password` = NULL, `phone` = NULL, `userStatus` = NULL, additional_properties = NULL, ...
) { ) {
if (!is.null(`id`)) { if (!is.null(`id`)) {
stopifnot(is.numeric(`id`), length(`id`) == 1) stopifnot(is.numeric(`id`), length(`id`) == 1)
@ -79,6 +82,11 @@ User <- R6::R6Class(
stopifnot(is.numeric(`userStatus`), length(`userStatus`) == 1) stopifnot(is.numeric(`userStatus`), length(`userStatus`) == 1)
self$`userStatus` <- `userStatus` self$`userStatus` <- `userStatus`
} }
if (!is.null(additional_properties)) {
for (key in names(additional_properties)) {
self$additional_properties[[key]] <- additional_properties[[key]]
}
}
}, },
#' To JSON string #' To JSON string
#' #'
@ -121,6 +129,9 @@ User <- R6::R6Class(
UserObject[["userStatus"]] <- UserObject[["userStatus"]] <-
self$`userStatus` self$`userStatus`
} }
for (key in names(self$additional_properties)) {
UserObject[[key]] <- self$additional_properties[[key]]
}
UserObject UserObject
}, },
@ -235,7 +246,12 @@ User <- R6::R6Class(
} }
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
json_obj <- jsonlite::fromJSON(json_string)
for (key in names(self$additional_properties)) {
json_obj[[key]] <- self$additional_properties[[key]]
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
}, },
#' Deserialize JSON string into an instance of User #' Deserialize JSON string into an instance of User
#' #'

View File

@ -10,6 +10,7 @@
#' @field hasBaleen character [optional] #' @field hasBaleen character [optional]
#' @field hasTeeth character [optional] #' @field hasTeeth character [optional]
#' @field className character #' @field className character
#' @field additional_properties named list(character) [optional]
#' @importFrom R6 R6Class #' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON #' @importFrom jsonlite fromJSON toJSON
#' @export #' @export
@ -19,6 +20,7 @@ Whale <- R6::R6Class(
`hasBaleen` = NULL, `hasBaleen` = NULL,
`hasTeeth` = NULL, `hasTeeth` = NULL,
`className` = NULL, `className` = NULL,
`additional_properties` = NULL,
#' Initialize a new Whale class. #' Initialize a new Whale class.
#' #'
#' @description #' @description
@ -27,10 +29,11 @@ Whale <- R6::R6Class(
#' @param className className #' @param className className
#' @param hasBaleen hasBaleen #' @param hasBaleen hasBaleen
#' @param hasTeeth hasTeeth #' @param hasTeeth hasTeeth
#' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(
`className`, `hasBaleen` = NULL, `hasTeeth` = NULL, ... `className`, `hasBaleen` = NULL, `hasTeeth` = NULL, additional_properties = NULL, ...
) { ) {
if (!missing(`className`)) { if (!missing(`className`)) {
stopifnot(is.character(`className`), length(`className`) == 1) stopifnot(is.character(`className`), length(`className`) == 1)
@ -44,6 +47,11 @@ Whale <- R6::R6Class(
stopifnot(is.logical(`hasTeeth`), length(`hasTeeth`) == 1) stopifnot(is.logical(`hasTeeth`), length(`hasTeeth`) == 1)
self$`hasTeeth` <- `hasTeeth` self$`hasTeeth` <- `hasTeeth`
} }
if (!is.null(additional_properties)) {
for (key in names(additional_properties)) {
self$additional_properties[[key]] <- additional_properties[[key]]
}
}
}, },
#' To JSON string #' To JSON string
#' #'
@ -66,6 +74,9 @@ Whale <- R6::R6Class(
WhaleObject[["className"]] <- WhaleObject[["className"]] <-
self$`className` self$`className`
} }
for (key in names(self$additional_properties)) {
WhaleObject[[key]] <- self$additional_properties[[key]]
}
WhaleObject WhaleObject
}, },
@ -125,7 +136,12 @@ Whale <- R6::R6Class(
} }
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
json_obj <- jsonlite::fromJSON(json_string)
for (key in names(self$additional_properties)) {
json_obj[[key]] <- self$additional_properties[[key]]
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
}, },
#' Deserialize JSON string into an instance of Whale #' Deserialize JSON string into an instance of Whale
#' #'

View File

@ -9,6 +9,7 @@
#' @format An \code{R6Class} generator object #' @format An \code{R6Class} generator object
#' @field type character [optional] #' @field type character [optional]
#' @field className character #' @field className character
#' @field additional_properties named list(character) [optional]
#' @importFrom R6 R6Class #' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON #' @importFrom jsonlite fromJSON toJSON
#' @export #' @export
@ -17,6 +18,7 @@ Zebra <- R6::R6Class(
public = list( public = list(
`type` = NULL, `type` = NULL,
`className` = NULL, `className` = NULL,
`additional_properties` = NULL,
#' Initialize a new Zebra class. #' Initialize a new Zebra class.
#' #'
#' @description #' @description
@ -24,10 +26,11 @@ Zebra <- R6::R6Class(
#' #'
#' @param className className #' @param className className
#' @param type type #' @param type type
#' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(
`className`, `type` = NULL, ... `className`, `type` = NULL, additional_properties = NULL, ...
) { ) {
if (!missing(`className`)) { if (!missing(`className`)) {
stopifnot(is.character(`className`), length(`className`) == 1) stopifnot(is.character(`className`), length(`className`) == 1)
@ -37,6 +40,11 @@ Zebra <- R6::R6Class(
stopifnot(is.character(`type`), length(`type`) == 1) stopifnot(is.character(`type`), length(`type`) == 1)
self$`type` <- `type` self$`type` <- `type`
} }
if (!is.null(additional_properties)) {
for (key in names(additional_properties)) {
self$additional_properties[[key]] <- additional_properties[[key]]
}
}
}, },
#' To JSON string #' To JSON string
#' #'
@ -55,6 +63,9 @@ Zebra <- R6::R6Class(
ZebraObject[["className"]] <- ZebraObject[["className"]] <-
self$`className` self$`className`
} }
for (key in names(self$additional_properties)) {
ZebraObject[[key]] <- self$additional_properties[[key]]
}
ZebraObject ZebraObject
}, },
@ -103,7 +114,12 @@ Zebra <- R6::R6Class(
} }
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
json_obj <- jsonlite::fromJSON(json_string)
for (key in names(self$additional_properties)) {
json_obj[[key]] <- self$additional_properties[[key]]
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
}, },
#' Deserialize JSON string into an instance of Zebra #' Deserialize JSON string into an instance of Zebra
#' #'

View File

@ -3,6 +3,17 @@ install.packages("petstore_1.0.0.tar.gz",repos=NULL, type="source")
library(petstore) library(petstore)
library(jsonlite) library(jsonlite)
t <- Tag$new()
t$id <- 123
t$additional_properties <- c("abc" = 849, "array" = list('a', 'b', 'c'))
t$additional_properties
t$additional_properties["abc"]
t$additional_properties["array"]
print(t$toJSON())
print(t$toJSONString())
print("done tag")
whale_json <- '{"className": "whale", "hasBaleen": true, "hasTeeth": true}' whale_json <- '{"className": "whale", "hasBaleen": true, "hasTeeth": true}'
zebra_json <- '{"className": "zebra", "type": "plains"}' zebra_json <- '{"className": "zebra", "type": "plains"}'

View File

@ -21,6 +21,17 @@ pet_api$api_client$username <- "username123"
pet_api$api_client$password <- "password123" pet_api$api_client$password <- "password123"
result <- pet_api$add_pet(pet) result <- pet_api$add_pet(pet)
test_that("Additional Properties test", {
# test tag
t <- Tag$new(id = 393, name = "something")
t$additional_properties <- c("a1" = 998, "b2" = "bbccdd")
expect_equal(t$toJSONString(), "{\"id\":393,\"name\":\"something\",\"a1\":\"998\",\"b2\":\"bbccdd\"}")
# test tag with additional_properties in `new`
t <- Tag$new(id = 393, name = "something", additional_properties = list("nested_object" = list("inside_item" = 8989)))
expect_equal(t$toJSONString(), "{\"id\":393,\"name\":\"something\",\"nested_object\":{\"inside_item\":8989}}")
})
test_that("Test toJSON toJSONString fromJSON fromJSONString print", { test_that("Test toJSON toJSONString fromJSON fromJSONString print", {
# test pet # test pet
expect_equal(pet_id, 123321) expect_equal(pet_id, 123321)

View File

@ -88,7 +88,6 @@ AllofTagApiResponse <- R6::R6Class(
AllofTagApiResponseObject[["message"]] <- AllofTagApiResponseObject[["message"]] <-
self$`message` self$`message`
} }
AllofTagApiResponseObject AllofTagApiResponseObject
}, },
#' Deserialize JSON string into an instance of AllofTagApiResponse #' Deserialize JSON string into an instance of AllofTagApiResponse
@ -169,7 +168,7 @@ AllofTagApiResponse <- R6::R6Class(
} }
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
}, },
#' Deserialize JSON string into an instance of AllofTagApiResponse #' Deserialize JSON string into an instance of AllofTagApiResponse
#' #'

View File

@ -55,7 +55,6 @@ Animal <- R6::R6Class(
AnimalObject[["color"]] <- AnimalObject[["color"]] <-
self$`color` self$`color`
} }
AnimalObject AnimalObject
}, },
#' Deserialize JSON string into an instance of Animal #' Deserialize JSON string into an instance of Animal
@ -103,7 +102,7 @@ Animal <- R6::R6Class(
} }
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
}, },
#' Deserialize JSON string into an instance of Animal #' Deserialize JSON string into an instance of Animal
#' #'

View File

@ -55,7 +55,6 @@ BasquePig <- R6::R6Class(
BasquePigObject[["color"]] <- BasquePigObject[["color"]] <-
self$`color` self$`color`
} }
BasquePigObject BasquePigObject
}, },
#' Deserialize JSON string into an instance of BasquePig #' Deserialize JSON string into an instance of BasquePig
@ -103,7 +102,7 @@ BasquePig <- R6::R6Class(
} }
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
}, },
#' Deserialize JSON string into an instance of BasquePig #' Deserialize JSON string into an instance of BasquePig
#' #'

View File

@ -67,7 +67,6 @@ Cat <- R6::R6Class(
CatObject[["declawed"]] <- CatObject[["declawed"]] <-
self$`declawed` self$`declawed`
} }
CatObject CatObject
}, },
#' Deserialize JSON string into an instance of Cat #' Deserialize JSON string into an instance of Cat
@ -126,7 +125,7 @@ Cat <- R6::R6Class(
} }
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
}, },
#' Deserialize JSON string into an instance of Cat #' Deserialize JSON string into an instance of Cat
#' #'

View File

@ -44,7 +44,6 @@ CatAllOf <- R6::R6Class(
CatAllOfObject[["declawed"]] <- CatAllOfObject[["declawed"]] <-
self$`declawed` self$`declawed`
} }
CatAllOfObject CatAllOfObject
}, },
#' Deserialize JSON string into an instance of CatAllOf #' Deserialize JSON string into an instance of CatAllOf
@ -81,7 +80,7 @@ CatAllOf <- R6::R6Class(
} }
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
}, },
#' Deserialize JSON string into an instance of CatAllOf #' Deserialize JSON string into an instance of CatAllOf
#' #'

View File

@ -55,7 +55,6 @@ Category <- R6::R6Class(
CategoryObject[["name"]] <- CategoryObject[["name"]] <-
self$`name` self$`name`
} }
CategoryObject CategoryObject
}, },
#' Deserialize JSON string into an instance of Category #' Deserialize JSON string into an instance of Category
@ -103,7 +102,7 @@ Category <- R6::R6Class(
} }
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
}, },
#' Deserialize JSON string into an instance of Category #' Deserialize JSON string into an instance of Category
#' #'

View File

@ -55,7 +55,6 @@ DanishPig <- R6::R6Class(
DanishPigObject[["size"]] <- DanishPigObject[["size"]] <-
self$`size` self$`size`
} }
DanishPigObject DanishPigObject
}, },
#' Deserialize JSON string into an instance of DanishPig #' Deserialize JSON string into an instance of DanishPig
@ -103,7 +102,7 @@ DanishPig <- R6::R6Class(
} }
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
}, },
#' Deserialize JSON string into an instance of DanishPig #' Deserialize JSON string into an instance of DanishPig
#' #'

View File

@ -67,7 +67,6 @@ Dog <- R6::R6Class(
DogObject[["breed"]] <- DogObject[["breed"]] <-
self$`breed` self$`breed`
} }
DogObject DogObject
}, },
#' Deserialize JSON string into an instance of Dog #' Deserialize JSON string into an instance of Dog
@ -126,7 +125,7 @@ Dog <- R6::R6Class(
} }
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
}, },
#' Deserialize JSON string into an instance of Dog #' Deserialize JSON string into an instance of Dog
#' #'

View File

@ -44,7 +44,6 @@ DogAllOf <- R6::R6Class(
DogAllOfObject[["breed"]] <- DogAllOfObject[["breed"]] <-
self$`breed` self$`breed`
} }
DogAllOfObject DogAllOfObject
}, },
#' Deserialize JSON string into an instance of DogAllOf #' Deserialize JSON string into an instance of DogAllOf
@ -81,7 +80,7 @@ DogAllOf <- R6::R6Class(
} }
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
}, },
#' Deserialize JSON string into an instance of DogAllOf #' Deserialize JSON string into an instance of DogAllOf
#' #'

View File

@ -66,7 +66,6 @@ ModelApiResponse <- R6::R6Class(
ModelApiResponseObject[["message"]] <- ModelApiResponseObject[["message"]] <-
self$`message` self$`message`
} }
ModelApiResponseObject ModelApiResponseObject
}, },
#' Deserialize JSON string into an instance of ModelApiResponse #' Deserialize JSON string into an instance of ModelApiResponse
@ -125,7 +124,7 @@ ModelApiResponse <- R6::R6Class(
} }
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
}, },
#' Deserialize JSON string into an instance of ModelApiResponse #' Deserialize JSON string into an instance of ModelApiResponse
#' #'

View File

@ -55,7 +55,6 @@ NestedOneOf <- R6::R6Class(
NestedOneOfObject[["nested_pig"]] <- NestedOneOfObject[["nested_pig"]] <-
self$`nested_pig`$toJSON() self$`nested_pig`$toJSON()
} }
NestedOneOfObject NestedOneOfObject
}, },
#' Deserialize JSON string into an instance of NestedOneOf #' Deserialize JSON string into an instance of NestedOneOf
@ -105,7 +104,7 @@ NestedOneOf <- R6::R6Class(
} }
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
}, },
#' Deserialize JSON string into an instance of NestedOneOf #' Deserialize JSON string into an instance of NestedOneOf
#' #'

View File

@ -99,7 +99,6 @@ Order <- R6::R6Class(
OrderObject[["complete"]] <- OrderObject[["complete"]] <-
self$`complete` self$`complete`
} }
OrderObject OrderObject
}, },
#' Deserialize JSON string into an instance of Order #' Deserialize JSON string into an instance of Order
@ -191,7 +190,7 @@ Order <- R6::R6Class(
} }
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
}, },
#' Deserialize JSON string into an instance of Order #' Deserialize JSON string into an instance of Order
#' #'

View File

@ -101,7 +101,6 @@ Pet <- R6::R6Class(
PetObject[["status"]] <- PetObject[["status"]] <-
self$`status` self$`status`
} }
PetObject PetObject
}, },
#' Deserialize JSON string into an instance of Pet #' Deserialize JSON string into an instance of Pet
@ -195,7 +194,7 @@ Pet <- R6::R6Class(
} }
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
}, },
#' Deserialize JSON string into an instance of Pet #' Deserialize JSON string into an instance of Pet
#' #'

View File

@ -99,7 +99,6 @@ Special <- R6::R6Class(
SpecialObject[["empty_string"]] <- SpecialObject[["empty_string"]] <-
self$`empty_string` self$`empty_string`
} }
SpecialObject SpecialObject
}, },
#' Deserialize JSON string into an instance of Special #' Deserialize JSON string into an instance of Special
@ -191,7 +190,7 @@ Special <- R6::R6Class(
} }
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
}, },
#' Deserialize JSON string into an instance of Special #' Deserialize JSON string into an instance of Special
#' #'

View File

@ -55,7 +55,6 @@ Tag <- R6::R6Class(
TagObject[["name"]] <- TagObject[["name"]] <-
self$`name` self$`name`
} }
TagObject TagObject
}, },
#' Deserialize JSON string into an instance of Tag #' Deserialize JSON string into an instance of Tag
@ -103,7 +102,7 @@ Tag <- R6::R6Class(
} }
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
}, },
#' Deserialize JSON string into an instance of Tag #' Deserialize JSON string into an instance of Tag
#' #'

View File

@ -54,7 +54,6 @@ UpdatePetRequest <- R6::R6Class(
UpdatePetRequestObject[["binaryDataN2Information"]] <- UpdatePetRequestObject[["binaryDataN2Information"]] <-
self$`binaryDataN2Information` self$`binaryDataN2Information`
} }
UpdatePetRequestObject UpdatePetRequestObject
}, },
#' Deserialize JSON string into an instance of UpdatePetRequest #' Deserialize JSON string into an instance of UpdatePetRequest
@ -104,7 +103,7 @@ UpdatePetRequest <- R6::R6Class(
} }
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
}, },
#' Deserialize JSON string into an instance of UpdatePetRequest #' Deserialize JSON string into an instance of UpdatePetRequest
#' #'

View File

@ -121,7 +121,6 @@ User <- R6::R6Class(
UserObject[["userStatus"]] <- UserObject[["userStatus"]] <-
self$`userStatus` self$`userStatus`
} }
UserObject UserObject
}, },
#' Deserialize JSON string into an instance of User #' Deserialize JSON string into an instance of User
@ -235,7 +234,7 @@ User <- R6::R6Class(
} }
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
}, },
#' Deserialize JSON string into an instance of User #' Deserialize JSON string into an instance of User
#' #'

View File

@ -66,7 +66,6 @@ Whale <- R6::R6Class(
WhaleObject[["className"]] <- WhaleObject[["className"]] <-
self$`className` self$`className`
} }
WhaleObject WhaleObject
}, },
#' Deserialize JSON string into an instance of Whale #' Deserialize JSON string into an instance of Whale
@ -125,7 +124,7 @@ Whale <- R6::R6Class(
} }
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
}, },
#' Deserialize JSON string into an instance of Whale #' Deserialize JSON string into an instance of Whale
#' #'

View File

@ -55,7 +55,6 @@ Zebra <- R6::R6Class(
ZebraObject[["className"]] <- ZebraObject[["className"]] <-
self$`className` self$`className`
} }
ZebraObject ZebraObject
}, },
#' Deserialize JSON string into an instance of Zebra #' Deserialize JSON string into an instance of Zebra
@ -103,7 +102,7 @@ Zebra <- R6::R6Class(
} }
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
}, },
#' Deserialize JSON string into an instance of Zebra #' Deserialize JSON string into an instance of Zebra
#' #'

View File

@ -3,6 +3,14 @@ install.packages("petstore_1.0.0.tar.gz",repos=NULL, type="source")
library(petstore) library(petstore)
library(jsonlite) library(jsonlite)
t <- Tag$new()
t$id <- 123
#t$additional_properties <- c("abc" = 849)
print(t$toJSON())
print(t$toJSONString())
print("done tag")
t <- OneOfPrimitiveTypeTest$new() t <- OneOfPrimitiveTypeTest$new()
#t$fromJSONString("[1,2,3]") #t$fromJSONString("[1,2,3]")

View File

@ -12,6 +12,7 @@
#' @field code integer [optional] #' @field code integer [optional]
#' @field type character [optional] #' @field type character [optional]
#' @field message character [optional] #' @field message character [optional]
#' @field additional_properties named list(character) [optional]
#' @importFrom R6 R6Class #' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON #' @importFrom jsonlite fromJSON toJSON
#' @export #' @export
@ -23,6 +24,7 @@ AllofTagApiResponse <- R6::R6Class(
`code` = NULL, `code` = NULL,
`type` = NULL, `type` = NULL,
`message` = NULL, `message` = NULL,
`additional_properties` = NULL,
#' Initialize a new AllofTagApiResponse class. #' Initialize a new AllofTagApiResponse class.
#' #'
#' @description #' @description
@ -33,10 +35,11 @@ AllofTagApiResponse <- R6::R6Class(
#' @param code code #' @param code code
#' @param type type #' @param type type
#' @param message message #' @param message message
#' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(
`id` = NULL, `name` = NULL, `code` = NULL, `type` = NULL, `message` = NULL, ... `id` = NULL, `name` = NULL, `code` = NULL, `type` = NULL, `message` = NULL, additional_properties = NULL, ...
) { ) {
if (!is.null(`id`)) { if (!is.null(`id`)) {
stopifnot(is.numeric(`id`), length(`id`) == 1) stopifnot(is.numeric(`id`), length(`id`) == 1)
@ -58,6 +61,11 @@ AllofTagApiResponse <- R6::R6Class(
stopifnot(is.character(`message`), length(`message`) == 1) stopifnot(is.character(`message`), length(`message`) == 1)
self$`message` <- `message` self$`message` <- `message`
} }
if (!is.null(additional_properties)) {
for (key in names(additional_properties)) {
self$additional_properties[[key]] <- additional_properties[[key]]
}
}
}, },
#' To JSON string #' To JSON string
#' #'
@ -88,6 +96,9 @@ AllofTagApiResponse <- R6::R6Class(
AllofTagApiResponseObject[["message"]] <- AllofTagApiResponseObject[["message"]] <-
self$`message` self$`message`
} }
for (key in names(self$additional_properties)) {
AllofTagApiResponseObject[[key]] <- self$additional_properties[[key]]
}
AllofTagApiResponseObject AllofTagApiResponseObject
}, },
@ -169,7 +180,12 @@ AllofTagApiResponse <- R6::R6Class(
} }
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
json_obj <- jsonlite::fromJSON(json_string)
for (key in names(self$additional_properties)) {
json_obj[[key]] <- self$additional_properties[[key]]
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
}, },
#' Deserialize JSON string into an instance of AllofTagApiResponse #' Deserialize JSON string into an instance of AllofTagApiResponse
#' #'

View File

@ -9,6 +9,7 @@
#' @format An \code{R6Class} generator object #' @format An \code{R6Class} generator object
#' @field className character #' @field className character
#' @field color character [optional] #' @field color character [optional]
#' @field additional_properties named list(character) [optional]
#' @importFrom R6 R6Class #' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON #' @importFrom jsonlite fromJSON toJSON
#' @export #' @export
@ -17,6 +18,7 @@ Animal <- R6::R6Class(
public = list( public = list(
`className` = NULL, `className` = NULL,
`color` = NULL, `color` = NULL,
`additional_properties` = NULL,
#' Initialize a new Animal class. #' Initialize a new Animal class.
#' #'
#' @description #' @description
@ -24,10 +26,11 @@ Animal <- R6::R6Class(
#' #'
#' @param className className #' @param className className
#' @param color color. Default to "red". #' @param color color. Default to "red".
#' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(
`className`, `color` = "red", ... `className`, `color` = "red", additional_properties = NULL, ...
) { ) {
if (!missing(`className`)) { if (!missing(`className`)) {
stopifnot(is.character(`className`), length(`className`) == 1) stopifnot(is.character(`className`), length(`className`) == 1)
@ -37,6 +40,11 @@ Animal <- R6::R6Class(
stopifnot(is.character(`color`), length(`color`) == 1) stopifnot(is.character(`color`), length(`color`) == 1)
self$`color` <- `color` self$`color` <- `color`
} }
if (!is.null(additional_properties)) {
for (key in names(additional_properties)) {
self$additional_properties[[key]] <- additional_properties[[key]]
}
}
}, },
#' To JSON string #' To JSON string
#' #'
@ -55,6 +63,9 @@ Animal <- R6::R6Class(
AnimalObject[["color"]] <- AnimalObject[["color"]] <-
self$`color` self$`color`
} }
for (key in names(self$additional_properties)) {
AnimalObject[[key]] <- self$additional_properties[[key]]
}
AnimalObject AnimalObject
}, },
@ -103,7 +114,12 @@ Animal <- R6::R6Class(
} }
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
json_obj <- jsonlite::fromJSON(json_string)
for (key in names(self$additional_properties)) {
json_obj[[key]] <- self$additional_properties[[key]]
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
}, },
#' Deserialize JSON string into an instance of Animal #' Deserialize JSON string into an instance of Animal
#' #'

View File

@ -9,6 +9,7 @@
#' @format An \code{R6Class} generator object #' @format An \code{R6Class} generator object
#' @field className character #' @field className character
#' @field color character #' @field color character
#' @field additional_properties named list(character) [optional]
#' @importFrom R6 R6Class #' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON #' @importFrom jsonlite fromJSON toJSON
#' @export #' @export
@ -17,6 +18,7 @@ BasquePig <- R6::R6Class(
public = list( public = list(
`className` = NULL, `className` = NULL,
`color` = NULL, `color` = NULL,
`additional_properties` = NULL,
#' Initialize a new BasquePig class. #' Initialize a new BasquePig class.
#' #'
#' @description #' @description
@ -24,10 +26,11 @@ BasquePig <- R6::R6Class(
#' #'
#' @param className className #' @param className className
#' @param color color #' @param color color
#' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(
`className`, `color`, ... `className`, `color`, additional_properties = NULL, ...
) { ) {
if (!missing(`className`)) { if (!missing(`className`)) {
stopifnot(is.character(`className`), length(`className`) == 1) stopifnot(is.character(`className`), length(`className`) == 1)
@ -37,6 +40,11 @@ BasquePig <- R6::R6Class(
stopifnot(is.character(`color`), length(`color`) == 1) stopifnot(is.character(`color`), length(`color`) == 1)
self$`color` <- `color` self$`color` <- `color`
} }
if (!is.null(additional_properties)) {
for (key in names(additional_properties)) {
self$additional_properties[[key]] <- additional_properties[[key]]
}
}
}, },
#' To JSON string #' To JSON string
#' #'
@ -55,6 +63,9 @@ BasquePig <- R6::R6Class(
BasquePigObject[["color"]] <- BasquePigObject[["color"]] <-
self$`color` self$`color`
} }
for (key in names(self$additional_properties)) {
BasquePigObject[[key]] <- self$additional_properties[[key]]
}
BasquePigObject BasquePigObject
}, },
@ -103,7 +114,12 @@ BasquePig <- R6::R6Class(
} }
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
json_obj <- jsonlite::fromJSON(json_string)
for (key in names(self$additional_properties)) {
json_obj[[key]] <- self$additional_properties[[key]]
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
}, },
#' Deserialize JSON string into an instance of BasquePig #' Deserialize JSON string into an instance of BasquePig
#' #'

View File

@ -10,6 +10,7 @@
#' @field className character #' @field className character
#' @field color character [optional] #' @field color character [optional]
#' @field declawed character [optional] #' @field declawed character [optional]
#' @field additional_properties named list(character) [optional]
#' @importFrom R6 R6Class #' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON #' @importFrom jsonlite fromJSON toJSON
#' @export #' @export
@ -20,6 +21,7 @@ Cat <- R6::R6Class(
`className` = NULL, `className` = NULL,
`color` = NULL, `color` = NULL,
`declawed` = NULL, `declawed` = NULL,
`additional_properties` = NULL,
#' Initialize a new Cat class. #' Initialize a new Cat class.
#' #'
#' @description #' @description
@ -28,10 +30,11 @@ Cat <- R6::R6Class(
#' @param className className #' @param className className
#' @param color color. Default to "red". #' @param color color. Default to "red".
#' @param declawed declawed #' @param declawed declawed
#' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(
`className`, `color` = "red", `declawed` = NULL, ... `className`, `color` = "red", `declawed` = NULL, additional_properties = NULL, ...
) { ) {
if (!missing(`className`)) { if (!missing(`className`)) {
stopifnot(is.character(`className`), length(`className`) == 1) stopifnot(is.character(`className`), length(`className`) == 1)
@ -45,6 +48,11 @@ Cat <- R6::R6Class(
stopifnot(is.logical(`declawed`), length(`declawed`) == 1) stopifnot(is.logical(`declawed`), length(`declawed`) == 1)
self$`declawed` <- `declawed` self$`declawed` <- `declawed`
} }
if (!is.null(additional_properties)) {
for (key in names(additional_properties)) {
self$additional_properties[[key]] <- additional_properties[[key]]
}
}
}, },
#' To JSON string #' To JSON string
#' #'
@ -67,6 +75,9 @@ Cat <- R6::R6Class(
CatObject[["declawed"]] <- CatObject[["declawed"]] <-
self$`declawed` self$`declawed`
} }
for (key in names(self$additional_properties)) {
CatObject[[key]] <- self$additional_properties[[key]]
}
CatObject CatObject
}, },
@ -126,7 +137,12 @@ Cat <- R6::R6Class(
} }
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
json_obj <- jsonlite::fromJSON(json_string)
for (key in names(self$additional_properties)) {
json_obj[[key]] <- self$additional_properties[[key]]
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
}, },
#' Deserialize JSON string into an instance of Cat #' Deserialize JSON string into an instance of Cat
#' #'

View File

@ -8,6 +8,7 @@
#' @description CatAllOf Class #' @description CatAllOf Class
#' @format An \code{R6Class} generator object #' @format An \code{R6Class} generator object
#' @field declawed character [optional] #' @field declawed character [optional]
#' @field additional_properties named list(character) [optional]
#' @importFrom R6 R6Class #' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON #' @importFrom jsonlite fromJSON toJSON
#' @export #' @export
@ -15,21 +16,28 @@ CatAllOf <- R6::R6Class(
"CatAllOf", "CatAllOf",
public = list( public = list(
`declawed` = NULL, `declawed` = NULL,
`additional_properties` = NULL,
#' Initialize a new CatAllOf class. #' Initialize a new CatAllOf class.
#' #'
#' @description #' @description
#' Initialize a new CatAllOf class. #' Initialize a new CatAllOf class.
#' #'
#' @param declawed declawed #' @param declawed declawed
#' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(
`declawed` = NULL, ... `declawed` = NULL, additional_properties = NULL, ...
) { ) {
if (!is.null(`declawed`)) { if (!is.null(`declawed`)) {
stopifnot(is.logical(`declawed`), length(`declawed`) == 1) stopifnot(is.logical(`declawed`), length(`declawed`) == 1)
self$`declawed` <- `declawed` self$`declawed` <- `declawed`
} }
if (!is.null(additional_properties)) {
for (key in names(additional_properties)) {
self$additional_properties[[key]] <- additional_properties[[key]]
}
}
}, },
#' To JSON string #' To JSON string
#' #'
@ -44,6 +52,9 @@ CatAllOf <- R6::R6Class(
CatAllOfObject[["declawed"]] <- CatAllOfObject[["declawed"]] <-
self$`declawed` self$`declawed`
} }
for (key in names(self$additional_properties)) {
CatAllOfObject[[key]] <- self$additional_properties[[key]]
}
CatAllOfObject CatAllOfObject
}, },
@ -81,7 +92,12 @@ CatAllOf <- R6::R6Class(
} }
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
json_obj <- jsonlite::fromJSON(json_string)
for (key in names(self$additional_properties)) {
json_obj[[key]] <- self$additional_properties[[key]]
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
}, },
#' Deserialize JSON string into an instance of CatAllOf #' Deserialize JSON string into an instance of CatAllOf
#' #'

View File

@ -9,6 +9,7 @@
#' @format An \code{R6Class} generator object #' @format An \code{R6Class} generator object
#' @field id integer [optional] #' @field id integer [optional]
#' @field name character [optional] #' @field name character [optional]
#' @field additional_properties named list(character) [optional]
#' @importFrom R6 R6Class #' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON #' @importFrom jsonlite fromJSON toJSON
#' @export #' @export
@ -17,6 +18,7 @@ Category <- R6::R6Class(
public = list( public = list(
`id` = NULL, `id` = NULL,
`name` = NULL, `name` = NULL,
`additional_properties` = NULL,
#' Initialize a new Category class. #' Initialize a new Category class.
#' #'
#' @description #' @description
@ -24,10 +26,11 @@ Category <- R6::R6Class(
#' #'
#' @param id id #' @param id id
#' @param name name #' @param name name
#' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(
`id` = NULL, `name` = NULL, ... `id` = NULL, `name` = NULL, additional_properties = NULL, ...
) { ) {
if (!is.null(`id`)) { if (!is.null(`id`)) {
stopifnot(is.numeric(`id`), length(`id`) == 1) stopifnot(is.numeric(`id`), length(`id`) == 1)
@ -37,6 +40,11 @@ Category <- R6::R6Class(
stopifnot(is.character(`name`), length(`name`) == 1) stopifnot(is.character(`name`), length(`name`) == 1)
self$`name` <- `name` self$`name` <- `name`
} }
if (!is.null(additional_properties)) {
for (key in names(additional_properties)) {
self$additional_properties[[key]] <- additional_properties[[key]]
}
}
}, },
#' To JSON string #' To JSON string
#' #'
@ -55,6 +63,9 @@ Category <- R6::R6Class(
CategoryObject[["name"]] <- CategoryObject[["name"]] <-
self$`name` self$`name`
} }
for (key in names(self$additional_properties)) {
CategoryObject[[key]] <- self$additional_properties[[key]]
}
CategoryObject CategoryObject
}, },
@ -103,7 +114,12 @@ Category <- R6::R6Class(
} }
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
json_obj <- jsonlite::fromJSON(json_string)
for (key in names(self$additional_properties)) {
json_obj[[key]] <- self$additional_properties[[key]]
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
}, },
#' Deserialize JSON string into an instance of Category #' Deserialize JSON string into an instance of Category
#' #'

View File

@ -9,6 +9,7 @@
#' @format An \code{R6Class} generator object #' @format An \code{R6Class} generator object
#' @field className character #' @field className character
#' @field size integer #' @field size integer
#' @field additional_properties named list(character) [optional]
#' @importFrom R6 R6Class #' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON #' @importFrom jsonlite fromJSON toJSON
#' @export #' @export
@ -17,6 +18,7 @@ DanishPig <- R6::R6Class(
public = list( public = list(
`className` = NULL, `className` = NULL,
`size` = NULL, `size` = NULL,
`additional_properties` = NULL,
#' Initialize a new DanishPig class. #' Initialize a new DanishPig class.
#' #'
#' @description #' @description
@ -24,10 +26,11 @@ DanishPig <- R6::R6Class(
#' #'
#' @param className className #' @param className className
#' @param size size #' @param size size
#' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(
`className`, `size`, ... `className`, `size`, additional_properties = NULL, ...
) { ) {
if (!missing(`className`)) { if (!missing(`className`)) {
stopifnot(is.character(`className`), length(`className`) == 1) stopifnot(is.character(`className`), length(`className`) == 1)
@ -37,6 +40,11 @@ DanishPig <- R6::R6Class(
stopifnot(is.numeric(`size`), length(`size`) == 1) stopifnot(is.numeric(`size`), length(`size`) == 1)
self$`size` <- `size` self$`size` <- `size`
} }
if (!is.null(additional_properties)) {
for (key in names(additional_properties)) {
self$additional_properties[[key]] <- additional_properties[[key]]
}
}
}, },
#' To JSON string #' To JSON string
#' #'
@ -55,6 +63,9 @@ DanishPig <- R6::R6Class(
DanishPigObject[["size"]] <- DanishPigObject[["size"]] <-
self$`size` self$`size`
} }
for (key in names(self$additional_properties)) {
DanishPigObject[[key]] <- self$additional_properties[[key]]
}
DanishPigObject DanishPigObject
}, },
@ -103,7 +114,12 @@ DanishPig <- R6::R6Class(
} }
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
json_obj <- jsonlite::fromJSON(json_string)
for (key in names(self$additional_properties)) {
json_obj[[key]] <- self$additional_properties[[key]]
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
}, },
#' Deserialize JSON string into an instance of DanishPig #' Deserialize JSON string into an instance of DanishPig
#' #'

View File

@ -10,6 +10,7 @@
#' @field className character #' @field className character
#' @field color character [optional] #' @field color character [optional]
#' @field breed character [optional] #' @field breed character [optional]
#' @field additional_properties named list(character) [optional]
#' @importFrom R6 R6Class #' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON #' @importFrom jsonlite fromJSON toJSON
#' @export #' @export
@ -20,6 +21,7 @@ Dog <- R6::R6Class(
`className` = NULL, `className` = NULL,
`color` = NULL, `color` = NULL,
`breed` = NULL, `breed` = NULL,
`additional_properties` = NULL,
#' Initialize a new Dog class. #' Initialize a new Dog class.
#' #'
#' @description #' @description
@ -28,10 +30,11 @@ Dog <- R6::R6Class(
#' @param className className #' @param className className
#' @param color color. Default to "red". #' @param color color. Default to "red".
#' @param breed breed #' @param breed breed
#' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(
`className`, `color` = "red", `breed` = NULL, ... `className`, `color` = "red", `breed` = NULL, additional_properties = NULL, ...
) { ) {
if (!missing(`className`)) { if (!missing(`className`)) {
stopifnot(is.character(`className`), length(`className`) == 1) stopifnot(is.character(`className`), length(`className`) == 1)
@ -45,6 +48,11 @@ Dog <- R6::R6Class(
stopifnot(is.character(`breed`), length(`breed`) == 1) stopifnot(is.character(`breed`), length(`breed`) == 1)
self$`breed` <- `breed` self$`breed` <- `breed`
} }
if (!is.null(additional_properties)) {
for (key in names(additional_properties)) {
self$additional_properties[[key]] <- additional_properties[[key]]
}
}
}, },
#' To JSON string #' To JSON string
#' #'
@ -67,6 +75,9 @@ Dog <- R6::R6Class(
DogObject[["breed"]] <- DogObject[["breed"]] <-
self$`breed` self$`breed`
} }
for (key in names(self$additional_properties)) {
DogObject[[key]] <- self$additional_properties[[key]]
}
DogObject DogObject
}, },
@ -126,7 +137,12 @@ Dog <- R6::R6Class(
} }
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
json_obj <- jsonlite::fromJSON(json_string)
for (key in names(self$additional_properties)) {
json_obj[[key]] <- self$additional_properties[[key]]
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
}, },
#' Deserialize JSON string into an instance of Dog #' Deserialize JSON string into an instance of Dog
#' #'

View File

@ -8,6 +8,7 @@
#' @description DogAllOf Class #' @description DogAllOf Class
#' @format An \code{R6Class} generator object #' @format An \code{R6Class} generator object
#' @field breed character [optional] #' @field breed character [optional]
#' @field additional_properties named list(character) [optional]
#' @importFrom R6 R6Class #' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON #' @importFrom jsonlite fromJSON toJSON
#' @export #' @export
@ -15,21 +16,28 @@ DogAllOf <- R6::R6Class(
"DogAllOf", "DogAllOf",
public = list( public = list(
`breed` = NULL, `breed` = NULL,
`additional_properties` = NULL,
#' Initialize a new DogAllOf class. #' Initialize a new DogAllOf class.
#' #'
#' @description #' @description
#' Initialize a new DogAllOf class. #' Initialize a new DogAllOf class.
#' #'
#' @param breed breed #' @param breed breed
#' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(
`breed` = NULL, ... `breed` = NULL, additional_properties = NULL, ...
) { ) {
if (!is.null(`breed`)) { if (!is.null(`breed`)) {
stopifnot(is.character(`breed`), length(`breed`) == 1) stopifnot(is.character(`breed`), length(`breed`) == 1)
self$`breed` <- `breed` self$`breed` <- `breed`
} }
if (!is.null(additional_properties)) {
for (key in names(additional_properties)) {
self$additional_properties[[key]] <- additional_properties[[key]]
}
}
}, },
#' To JSON string #' To JSON string
#' #'
@ -44,6 +52,9 @@ DogAllOf <- R6::R6Class(
DogAllOfObject[["breed"]] <- DogAllOfObject[["breed"]] <-
self$`breed` self$`breed`
} }
for (key in names(self$additional_properties)) {
DogAllOfObject[[key]] <- self$additional_properties[[key]]
}
DogAllOfObject DogAllOfObject
}, },
@ -81,7 +92,12 @@ DogAllOf <- R6::R6Class(
} }
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
json_obj <- jsonlite::fromJSON(json_string)
for (key in names(self$additional_properties)) {
json_obj[[key]] <- self$additional_properties[[key]]
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
}, },
#' Deserialize JSON string into an instance of DogAllOf #' Deserialize JSON string into an instance of DogAllOf
#' #'

View File

@ -10,6 +10,7 @@
#' @field code integer [optional] #' @field code integer [optional]
#' @field type character [optional] #' @field type character [optional]
#' @field message character [optional] #' @field message character [optional]
#' @field additional_properties named list(character) [optional]
#' @importFrom R6 R6Class #' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON #' @importFrom jsonlite fromJSON toJSON
#' @export #' @export
@ -19,6 +20,7 @@ ModelApiResponse <- R6::R6Class(
`code` = NULL, `code` = NULL,
`type` = NULL, `type` = NULL,
`message` = NULL, `message` = NULL,
`additional_properties` = NULL,
#' Initialize a new ModelApiResponse class. #' Initialize a new ModelApiResponse class.
#' #'
#' @description #' @description
@ -27,10 +29,11 @@ ModelApiResponse <- R6::R6Class(
#' @param code code #' @param code code
#' @param type type #' @param type type
#' @param message message #' @param message message
#' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(
`code` = NULL, `type` = NULL, `message` = NULL, ... `code` = NULL, `type` = NULL, `message` = NULL, additional_properties = NULL, ...
) { ) {
if (!is.null(`code`)) { if (!is.null(`code`)) {
stopifnot(is.numeric(`code`), length(`code`) == 1) stopifnot(is.numeric(`code`), length(`code`) == 1)
@ -44,6 +47,11 @@ ModelApiResponse <- R6::R6Class(
stopifnot(is.character(`message`), length(`message`) == 1) stopifnot(is.character(`message`), length(`message`) == 1)
self$`message` <- `message` self$`message` <- `message`
} }
if (!is.null(additional_properties)) {
for (key in names(additional_properties)) {
self$additional_properties[[key]] <- additional_properties[[key]]
}
}
}, },
#' To JSON string #' To JSON string
#' #'
@ -66,6 +74,9 @@ ModelApiResponse <- R6::R6Class(
ModelApiResponseObject[["message"]] <- ModelApiResponseObject[["message"]] <-
self$`message` self$`message`
} }
for (key in names(self$additional_properties)) {
ModelApiResponseObject[[key]] <- self$additional_properties[[key]]
}
ModelApiResponseObject ModelApiResponseObject
}, },
@ -125,7 +136,12 @@ ModelApiResponse <- R6::R6Class(
} }
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
json_obj <- jsonlite::fromJSON(json_string)
for (key in names(self$additional_properties)) {
json_obj[[key]] <- self$additional_properties[[key]]
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
}, },
#' Deserialize JSON string into an instance of ModelApiResponse #' Deserialize JSON string into an instance of ModelApiResponse
#' #'

View File

@ -9,6 +9,7 @@
#' @format An \code{R6Class} generator object #' @format An \code{R6Class} generator object
#' @field size integer [optional] #' @field size integer [optional]
#' @field nested_pig \link{Pig} [optional] #' @field nested_pig \link{Pig} [optional]
#' @field additional_properties named list(character) [optional]
#' @importFrom R6 R6Class #' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON #' @importFrom jsonlite fromJSON toJSON
#' @export #' @export
@ -17,6 +18,7 @@ NestedOneOf <- R6::R6Class(
public = list( public = list(
`size` = NULL, `size` = NULL,
`nested_pig` = NULL, `nested_pig` = NULL,
`additional_properties` = NULL,
#' Initialize a new NestedOneOf class. #' Initialize a new NestedOneOf class.
#' #'
#' @description #' @description
@ -24,10 +26,11 @@ NestedOneOf <- R6::R6Class(
#' #'
#' @param size size #' @param size size
#' @param nested_pig nested_pig #' @param nested_pig nested_pig
#' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(
`size` = NULL, `nested_pig` = NULL, ... `size` = NULL, `nested_pig` = NULL, additional_properties = NULL, ...
) { ) {
if (!is.null(`size`)) { if (!is.null(`size`)) {
stopifnot(is.numeric(`size`), length(`size`) == 1) stopifnot(is.numeric(`size`), length(`size`) == 1)
@ -37,6 +40,11 @@ NestedOneOf <- R6::R6Class(
stopifnot(R6::is.R6(`nested_pig`)) stopifnot(R6::is.R6(`nested_pig`))
self$`nested_pig` <- `nested_pig` self$`nested_pig` <- `nested_pig`
} }
if (!is.null(additional_properties)) {
for (key in names(additional_properties)) {
self$additional_properties[[key]] <- additional_properties[[key]]
}
}
}, },
#' To JSON string #' To JSON string
#' #'
@ -55,6 +63,9 @@ NestedOneOf <- R6::R6Class(
NestedOneOfObject[["nested_pig"]] <- NestedOneOfObject[["nested_pig"]] <-
self$`nested_pig`$toJSON() self$`nested_pig`$toJSON()
} }
for (key in names(self$additional_properties)) {
NestedOneOfObject[[key]] <- self$additional_properties[[key]]
}
NestedOneOfObject NestedOneOfObject
}, },
@ -105,7 +116,12 @@ NestedOneOf <- R6::R6Class(
} }
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
json_obj <- jsonlite::fromJSON(json_string)
for (key in names(self$additional_properties)) {
json_obj[[key]] <- self$additional_properties[[key]]
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
}, },
#' Deserialize JSON string into an instance of NestedOneOf #' Deserialize JSON string into an instance of NestedOneOf
#' #'

View File

@ -13,6 +13,7 @@
#' @field shipDate character [optional] #' @field shipDate character [optional]
#' @field status character [optional] #' @field status character [optional]
#' @field complete character [optional] #' @field complete character [optional]
#' @field additional_properties named list(character) [optional]
#' @importFrom R6 R6Class #' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON #' @importFrom jsonlite fromJSON toJSON
#' @export #' @export
@ -25,6 +26,7 @@ Order <- R6::R6Class(
`shipDate` = NULL, `shipDate` = NULL,
`status` = NULL, `status` = NULL,
`complete` = NULL, `complete` = NULL,
`additional_properties` = NULL,
#' Initialize a new Order class. #' Initialize a new Order class.
#' #'
#' @description #' @description
@ -36,10 +38,11 @@ Order <- R6::R6Class(
#' @param shipDate shipDate #' @param shipDate shipDate
#' @param status Order Status #' @param status Order Status
#' @param complete complete. Default to FALSE. #' @param complete complete. Default to FALSE.
#' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(
`id` = NULL, `petId` = NULL, `quantity` = NULL, `shipDate` = NULL, `status` = NULL, `complete` = FALSE, ... `id` = NULL, `petId` = NULL, `quantity` = NULL, `shipDate` = NULL, `status` = NULL, `complete` = FALSE, additional_properties = NULL, ...
) { ) {
if (!is.null(`id`)) { if (!is.null(`id`)) {
stopifnot(is.numeric(`id`), length(`id`) == 1) stopifnot(is.numeric(`id`), length(`id`) == 1)
@ -65,6 +68,11 @@ Order <- R6::R6Class(
stopifnot(is.logical(`complete`), length(`complete`) == 1) stopifnot(is.logical(`complete`), length(`complete`) == 1)
self$`complete` <- `complete` self$`complete` <- `complete`
} }
if (!is.null(additional_properties)) {
for (key in names(additional_properties)) {
self$additional_properties[[key]] <- additional_properties[[key]]
}
}
}, },
#' To JSON string #' To JSON string
#' #'
@ -99,6 +107,9 @@ Order <- R6::R6Class(
OrderObject[["complete"]] <- OrderObject[["complete"]] <-
self$`complete` self$`complete`
} }
for (key in names(self$additional_properties)) {
OrderObject[[key]] <- self$additional_properties[[key]]
}
OrderObject OrderObject
}, },
@ -191,7 +202,12 @@ Order <- R6::R6Class(
} }
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
json_obj <- jsonlite::fromJSON(json_string)
for (key in names(self$additional_properties)) {
json_obj[[key]] <- self$additional_properties[[key]]
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
}, },
#' Deserialize JSON string into an instance of Order #' Deserialize JSON string into an instance of Order
#' #'

View File

@ -13,6 +13,7 @@
#' @field photoUrls list(character) #' @field photoUrls list(character)
#' @field tags list(\link{Tag}) [optional] #' @field tags list(\link{Tag}) [optional]
#' @field status character [optional] #' @field status character [optional]
#' @field additional_properties named list(character) [optional]
#' @importFrom R6 R6Class #' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON #' @importFrom jsonlite fromJSON toJSON
#' @export #' @export
@ -25,6 +26,7 @@ Pet <- R6::R6Class(
`photoUrls` = NULL, `photoUrls` = NULL,
`tags` = NULL, `tags` = NULL,
`status` = NULL, `status` = NULL,
`additional_properties` = NULL,
#' Initialize a new Pet class. #' Initialize a new Pet class.
#' #'
#' @description #' @description
@ -36,10 +38,11 @@ Pet <- R6::R6Class(
#' @param category category #' @param category category
#' @param tags tags #' @param tags tags
#' @param status pet status in the store #' @param status pet status in the store
#' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(
`name`, `photoUrls`, `id` = NULL, `category` = NULL, `tags` = NULL, `status` = NULL, ... `name`, `photoUrls`, `id` = NULL, `category` = NULL, `tags` = NULL, `status` = NULL, additional_properties = NULL, ...
) { ) {
if (!missing(`name`)) { if (!missing(`name`)) {
stopifnot(is.character(`name`), length(`name`) == 1) stopifnot(is.character(`name`), length(`name`) == 1)
@ -67,6 +70,11 @@ Pet <- R6::R6Class(
stopifnot(is.character(`status`), length(`status`) == 1) stopifnot(is.character(`status`), length(`status`) == 1)
self$`status` <- `status` self$`status` <- `status`
} }
if (!is.null(additional_properties)) {
for (key in names(additional_properties)) {
self$additional_properties[[key]] <- additional_properties[[key]]
}
}
}, },
#' To JSON string #' To JSON string
#' #'
@ -101,6 +109,9 @@ Pet <- R6::R6Class(
PetObject[["status"]] <- PetObject[["status"]] <-
self$`status` self$`status`
} }
for (key in names(self$additional_properties)) {
PetObject[[key]] <- self$additional_properties[[key]]
}
PetObject PetObject
}, },
@ -195,7 +206,12 @@ Pet <- R6::R6Class(
} }
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
json_obj <- jsonlite::fromJSON(json_string)
for (key in names(self$additional_properties)) {
json_obj[[key]] <- self$additional_properties[[key]]
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
}, },
#' Deserialize JSON string into an instance of Pet #' Deserialize JSON string into an instance of Pet
#' #'

View File

@ -13,6 +13,7 @@
#' @field 123_number character [optional] #' @field 123_number character [optional]
#' @field array[test] character [optional] #' @field array[test] character [optional]
#' @field empty_string character [optional] #' @field empty_string character [optional]
#' @field additional_properties named list(character) [optional]
#' @importFrom R6 R6Class #' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON #' @importFrom jsonlite fromJSON toJSON
#' @export #' @export
@ -25,6 +26,7 @@ Special <- R6::R6Class(
`123_number` = NULL, `123_number` = NULL,
`array[test]` = NULL, `array[test]` = NULL,
`empty_string` = NULL, `empty_string` = NULL,
`additional_properties` = NULL,
#' Initialize a new Special class. #' Initialize a new Special class.
#' #'
#' @description #' @description
@ -36,10 +38,11 @@ Special <- R6::R6Class(
#' @param 123_number 123_number #' @param 123_number 123_number
#' @param array[test] array[test] #' @param array[test] array[test]
#' @param empty_string empty_string #' @param empty_string empty_string
#' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(
`item_self` = NULL, `item_private` = NULL, `item_super` = NULL, `123_number` = NULL, `array[test]` = NULL, `empty_string` = NULL, ... `item_self` = NULL, `item_private` = NULL, `item_super` = NULL, `123_number` = NULL, `array[test]` = NULL, `empty_string` = NULL, additional_properties = NULL, ...
) { ) {
if (!is.null(`item_self`)) { if (!is.null(`item_self`)) {
stopifnot(is.numeric(`item_self`), length(`item_self`) == 1) stopifnot(is.numeric(`item_self`), length(`item_self`) == 1)
@ -65,6 +68,11 @@ Special <- R6::R6Class(
stopifnot(is.character(`empty_string`), length(`empty_string`) == 1) stopifnot(is.character(`empty_string`), length(`empty_string`) == 1)
self$`empty_string` <- `empty_string` self$`empty_string` <- `empty_string`
} }
if (!is.null(additional_properties)) {
for (key in names(additional_properties)) {
self$additional_properties[[key]] <- additional_properties[[key]]
}
}
}, },
#' To JSON string #' To JSON string
#' #'
@ -99,6 +107,9 @@ Special <- R6::R6Class(
SpecialObject[["empty_string"]] <- SpecialObject[["empty_string"]] <-
self$`empty_string` self$`empty_string`
} }
for (key in names(self$additional_properties)) {
SpecialObject[[key]] <- self$additional_properties[[key]]
}
SpecialObject SpecialObject
}, },
@ -191,7 +202,12 @@ Special <- R6::R6Class(
} }
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
json_obj <- jsonlite::fromJSON(json_string)
for (key in names(self$additional_properties)) {
json_obj[[key]] <- self$additional_properties[[key]]
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
}, },
#' Deserialize JSON string into an instance of Special #' Deserialize JSON string into an instance of Special
#' #'

View File

@ -9,6 +9,7 @@
#' @format An \code{R6Class} generator object #' @format An \code{R6Class} generator object
#' @field id integer [optional] #' @field id integer [optional]
#' @field name character [optional] #' @field name character [optional]
#' @field additional_properties named list(character) [optional]
#' @importFrom R6 R6Class #' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON #' @importFrom jsonlite fromJSON toJSON
#' @export #' @export
@ -17,6 +18,7 @@ Tag <- R6::R6Class(
public = list( public = list(
`id` = NULL, `id` = NULL,
`name` = NULL, `name` = NULL,
`additional_properties` = NULL,
#' Initialize a new Tag class. #' Initialize a new Tag class.
#' #'
#' @description #' @description
@ -24,10 +26,11 @@ Tag <- R6::R6Class(
#' #'
#' @param id id #' @param id id
#' @param name name #' @param name name
#' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(
`id` = NULL, `name` = NULL, ... `id` = NULL, `name` = NULL, additional_properties = NULL, ...
) { ) {
if (!is.null(`id`)) { if (!is.null(`id`)) {
stopifnot(is.numeric(`id`), length(`id`) == 1) stopifnot(is.numeric(`id`), length(`id`) == 1)
@ -37,6 +40,11 @@ Tag <- R6::R6Class(
stopifnot(is.character(`name`), length(`name`) == 1) stopifnot(is.character(`name`), length(`name`) == 1)
self$`name` <- `name` self$`name` <- `name`
} }
if (!is.null(additional_properties)) {
for (key in names(additional_properties)) {
self$additional_properties[[key]] <- additional_properties[[key]]
}
}
}, },
#' To JSON string #' To JSON string
#' #'
@ -55,6 +63,9 @@ Tag <- R6::R6Class(
TagObject[["name"]] <- TagObject[["name"]] <-
self$`name` self$`name`
} }
for (key in names(self$additional_properties)) {
TagObject[[key]] <- self$additional_properties[[key]]
}
TagObject TagObject
}, },
@ -103,7 +114,12 @@ Tag <- R6::R6Class(
} }
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
json_obj <- jsonlite::fromJSON(json_string)
for (key in names(self$additional_properties)) {
json_obj[[key]] <- self$additional_properties[[key]]
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
}, },
#' Deserialize JSON string into an instance of Tag #' Deserialize JSON string into an instance of Tag
#' #'

View File

@ -9,6 +9,7 @@
#' @format An \code{R6Class} generator object #' @format An \code{R6Class} generator object
#' @field jsonData \link{Pet} [optional] #' @field jsonData \link{Pet} [optional]
#' @field binaryDataN2Information data.frame [optional] #' @field binaryDataN2Information data.frame [optional]
#' @field additional_properties named list(character) [optional]
#' @importFrom R6 R6Class #' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON #' @importFrom jsonlite fromJSON toJSON
#' @export #' @export
@ -17,6 +18,7 @@ UpdatePetRequest <- R6::R6Class(
public = list( public = list(
`jsonData` = NULL, `jsonData` = NULL,
`binaryDataN2Information` = NULL, `binaryDataN2Information` = NULL,
`additional_properties` = NULL,
#' Initialize a new UpdatePetRequest class. #' Initialize a new UpdatePetRequest class.
#' #'
#' @description #' @description
@ -24,10 +26,11 @@ UpdatePetRequest <- R6::R6Class(
#' #'
#' @param jsonData jsonData #' @param jsonData jsonData
#' @param binaryDataN2Information binaryDataN2Information #' @param binaryDataN2Information binaryDataN2Information
#' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(
`jsonData` = NULL, `binaryDataN2Information` = NULL, ... `jsonData` = NULL, `binaryDataN2Information` = NULL, additional_properties = NULL, ...
) { ) {
if (!is.null(`jsonData`)) { if (!is.null(`jsonData`)) {
stopifnot(R6::is.R6(`jsonData`)) stopifnot(R6::is.R6(`jsonData`))
@ -36,6 +39,11 @@ UpdatePetRequest <- R6::R6Class(
if (!is.null(`binaryDataN2Information`)) { if (!is.null(`binaryDataN2Information`)) {
self$`binaryDataN2Information` <- `binaryDataN2Information` self$`binaryDataN2Information` <- `binaryDataN2Information`
} }
if (!is.null(additional_properties)) {
for (key in names(additional_properties)) {
self$additional_properties[[key]] <- additional_properties[[key]]
}
}
}, },
#' To JSON string #' To JSON string
#' #'
@ -54,6 +62,9 @@ UpdatePetRequest <- R6::R6Class(
UpdatePetRequestObject[["binaryDataN2Information"]] <- UpdatePetRequestObject[["binaryDataN2Information"]] <-
self$`binaryDataN2Information` self$`binaryDataN2Information`
} }
for (key in names(self$additional_properties)) {
UpdatePetRequestObject[[key]] <- self$additional_properties[[key]]
}
UpdatePetRequestObject UpdatePetRequestObject
}, },
@ -104,7 +115,12 @@ UpdatePetRequest <- R6::R6Class(
} }
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
json_obj <- jsonlite::fromJSON(json_string)
for (key in names(self$additional_properties)) {
json_obj[[key]] <- self$additional_properties[[key]]
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
}, },
#' Deserialize JSON string into an instance of UpdatePetRequest #' Deserialize JSON string into an instance of UpdatePetRequest
#' #'

View File

@ -15,6 +15,7 @@
#' @field password character [optional] #' @field password character [optional]
#' @field phone character [optional] #' @field phone character [optional]
#' @field userStatus integer [optional] #' @field userStatus integer [optional]
#' @field additional_properties named list(character) [optional]
#' @importFrom R6 R6Class #' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON #' @importFrom jsonlite fromJSON toJSON
#' @export #' @export
@ -29,6 +30,7 @@ User <- R6::R6Class(
`password` = NULL, `password` = NULL,
`phone` = NULL, `phone` = NULL,
`userStatus` = NULL, `userStatus` = NULL,
`additional_properties` = NULL,
#' Initialize a new User class. #' Initialize a new User class.
#' #'
#' @description #' @description
@ -42,10 +44,11 @@ User <- R6::R6Class(
#' @param password password #' @param password password
#' @param phone phone #' @param phone phone
#' @param userStatus User Status #' @param userStatus User Status
#' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(
`id` = NULL, `username` = NULL, `firstName` = NULL, `lastName` = NULL, `email` = NULL, `password` = NULL, `phone` = NULL, `userStatus` = NULL, ... `id` = NULL, `username` = NULL, `firstName` = NULL, `lastName` = NULL, `email` = NULL, `password` = NULL, `phone` = NULL, `userStatus` = NULL, additional_properties = NULL, ...
) { ) {
if (!is.null(`id`)) { if (!is.null(`id`)) {
stopifnot(is.numeric(`id`), length(`id`) == 1) stopifnot(is.numeric(`id`), length(`id`) == 1)
@ -79,6 +82,11 @@ User <- R6::R6Class(
stopifnot(is.numeric(`userStatus`), length(`userStatus`) == 1) stopifnot(is.numeric(`userStatus`), length(`userStatus`) == 1)
self$`userStatus` <- `userStatus` self$`userStatus` <- `userStatus`
} }
if (!is.null(additional_properties)) {
for (key in names(additional_properties)) {
self$additional_properties[[key]] <- additional_properties[[key]]
}
}
}, },
#' To JSON string #' To JSON string
#' #'
@ -121,6 +129,9 @@ User <- R6::R6Class(
UserObject[["userStatus"]] <- UserObject[["userStatus"]] <-
self$`userStatus` self$`userStatus`
} }
for (key in names(self$additional_properties)) {
UserObject[[key]] <- self$additional_properties[[key]]
}
UserObject UserObject
}, },
@ -235,7 +246,12 @@ User <- R6::R6Class(
} }
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
json_obj <- jsonlite::fromJSON(json_string)
for (key in names(self$additional_properties)) {
json_obj[[key]] <- self$additional_properties[[key]]
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
}, },
#' Deserialize JSON string into an instance of User #' Deserialize JSON string into an instance of User
#' #'

View File

@ -10,6 +10,7 @@
#' @field hasBaleen character [optional] #' @field hasBaleen character [optional]
#' @field hasTeeth character [optional] #' @field hasTeeth character [optional]
#' @field className character #' @field className character
#' @field additional_properties named list(character) [optional]
#' @importFrom R6 R6Class #' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON #' @importFrom jsonlite fromJSON toJSON
#' @export #' @export
@ -19,6 +20,7 @@ Whale <- R6::R6Class(
`hasBaleen` = NULL, `hasBaleen` = NULL,
`hasTeeth` = NULL, `hasTeeth` = NULL,
`className` = NULL, `className` = NULL,
`additional_properties` = NULL,
#' Initialize a new Whale class. #' Initialize a new Whale class.
#' #'
#' @description #' @description
@ -27,10 +29,11 @@ Whale <- R6::R6Class(
#' @param className className #' @param className className
#' @param hasBaleen hasBaleen #' @param hasBaleen hasBaleen
#' @param hasTeeth hasTeeth #' @param hasTeeth hasTeeth
#' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(
`className`, `hasBaleen` = NULL, `hasTeeth` = NULL, ... `className`, `hasBaleen` = NULL, `hasTeeth` = NULL, additional_properties = NULL, ...
) { ) {
if (!missing(`className`)) { if (!missing(`className`)) {
stopifnot(is.character(`className`), length(`className`) == 1) stopifnot(is.character(`className`), length(`className`) == 1)
@ -44,6 +47,11 @@ Whale <- R6::R6Class(
stopifnot(is.logical(`hasTeeth`), length(`hasTeeth`) == 1) stopifnot(is.logical(`hasTeeth`), length(`hasTeeth`) == 1)
self$`hasTeeth` <- `hasTeeth` self$`hasTeeth` <- `hasTeeth`
} }
if (!is.null(additional_properties)) {
for (key in names(additional_properties)) {
self$additional_properties[[key]] <- additional_properties[[key]]
}
}
}, },
#' To JSON string #' To JSON string
#' #'
@ -66,6 +74,9 @@ Whale <- R6::R6Class(
WhaleObject[["className"]] <- WhaleObject[["className"]] <-
self$`className` self$`className`
} }
for (key in names(self$additional_properties)) {
WhaleObject[[key]] <- self$additional_properties[[key]]
}
WhaleObject WhaleObject
}, },
@ -125,7 +136,12 @@ Whale <- R6::R6Class(
} }
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
json_obj <- jsonlite::fromJSON(json_string)
for (key in names(self$additional_properties)) {
json_obj[[key]] <- self$additional_properties[[key]]
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
}, },
#' Deserialize JSON string into an instance of Whale #' Deserialize JSON string into an instance of Whale
#' #'

View File

@ -9,6 +9,7 @@
#' @format An \code{R6Class} generator object #' @format An \code{R6Class} generator object
#' @field type character [optional] #' @field type character [optional]
#' @field className character #' @field className character
#' @field additional_properties named list(character) [optional]
#' @importFrom R6 R6Class #' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON #' @importFrom jsonlite fromJSON toJSON
#' @export #' @export
@ -17,6 +18,7 @@ Zebra <- R6::R6Class(
public = list( public = list(
`type` = NULL, `type` = NULL,
`className` = NULL, `className` = NULL,
`additional_properties` = NULL,
#' Initialize a new Zebra class. #' Initialize a new Zebra class.
#' #'
#' @description #' @description
@ -24,10 +26,11 @@ Zebra <- R6::R6Class(
#' #'
#' @param className className #' @param className className
#' @param type type #' @param type type
#' @param additional_properties additonal properties (optional)
#' @param ... Other optional arguments. #' @param ... Other optional arguments.
#' @export #' @export
initialize = function( initialize = function(
`className`, `type` = NULL, ... `className`, `type` = NULL, additional_properties = NULL, ...
) { ) {
if (!missing(`className`)) { if (!missing(`className`)) {
stopifnot(is.character(`className`), length(`className`) == 1) stopifnot(is.character(`className`), length(`className`) == 1)
@ -37,6 +40,11 @@ Zebra <- R6::R6Class(
stopifnot(is.character(`type`), length(`type`) == 1) stopifnot(is.character(`type`), length(`type`) == 1)
self$`type` <- `type` self$`type` <- `type`
} }
if (!is.null(additional_properties)) {
for (key in names(additional_properties)) {
self$additional_properties[[key]] <- additional_properties[[key]]
}
}
}, },
#' To JSON string #' To JSON string
#' #'
@ -55,6 +63,9 @@ Zebra <- R6::R6Class(
ZebraObject[["className"]] <- ZebraObject[["className"]] <-
self$`className` self$`className`
} }
for (key in names(self$additional_properties)) {
ZebraObject[[key]] <- self$additional_properties[[key]]
}
ZebraObject ZebraObject
}, },
@ -103,7 +114,12 @@ Zebra <- R6::R6Class(
} }
) )
jsoncontent <- paste(jsoncontent, collapse = ",") jsoncontent <- paste(jsoncontent, collapse = ",")
as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = "")))
json_obj <- jsonlite::fromJSON(json_string)
for (key in names(self$additional_properties)) {
json_obj[[key]] <- self$additional_properties[[key]]
}
json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA)))
}, },
#' Deserialize JSON string into an instance of Zebra #' Deserialize JSON string into an instance of Zebra
#' #'