Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions composer.lock

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes done was because composer audit --locked was failing due to these vulnerabilities and dependabot has not yet created a PR to fix this.

Image

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/Command/Api/ApiBaseCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,9 @@ private function castParamType(array $paramSpec, array|string|bool|int $value):
if (isset($oneOf)) {
$types = [];
foreach ($oneOf as $type) {
if (!array_key_exists('type', $type)) {
continue;
}
if ($type['type'] === 'array' && str_contains($value, ',')) {
return $this->castParamToArray($type, $value);
}
Expand Down
18 changes: 18 additions & 0 deletions tests/phpunit/src/Commands/Api/ApiCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,24 @@ public function testTrustedProxiesCommandExecutesHttpGet(): void
$this->assertEquals(0, $this->getStatusCode());
}

/**
* oneOf entries that lack a 'type' key (e.g. unresolved $ref) must be
* skipped silently rather than throwing an "Undefined array key" warning.
*/
public function testCastParamTypeSkipsOneOfEntriesWithoutTypeKey(): void
{
$command = $this->getApiCommandByName('api:environments:code-switch');
$ref = new \ReflectionMethod($command, 'castParamType');
$paramSpec = [
'oneOf' => [
['$ref' => '#/components/schemas/SomeRef'],
Comment thread
deepakmishra2 marked this conversation as resolved.
['type' => 'integer'],
],
];
$result = $ref->invoke($command, $paramSpec, '42');
$this->assertSame(42, $result);
}

public function testTaskWait(): void
{
$environmentId = '24-a47ac10b-58cc-4372-a567-0e02b2c3d470';
Expand Down
Loading