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}}
|
{{#isString}}
|
||||||
stopifnot(is.character(`{{baseName}}`), length(`{{baseName}}`) == 1)
|
stopifnot(is.character(`{{baseName}}`), length(`{{baseName}}`) == 1)
|
||||||
{{/isString}}
|
{{/isString}}
|
||||||
|
{{#isBoolean}}
|
||||||
|
stopifnot(is.logical(`{{baseName}}`), length(`{{baseName}}`) == 1)
|
||||||
|
{{/isBoolean}}
|
||||||
{{#isDate}}
|
{{#isDate}}
|
||||||
stopifnot(is.character(`{{baseName}}`), length(`{{baseName}}`) == 1)
|
stopifnot(is.character(`{{baseName}}`), length(`{{baseName}}`) == 1)
|
||||||
{{/isDate}}
|
{{/isDate}}
|
||||||
@ -88,6 +91,9 @@
|
|||||||
{{#isString}}
|
{{#isString}}
|
||||||
stopifnot(is.character(`{{baseName}}`), length(`{{baseName}}`) == 1)
|
stopifnot(is.character(`{{baseName}}`), length(`{{baseName}}`) == 1)
|
||||||
{{/isString}}
|
{{/isString}}
|
||||||
|
{{#isBoolean}}
|
||||||
|
stopifnot(is.logical(`{{baseName}}`), length(`{{baseName}}`) == 1)
|
||||||
|
{{/isBoolean}}
|
||||||
{{#isDate}}
|
{{#isDate}}
|
||||||
stopifnot(is.character(`{{baseName}}`), length(`{{baseName}}`) == 1)
|
stopifnot(is.character(`{{baseName}}`), length(`{{baseName}}`) == 1)
|
||||||
{{/isDate}}
|
{{/isDate}}
|
||||||
@ -185,7 +191,7 @@
|
|||||||
{{/isArray}}
|
{{/isArray}}
|
||||||
{{#isMap}}
|
{{#isMap}}
|
||||||
{{#isPrimitiveType}}
|
{{#isPrimitiveType}}
|
||||||
{{#isNumeric}}%d{{/isNumeric}}{{^isNumeric}}"%s"{{/isNumeric}}
|
{{#isNumeric}}%d{{/isNumeric}}{{^isNumeric}}{{^isBoolean}}"{{/isBoolean}}%s{{^isBoolean}}"{{/isBoolean}}{{/isNumeric}}
|
||||||
{{/isPrimitiveType}}
|
{{/isPrimitiveType}}
|
||||||
{{^isPrimitiveType}}%s
|
{{^isPrimitiveType}}%s
|
||||||
{{/isPrimitiveType}}
|
{{/isPrimitiveType}}
|
||||||
@ -193,7 +199,7 @@
|
|||||||
{{/isContainer}}
|
{{/isContainer}}
|
||||||
{{^isContainer}}
|
{{^isContainer}}
|
||||||
{{#isPrimitiveType}}
|
{{#isPrimitiveType}}
|
||||||
{{#isNumeric}}%d{{/isNumeric}}{{^isNumeric}}"%s"{{/isNumeric}}
|
{{#isNumeric}}%d{{/isNumeric}}{{^isNumeric}}{{^isBoolean}}"{{/isBoolean}}%s{{^isBoolean}}"{{/isBoolean}}{{/isNumeric}}
|
||||||
{{/isPrimitiveType}}
|
{{/isPrimitiveType}}
|
||||||
{{^isPrimitiveType}}%s
|
{{^isPrimitiveType}}%s
|
||||||
{{/isPrimitiveType}}
|
{{/isPrimitiveType}}
|
||||||
@ -218,7 +224,7 @@
|
|||||||
{{/isContainer}}
|
{{/isContainer}}
|
||||||
{{^isContainer}}
|
{{^isContainer}}
|
||||||
{{#isPrimitiveType}}
|
{{#isPrimitiveType}}
|
||||||
self$`{{baseName}}`
|
{{#isBoolean}}tolower({{/isBoolean}}self$`{{baseName}}`{{#isBoolean}}){{/isBoolean}}
|
||||||
{{/isPrimitiveType}}
|
{{/isPrimitiveType}}
|
||||||
{{^isPrimitiveType}}
|
{{^isPrimitiveType}}
|
||||||
jsonlite::toJSON(self$`{{baseName}}`$toJSON(), auto_unbox=TRUE, digits = NA)
|
jsonlite::toJSON(self$`{{baseName}}`$toJSON(), auto_unbox=TRUE, digits = NA)
|
||||||
@ -253,4 +259,3 @@
|
|||||||
{{/isEnum}}
|
{{/isEnum}}
|
||||||
{{/model}}
|
{{/model}}
|
||||||
{{/models}}
|
{{/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`
|
self$`status` <- `status`
|
||||||
}
|
}
|
||||||
if (!is.null(`complete`)) {
|
if (!is.null(`complete`)) {
|
||||||
|
stopifnot(is.logical(`complete`), length(`complete`) == 1)
|
||||||
self$`complete` <- `complete`
|
self$`complete` <- `complete`
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -156,9 +157,9 @@ Order <- R6::R6Class(
|
|||||||
if (!is.null(self$`complete`)) {
|
if (!is.null(self$`complete`)) {
|
||||||
sprintf(
|
sprintf(
|
||||||
'"complete":
|
'"complete":
|
||||||
"%s"
|
%s
|
||||||
',
|
',
|
||||||
self$`complete`
|
tolower(self$`complete`)
|
||||||
)}
|
)}
|
||||||
)
|
)
|
||||||
jsoncontent <- paste(jsoncontent, collapse = ",")
|
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