Skip to content

Commit

Permalink
CLI-1379: TypeError in api:environments:cron-create (#1786)
Browse files Browse the repository at this point in the history
* CLI-1379: TypeError in api:environments:cron-create

* mutation

* mutation
  • Loading branch information
danepowell authored Aug 30, 2024
1 parent 5451922 commit a209ed1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Command/Api/ApiCommandHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -432,11 +432,12 @@ private function getRequestBodyFromParameterSchema(array $schema, array $acquiaC

private function getPropertySpecFromRequestBodyParam(array $requestBodySchema, mixed $parameterDefinition): mixed
{
return $requestBodySchema['properties'][$parameterDefinition->getName()] ?? null;
$name = self::restoreRenamedParameter($parameterDefinition->getName());
return $requestBodySchema['properties'][$name] ?? null;
}

/**
* @return array<mixed>
* @return array<string>
*/
protected static function getParameterRenameMap(): array
{
Expand All @@ -449,7 +450,7 @@ protected static function getParameterRenameMap(): array
];
}

public static function renameParameter(mixed $propKey): mixed
private static function renameParameter(string $propKey): string
{
$parameterRenameMap = self::getParameterRenameMap();
if (array_key_exists($propKey, $parameterRenameMap)) {
Expand All @@ -458,7 +459,7 @@ public static function renameParameter(mixed $propKey): mixed
return $propKey;
}

public static function restoreRenamedParameter(string $propKey): int|string
public static function restoreRenamedParameter(string $propKey): string
{
$parameterRenameMap = array_flip(self::getParameterRenameMap());
if (array_key_exists($propKey, $parameterRenameMap)) {
Expand Down

0 comments on commit a209ed1

Please sign in to comment.