forked from loafle/openapi-generator-original
[R] minor bug fixes in oneOf, anyOf (#13298)
* update oneof to handle primitive types in r client * add support for primitive type support in anyOf in r client * remmove lock
This commit is contained in:
parent
1e879af472
commit
66ecfb62c3
1
.gitignore
vendored
1
.gitignore
vendored
@ -251,6 +251,7 @@ samples/server/petstore/erlang-server/rebar.lock
|
||||
# JS
|
||||
samples/client/petstore/javascript-es6/package-lock.json
|
||||
samples/client/petstore/javascript-promise-es6/package-lock.json
|
||||
samples/client/petstore/javascript-apollo/package-lock.json
|
||||
|
||||
# elm
|
||||
samples/client/petstore/elm/index.html
|
||||
|
@ -58,22 +58,32 @@
|
||||
fromJSON = function(input) {
|
||||
error_messages <- list()
|
||||
|
||||
{{#anyOf}}
|
||||
{{{.}}}_result <- tryCatch({
|
||||
{{{.}}}$public_methods$validateJSON(input)
|
||||
{{{.}}}_instance <- {{{.}}}$new()
|
||||
self$actual_instance <- {{{.}}}_instance$fromJSON(input)
|
||||
self$actual_type <- "{{{.}}}"
|
||||
{{#composedSchemas.anyOf}}
|
||||
{{^isNull}}
|
||||
{{{dataType}}}_result <- tryCatch({
|
||||
{{#isPrimitiveType}}
|
||||
instance <- jsonlite::fromJSON(input, simplifyVector = FALSE)
|
||||
if (typeof(instance) != "{{{dataType}}}") {
|
||||
stop(sprintf("Data type doesn't match. Expected: %s. Actual: %s.", "{{{dataType}}}", typeof(instance)))
|
||||
}
|
||||
{{/isPrimitiveType}}
|
||||
{{^isPrimitiveType}}
|
||||
{{{dataType}}}$public_methods$validateJSON(input)
|
||||
{{{dataType}}}_instance <- {{{dataType}}}$new()
|
||||
{{/isPrimitiveType}}
|
||||
self$actual_instance <- {{{dataType}}}_instance$fromJSON(input)
|
||||
self$actual_type <- "{{{dataType}}}"
|
||||
return(self)
|
||||
},
|
||||
error = function(err) err
|
||||
)
|
||||
|
||||
if (!is.null({{{.}}}_result["error"])) {
|
||||
error_messages <- append(error_messages, {{{.}}}_result["message"])
|
||||
if (!is.null({{{dataType}}}_result["error"])) {
|
||||
error_messages <- append(error_messages, {{{dataType}}}_result["message"])
|
||||
}
|
||||
|
||||
{{/anyOf}}
|
||||
{{/isNull}}
|
||||
{{/composedSchemas.anyOf}}
|
||||
# no match
|
||||
stop(paste("No match found when deserializing the payload into {{{classname}}} with anyOf schemas {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}. Details: ",
|
||||
paste(error_messages, collapse = ", ")))
|
||||
|
@ -15,7 +15,7 @@
|
||||
actual_instance = NULL,
|
||||
#' @field actual_type the type of the object stored in this instance.
|
||||
actual_type = NULL,
|
||||
#' @field one_of a list of object types defined in the oneOf schema.
|
||||
#' @field one_of a list of types defined in the oneOf schema.
|
||||
one_of = list({{#oneOf}}"{{{.}}}"{{^-last}}, {{/-last}}{{/oneOf}}),
|
||||
#' Initialize a new {{{classname}}}.
|
||||
#'
|
||||
@ -61,23 +61,33 @@
|
||||
error_messages <- list()
|
||||
instance <- NULL
|
||||
|
||||
{{#oneOf}}
|
||||
{{{.}}}_result <- tryCatch({
|
||||
{{{.}}}$public_methods$validateJSON(input)
|
||||
{{{.}}}_instance <- {{{.}}}$new()
|
||||
instance <- {{{.}}}_instance$fromJSON(input)
|
||||
instance_type <- "{{{.}}}"
|
||||
matched_schemas <- append(matched_schemas, "{{{.}}}")
|
||||
{{#composedSchemas.oneOf}}
|
||||
{{^isNull}}
|
||||
{{{dataType}}}_result <- tryCatch({
|
||||
{{#isPrimitiveType}}
|
||||
instance <- jsonlite::fromJSON(input, simplifyVector = FALSE)
|
||||
if (typeof(instance) != "{{{dataType}}}") {
|
||||
stop(sprintf("Data type doesn't match. Expected: %s. Actual: %s.", "{{{dataType}}}", typeof(instance)))
|
||||
}
|
||||
{{/isPrimitiveType}}
|
||||
{{^isPrimitiveType}}
|
||||
{{{dataType}}}$public_methods$validateJSON(input)
|
||||
{{{dataType}}}_instance <- {{{dataType}}}$new()
|
||||
instance <- {{{dataType}}}_instance$fromJSON(input)
|
||||
{{/isPrimitiveType}}
|
||||
instance_type <- "{{{dataType}}}"
|
||||
matched_schemas <- append(matched_schemas, "{{{dataType}}}")
|
||||
matched <- matched + 1
|
||||
},
|
||||
error = function(err) err
|
||||
)
|
||||
|
||||
if (!is.null({{{.}}}_result["error"])) {
|
||||
error_messages <- append(error_messages, {{{.}}}_result["message"])
|
||||
if (!is.null({{{dataType}}}_result["error"])) {
|
||||
error_messages <- append(error_messages, {{{dataType}}}_result["message"])
|
||||
}
|
||||
|
||||
{{/oneOf}}
|
||||
{{/isNull}}
|
||||
{{/composedSchemas.oneOf}}
|
||||
if (matched == 1) {
|
||||
# successfully match exactly 1 schema specified in oneOf
|
||||
self$actual_instance <- instance
|
||||
|
@ -933,6 +933,14 @@ components:
|
||||
- $ref: '#/components/schemas/DanishPig'
|
||||
discriminator:
|
||||
propertyName: className
|
||||
OneOfPrimitiveTypeTest:
|
||||
oneOf:
|
||||
- type: "integer"
|
||||
- type: "string"
|
||||
AnyOfPrimitiveTypeTest:
|
||||
oneOf:
|
||||
- type: "integer"
|
||||
- type: "string"
|
||||
BasquePig:
|
||||
type: object
|
||||
properties:
|
||||
|
@ -8,6 +8,7 @@ NAMESPACE
|
||||
R/allof_tag_api_response.R
|
||||
R/animal.R
|
||||
R/any_of_pig.R
|
||||
R/any_of_primitive_type_test.R
|
||||
R/api_client.R
|
||||
R/api_exception.R
|
||||
R/api_response.R
|
||||
@ -21,6 +22,7 @@ R/dog_all_of.R
|
||||
R/fake_api.R
|
||||
R/model_api_response.R
|
||||
R/nested_one_of.R
|
||||
R/one_of_primitive_type_test.R
|
||||
R/order.R
|
||||
R/pet.R
|
||||
R/pet_api.R
|
||||
@ -36,6 +38,7 @@ README.md
|
||||
docs/AllofTagApiResponse.md
|
||||
docs/Animal.md
|
||||
docs/AnyOfPig.md
|
||||
docs/AnyOfPrimitiveTypeTest.md
|
||||
docs/BasquePig.md
|
||||
docs/Cat.md
|
||||
docs/CatAllOf.md
|
||||
@ -46,6 +49,7 @@ docs/DogAllOf.md
|
||||
docs/FakeApi.md
|
||||
docs/ModelApiResponse.md
|
||||
docs/NestedOneOf.md
|
||||
docs/OneOfPrimitiveTypeTest.md
|
||||
docs/Order.md
|
||||
docs/Pet.md
|
||||
docs/PetApi.md
|
||||
|
@ -19,6 +19,7 @@ export(ApiException)
|
||||
export(AllofTagApiResponse)
|
||||
export(Animal)
|
||||
export(AnyOfPig)
|
||||
export(AnyOfPrimitiveTypeTest)
|
||||
export(BasquePig)
|
||||
export(Cat)
|
||||
export(CatAllOf)
|
||||
@ -28,6 +29,7 @@ export(Dog)
|
||||
export(DogAllOf)
|
||||
export(ModelApiResponse)
|
||||
export(NestedOneOf)
|
||||
export(OneOfPrimitiveTypeTest)
|
||||
export(Order)
|
||||
export(Pet)
|
||||
export(Pig)
|
||||
|
@ -0,0 +1,186 @@
|
||||
#' OpenAPI Petstore
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title AnyOfPrimitiveTypeTest
|
||||
#'
|
||||
#' @description AnyOfPrimitiveTypeTest Class
|
||||
#'
|
||||
#' @format An \code{R6Class} generator object
|
||||
#'
|
||||
#' @importFrom R6 R6Class
|
||||
#' @importFrom jsonlite fromJSON toJSON
|
||||
#' @export
|
||||
AnyOfPrimitiveTypeTest <- R6::R6Class(
|
||||
"AnyOfPrimitiveTypeTest",
|
||||
public = list(
|
||||
#' @field actual_instance the object stored in this instance.
|
||||
actual_instance = NULL,
|
||||
#' @field actual_type the type of the object stored in this instance.
|
||||
actual_type = NULL,
|
||||
#' @field one_of a list of types defined in the oneOf schema.
|
||||
one_of = list("character", "integer"),
|
||||
#' Initialize a new AnyOfPrimitiveTypeTest.
|
||||
#'
|
||||
#' @description
|
||||
#' Initialize a new AnyOfPrimitiveTypeTest.
|
||||
#'
|
||||
#' @param instance an instance of the object defined in the oneOf schemas: "character", "integer"
|
||||
#' @export
|
||||
initialize = function(instance = NULL) {
|
||||
if (is.null(instance)) {
|
||||
# do nothing
|
||||
} else if (get(class(instance)[[1]], pos = -1)$classname == "character") {
|
||||
self$actual_instance <- instance
|
||||
self$actual_type <- "character"
|
||||
} else if (get(class(instance)[[1]], pos = -1)$classname == "integer") {
|
||||
self$actual_instance <- instance
|
||||
self$actual_type <- "integer"
|
||||
} else {
|
||||
stop(paste("Failed to initialize AnyOfPrimitiveTypeTest with oneOf schemas character, integer. Provided class name: ",
|
||||
get(class(instance)[[1]], pos = -1)$classname))
|
||||
}
|
||||
},
|
||||
#' Deserialize JSON string into an instance of AnyOfPrimitiveTypeTest.
|
||||
#'
|
||||
#' @description
|
||||
#' Deserialize JSON string into an instance of AnyOfPrimitiveTypeTest.
|
||||
#' An alias to the method `fromJSON` .
|
||||
#'
|
||||
#' @param input The input JSON.
|
||||
#' @return An instance of AnyOfPrimitiveTypeTest.
|
||||
#' @export
|
||||
fromJSONString = function(input) {
|
||||
self$fromJSON(input)
|
||||
},
|
||||
#' Deserialize JSON string into an instance of AnyOfPrimitiveTypeTest.
|
||||
#'
|
||||
#' @description
|
||||
#' Deserialize JSON string into an instance of AnyOfPrimitiveTypeTest.
|
||||
#'
|
||||
#' @param input The input JSON.
|
||||
#' @return An instance of AnyOfPrimitiveTypeTest.
|
||||
#' @export
|
||||
fromJSON = function(input) {
|
||||
matched <- 0 # match counter
|
||||
matched_schemas <- list() #names of matched schemas
|
||||
error_messages <- list()
|
||||
instance <- NULL
|
||||
|
||||
integer_result <- tryCatch({
|
||||
instance <- jsonlite::fromJSON(input, simplifyVector = FALSE)
|
||||
if (typeof(instance) != "integer") {
|
||||
stop(sprintf("Data type doesn't match. Expected: %s. Actual: %s.", "integer", typeof(instance)))
|
||||
}
|
||||
instance_type <- "integer"
|
||||
matched_schemas <- append(matched_schemas, "integer")
|
||||
matched <- matched + 1
|
||||
},
|
||||
error = function(err) err
|
||||
)
|
||||
|
||||
if (!is.null(integer_result["error"])) {
|
||||
error_messages <- append(error_messages, integer_result["message"])
|
||||
}
|
||||
|
||||
character_result <- tryCatch({
|
||||
instance <- jsonlite::fromJSON(input, simplifyVector = FALSE)
|
||||
if (typeof(instance) != "character") {
|
||||
stop(sprintf("Data type doesn't match. Expected: %s. Actual: %s.", "character", typeof(instance)))
|
||||
}
|
||||
instance_type <- "character"
|
||||
matched_schemas <- append(matched_schemas, "character")
|
||||
matched <- matched + 1
|
||||
},
|
||||
error = function(err) err
|
||||
)
|
||||
|
||||
if (!is.null(character_result["error"])) {
|
||||
error_messages <- append(error_messages, character_result["message"])
|
||||
}
|
||||
|
||||
if (matched == 1) {
|
||||
# successfully match exactly 1 schema specified in oneOf
|
||||
self$actual_instance <- instance
|
||||
self$actual_type <- instance_type
|
||||
} else if (matched > 1) {
|
||||
# more than 1 match
|
||||
stop("Multiple matches found when deserializing the payload into AnyOfPrimitiveTypeTest with oneOf schemas character, integer.")
|
||||
} else {
|
||||
# no match
|
||||
stop(paste("No match found when deserializing the payload into AnyOfPrimitiveTypeTest with oneOf schemas character, integer. Details: ",
|
||||
paste(error_messages, collapse = ", ")))
|
||||
}
|
||||
|
||||
self
|
||||
},
|
||||
#' Serialize AnyOfPrimitiveTypeTest to JSON string.
|
||||
#'
|
||||
#' @description
|
||||
#' Serialize AnyOfPrimitiveTypeTest to JSON string.
|
||||
#'
|
||||
#' @return JSON string representation of the AnyOfPrimitiveTypeTest.
|
||||
#' @export
|
||||
toJSONString = function() {
|
||||
if (!is.null(self$actual_instance)) {
|
||||
as.character(jsonlite::minify(self$actual_instance$toJSONString()))
|
||||
} else {
|
||||
NULL
|
||||
}
|
||||
},
|
||||
#' Serialize AnyOfPrimitiveTypeTest to JSON.
|
||||
#'
|
||||
#' @description
|
||||
#' Serialize AnyOfPrimitiveTypeTest to JSON.
|
||||
#'
|
||||
#' @return JSON representation of the AnyOfPrimitiveTypeTest.
|
||||
#' @export
|
||||
toJSON = function() {
|
||||
if (!is.null(self$actual_instance)) {
|
||||
self$actual_instance$toJSON()
|
||||
} else {
|
||||
NULL
|
||||
}
|
||||
},
|
||||
#' Validate the input JSON with respect to AnyOfPrimitiveTypeTest.
|
||||
#'
|
||||
#' @description
|
||||
#' Validate the input JSON with respect to AnyOfPrimitiveTypeTest and
|
||||
#' throw exception if invalid.
|
||||
#'
|
||||
#' @param input The input JSON.
|
||||
#' @export
|
||||
validateJSON = function(input) {
|
||||
# backup current values
|
||||
actual_instance_bak <- self$actual_instance
|
||||
actual_type_bak <- self$actual_type
|
||||
|
||||
# if it's not valid, an error will be thrown
|
||||
self$fromJSON(input)
|
||||
|
||||
# no error thrown, restore old values
|
||||
self$actual_instance <- actual_instance_bak
|
||||
self$actual_type <- actual_type_bak
|
||||
},
|
||||
#' Returns the string representation of the instance.
|
||||
#'
|
||||
#' @description
|
||||
#' Returns the string representation of the instance.
|
||||
#'
|
||||
#' @return The string representation of the instance.
|
||||
#' @export
|
||||
toString = function() {
|
||||
jsoncontent <- c(
|
||||
sprintf('"actual_instance": %s', if (is.null(self$actual_instance)) NULL else self$actual_instance$toJSONString()),
|
||||
sprintf('"actual_type": "%s"', self$actual_type),
|
||||
sprintf('"one_of": "%s"', paste(unlist(self$one_of), collapse = ", "))
|
||||
)
|
||||
jsoncontent <- paste(jsoncontent, collapse = ",")
|
||||
as.character(jsonlite::prettify(paste("{", jsoncontent, "}", sep = "")))
|
||||
}
|
||||
)
|
||||
)
|
@ -0,0 +1,186 @@
|
||||
#' OpenAPI Petstore
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title OneOfPrimitiveTypeTest
|
||||
#'
|
||||
#' @description OneOfPrimitiveTypeTest Class
|
||||
#'
|
||||
#' @format An \code{R6Class} generator object
|
||||
#'
|
||||
#' @importFrom R6 R6Class
|
||||
#' @importFrom jsonlite fromJSON toJSON
|
||||
#' @export
|
||||
OneOfPrimitiveTypeTest <- R6::R6Class(
|
||||
"OneOfPrimitiveTypeTest",
|
||||
public = list(
|
||||
#' @field actual_instance the object stored in this instance.
|
||||
actual_instance = NULL,
|
||||
#' @field actual_type the type of the object stored in this instance.
|
||||
actual_type = NULL,
|
||||
#' @field one_of a list of types defined in the oneOf schema.
|
||||
one_of = list("character", "integer"),
|
||||
#' Initialize a new OneOfPrimitiveTypeTest.
|
||||
#'
|
||||
#' @description
|
||||
#' Initialize a new OneOfPrimitiveTypeTest.
|
||||
#'
|
||||
#' @param instance an instance of the object defined in the oneOf schemas: "character", "integer"
|
||||
#' @export
|
||||
initialize = function(instance = NULL) {
|
||||
if (is.null(instance)) {
|
||||
# do nothing
|
||||
} else if (get(class(instance)[[1]], pos = -1)$classname == "character") {
|
||||
self$actual_instance <- instance
|
||||
self$actual_type <- "character"
|
||||
} else if (get(class(instance)[[1]], pos = -1)$classname == "integer") {
|
||||
self$actual_instance <- instance
|
||||
self$actual_type <- "integer"
|
||||
} else {
|
||||
stop(paste("Failed to initialize OneOfPrimitiveTypeTest with oneOf schemas character, integer. Provided class name: ",
|
||||
get(class(instance)[[1]], pos = -1)$classname))
|
||||
}
|
||||
},
|
||||
#' Deserialize JSON string into an instance of OneOfPrimitiveTypeTest.
|
||||
#'
|
||||
#' @description
|
||||
#' Deserialize JSON string into an instance of OneOfPrimitiveTypeTest.
|
||||
#' An alias to the method `fromJSON` .
|
||||
#'
|
||||
#' @param input The input JSON.
|
||||
#' @return An instance of OneOfPrimitiveTypeTest.
|
||||
#' @export
|
||||
fromJSONString = function(input) {
|
||||
self$fromJSON(input)
|
||||
},
|
||||
#' Deserialize JSON string into an instance of OneOfPrimitiveTypeTest.
|
||||
#'
|
||||
#' @description
|
||||
#' Deserialize JSON string into an instance of OneOfPrimitiveTypeTest.
|
||||
#'
|
||||
#' @param input The input JSON.
|
||||
#' @return An instance of OneOfPrimitiveTypeTest.
|
||||
#' @export
|
||||
fromJSON = function(input) {
|
||||
matched <- 0 # match counter
|
||||
matched_schemas <- list() #names of matched schemas
|
||||
error_messages <- list()
|
||||
instance <- NULL
|
||||
|
||||
integer_result <- tryCatch({
|
||||
instance <- jsonlite::fromJSON(input, simplifyVector = FALSE)
|
||||
if (typeof(instance) != "integer") {
|
||||
stop(sprintf("Data type doesn't match. Expected: %s. Actual: %s.", "integer", typeof(instance)))
|
||||
}
|
||||
instance_type <- "integer"
|
||||
matched_schemas <- append(matched_schemas, "integer")
|
||||
matched <- matched + 1
|
||||
},
|
||||
error = function(err) err
|
||||
)
|
||||
|
||||
if (!is.null(integer_result["error"])) {
|
||||
error_messages <- append(error_messages, integer_result["message"])
|
||||
}
|
||||
|
||||
character_result <- tryCatch({
|
||||
instance <- jsonlite::fromJSON(input, simplifyVector = FALSE)
|
||||
if (typeof(instance) != "character") {
|
||||
stop(sprintf("Data type doesn't match. Expected: %s. Actual: %s.", "character", typeof(instance)))
|
||||
}
|
||||
instance_type <- "character"
|
||||
matched_schemas <- append(matched_schemas, "character")
|
||||
matched <- matched + 1
|
||||
},
|
||||
error = function(err) err
|
||||
)
|
||||
|
||||
if (!is.null(character_result["error"])) {
|
||||
error_messages <- append(error_messages, character_result["message"])
|
||||
}
|
||||
|
||||
if (matched == 1) {
|
||||
# successfully match exactly 1 schema specified in oneOf
|
||||
self$actual_instance <- instance
|
||||
self$actual_type <- instance_type
|
||||
} else if (matched > 1) {
|
||||
# more than 1 match
|
||||
stop("Multiple matches found when deserializing the payload into OneOfPrimitiveTypeTest with oneOf schemas character, integer.")
|
||||
} else {
|
||||
# no match
|
||||
stop(paste("No match found when deserializing the payload into OneOfPrimitiveTypeTest with oneOf schemas character, integer. Details: ",
|
||||
paste(error_messages, collapse = ", ")))
|
||||
}
|
||||
|
||||
self
|
||||
},
|
||||
#' Serialize OneOfPrimitiveTypeTest to JSON string.
|
||||
#'
|
||||
#' @description
|
||||
#' Serialize OneOfPrimitiveTypeTest to JSON string.
|
||||
#'
|
||||
#' @return JSON string representation of the OneOfPrimitiveTypeTest.
|
||||
#' @export
|
||||
toJSONString = function() {
|
||||
if (!is.null(self$actual_instance)) {
|
||||
as.character(jsonlite::minify(self$actual_instance$toJSONString()))
|
||||
} else {
|
||||
NULL
|
||||
}
|
||||
},
|
||||
#' Serialize OneOfPrimitiveTypeTest to JSON.
|
||||
#'
|
||||
#' @description
|
||||
#' Serialize OneOfPrimitiveTypeTest to JSON.
|
||||
#'
|
||||
#' @return JSON representation of the OneOfPrimitiveTypeTest.
|
||||
#' @export
|
||||
toJSON = function() {
|
||||
if (!is.null(self$actual_instance)) {
|
||||
self$actual_instance$toJSON()
|
||||
} else {
|
||||
NULL
|
||||
}
|
||||
},
|
||||
#' Validate the input JSON with respect to OneOfPrimitiveTypeTest.
|
||||
#'
|
||||
#' @description
|
||||
#' Validate the input JSON with respect to OneOfPrimitiveTypeTest and
|
||||
#' throw exception if invalid.
|
||||
#'
|
||||
#' @param input The input JSON.
|
||||
#' @export
|
||||
validateJSON = function(input) {
|
||||
# backup current values
|
||||
actual_instance_bak <- self$actual_instance
|
||||
actual_type_bak <- self$actual_type
|
||||
|
||||
# if it's not valid, an error will be thrown
|
||||
self$fromJSON(input)
|
||||
|
||||
# no error thrown, restore old values
|
||||
self$actual_instance <- actual_instance_bak
|
||||
self$actual_type <- actual_type_bak
|
||||
},
|
||||
#' Returns the string representation of the instance.
|
||||
#'
|
||||
#' @description
|
||||
#' Returns the string representation of the instance.
|
||||
#'
|
||||
#' @return The string representation of the instance.
|
||||
#' @export
|
||||
toString = function() {
|
||||
jsoncontent <- c(
|
||||
sprintf('"actual_instance": %s', if (is.null(self$actual_instance)) NULL else self$actual_instance$toJSONString()),
|
||||
sprintf('"actual_type": "%s"', self$actual_type),
|
||||
sprintf('"one_of": "%s"', paste(unlist(self$one_of), collapse = ", "))
|
||||
)
|
||||
jsoncontent <- paste(jsoncontent, collapse = ",")
|
||||
as.character(jsonlite::prettify(paste("{", jsoncontent, "}", sep = "")))
|
||||
}
|
||||
)
|
||||
)
|
@ -22,7 +22,7 @@ Pig <- R6::R6Class(
|
||||
actual_instance = NULL,
|
||||
#' @field actual_type the type of the object stored in this instance.
|
||||
actual_type = NULL,
|
||||
#' @field one_of a list of object types defined in the oneOf schema.
|
||||
#' @field one_of a list of types defined in the oneOf schema.
|
||||
one_of = list("BasquePig", "DanishPig"),
|
||||
#' Initialize a new Pig.
|
||||
#'
|
||||
|
@ -92,6 +92,7 @@ Class | Method | HTTP request | Description
|
||||
- [AllofTagApiResponse](docs/AllofTagApiResponse.md)
|
||||
- [Animal](docs/Animal.md)
|
||||
- [AnyOfPig](docs/AnyOfPig.md)
|
||||
- [AnyOfPrimitiveTypeTest](docs/AnyOfPrimitiveTypeTest.md)
|
||||
- [BasquePig](docs/BasquePig.md)
|
||||
- [Cat](docs/Cat.md)
|
||||
- [CatAllOf](docs/CatAllOf.md)
|
||||
@ -101,6 +102,7 @@ Class | Method | HTTP request | Description
|
||||
- [DogAllOf](docs/DogAllOf.md)
|
||||
- [ModelApiResponse](docs/ModelApiResponse.md)
|
||||
- [NestedOneOf](docs/NestedOneOf.md)
|
||||
- [OneOfPrimitiveTypeTest](docs/OneOfPrimitiveTypeTest.md)
|
||||
- [Order](docs/Order.md)
|
||||
- [Pet](docs/Pet.md)
|
||||
- [Pig](docs/Pig.md)
|
||||
|
@ -0,0 +1,8 @@
|
||||
# petstore::AnyOfPrimitiveTypeTest
|
||||
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
|
||||
|
@ -0,0 +1,8 @@
|
||||
# petstore::OneOfPrimitiveTypeTest
|
||||
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
|
||||
|
@ -0,0 +1,4 @@
|
||||
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
||||
# Please update as you see appropriate
|
||||
|
||||
context("Test AnyOfPrimitiveTypeTest")
|
@ -0,0 +1,4 @@
|
||||
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
||||
# Please update as you see appropriate
|
||||
|
||||
context("Test OneOfPrimitiveTypeTest")
|
@ -8,6 +8,7 @@ NAMESPACE
|
||||
R/allof_tag_api_response.R
|
||||
R/animal.R
|
||||
R/any_of_pig.R
|
||||
R/any_of_primitive_type_test.R
|
||||
R/api_client.R
|
||||
R/api_exception.R
|
||||
R/api_response.R
|
||||
@ -21,6 +22,7 @@ R/dog_all_of.R
|
||||
R/fake_api.R
|
||||
R/model_api_response.R
|
||||
R/nested_one_of.R
|
||||
R/one_of_primitive_type_test.R
|
||||
R/order.R
|
||||
R/pet.R
|
||||
R/pet_api.R
|
||||
@ -35,6 +37,7 @@ README.md
|
||||
docs/AllofTagApiResponse.md
|
||||
docs/Animal.md
|
||||
docs/AnyOfPig.md
|
||||
docs/AnyOfPrimitiveTypeTest.md
|
||||
docs/BasquePig.md
|
||||
docs/Cat.md
|
||||
docs/CatAllOf.md
|
||||
@ -45,6 +48,7 @@ docs/DogAllOf.md
|
||||
docs/FakeApi.md
|
||||
docs/ModelApiResponse.md
|
||||
docs/NestedOneOf.md
|
||||
docs/OneOfPrimitiveTypeTest.md
|
||||
docs/Order.md
|
||||
docs/Pet.md
|
||||
docs/PetApi.md
|
||||
|
@ -17,6 +17,7 @@ export(ApiException)
|
||||
export(AllofTagApiResponse)
|
||||
export(Animal)
|
||||
export(AnyOfPig)
|
||||
export(AnyOfPrimitiveTypeTest)
|
||||
export(BasquePig)
|
||||
export(Cat)
|
||||
export(CatAllOf)
|
||||
@ -26,6 +27,7 @@ export(Dog)
|
||||
export(DogAllOf)
|
||||
export(ModelApiResponse)
|
||||
export(NestedOneOf)
|
||||
export(OneOfPrimitiveTypeTest)
|
||||
export(Order)
|
||||
export(Pet)
|
||||
export(Pig)
|
||||
|
186
samples/client/petstore/R-httr2/R/any_of_primitive_type_test.R
Normal file
186
samples/client/petstore/R-httr2/R/any_of_primitive_type_test.R
Normal file
@ -0,0 +1,186 @@
|
||||
#' OpenAPI Petstore
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title AnyOfPrimitiveTypeTest
|
||||
#'
|
||||
#' @description AnyOfPrimitiveTypeTest Class
|
||||
#'
|
||||
#' @format An \code{R6Class} generator object
|
||||
#'
|
||||
#' @importFrom R6 R6Class
|
||||
#' @importFrom jsonlite fromJSON toJSON
|
||||
#' @export
|
||||
AnyOfPrimitiveTypeTest <- R6::R6Class(
|
||||
"AnyOfPrimitiveTypeTest",
|
||||
public = list(
|
||||
#' @field actual_instance the object stored in this instance.
|
||||
actual_instance = NULL,
|
||||
#' @field actual_type the type of the object stored in this instance.
|
||||
actual_type = NULL,
|
||||
#' @field one_of a list of types defined in the oneOf schema.
|
||||
one_of = list("character", "integer"),
|
||||
#' Initialize a new AnyOfPrimitiveTypeTest.
|
||||
#'
|
||||
#' @description
|
||||
#' Initialize a new AnyOfPrimitiveTypeTest.
|
||||
#'
|
||||
#' @param instance an instance of the object defined in the oneOf schemas: "character", "integer"
|
||||
#' @export
|
||||
initialize = function(instance = NULL) {
|
||||
if (is.null(instance)) {
|
||||
# do nothing
|
||||
} else if (get(class(instance)[[1]], pos = -1)$classname == "character") {
|
||||
self$actual_instance <- instance
|
||||
self$actual_type <- "character"
|
||||
} else if (get(class(instance)[[1]], pos = -1)$classname == "integer") {
|
||||
self$actual_instance <- instance
|
||||
self$actual_type <- "integer"
|
||||
} else {
|
||||
stop(paste("Failed to initialize AnyOfPrimitiveTypeTest with oneOf schemas character, integer. Provided class name: ",
|
||||
get(class(instance)[[1]], pos = -1)$classname))
|
||||
}
|
||||
},
|
||||
#' Deserialize JSON string into an instance of AnyOfPrimitiveTypeTest.
|
||||
#'
|
||||
#' @description
|
||||
#' Deserialize JSON string into an instance of AnyOfPrimitiveTypeTest.
|
||||
#' An alias to the method `fromJSON` .
|
||||
#'
|
||||
#' @param input The input JSON.
|
||||
#' @return An instance of AnyOfPrimitiveTypeTest.
|
||||
#' @export
|
||||
fromJSONString = function(input) {
|
||||
self$fromJSON(input)
|
||||
},
|
||||
#' Deserialize JSON string into an instance of AnyOfPrimitiveTypeTest.
|
||||
#'
|
||||
#' @description
|
||||
#' Deserialize JSON string into an instance of AnyOfPrimitiveTypeTest.
|
||||
#'
|
||||
#' @param input The input JSON.
|
||||
#' @return An instance of AnyOfPrimitiveTypeTest.
|
||||
#' @export
|
||||
fromJSON = function(input) {
|
||||
matched <- 0 # match counter
|
||||
matched_schemas <- list() #names of matched schemas
|
||||
error_messages <- list()
|
||||
instance <- NULL
|
||||
|
||||
integer_result <- tryCatch({
|
||||
instance <- jsonlite::fromJSON(input, simplifyVector = FALSE)
|
||||
if (typeof(instance) != "integer") {
|
||||
stop(sprintf("Data type doesn't match. Expected: %s. Actual: %s.", "integer", typeof(instance)))
|
||||
}
|
||||
instance_type <- "integer"
|
||||
matched_schemas <- append(matched_schemas, "integer")
|
||||
matched <- matched + 1
|
||||
},
|
||||
error = function(err) err
|
||||
)
|
||||
|
||||
if (!is.null(integer_result["error"])) {
|
||||
error_messages <- append(error_messages, integer_result["message"])
|
||||
}
|
||||
|
||||
character_result <- tryCatch({
|
||||
instance <- jsonlite::fromJSON(input, simplifyVector = FALSE)
|
||||
if (typeof(instance) != "character") {
|
||||
stop(sprintf("Data type doesn't match. Expected: %s. Actual: %s.", "character", typeof(instance)))
|
||||
}
|
||||
instance_type <- "character"
|
||||
matched_schemas <- append(matched_schemas, "character")
|
||||
matched <- matched + 1
|
||||
},
|
||||
error = function(err) err
|
||||
)
|
||||
|
||||
if (!is.null(character_result["error"])) {
|
||||
error_messages <- append(error_messages, character_result["message"])
|
||||
}
|
||||
|
||||
if (matched == 1) {
|
||||
# successfully match exactly 1 schema specified in oneOf
|
||||
self$actual_instance <- instance
|
||||
self$actual_type <- instance_type
|
||||
} else if (matched > 1) {
|
||||
# more than 1 match
|
||||
stop("Multiple matches found when deserializing the payload into AnyOfPrimitiveTypeTest with oneOf schemas character, integer.")
|
||||
} else {
|
||||
# no match
|
||||
stop(paste("No match found when deserializing the payload into AnyOfPrimitiveTypeTest with oneOf schemas character, integer. Details: ",
|
||||
paste(error_messages, collapse = ", ")))
|
||||
}
|
||||
|
||||
self
|
||||
},
|
||||
#' Serialize AnyOfPrimitiveTypeTest to JSON string.
|
||||
#'
|
||||
#' @description
|
||||
#' Serialize AnyOfPrimitiveTypeTest to JSON string.
|
||||
#'
|
||||
#' @return JSON string representation of the AnyOfPrimitiveTypeTest.
|
||||
#' @export
|
||||
toJSONString = function() {
|
||||
if (!is.null(self$actual_instance)) {
|
||||
as.character(jsonlite::minify(self$actual_instance$toJSONString()))
|
||||
} else {
|
||||
NULL
|
||||
}
|
||||
},
|
||||
#' Serialize AnyOfPrimitiveTypeTest to JSON.
|
||||
#'
|
||||
#' @description
|
||||
#' Serialize AnyOfPrimitiveTypeTest to JSON.
|
||||
#'
|
||||
#' @return JSON representation of the AnyOfPrimitiveTypeTest.
|
||||
#' @export
|
||||
toJSON = function() {
|
||||
if (!is.null(self$actual_instance)) {
|
||||
self$actual_instance$toJSON()
|
||||
} else {
|
||||
NULL
|
||||
}
|
||||
},
|
||||
#' Validate the input JSON with respect to AnyOfPrimitiveTypeTest.
|
||||
#'
|
||||
#' @description
|
||||
#' Validate the input JSON with respect to AnyOfPrimitiveTypeTest and
|
||||
#' throw exception if invalid.
|
||||
#'
|
||||
#' @param input The input JSON.
|
||||
#' @export
|
||||
validateJSON = function(input) {
|
||||
# backup current values
|
||||
actual_instance_bak <- self$actual_instance
|
||||
actual_type_bak <- self$actual_type
|
||||
|
||||
# if it's not valid, an error will be thrown
|
||||
self$fromJSON(input)
|
||||
|
||||
# no error thrown, restore old values
|
||||
self$actual_instance <- actual_instance_bak
|
||||
self$actual_type <- actual_type_bak
|
||||
},
|
||||
#' Returns the string representation of the instance.
|
||||
#'
|
||||
#' @description
|
||||
#' Returns the string representation of the instance.
|
||||
#'
|
||||
#' @return The string representation of the instance.
|
||||
#' @export
|
||||
toString = function() {
|
||||
jsoncontent <- c(
|
||||
sprintf('"actual_instance": %s', if (is.null(self$actual_instance)) NULL else self$actual_instance$toJSONString()),
|
||||
sprintf('"actual_type": "%s"', self$actual_type),
|
||||
sprintf('"one_of": "%s"', paste(unlist(self$one_of), collapse = ", "))
|
||||
)
|
||||
jsoncontent <- paste(jsoncontent, collapse = ",")
|
||||
as.character(jsonlite::prettify(paste("{", jsoncontent, "}", sep = "")))
|
||||
}
|
||||
)
|
||||
)
|
186
samples/client/petstore/R-httr2/R/one_of_primitive_type_test.R
Normal file
186
samples/client/petstore/R-httr2/R/one_of_primitive_type_test.R
Normal file
@ -0,0 +1,186 @@
|
||||
#' OpenAPI Petstore
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title OneOfPrimitiveTypeTest
|
||||
#'
|
||||
#' @description OneOfPrimitiveTypeTest Class
|
||||
#'
|
||||
#' @format An \code{R6Class} generator object
|
||||
#'
|
||||
#' @importFrom R6 R6Class
|
||||
#' @importFrom jsonlite fromJSON toJSON
|
||||
#' @export
|
||||
OneOfPrimitiveTypeTest <- R6::R6Class(
|
||||
"OneOfPrimitiveTypeTest",
|
||||
public = list(
|
||||
#' @field actual_instance the object stored in this instance.
|
||||
actual_instance = NULL,
|
||||
#' @field actual_type the type of the object stored in this instance.
|
||||
actual_type = NULL,
|
||||
#' @field one_of a list of types defined in the oneOf schema.
|
||||
one_of = list("character", "integer"),
|
||||
#' Initialize a new OneOfPrimitiveTypeTest.
|
||||
#'
|
||||
#' @description
|
||||
#' Initialize a new OneOfPrimitiveTypeTest.
|
||||
#'
|
||||
#' @param instance an instance of the object defined in the oneOf schemas: "character", "integer"
|
||||
#' @export
|
||||
initialize = function(instance = NULL) {
|
||||
if (is.null(instance)) {
|
||||
# do nothing
|
||||
} else if (get(class(instance)[[1]], pos = -1)$classname == "character") {
|
||||
self$actual_instance <- instance
|
||||
self$actual_type <- "character"
|
||||
} else if (get(class(instance)[[1]], pos = -1)$classname == "integer") {
|
||||
self$actual_instance <- instance
|
||||
self$actual_type <- "integer"
|
||||
} else {
|
||||
stop(paste("Failed to initialize OneOfPrimitiveTypeTest with oneOf schemas character, integer. Provided class name: ",
|
||||
get(class(instance)[[1]], pos = -1)$classname))
|
||||
}
|
||||
},
|
||||
#' Deserialize JSON string into an instance of OneOfPrimitiveTypeTest.
|
||||
#'
|
||||
#' @description
|
||||
#' Deserialize JSON string into an instance of OneOfPrimitiveTypeTest.
|
||||
#' An alias to the method `fromJSON` .
|
||||
#'
|
||||
#' @param input The input JSON.
|
||||
#' @return An instance of OneOfPrimitiveTypeTest.
|
||||
#' @export
|
||||
fromJSONString = function(input) {
|
||||
self$fromJSON(input)
|
||||
},
|
||||
#' Deserialize JSON string into an instance of OneOfPrimitiveTypeTest.
|
||||
#'
|
||||
#' @description
|
||||
#' Deserialize JSON string into an instance of OneOfPrimitiveTypeTest.
|
||||
#'
|
||||
#' @param input The input JSON.
|
||||
#' @return An instance of OneOfPrimitiveTypeTest.
|
||||
#' @export
|
||||
fromJSON = function(input) {
|
||||
matched <- 0 # match counter
|
||||
matched_schemas <- list() #names of matched schemas
|
||||
error_messages <- list()
|
||||
instance <- NULL
|
||||
|
||||
integer_result <- tryCatch({
|
||||
instance <- jsonlite::fromJSON(input, simplifyVector = FALSE)
|
||||
if (typeof(instance) != "integer") {
|
||||
stop(sprintf("Data type doesn't match. Expected: %s. Actual: %s.", "integer", typeof(instance)))
|
||||
}
|
||||
instance_type <- "integer"
|
||||
matched_schemas <- append(matched_schemas, "integer")
|
||||
matched <- matched + 1
|
||||
},
|
||||
error = function(err) err
|
||||
)
|
||||
|
||||
if (!is.null(integer_result["error"])) {
|
||||
error_messages <- append(error_messages, integer_result["message"])
|
||||
}
|
||||
|
||||
character_result <- tryCatch({
|
||||
instance <- jsonlite::fromJSON(input, simplifyVector = FALSE)
|
||||
if (typeof(instance) != "character") {
|
||||
stop(sprintf("Data type doesn't match. Expected: %s. Actual: %s.", "character", typeof(instance)))
|
||||
}
|
||||
instance_type <- "character"
|
||||
matched_schemas <- append(matched_schemas, "character")
|
||||
matched <- matched + 1
|
||||
},
|
||||
error = function(err) err
|
||||
)
|
||||
|
||||
if (!is.null(character_result["error"])) {
|
||||
error_messages <- append(error_messages, character_result["message"])
|
||||
}
|
||||
|
||||
if (matched == 1) {
|
||||
# successfully match exactly 1 schema specified in oneOf
|
||||
self$actual_instance <- instance
|
||||
self$actual_type <- instance_type
|
||||
} else if (matched > 1) {
|
||||
# more than 1 match
|
||||
stop("Multiple matches found when deserializing the payload into OneOfPrimitiveTypeTest with oneOf schemas character, integer.")
|
||||
} else {
|
||||
# no match
|
||||
stop(paste("No match found when deserializing the payload into OneOfPrimitiveTypeTest with oneOf schemas character, integer. Details: ",
|
||||
paste(error_messages, collapse = ", ")))
|
||||
}
|
||||
|
||||
self
|
||||
},
|
||||
#' Serialize OneOfPrimitiveTypeTest to JSON string.
|
||||
#'
|
||||
#' @description
|
||||
#' Serialize OneOfPrimitiveTypeTest to JSON string.
|
||||
#'
|
||||
#' @return JSON string representation of the OneOfPrimitiveTypeTest.
|
||||
#' @export
|
||||
toJSONString = function() {
|
||||
if (!is.null(self$actual_instance)) {
|
||||
as.character(jsonlite::minify(self$actual_instance$toJSONString()))
|
||||
} else {
|
||||
NULL
|
||||
}
|
||||
},
|
||||
#' Serialize OneOfPrimitiveTypeTest to JSON.
|
||||
#'
|
||||
#' @description
|
||||
#' Serialize OneOfPrimitiveTypeTest to JSON.
|
||||
#'
|
||||
#' @return JSON representation of the OneOfPrimitiveTypeTest.
|
||||
#' @export
|
||||
toJSON = function() {
|
||||
if (!is.null(self$actual_instance)) {
|
||||
self$actual_instance$toJSON()
|
||||
} else {
|
||||
NULL
|
||||
}
|
||||
},
|
||||
#' Validate the input JSON with respect to OneOfPrimitiveTypeTest.
|
||||
#'
|
||||
#' @description
|
||||
#' Validate the input JSON with respect to OneOfPrimitiveTypeTest and
|
||||
#' throw exception if invalid.
|
||||
#'
|
||||
#' @param input The input JSON.
|
||||
#' @export
|
||||
validateJSON = function(input) {
|
||||
# backup current values
|
||||
actual_instance_bak <- self$actual_instance
|
||||
actual_type_bak <- self$actual_type
|
||||
|
||||
# if it's not valid, an error will be thrown
|
||||
self$fromJSON(input)
|
||||
|
||||
# no error thrown, restore old values
|
||||
self$actual_instance <- actual_instance_bak
|
||||
self$actual_type <- actual_type_bak
|
||||
},
|
||||
#' Returns the string representation of the instance.
|
||||
#'
|
||||
#' @description
|
||||
#' Returns the string representation of the instance.
|
||||
#'
|
||||
#' @return The string representation of the instance.
|
||||
#' @export
|
||||
toString = function() {
|
||||
jsoncontent <- c(
|
||||
sprintf('"actual_instance": %s', if (is.null(self$actual_instance)) NULL else self$actual_instance$toJSONString()),
|
||||
sprintf('"actual_type": "%s"', self$actual_type),
|
||||
sprintf('"one_of": "%s"', paste(unlist(self$one_of), collapse = ", "))
|
||||
)
|
||||
jsoncontent <- paste(jsoncontent, collapse = ",")
|
||||
as.character(jsonlite::prettify(paste("{", jsoncontent, "}", sep = "")))
|
||||
}
|
||||
)
|
||||
)
|
@ -22,7 +22,7 @@ Pig <- R6::R6Class(
|
||||
actual_instance = NULL,
|
||||
#' @field actual_type the type of the object stored in this instance.
|
||||
actual_type = NULL,
|
||||
#' @field one_of a list of object types defined in the oneOf schema.
|
||||
#' @field one_of a list of types defined in the oneOf schema.
|
||||
one_of = list("BasquePig", "DanishPig"),
|
||||
#' Initialize a new Pig.
|
||||
#'
|
||||
|
@ -92,6 +92,7 @@ Class | Method | HTTP request | Description
|
||||
- [AllofTagApiResponse](docs/AllofTagApiResponse.md)
|
||||
- [Animal](docs/Animal.md)
|
||||
- [AnyOfPig](docs/AnyOfPig.md)
|
||||
- [AnyOfPrimitiveTypeTest](docs/AnyOfPrimitiveTypeTest.md)
|
||||
- [BasquePig](docs/BasquePig.md)
|
||||
- [Cat](docs/Cat.md)
|
||||
- [CatAllOf](docs/CatAllOf.md)
|
||||
@ -101,6 +102,7 @@ Class | Method | HTTP request | Description
|
||||
- [DogAllOf](docs/DogAllOf.md)
|
||||
- [ModelApiResponse](docs/ModelApiResponse.md)
|
||||
- [NestedOneOf](docs/NestedOneOf.md)
|
||||
- [OneOfPrimitiveTypeTest](docs/OneOfPrimitiveTypeTest.md)
|
||||
- [Order](docs/Order.md)
|
||||
- [Pet](docs/Pet.md)
|
||||
- [Pig](docs/Pig.md)
|
||||
|
@ -0,0 +1,8 @@
|
||||
# petstore::AnyOfPrimitiveTypeTest
|
||||
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
|
||||
|
@ -0,0 +1,8 @@
|
||||
# petstore::OneOfPrimitiveTypeTest
|
||||
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
|
||||
|
@ -3,27 +3,32 @@ install.packages("petstore_1.0.0.tar.gz",repos=NULL, type="source")
|
||||
library(petstore)
|
||||
library(jsonlite)
|
||||
|
||||
var_pet <- Pet$new("name_example", list("photoUrls_example"), 56, Category$new(56, "name_example"), list(Tag$new(56, "name_example")), "available") # Pet | Pet object that needs to be added to the store
|
||||
t <- OneOfPrimitiveTypeTest$new()
|
||||
|
||||
#Add a new pet to the store
|
||||
api_instance <- PetApi$new()
|
||||
# Configure OAuth2 access token for authorization: petstore_auth
|
||||
api_instance$api_client$access_token <- 'TODO_YOUR_ACCESS_TOKEN';
|
||||
result <- tryCatch(
|
||||
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||
# api_instance$AddPet(var_pet, data_file = "result.txt"),
|
||||
api_instance$add_pet(var_pet),
|
||||
ApiException = function(ex) ex
|
||||
)
|
||||
t$fromJSONString("[1,2,3]")
|
||||
|
||||
var_pet_id <- 56 # integer | ID of pet to return
|
||||
|
||||
pet_response <- api_instance$get_pet_by_id(var_pet_id, data_file = "get_pet_by_id.json")
|
||||
response <- read_json("get_pet_by_id.json")
|
||||
dput(response)
|
||||
|
||||
# test streaming
|
||||
api_instance$get_pet_by_id_streaming(var_pet_id, stream_callback = function(x) { print(x) })
|
||||
###var_pet <- Pet$new("name_example", list("photoUrls_example"), 56, Category$new(56, "name_example"), list(Tag$new(56, "name_example")), "available") # Pet | Pet object that needs to be added to the store
|
||||
###
|
||||
####Add a new pet to the store
|
||||
###api_instance <- PetApi$new()
|
||||
#### Configure OAuth2 access token for authorization: petstore_auth
|
||||
###api_instance$api_client$access_token <- 'TODO_YOUR_ACCESS_TOKEN';
|
||||
###result <- tryCatch(
|
||||
### # to save the result into a file, simply add the optional `data_file` parameter, e.g.
|
||||
### # api_instance$AddPet(var_pet, data_file = "result.txt"),
|
||||
### api_instance$add_pet(var_pet),
|
||||
### ApiException = function(ex) ex
|
||||
### )
|
||||
###
|
||||
###var_pet_id <- 56 # integer | ID of pet to return
|
||||
###
|
||||
###pet_response <- api_instance$get_pet_by_id(var_pet_id, data_file = "get_pet_by_id.json")
|
||||
###response <- read_json("get_pet_by_id.json")
|
||||
###dput(response)
|
||||
###
|
||||
#### test streaming
|
||||
###api_instance$get_pet_by_id_streaming(var_pet_id, stream_callback = function(x) { print(x) })
|
||||
|
||||
##Find pet by ID (streaming)
|
||||
#api_instance <- PetApi$new()
|
||||
|
@ -0,0 +1,4 @@
|
||||
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
||||
# Please update as you see appropriate
|
||||
|
||||
context("Test AnyOfPrimitiveTypeTest")
|
@ -0,0 +1,4 @@
|
||||
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
||||
# Please update as you see appropriate
|
||||
|
||||
context("Test OneOfPrimitiveTypeTest")
|
@ -260,6 +260,32 @@ test_that ("Tests validations", {
|
||||
|
||||
})
|
||||
|
||||
test_that("Tests oneOf primitive types", {
|
||||
test <- OneOfPrimitiveTypeTest$new()
|
||||
test$fromJSONString("\"123abc\"")
|
||||
expect_equal(test$actual_instance, '123abc')
|
||||
expect_equal(test$actual_type, 'character')
|
||||
|
||||
test$fromJSONString("456")
|
||||
expect_equal(test$actual_instance, 456)
|
||||
expect_equal(test$actual_type, 'integer')
|
||||
|
||||
expect_error(test$fromJSONString("[45,12]"), "No match found when deserializing the payload into OneOfPrimitiveTypeTest with oneOf schemas character, integer. Details: Data type doesn't match. Expected: integer. Actual: list., Data type doesn't match. Expected: character. Actual: list.") # should throw an error
|
||||
})
|
||||
|
||||
test_that("Tests anyOf primitive types", {
|
||||
test <- AnyOfPrimitiveTypeTest$new()
|
||||
test$fromJSONString("\"123abc\"")
|
||||
expect_equal(test$actual_instance, '123abc')
|
||||
expect_equal(test$actual_type, 'character')
|
||||
|
||||
test$fromJSONString("456")
|
||||
expect_equal(test$actual_instance, 456)
|
||||
expect_equal(test$actual_type, 'integer')
|
||||
|
||||
expect_error(test$fromJSONString("[45,12]"), "No match found when deserializing the payload into AnyOfPrimitiveTypeTest with oneOf schemas character, integer. Details: Data type doesn't match. Expected: integer. Actual: list., Data type doesn't match. Expected: character. Actual: list.") # should throw an error
|
||||
})
|
||||
|
||||
test_that("Tests oneOf", {
|
||||
basque_pig_json <-
|
||||
'{"className": "BasquePig", "color": "red"}'
|
||||
|
@ -8,6 +8,7 @@ NAMESPACE
|
||||
R/allof_tag_api_response.R
|
||||
R/animal.R
|
||||
R/any_of_pig.R
|
||||
R/any_of_primitive_type_test.R
|
||||
R/api_client.R
|
||||
R/api_exception.R
|
||||
R/api_response.R
|
||||
@ -21,6 +22,7 @@ R/dog_all_of.R
|
||||
R/fake_api.R
|
||||
R/model_api_response.R
|
||||
R/nested_one_of.R
|
||||
R/one_of_primitive_type_test.R
|
||||
R/order.R
|
||||
R/pet.R
|
||||
R/pet_api.R
|
||||
@ -35,6 +37,7 @@ README.md
|
||||
docs/AllofTagApiResponse.md
|
||||
docs/Animal.md
|
||||
docs/AnyOfPig.md
|
||||
docs/AnyOfPrimitiveTypeTest.md
|
||||
docs/BasquePig.md
|
||||
docs/Cat.md
|
||||
docs/CatAllOf.md
|
||||
@ -45,6 +48,7 @@ docs/DogAllOf.md
|
||||
docs/FakeApi.md
|
||||
docs/ModelApiResponse.md
|
||||
docs/NestedOneOf.md
|
||||
docs/OneOfPrimitiveTypeTest.md
|
||||
docs/Order.md
|
||||
docs/Pet.md
|
||||
docs/PetApi.md
|
||||
|
@ -17,6 +17,7 @@ export(ApiException)
|
||||
export(AllofTagApiResponse)
|
||||
export(Animal)
|
||||
export(AnyOfPig)
|
||||
export(AnyOfPrimitiveTypeTest)
|
||||
export(BasquePig)
|
||||
export(Cat)
|
||||
export(CatAllOf)
|
||||
@ -26,6 +27,7 @@ export(Dog)
|
||||
export(DogAllOf)
|
||||
export(ModelApiResponse)
|
||||
export(NestedOneOf)
|
||||
export(OneOfPrimitiveTypeTest)
|
||||
export(Order)
|
||||
export(Pet)
|
||||
export(Pig)
|
||||
|
186
samples/client/petstore/R/R/any_of_primitive_type_test.R
Normal file
186
samples/client/petstore/R/R/any_of_primitive_type_test.R
Normal file
@ -0,0 +1,186 @@
|
||||
#' OpenAPI Petstore
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title AnyOfPrimitiveTypeTest
|
||||
#'
|
||||
#' @description AnyOfPrimitiveTypeTest Class
|
||||
#'
|
||||
#' @format An \code{R6Class} generator object
|
||||
#'
|
||||
#' @importFrom R6 R6Class
|
||||
#' @importFrom jsonlite fromJSON toJSON
|
||||
#' @export
|
||||
AnyOfPrimitiveTypeTest <- R6::R6Class(
|
||||
"AnyOfPrimitiveTypeTest",
|
||||
public = list(
|
||||
#' @field actual_instance the object stored in this instance.
|
||||
actual_instance = NULL,
|
||||
#' @field actual_type the type of the object stored in this instance.
|
||||
actual_type = NULL,
|
||||
#' @field one_of a list of types defined in the oneOf schema.
|
||||
one_of = list("character", "integer"),
|
||||
#' Initialize a new AnyOfPrimitiveTypeTest.
|
||||
#'
|
||||
#' @description
|
||||
#' Initialize a new AnyOfPrimitiveTypeTest.
|
||||
#'
|
||||
#' @param instance an instance of the object defined in the oneOf schemas: "character", "integer"
|
||||
#' @export
|
||||
initialize = function(instance = NULL) {
|
||||
if (is.null(instance)) {
|
||||
# do nothing
|
||||
} else if (get(class(instance)[[1]], pos = -1)$classname == "character") {
|
||||
self$actual_instance <- instance
|
||||
self$actual_type <- "character"
|
||||
} else if (get(class(instance)[[1]], pos = -1)$classname == "integer") {
|
||||
self$actual_instance <- instance
|
||||
self$actual_type <- "integer"
|
||||
} else {
|
||||
stop(paste("Failed to initialize AnyOfPrimitiveTypeTest with oneOf schemas character, integer. Provided class name: ",
|
||||
get(class(instance)[[1]], pos = -1)$classname))
|
||||
}
|
||||
},
|
||||
#' Deserialize JSON string into an instance of AnyOfPrimitiveTypeTest.
|
||||
#'
|
||||
#' @description
|
||||
#' Deserialize JSON string into an instance of AnyOfPrimitiveTypeTest.
|
||||
#' An alias to the method `fromJSON` .
|
||||
#'
|
||||
#' @param input The input JSON.
|
||||
#' @return An instance of AnyOfPrimitiveTypeTest.
|
||||
#' @export
|
||||
fromJSONString = function(input) {
|
||||
self$fromJSON(input)
|
||||
},
|
||||
#' Deserialize JSON string into an instance of AnyOfPrimitiveTypeTest.
|
||||
#'
|
||||
#' @description
|
||||
#' Deserialize JSON string into an instance of AnyOfPrimitiveTypeTest.
|
||||
#'
|
||||
#' @param input The input JSON.
|
||||
#' @return An instance of AnyOfPrimitiveTypeTest.
|
||||
#' @export
|
||||
fromJSON = function(input) {
|
||||
matched <- 0 # match counter
|
||||
matched_schemas <- list() #names of matched schemas
|
||||
error_messages <- list()
|
||||
instance <- NULL
|
||||
|
||||
integer_result <- tryCatch({
|
||||
instance <- jsonlite::fromJSON(input, simplifyVector = FALSE)
|
||||
if (typeof(instance) != "integer") {
|
||||
stop(sprintf("Data type doesn't match. Expected: %s. Actual: %s.", "integer", typeof(instance)))
|
||||
}
|
||||
instance_type <- "integer"
|
||||
matched_schemas <- append(matched_schemas, "integer")
|
||||
matched <- matched + 1
|
||||
},
|
||||
error = function(err) err
|
||||
)
|
||||
|
||||
if (!is.null(integer_result["error"])) {
|
||||
error_messages <- append(error_messages, integer_result["message"])
|
||||
}
|
||||
|
||||
character_result <- tryCatch({
|
||||
instance <- jsonlite::fromJSON(input, simplifyVector = FALSE)
|
||||
if (typeof(instance) != "character") {
|
||||
stop(sprintf("Data type doesn't match. Expected: %s. Actual: %s.", "character", typeof(instance)))
|
||||
}
|
||||
instance_type <- "character"
|
||||
matched_schemas <- append(matched_schemas, "character")
|
||||
matched <- matched + 1
|
||||
},
|
||||
error = function(err) err
|
||||
)
|
||||
|
||||
if (!is.null(character_result["error"])) {
|
||||
error_messages <- append(error_messages, character_result["message"])
|
||||
}
|
||||
|
||||
if (matched == 1) {
|
||||
# successfully match exactly 1 schema specified in oneOf
|
||||
self$actual_instance <- instance
|
||||
self$actual_type <- instance_type
|
||||
} else if (matched > 1) {
|
||||
# more than 1 match
|
||||
stop("Multiple matches found when deserializing the payload into AnyOfPrimitiveTypeTest with oneOf schemas character, integer.")
|
||||
} else {
|
||||
# no match
|
||||
stop(paste("No match found when deserializing the payload into AnyOfPrimitiveTypeTest with oneOf schemas character, integer. Details: ",
|
||||
paste(error_messages, collapse = ", ")))
|
||||
}
|
||||
|
||||
self
|
||||
},
|
||||
#' Serialize AnyOfPrimitiveTypeTest to JSON string.
|
||||
#'
|
||||
#' @description
|
||||
#' Serialize AnyOfPrimitiveTypeTest to JSON string.
|
||||
#'
|
||||
#' @return JSON string representation of the AnyOfPrimitiveTypeTest.
|
||||
#' @export
|
||||
toJSONString = function() {
|
||||
if (!is.null(self$actual_instance)) {
|
||||
as.character(jsonlite::minify(self$actual_instance$toJSONString()))
|
||||
} else {
|
||||
NULL
|
||||
}
|
||||
},
|
||||
#' Serialize AnyOfPrimitiveTypeTest to JSON.
|
||||
#'
|
||||
#' @description
|
||||
#' Serialize AnyOfPrimitiveTypeTest to JSON.
|
||||
#'
|
||||
#' @return JSON representation of the AnyOfPrimitiveTypeTest.
|
||||
#' @export
|
||||
toJSON = function() {
|
||||
if (!is.null(self$actual_instance)) {
|
||||
self$actual_instance$toJSON()
|
||||
} else {
|
||||
NULL
|
||||
}
|
||||
},
|
||||
#' Validate the input JSON with respect to AnyOfPrimitiveTypeTest.
|
||||
#'
|
||||
#' @description
|
||||
#' Validate the input JSON with respect to AnyOfPrimitiveTypeTest and
|
||||
#' throw exception if invalid.
|
||||
#'
|
||||
#' @param input The input JSON.
|
||||
#' @export
|
||||
validateJSON = function(input) {
|
||||
# backup current values
|
||||
actual_instance_bak <- self$actual_instance
|
||||
actual_type_bak <- self$actual_type
|
||||
|
||||
# if it's not valid, an error will be thrown
|
||||
self$fromJSON(input)
|
||||
|
||||
# no error thrown, restore old values
|
||||
self$actual_instance <- actual_instance_bak
|
||||
self$actual_type <- actual_type_bak
|
||||
},
|
||||
#' Returns the string representation of the instance.
|
||||
#'
|
||||
#' @description
|
||||
#' Returns the string representation of the instance.
|
||||
#'
|
||||
#' @return The string representation of the instance.
|
||||
#' @export
|
||||
toString = function() {
|
||||
jsoncontent <- c(
|
||||
sprintf('"actual_instance": %s', if (is.null(self$actual_instance)) NULL else self$actual_instance$toJSONString()),
|
||||
sprintf('"actual_type": "%s"', self$actual_type),
|
||||
sprintf('"one_of": "%s"', paste(unlist(self$one_of), collapse = ", "))
|
||||
)
|
||||
jsoncontent <- paste(jsoncontent, collapse = ",")
|
||||
as.character(jsonlite::prettify(paste("{", jsoncontent, "}", sep = "")))
|
||||
}
|
||||
)
|
||||
)
|
186
samples/client/petstore/R/R/one_of_primitive_type_test.R
Normal file
186
samples/client/petstore/R/R/one_of_primitive_type_test.R
Normal file
@ -0,0 +1,186 @@
|
||||
#' OpenAPI Petstore
|
||||
#'
|
||||
#' This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#'
|
||||
#' The version of the OpenAPI document: 1.0.0
|
||||
#' Generated by: https://openapi-generator.tech
|
||||
#'
|
||||
#' @docType class
|
||||
#' @title OneOfPrimitiveTypeTest
|
||||
#'
|
||||
#' @description OneOfPrimitiveTypeTest Class
|
||||
#'
|
||||
#' @format An \code{R6Class} generator object
|
||||
#'
|
||||
#' @importFrom R6 R6Class
|
||||
#' @importFrom jsonlite fromJSON toJSON
|
||||
#' @export
|
||||
OneOfPrimitiveTypeTest <- R6::R6Class(
|
||||
"OneOfPrimitiveTypeTest",
|
||||
public = list(
|
||||
#' @field actual_instance the object stored in this instance.
|
||||
actual_instance = NULL,
|
||||
#' @field actual_type the type of the object stored in this instance.
|
||||
actual_type = NULL,
|
||||
#' @field one_of a list of types defined in the oneOf schema.
|
||||
one_of = list("character", "integer"),
|
||||
#' Initialize a new OneOfPrimitiveTypeTest.
|
||||
#'
|
||||
#' @description
|
||||
#' Initialize a new OneOfPrimitiveTypeTest.
|
||||
#'
|
||||
#' @param instance an instance of the object defined in the oneOf schemas: "character", "integer"
|
||||
#' @export
|
||||
initialize = function(instance = NULL) {
|
||||
if (is.null(instance)) {
|
||||
# do nothing
|
||||
} else if (get(class(instance)[[1]], pos = -1)$classname == "character") {
|
||||
self$actual_instance <- instance
|
||||
self$actual_type <- "character"
|
||||
} else if (get(class(instance)[[1]], pos = -1)$classname == "integer") {
|
||||
self$actual_instance <- instance
|
||||
self$actual_type <- "integer"
|
||||
} else {
|
||||
stop(paste("Failed to initialize OneOfPrimitiveTypeTest with oneOf schemas character, integer. Provided class name: ",
|
||||
get(class(instance)[[1]], pos = -1)$classname))
|
||||
}
|
||||
},
|
||||
#' Deserialize JSON string into an instance of OneOfPrimitiveTypeTest.
|
||||
#'
|
||||
#' @description
|
||||
#' Deserialize JSON string into an instance of OneOfPrimitiveTypeTest.
|
||||
#' An alias to the method `fromJSON` .
|
||||
#'
|
||||
#' @param input The input JSON.
|
||||
#' @return An instance of OneOfPrimitiveTypeTest.
|
||||
#' @export
|
||||
fromJSONString = function(input) {
|
||||
self$fromJSON(input)
|
||||
},
|
||||
#' Deserialize JSON string into an instance of OneOfPrimitiveTypeTest.
|
||||
#'
|
||||
#' @description
|
||||
#' Deserialize JSON string into an instance of OneOfPrimitiveTypeTest.
|
||||
#'
|
||||
#' @param input The input JSON.
|
||||
#' @return An instance of OneOfPrimitiveTypeTest.
|
||||
#' @export
|
||||
fromJSON = function(input) {
|
||||
matched <- 0 # match counter
|
||||
matched_schemas <- list() #names of matched schemas
|
||||
error_messages <- list()
|
||||
instance <- NULL
|
||||
|
||||
integer_result <- tryCatch({
|
||||
instance <- jsonlite::fromJSON(input, simplifyVector = FALSE)
|
||||
if (typeof(instance) != "integer") {
|
||||
stop(sprintf("Data type doesn't match. Expected: %s. Actual: %s.", "integer", typeof(instance)))
|
||||
}
|
||||
instance_type <- "integer"
|
||||
matched_schemas <- append(matched_schemas, "integer")
|
||||
matched <- matched + 1
|
||||
},
|
||||
error = function(err) err
|
||||
)
|
||||
|
||||
if (!is.null(integer_result["error"])) {
|
||||
error_messages <- append(error_messages, integer_result["message"])
|
||||
}
|
||||
|
||||
character_result <- tryCatch({
|
||||
instance <- jsonlite::fromJSON(input, simplifyVector = FALSE)
|
||||
if (typeof(instance) != "character") {
|
||||
stop(sprintf("Data type doesn't match. Expected: %s. Actual: %s.", "character", typeof(instance)))
|
||||
}
|
||||
instance_type <- "character"
|
||||
matched_schemas <- append(matched_schemas, "character")
|
||||
matched <- matched + 1
|
||||
},
|
||||
error = function(err) err
|
||||
)
|
||||
|
||||
if (!is.null(character_result["error"])) {
|
||||
error_messages <- append(error_messages, character_result["message"])
|
||||
}
|
||||
|
||||
if (matched == 1) {
|
||||
# successfully match exactly 1 schema specified in oneOf
|
||||
self$actual_instance <- instance
|
||||
self$actual_type <- instance_type
|
||||
} else if (matched > 1) {
|
||||
# more than 1 match
|
||||
stop("Multiple matches found when deserializing the payload into OneOfPrimitiveTypeTest with oneOf schemas character, integer.")
|
||||
} else {
|
||||
# no match
|
||||
stop(paste("No match found when deserializing the payload into OneOfPrimitiveTypeTest with oneOf schemas character, integer. Details: ",
|
||||
paste(error_messages, collapse = ", ")))
|
||||
}
|
||||
|
||||
self
|
||||
},
|
||||
#' Serialize OneOfPrimitiveTypeTest to JSON string.
|
||||
#'
|
||||
#' @description
|
||||
#' Serialize OneOfPrimitiveTypeTest to JSON string.
|
||||
#'
|
||||
#' @return JSON string representation of the OneOfPrimitiveTypeTest.
|
||||
#' @export
|
||||
toJSONString = function() {
|
||||
if (!is.null(self$actual_instance)) {
|
||||
as.character(jsonlite::minify(self$actual_instance$toJSONString()))
|
||||
} else {
|
||||
NULL
|
||||
}
|
||||
},
|
||||
#' Serialize OneOfPrimitiveTypeTest to JSON.
|
||||
#'
|
||||
#' @description
|
||||
#' Serialize OneOfPrimitiveTypeTest to JSON.
|
||||
#'
|
||||
#' @return JSON representation of the OneOfPrimitiveTypeTest.
|
||||
#' @export
|
||||
toJSON = function() {
|
||||
if (!is.null(self$actual_instance)) {
|
||||
self$actual_instance$toJSON()
|
||||
} else {
|
||||
NULL
|
||||
}
|
||||
},
|
||||
#' Validate the input JSON with respect to OneOfPrimitiveTypeTest.
|
||||
#'
|
||||
#' @description
|
||||
#' Validate the input JSON with respect to OneOfPrimitiveTypeTest and
|
||||
#' throw exception if invalid.
|
||||
#'
|
||||
#' @param input The input JSON.
|
||||
#' @export
|
||||
validateJSON = function(input) {
|
||||
# backup current values
|
||||
actual_instance_bak <- self$actual_instance
|
||||
actual_type_bak <- self$actual_type
|
||||
|
||||
# if it's not valid, an error will be thrown
|
||||
self$fromJSON(input)
|
||||
|
||||
# no error thrown, restore old values
|
||||
self$actual_instance <- actual_instance_bak
|
||||
self$actual_type <- actual_type_bak
|
||||
},
|
||||
#' Returns the string representation of the instance.
|
||||
#'
|
||||
#' @description
|
||||
#' Returns the string representation of the instance.
|
||||
#'
|
||||
#' @return The string representation of the instance.
|
||||
#' @export
|
||||
toString = function() {
|
||||
jsoncontent <- c(
|
||||
sprintf('"actual_instance": %s', if (is.null(self$actual_instance)) NULL else self$actual_instance$toJSONString()),
|
||||
sprintf('"actual_type": "%s"', self$actual_type),
|
||||
sprintf('"one_of": "%s"', paste(unlist(self$one_of), collapse = ", "))
|
||||
)
|
||||
jsoncontent <- paste(jsoncontent, collapse = ",")
|
||||
as.character(jsonlite::prettify(paste("{", jsoncontent, "}", sep = "")))
|
||||
}
|
||||
)
|
||||
)
|
@ -22,7 +22,7 @@ Pig <- R6::R6Class(
|
||||
actual_instance = NULL,
|
||||
#' @field actual_type the type of the object stored in this instance.
|
||||
actual_type = NULL,
|
||||
#' @field one_of a list of object types defined in the oneOf schema.
|
||||
#' @field one_of a list of types defined in the oneOf schema.
|
||||
one_of = list("BasquePig", "DanishPig"),
|
||||
#' Initialize a new Pig.
|
||||
#'
|
||||
|
@ -92,6 +92,7 @@ Class | Method | HTTP request | Description
|
||||
- [AllofTagApiResponse](docs/AllofTagApiResponse.md)
|
||||
- [Animal](docs/Animal.md)
|
||||
- [AnyOfPig](docs/AnyOfPig.md)
|
||||
- [AnyOfPrimitiveTypeTest](docs/AnyOfPrimitiveTypeTest.md)
|
||||
- [BasquePig](docs/BasquePig.md)
|
||||
- [Cat](docs/Cat.md)
|
||||
- [CatAllOf](docs/CatAllOf.md)
|
||||
@ -101,6 +102,7 @@ Class | Method | HTTP request | Description
|
||||
- [DogAllOf](docs/DogAllOf.md)
|
||||
- [ModelApiResponse](docs/ModelApiResponse.md)
|
||||
- [NestedOneOf](docs/NestedOneOf.md)
|
||||
- [OneOfPrimitiveTypeTest](docs/OneOfPrimitiveTypeTest.md)
|
||||
- [Order](docs/Order.md)
|
||||
- [Pet](docs/Pet.md)
|
||||
- [Pig](docs/Pig.md)
|
||||
|
8
samples/client/petstore/R/docs/AnyOfPrimitiveTypeTest.md
Normal file
8
samples/client/petstore/R/docs/AnyOfPrimitiveTypeTest.md
Normal file
@ -0,0 +1,8 @@
|
||||
# petstore::AnyOfPrimitiveTypeTest
|
||||
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
|
||||
|
8
samples/client/petstore/R/docs/OneOfPrimitiveTypeTest.md
Normal file
8
samples/client/petstore/R/docs/OneOfPrimitiveTypeTest.md
Normal file
@ -0,0 +1,8 @@
|
||||
# petstore::OneOfPrimitiveTypeTest
|
||||
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
|
||||
|
@ -0,0 +1,4 @@
|
||||
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
||||
# Please update as you see appropriate
|
||||
|
||||
context("Test AnyOfPrimitiveTypeTest")
|
@ -0,0 +1,4 @@
|
||||
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
||||
# Please update as you see appropriate
|
||||
|
||||
context("Test OneOfPrimitiveTypeTest")
|
Loading…
x
Reference in New Issue
Block a user