Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query parameters DTO #13

Open
Alexandre-Fernandez opened this issue Apr 13, 2023 · 1 comment
Open

Query parameters DTO #13

Alexandre-Fernandez opened this issue Apr 13, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@Alexandre-Fernandez
Copy link

Alexandre-Fernandez commented Apr 13, 2023

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.

@sfmok
Copy link
Owner

sfmok commented Apr 17, 2023

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

@sfmok sfmok added the enhancement New feature or request label Apr 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants