forked from loafle/openapi-generator-original
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:
parent
2342396465
commit
97ddcc2257
@ -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}}
|
||||
|
||||
|
@ -89,4 +89,3 @@ Category <- R6::R6Class(
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
|
@ -111,4 +111,3 @@ ModelApiResponse <- R6::R6Class(
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
|
@ -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(
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
|
@ -181,4 +181,3 @@ Pet <- R6::R6Class(
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
|
@ -89,4 +89,3 @@ Tag <- R6::R6Class(
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
|
@ -221,4 +221,3 @@ User <- R6::R6Class(
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user