Open miquellaboria opened 5 years ago
Hi @miquellaboria . What are you trying to do here? Do you want validation for both or only one of them?
Hi @DavidePastore I want to validate at least one of them.
Thanks!
@miquellaboria This is a nice use case. Can you please check if #40 fixes it and make it works as expected?
@DavidePastore I have the same validation error: At least one of these rules must pass for null\nKey groupId must be present\nKey userId must be present
Key are not found :(
Hi, this #40 worked here. Here's my code:
$app->get('/cliente', ClienteController::class . ':listarClientes')->add(new \DavidePastore\Slim\Validation\Validation( v::oneOf( v::key('test', v::notBlank()), v::key('test2', v::notBlank()) ) ));
@miquellaboria I expected that it worked as @alissonbezerra said. Let's investigate it. What is the definition of \App\Lib\Validation
?
How can I use Key with Route Params:
$app->delete('/group/{groupId}/access/{userId}', '\App\Controller\Group:removeUser') ->add(new \App\Lib\Validation(array( v::oneOf( v::key('groupId',v::IsPublicationOwner($container)), v::key('userId', v::ItsMe($container)) ) )));
Returns:
At least one of these rules must pass for null Key groupId must be present Key userId must be present