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:
Ramanth Addala 2019-12-04 07:23:55 +05:30 committed by William Cheng
parent 01e84d79a0
commit e0d6f7df1f
2 changed files with 12 additions and 8 deletions

View File

@ -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)) {

View File

@ -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)) {