Description
Symfony version(s) affected
7.0.1
Description
I use the following code but I meet an error
#[Route('/product/{id}/comments')]
public function show(
Product $product,
#[MapEntity(expr: 'repository.findBy(["product_id" => id], null, request.query.get("limit", 10)')]
iterable $comments
): Response {
}
Error is:
Controller "App\Controller\ProductController" requires that you provide a value for the "$comments" argument. Either the argument is nullable and no null value has been provided, no default value has been provided or there is a non-optional argument after this one.
How to reproduce
#[Route('/product/{id}/comments')]
public function show(
Product $product,
#[MapEntity(expr: 'repository.findBy(["product_id" => id], null, request.query.get("limit", 10)')]
iterable $comments
): Response {
}
Possible Solution
No response
Additional Context
No response