forked from loafle/openapi-generator-original
fix array of enum class in JS (#1484)
This commit is contained in:
@@ -546,8 +546,8 @@
|
|||||||
if (type === Object) {
|
if (type === Object) {
|
||||||
// generic object, return directly
|
// generic object, return directly
|
||||||
return data;
|
return data;
|
||||||
} else if (typeof type === 'function') {
|
} else if (typeof type.constructFromObject === 'function') {
|
||||||
// for model type like: User
|
// for model type like User or enum class
|
||||||
return type.constructFromObject(data);
|
return type.constructFromObject(data);
|
||||||
} else if (Array.isArray(type)) {
|
} else if (Array.isArray(type)) {
|
||||||
// for array type like: ['String']
|
// for array type like: ['String']
|
||||||
|
|||||||
@@ -502,8 +502,8 @@ class ApiClient {
|
|||||||
if (type === Object) {
|
if (type === Object) {
|
||||||
// generic object, return directly
|
// generic object, return directly
|
||||||
return data;
|
return data;
|
||||||
} else if (typeof type === 'function') {
|
} else if (typeof type.constructFromObject === 'function') {
|
||||||
// for model type like: User
|
// for model type like User and enum class
|
||||||
return type.constructFromObject(data);
|
return type.constructFromObject(data);
|
||||||
} else if (Array.isArray(type)) {
|
} else if (Array.isArray(type)) {
|
||||||
// for array type like: ['String']
|
// for array type like: ['String']
|
||||||
|
|||||||
@@ -486,8 +486,8 @@ class ApiClient {
|
|||||||
if (type === Object) {
|
if (type === Object) {
|
||||||
// generic object, return directly
|
// generic object, return directly
|
||||||
return data;
|
return data;
|
||||||
} else if (typeof type === 'function') {
|
} else if (typeof type.constructFromObject === 'function') {
|
||||||
// for model type like: User
|
// for model type like User and enum class
|
||||||
return type.constructFromObject(data);
|
return type.constructFromObject(data);
|
||||||
} else if (Array.isArray(type)) {
|
} else if (Array.isArray(type)) {
|
||||||
// for array type like: ['String']
|
// for array type like: ['String']
|
||||||
|
|||||||
@@ -478,8 +478,8 @@ class ApiClient {
|
|||||||
if (type === Object) {
|
if (type === Object) {
|
||||||
// generic object, return directly
|
// generic object, return directly
|
||||||
return data;
|
return data;
|
||||||
} else if (typeof type === 'function') {
|
} else if (typeof type.constructFromObject === 'function') {
|
||||||
// for model type like: User
|
// for model type like User and enum class
|
||||||
return type.constructFromObject(data);
|
return type.constructFromObject(data);
|
||||||
} else if (Array.isArray(type)) {
|
} else if (Array.isArray(type)) {
|
||||||
// for array type like: ['String']
|
// for array type like: ['String']
|
||||||
|
|||||||
@@ -525,8 +525,8 @@
|
|||||||
if (type === Object) {
|
if (type === Object) {
|
||||||
// generic object, return directly
|
// generic object, return directly
|
||||||
return data;
|
return data;
|
||||||
} else if (typeof type === 'function') {
|
} else if (typeof type.constructFromObject === 'function') {
|
||||||
// for model type like: User
|
// for model type like User or enum class
|
||||||
return type.constructFromObject(data);
|
return type.constructFromObject(data);
|
||||||
} else if (Array.isArray(type)) {
|
} else if (Array.isArray(type)) {
|
||||||
// for array type like: ['String']
|
// for array type like: ['String']
|
||||||
|
|||||||
@@ -536,8 +536,8 @@
|
|||||||
if (type === Object) {
|
if (type === Object) {
|
||||||
// generic object, return directly
|
// generic object, return directly
|
||||||
return data;
|
return data;
|
||||||
} else if (typeof type === 'function') {
|
} else if (typeof type.constructFromObject === 'function') {
|
||||||
// for model type like: User
|
// for model type like User or enum class
|
||||||
return type.constructFromObject(data);
|
return type.constructFromObject(data);
|
||||||
} else if (Array.isArray(type)) {
|
} else if (Array.isArray(type)) {
|
||||||
// for array type like: ['String']
|
// for array type like: ['String']
|
||||||
|
|||||||
Reference in New Issue
Block a user