Skip to content

Query parameters DTO #13

Open
Open
@Alexandre-Fernandez

Description

@Alexandre-Fernandez

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions