forked from loafle/openapi-generator-original
fix(r): fixing serializatin bug in empty json array (#4667)
* fix(r): fixing serializatin bug in empty json array * fix(r): fixing serializatin bug in empty json array
This commit is contained in:
parent
01e84d79a0
commit
e0d6f7df1f
@ -151,6 +151,7 @@ ApiClient <- R6::R6Class(
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if(!is.null(nrow(obj))){
|
||||
returnObj <- vector("list", length = nrow(obj))
|
||||
if (nrow(obj) > 0) {
|
||||
for (row in 1:nrow(obj)) {
|
||||
@ -159,6 +160,7 @@ ApiClient <- R6::R6Class(
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# To handle model objects which are not array or map containers. Ex:"Pet"
|
||||
else if (exists(returnType, pkgEnv) && !(c(returnType) %in% primitiveTypes)) {
|
||||
|
@ -149,6 +149,7 @@ ApiClient <- R6::R6Class(
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if(!is.null(nrow(obj))){
|
||||
returnObj <- vector("list", length = nrow(obj))
|
||||
if (nrow(obj) > 0) {
|
||||
for (row in 1:nrow(obj)) {
|
||||
@ -157,6 +158,7 @@ ApiClient <- R6::R6Class(
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# To handle model objects which are not array or map containers. Ex:"Pet"
|
||||
else if (exists(returnType, pkgEnv) && !(c(returnType) %in% primitiveTypes)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user