request-input-bundle
request-input-bundle copied to clipboard
Query parameters DTO
It would be nice if you could create a DTO to retrieve and validate all the query parameters from $request->query.
#[Route("/test", name: "test", methods: ["GET"])]
public function registration(
BodyDto $bodyDto // implements `InputInterface`, retrieves and validates the request's body
QueryDto $queryDto // implements `QueryInputInterface` retrieves and validates the request's query parameters
): Response {
// ...
}
If this change is made InputInterface may need a rename to something like BodyInputInterface (or something like that) to signal the difference with the query parameter version.
Thanks @Alexandre-Fernandez.
In fact, i was thinking about it where query paramerters are usually used as filters.
I will try to add it in v2