We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Assume we have the following list of rules to be validated as a application/json post:
$rules = [ 'message' => [ 'notification' => [ 'title' => v::stringType()->length(1, null)->setName("notificationTitle"), 'body' => v::stringType()->length(1, null)->setName("notificationBody"), 'actionName' => v::optional(v::stringType()->length(1, null))->setName("notificationAction") ] ] ];
If I were to post something like this:
{ 'message' : { 'notification' : 1 } }
an error exception is thrown instead of validating that notification should be an object.
notification
Respect seems to have a way to solve with using the key method but we don't have access to that using the middleware. Respect/Validation#317
key
Type: ErrorException Message: array_key_exists() expects parameter 2 to be array, integer given File: /path/vendor/davidepastore/slim-validation/src/Validation.php Line: 163
The text was updated successfully, but these errors were encountered:
Support Nested Object Validation
613caea
Closed #32
Hi @kdaker, thanks for opening this issue. You can try and use the 0.5.1 release that includes this bug fix.
Sorry, something went wrong.
will do @DavidePastore , thanks for the fix.
DavidePastore
No branches or pull requests
Assume we have the following list of rules to be validated as a application/json post:
If I were to post something like this:
an error exception is thrown instead of validating that
notification
should be an object.Respect seems to have a way to solve with using the
key
method but we don't have access to that using the middleware.Respect/Validation#317
exception:
The text was updated successfully, but these errors were encountered: