FriendsOfSymfony / FOSRestBundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony
http://symfony.com/doc/master/bundles/FOSRestBundle/index.html
MIT License
2.79k stars 704 forks source link

QueryParam how to define dependent parameters #2273

Open ehdez82 opened 3 years ago

ehdez82 commented 3 years ago

Hello, I have a question. In the following example, parameter C is incompatible with parameters A and B. However, parameters A and B are dependent, that is, if I send A, it is mandatory to send B and vice versa. How can I define this dependency with QueryParam. Thanks in advance.

/**
* QueryParam(name="paramA", nullable=true, description="Search by paramA")
* QueryParam(name="paramB", nullable=true, description="Search by paramB")
* QueryParam(name="paramC", nullable=true, incompatibles={"paramA", "paramB"}, description="Search by paramC")
*/
public function search(ParamFetcher $paramFetcher)
{

}