Skip to content

Commit

Permalink
bugfix: s3 path handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean O'Brien committed Nov 25, 2024
1 parent dd1b65a commit e9af4e4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Api/Serializer/RestSerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ private function applyQuery($name, Shape $member, $value, array &$opts)
private function buildEndpoint(Operation $operation, array $args, array $opts)
{
$isModifiedModel = $this->api->isModifiedModel();
$serviceName = $this->api->getServiceName();
// Create an associative array of variable definitions used in expansions
$varDefinitions = $this->getVarDefinitions($operation, $args);

Expand Down Expand Up @@ -225,7 +226,7 @@ function (array $matches) use ($varDefinitions) {

$path = $this->endpoint->getPath();

if ($isModifiedModel && $this->api->getServiceName() === 's3') {
if ($isModifiedModel && $serviceName !== 's3') {
if (substr($path, -1) === '/' && $relative[0] === '/') {
$path = rtrim($path, '/');
}
Expand All @@ -242,7 +243,9 @@ function (array $matches) use ($varDefinitions) {
}
}

if (!$isModifiedModel) {
if (!$isModifiedModel
&& $serviceName !== 's3'
) {
$relative = $this->prependPath($relative, $path);
}

Expand Down

0 comments on commit e9af4e4

Please sign in to comment.