Closed
Description
API Platform version(s) affected: 4.1.15
Description
In my project, I only use DTOs. Before Symfony 7.3, with the following example, I retrieved the object with the property $users filled with UserDTOs in my processor. Since Symfony 7.3, and without any other changes on my part, I only retrieve an array of IRIs.
phpdocumentor/reflection-docblock
is still installed.
Let me know if you want a reproducer.
How to reproduce
DTO :
#[ApiResource(
shortName: 'Location',
operations: [
new Post(
uriTemplate: '/locations',
),
],
openapi: new Operation(
tags: ['Location']
),
processor: LocationProcessor::class,
stateOptions: new Options(entityClass: Location::class),
)]
readonly class LocationInputDto
{
public function __construct(
#[Assert\NotBlank]
public ?string $name = null,
/** @var UserDto[] */
public ?array $users = [],
) {
}
}
Example request payload :
{
"name": "Tour Eiffel",
"users": [
"/api/users/1",
"/api/users/2"
]
}
Metadata
Metadata
Assignees
Labels
No labels