Add support for Boolean in R client generator (#9469)

* Add support for Boolean in R client generator

* Regenerated with updated R generator
This commit is contained in:
Steffen Neumann 2021-05-15 17:22:48 +02:00 committed by GitHub
parent 2342396465
commit 97ddcc2257
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 12 additions and 12 deletions

View File

@ -47,6 +47,9 @@
{{#isString}}
stopifnot(is.character(`{{baseName}}`), length(`{{baseName}}`) == 1)
{{/isString}}
{{#isBoolean}}
stopifnot(is.logical(`{{baseName}}`), length(`{{baseName}}`) == 1)
{{/isBoolean}}
{{#isDate}}
stopifnot(is.character(`{{baseName}}`), length(`{{baseName}}`) == 1)
{{/isDate}}
@ -88,6 +91,9 @@
{{#isString}}
stopifnot(is.character(`{{baseName}}`), length(`{{baseName}}`) == 1)
{{/isString}}
{{#isBoolean}}
stopifnot(is.logical(`{{baseName}}`), length(`{{baseName}}`) == 1)
{{/isBoolean}}
{{#isDate}}
stopifnot(is.character(`{{baseName}}`), length(`{{baseName}}`) == 1)
{{/isDate}}
@ -185,7 +191,7 @@
{{/isArray}}
{{#isMap}}
{{#isPrimitiveType}}
{{#isNumeric}}%d{{/isNumeric}}{{^isNumeric}}"%s"{{/isNumeric}}
{{#isNumeric}}%d{{/isNumeric}}{{^isNumeric}}{{^isBoolean}}"{{/isBoolean}}%s{{^isBoolean}}"{{/isBoolean}}{{/isNumeric}}
{{/isPrimitiveType}}
{{^isPrimitiveType}}%s
{{/isPrimitiveType}}
@ -193,7 +199,7 @@
{{/isContainer}}
{{^isContainer}}
{{#isPrimitiveType}}
{{#isNumeric}}%d{{/isNumeric}}{{^isNumeric}}"%s"{{/isNumeric}}
{{#isNumeric}}%d{{/isNumeric}}{{^isNumeric}}{{^isBoolean}}"{{/isBoolean}}%s{{^isBoolean}}"{{/isBoolean}}{{/isNumeric}}
{{/isPrimitiveType}}
{{^isPrimitiveType}}%s
{{/isPrimitiveType}}
@ -218,7 +224,7 @@
{{/isContainer}}
{{^isContainer}}
{{#isPrimitiveType}}
self$`{{baseName}}`
{{#isBoolean}}tolower({{/isBoolean}}self$`{{baseName}}`{{#isBoolean}}){{/isBoolean}}
{{/isPrimitiveType}}
{{^isPrimitiveType}}
jsonlite::toJSON(self$`{{baseName}}`$toJSON(), auto_unbox=TRUE, digits = NA)
@ -253,4 +259,3 @@
{{/isEnum}}
{{/model}}
{{/models}}

View File

@ -89,4 +89,3 @@ Category <- R6::R6Class(
}
)
)

View File

@ -111,4 +111,3 @@ ModelApiResponse <- R6::R6Class(
}
)
)

View File

@ -62,6 +62,7 @@ Order <- R6::R6Class(
self$`status` <- `status`
}
if (!is.null(`complete`)) {
stopifnot(is.logical(`complete`), length(`complete`) == 1)
self$`complete` <- `complete`
}
},
@ -156,9 +157,9 @@ Order <- R6::R6Class(
if (!is.null(self$`complete`)) {
sprintf(
'"complete":
"%s"
%s
',
self$`complete`
tolower(self$`complete`)
)}
)
jsoncontent <- paste(jsoncontent, collapse = ",")
@ -176,4 +177,3 @@ Order <- R6::R6Class(
}
)
)

View File

@ -181,4 +181,3 @@ Pet <- R6::R6Class(
}
)
)

View File

@ -89,4 +89,3 @@ Tag <- R6::R6Class(
}
)
)

View File

@ -221,4 +221,3 @@ User <- R6::R6Class(
}
)
)