@@ -56,22 +56,22 @@ class ObjectSerializer
56
56
$values = [];
57
57
if ($data instanceof ModelInterface) {
58
58
$formats = $data ::modelFormats();
59
- foreach ($data ::openAPITypes () as $property => $openAPIType ) {
59
+ foreach ($data ::modelTypes () as $property => $modelTypes ) {
60
60
$getter = $data ::getters()[$property ];
61
61
$value = $data -> $getter ();
62
- if ($value !== null && ! in_array(modelTypes, [{{{primitives} }}], true)) {
63
- $callable = [modelTypes, ' getAllowableEnumValues' ];
62
+ if ($value !== null && ! in_array($ modelTypes , [{{{primitives} }}], true)) {
63
+ $callable = [$ modelTypes , ' getAllowableEnumValues' ];
64
64
if (is_callable($callable )) {
65
65
/** array $callable */
66
66
$allowedEnumTypes = $callable ();
67
67
if (! in_array($value , $allowedEnumTypes , true )) {
68
68
$imploded = implode(" ', '" , $allowedEnumTypes );
69
- throw new \InvalidArgumentException(" Invalid value for enum 'openAPITypes ', must be one of: '$imploded'" );
69
+ throw new \InvalidArgumentException(" Invalid value for enum '$modelTypes ', must be one of: '$imploded'" );
70
70
}
71
71
}
72
72
}
73
73
if ($value !== null) {
74
- $values [$data ::attributeMap()[$property ]] = self::sanitizeForSerialization($value , openAPITypes , $formats [$property ]);
74
+ $values [$data ::attributeMap()[$property ]] = self::sanitizeForSerialization($value , $ modelTypes , $formats [$property ]);
75
75
}
76
76
}
77
77
} else {
0 commit comments