fix array of enum class in JS (#1484)

This commit is contained in:
William Cheng
2018-11-24 17:04:59 +08:00
committed by GitHub
parent f8ada391c4
commit bf2932d41c
6 changed files with 12 additions and 12 deletions

View File

@@ -478,8 +478,8 @@ class ApiClient {
if (type === Object) {
// generic object, return directly
return data;
} else if (typeof type === 'function') {
// for model type like: User
} else if (typeof type.constructFromObject === 'function') {
// for model type like User and enum class
return type.constructFromObject(data);
} else if (Array.isArray(type)) {
// for array type like: ['String']