Closed
Description
When there is mapping from a source array property to a target array property, the values in the source array get each nested in their own array.
class UserApiResource
{
public array $roles; // ["ROLE_USER"]
}
...
class UserEntity
{
public function setRoles(array $roles)
{
$this->roles = $roles; // [["ROLE_USER"]];
}
}
This occurs because the generated mapping class does wrap each value in the array in their own array:
$values = [];
foreach ($value->roles ?? [] as $key => $value_2) {
$values[] = [$value_2];
}
$result->setRoles($values);
This issue was not present in 9.2.1.