zfcampus/zf-content-validation

RPC zf-content-validation for MULTY Action in same controller

tigran-m-dev opened this issue · 2 comments

in module.config.php I have this

 'zf-content-validation' => array(
        'myApi\\V1\\Rpc\\Auth\\Controller' => array(
            'input_filter' => 'iguanApi\\V1\\Rpc\\Auth\\Validator',
      )

but in myApi\V1\Rpc\Auth\Controller controller I have many actions for example login, registration etc
so have any method to set validation for each ACTION not just request method (post,get,put, etc)

something like this

 'zf-content-validation' => array(
        'myApi\\V1\\Rpc\\Auth\\Controller' => array(
            'input_filter' => 'myApi\\V1\\Rpc\\Auth\\Validator',
            'actions'=>array(
                 'login'=>array(
                         'POST'=> 'myApi\\V1\\Rpc\\Auth\\Validator\\login'
                 ),
                 'registration'=>array(
                        'POST'=> 'myApi\\V1\\Rpc\\Auth\\Validator\\reg'
                 ),
                 .....
            ),
      )

We do not plan to support this. For apigility, we recommend single-purpose controllers, and will only provide tooling supporting that paradigm.