File tree Expand file tree Collapse file tree 6 files changed +12
-12
lines changed
modules/openapi-generator/src/main/resources/Javascript
javascript-promise-es6/src Expand file tree Collapse file tree 6 files changed +12
-12
lines changed Original file line number Diff line number Diff line change 546
546
if (type === Object) {
547
547
// generic object, return directly
548
548
return data;
549
- } else if (typeof type === 'function') {
550
- // for model type like: User
549
+ } else if (typeof type.constructFromObject === 'function') {
550
+ // for model type like User or enum class
551
551
return type.constructFromObject(data);
552
552
} else if (Array.isArray(type)) {
553
553
// for array type like: [' String' ]
Original file line number Diff line number Diff line change @@ -502,8 +502,8 @@ class ApiClient {
502
502
if (type === Object) {
503
503
// generic object, return directly
504
504
return data;
505
- } else if (typeof type === 'function') {
506
- // for model type like: User
505
+ } else if (typeof type.constructFromObject === 'function') {
506
+ // for model type like User and enum class
507
507
return type.constructFromObject(data);
508
508
} else if (Array.isArray(type)) {
509
509
// for array type like: [' String' ]
Original file line number Diff line number Diff line change @@ -486,8 +486,8 @@ class ApiClient {
486
486
if ( type === Object ) {
487
487
// generic object, return directly
488
488
return data ;
489
- } else if ( typeof type === 'function' ) {
490
- // for model type like: User
489
+ } else if ( typeof type . constructFromObject === 'function' ) {
490
+ // for model type like User and enum class
491
491
return type . constructFromObject ( data ) ;
492
492
} else if ( Array . isArray ( type ) ) {
493
493
// for array type like: ['String']
Original file line number Diff line number Diff line change @@ -478,8 +478,8 @@ class ApiClient {
478
478
if ( type === Object ) {
479
479
// generic object, return directly
480
480
return data ;
481
- } else if ( typeof type === 'function' ) {
482
- // for model type like: User
481
+ } else if ( typeof type . constructFromObject === 'function' ) {
482
+ // for model type like User and enum class
483
483
return type . constructFromObject ( data ) ;
484
484
} else if ( Array . isArray ( type ) ) {
485
485
// for array type like: ['String']
Original file line number Diff line number Diff line change 525
525
if ( type === Object ) {
526
526
// generic object, return directly
527
527
return data ;
528
- } else if ( typeof type === 'function' ) {
529
- // for model type like: User
528
+ } else if ( typeof type . constructFromObject === 'function' ) {
529
+ // for model type like User or enum class
530
530
return type . constructFromObject ( data ) ;
531
531
} else if ( Array . isArray ( type ) ) {
532
532
// for array type like: ['String']
Original file line number Diff line number Diff line change 536
536
if ( type === Object ) {
537
537
// generic object, return directly
538
538
return data ;
539
- } else if ( typeof type === 'function' ) {
540
- // for model type like: User
539
+ } else if ( typeof type . constructFromObject === 'function' ) {
540
+ // for model type like User or enum class
541
541
return type . constructFromObject ( data ) ;
542
542
} else if ( Array . isArray ( type ) ) {
543
543
// for array type like: ['String']
You can’t perform that action at this time.
0 commit comments