diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 182b081f..7521e7ea 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -3,10 +3,10 @@ id: 0b9e0548-6a63-426d-aa19-95795ea55543 management: docChecksum: bb72b9e5f65512abfc137f36f5e4fd02 docVersion: v2.1.0-beta.1 - speakeasyVersion: 1.396.6 - generationVersion: 2.415.6 - releaseVersion: 2.4.3 - configChecksum: 221f5b331bd74c2fff718348be503491 + speakeasyVersion: 1.397.2 + generationVersion: 2.415.8 + releaseVersion: 2.4.4 + configChecksum: 5adfaeec7fb402586c121cc62fabd10a repoURL: https://github.com/formancehq/formance-sdk-php.git repoSubDirectory: . installationURL: https://github.com/formancehq/formance-sdk-php @@ -24,7 +24,7 @@ features: nameOverrides: 2.81.2 nullables: 1.0.0 responseFormat: 0.1.0 - unions: 0.1.1 + unions: 0.1.2 generatedFiles: - .gitattributes - CONTRIBUTING.md diff --git a/RELEASES.md b/RELEASES.md index b3a83e24..827b59e1 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -228,4 +228,14 @@ Based on: ### Generated - [php v2.4.3] . ### Releases -- [Composer v2.4.3] https://packagist.org/packages/formance/formance-sdk#v2.4.3 - . \ No newline at end of file +- [Composer v2.4.3] https://packagist.org/packages/formance/formance-sdk#v2.4.3 - . + +## 2024-09-16 16:06:18 +### Changes +Based on: +- OpenAPI Doc v2.1.0-beta.1 +- Speakeasy CLI 1.397.2 (2.415.8) https://github.com/speakeasy-api/speakeasy +### Generated +- [php v2.4.4] . +### Releases +- [Composer v2.4.4] https://packagist.org/packages/formance/formance-sdk#v2.4.4 - . \ No newline at end of file diff --git a/gen.yaml b/gen.yaml index 34b0f527..cdcc3429 100755 --- a/gen.yaml +++ b/gen.yaml @@ -12,7 +12,7 @@ generation: comments: {} telemetryEnabled: false php: - version: 2.4.3 + version: 2.4.4 clientServerStatusCodesAsErrors: true flattenGlobalSecurity: true imports: diff --git a/src/SDKConfiguration.php b/src/SDKConfiguration.php index 6d9ef095..64a5c162 100644 --- a/src/SDKConfiguration.php +++ b/src/SDKConfiguration.php @@ -27,11 +27,11 @@ class SDKConfiguration public string $openapiDocVersion = 'v2.1.0-beta.1'; - public string $sdkVersion = '2.4.3'; + public string $sdkVersion = '2.4.4'; - public string $genVersion = '2.415.6'; + public string $genVersion = '2.415.8'; - public string $userAgent = 'speakeasy-sdk/php 2.4.3 2.415.6 v2.1.0-beta.1 formance/formance-sdk'; + public string $userAgent = 'speakeasy-sdk/php 2.4.4 2.415.8 v2.1.0-beta.1 formance/formance-sdk'; public function getServerUrl(): string { diff --git a/src/Utils/UnionHandler.php b/src/Utils/UnionHandler.php index fd60c395..d7a1f105 100644 --- a/src/Utils/UnionHandler.php +++ b/src/Utils/UnionHandler.php @@ -73,14 +73,26 @@ public function serializeUnion( return $this->matchSimpleType($data, $type, $context); } else { if (is_array($data)) { - $innerType = gettype($data[0]); - if ($innerType === 'object') { - $innerType = get_class($data[0]); + if (array_is_list($data) && ! empty($data)) { + $innerType = gettype($data[0]); + if ($innerType === 'object') { + $innerType = get_class($data[0]); + } + $resolvedType = [ + 'name' => 'array', + 'params' => ['name' => $innerType, 'params' => []], + ]; + } else { + $keyType = gettype(array_key_first($data)); + $valueType = gettype($data[array_key_first($data)]); + $resolvedType = [ + 'name' => 'array', + 'params' => [ + ['name' => $keyType, 'params' => []], + ['name' => $valueType, 'params' => []], + ], + ]; } - $resolvedType = [ - 'name' => 'array', - 'params' => ['name' => $innerType, 'params' => []], - ]; } else { $resolvedType = null; foreach ($type['params'] as $possibleType) { @@ -176,6 +188,8 @@ public function deserializeUnion(DeserializationVisitorInterface $visitor, mixed continue; } catch (NonFloatCastableTypeException $e) { continue; + } catch (RuntimeException $e) { + continue; } }