Skip to content

Commit f6cbcb1

Browse files
authored
Merge pull request #37 from formancehq/speakeasy-sdk-regen-1726502783
chore: 🐝 Update SDK - Generate
2 parents bf6cc27 + be12f07 commit f6cbcb1

5 files changed

Lines changed: 41 additions & 17 deletions

File tree

.speakeasy/gen.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ id: 0b9e0548-6a63-426d-aa19-95795ea55543
33
management:
44
docChecksum: bb72b9e5f65512abfc137f36f5e4fd02
55
docVersion: v2.1.0-beta.1
6-
speakeasyVersion: 1.396.6
7-
generationVersion: 2.415.6
8-
releaseVersion: 2.4.3
9-
configChecksum: 221f5b331bd74c2fff718348be503491
6+
speakeasyVersion: 1.397.2
7+
generationVersion: 2.415.8
8+
releaseVersion: 2.4.4
9+
configChecksum: 5adfaeec7fb402586c121cc62fabd10a
1010
repoURL: https://github.com/formancehq/formance-sdk-php.git
1111
repoSubDirectory: .
1212
installationURL: https://github.com/formancehq/formance-sdk-php
@@ -24,7 +24,7 @@ features:
2424
nameOverrides: 2.81.2
2525
nullables: 1.0.0
2626
responseFormat: 0.1.0
27-
unions: 0.1.1
27+
unions: 0.1.2
2828
generatedFiles:
2929
- .gitattributes
3030
- CONTRIBUTING.md

RELEASES.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,4 +228,14 @@ Based on:
228228
### Generated
229229
- [php v2.4.3] .
230230
### Releases
231-
- [Composer v2.4.3] https://packagist.org/packages/formance/formance-sdk#v2.4.3 - .
231+
- [Composer v2.4.3] https://packagist.org/packages/formance/formance-sdk#v2.4.3 - .
232+
233+
## 2024-09-16 16:06:18
234+
### Changes
235+
Based on:
236+
- OpenAPI Doc v2.1.0-beta.1
237+
- Speakeasy CLI 1.397.2 (2.415.8) https://github.com/speakeasy-api/speakeasy
238+
### Generated
239+
- [php v2.4.4] .
240+
### Releases
241+
- [Composer v2.4.4] https://packagist.org/packages/formance/formance-sdk#v2.4.4 - .

gen.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ generation:
1212
comments: {}
1313
telemetryEnabled: false
1414
php:
15-
version: 2.4.3
15+
version: 2.4.4
1616
clientServerStatusCodesAsErrors: true
1717
flattenGlobalSecurity: true
1818
imports:

src/SDKConfiguration.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ class SDKConfiguration
2727

2828
public string $openapiDocVersion = 'v2.1.0-beta.1';
2929

30-
public string $sdkVersion = '2.4.3';
30+
public string $sdkVersion = '2.4.4';
3131

32-
public string $genVersion = '2.415.6';
32+
public string $genVersion = '2.415.8';
3333

34-
public string $userAgent = 'speakeasy-sdk/php 2.4.3 2.415.6 v2.1.0-beta.1 formance/formance-sdk';
34+
public string $userAgent = 'speakeasy-sdk/php 2.4.4 2.415.8 v2.1.0-beta.1 formance/formance-sdk';
3535

3636
public function getServerUrl(): string
3737
{

src/Utils/UnionHandler.php

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,26 @@ public function serializeUnion(
7373
return $this->matchSimpleType($data, $type, $context);
7474
} else {
7575
if (is_array($data)) {
76-
$innerType = gettype($data[0]);
77-
if ($innerType === 'object') {
78-
$innerType = get_class($data[0]);
76+
if (array_is_list($data) && ! empty($data)) {
77+
$innerType = gettype($data[0]);
78+
if ($innerType === 'object') {
79+
$innerType = get_class($data[0]);
80+
}
81+
$resolvedType = [
82+
'name' => 'array',
83+
'params' => ['name' => $innerType, 'params' => []],
84+
];
85+
} else {
86+
$keyType = gettype(array_key_first($data));
87+
$valueType = gettype($data[array_key_first($data)]);
88+
$resolvedType = [
89+
'name' => 'array',
90+
'params' => [
91+
['name' => $keyType, 'params' => []],
92+
['name' => $valueType, 'params' => []],
93+
],
94+
];
7995
}
80-
$resolvedType = [
81-
'name' => 'array',
82-
'params' => ['name' => $innerType, 'params' => []],
83-
];
8496
} else {
8597
$resolvedType = null;
8698
foreach ($type['params'] as $possibleType) {
@@ -176,6 +188,8 @@ public function deserializeUnion(DeserializationVisitorInterface $visitor, mixed
176188
continue;
177189
} catch (NonFloatCastableTypeException $e) {
178190
continue;
191+
} catch (RuntimeException $e) {
192+
continue;
179193
}
180194
}
181195

0 commit comments

Comments
 (0)