Skip to content

Commit

Permalink
Fix array serialization problems
Browse files Browse the repository at this point in the history
  • Loading branch information
neclimdul committed Aug 4, 2021
1 parent 251e0d7 commit d48002e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/Lead/Model/LeadAttribute2.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class LeadAttribute2 implements ModelInterface, ArrayAccess, \JsonSerializable
*/
protected static $openAPITypes = [
'name' => 'string',
'searchable_fields' => '\NecLimDul\MarketoRest\Lead\Model\array[]',
'searchable_fields' => 'array[]',
'fields' => '\NecLimDul\MarketoRest\Lead\Model\LeadAttribute2Fields[]'
];

Expand Down Expand Up @@ -246,7 +246,7 @@ public function setName($name)
/**
* Gets searchable_fields
*
* @return \NecLimDul\MarketoRest\Lead\Model\array[]
* @return array[]
*/
public function getSearchableFields()
{
Expand All @@ -256,7 +256,7 @@ public function getSearchableFields()
/**
* Sets searchable_fields
*
* @param \NecLimDul\MarketoRest\Lead\Model\array[] $searchable_fields List of searchable fields
* @param array[] $searchable_fields List of searchable fields
*
* @return self
*/
Expand Down
6 changes: 3 additions & 3 deletions src/Lead/Model/ProgramMemberAttribute2.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class ProgramMemberAttribute2 implements ModelInterface, ArrayAccess, \JsonSeria
'created_at' => 'string',
'updated_at' => 'string',
'dedupe_fields' => 'string[]',
'searchable_fields' => '\NecLimDul\MarketoRest\Lead\Model\array[]',
'searchable_fields' => 'array[]',
'fields' => '\NecLimDul\MarketoRest\Lead\Model\LeadAttribute2Fields2[]'
];

Expand Down Expand Up @@ -378,7 +378,7 @@ public function setDedupeFields($dedupe_fields)
/**
* Gets searchable_fields
*
* @return \NecLimDul\MarketoRest\Lead\Model\array[]
* @return array[]
*/
public function getSearchableFields()
{
Expand All @@ -388,7 +388,7 @@ public function getSearchableFields()
/**
* Sets searchable_fields
*
* @param \NecLimDul\MarketoRest\Lead\Model\array[] $searchable_fields List of searchable fields
* @param array[] $searchable_fields List of searchable fields
*
* @return self
*/
Expand Down
4 changes: 2 additions & 2 deletions src/Lead/ObjectSerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n
foreach ($data::openAPITypes() as $property => $openAPIType) {
$getter = $data::getters()[$property];
$value = $data->$getter();
if ($value !== null && !in_array($openAPIType, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) {
if ($value !== null && !in_array($openAPIType, ['DateTime', 'array', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) {
$callable = [$openAPIType, 'getAllowableEnumValues'];
if (is_callable($callable)) {
/** array $callable */
Expand Down Expand Up @@ -355,7 +355,7 @@ public static function deserialize($data, $class, $httpHeaders = null)
}

/** @psalm-suppress ParadoxicalCondition */
if (in_array($class, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) {
if (in_array($class, ['DateTime', 'array', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) {
settype($data, $class);
return $data;
}
Expand Down

0 comments on commit d48002e

Please sign in to comment.