Skip to content

Commit 8f03c93

Browse files
committed
Still use Any for service methods objects
1 parent cba54e2 commit 8f03c93

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/SDK/Language/Swift.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ public function getFiles(): array
299299
* @param array $parameter
300300
* @return string
301301
*/
302-
public function getTypeName(array $parameter, array $spec = []): string
302+
public function getTypeName(array $parameter, array $spec = [], bool $isProperty = false): string
303303
{
304304
if (isset($parameter['enumName'])) {
305305
return ($spec['title'] ?? '') . 'Enums.' . \ucfirst($parameter['enumName']);
@@ -320,7 +320,7 @@ public function getTypeName(array $parameter, array $spec = []): string
320320
self::TYPE_ARRAY => (!empty(($parameter['array'] ?? [])['type']) && !\is_array($parameter['array']['type']))
321321
? '[' . $this->getTypeName($parameter['array']) . ']'
322322
: '[AnyCodable]',
323-
self::TYPE_OBJECT => '[String: AnyCodable]',
323+
self::TYPE_OBJECT => $isProperty ? '[String: AnyCodable]': 'Any',
324324
default => $parameter['type'],
325325
};
326326
}
@@ -527,7 +527,7 @@ protected function getPropertyType(array $property, array $spec, string $generic
527527
$type = '[' . $type . ']';
528528
}
529529
} else {
530-
$type = $this->getTypeName($property);
530+
$type = $this->getTypeName($property, isProperty: true);
531531
}
532532

533533
return $type;

0 commit comments

Comments
 (0)