Array wildcard validation is broken
See original GitHub issueFrom the docs, this example:
const data = {
users: [
{
name: 'John',
bio: {
age: 28,
education: {
primary: 'Elementary School',
secondary: 'Secondary School'
}
}
}
]
}
const rules = {
'users.*.name': 'required',
'users.*.bio.age': 'min:18',
'users.*.bio.education.primary': 'string',
'users.*.bio.education.secondary': 'string'
}
const validation = new Validator(data, rules)
if (validation.fails()) {
console.log(validation.errors.all())
}
It gives error:
The field is actually defined, but the error is given and error key is a string without array index.
Package version - 3.13.3
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Wildcard Validation Rules on Collections not working #1556
From what I've found, this issue occurs with collections. @jimpeters, as your example shows, validation works as expected for arrays. However, ...
Read more >Express-Validator 5.2.0 - Validate Wildcard Array of Objects
I am trying to validate an array of objects with express-validator. I have been using the new "wildcard" along with the "custom", ...
Read more >Mule Expression Language Reference
This reference page for the Mule Expression Language (MEL) provides lists and brief explanations of MEL features such as operators, literals, and functions, ......
Read more >JAXB Users Guide - Java EE
Common causes of this problem include typos, incorrect namespace URI declarations, and misunderstanding of XPath. 1.2. Fixing broken references in schema.
Read more >Array validation is not working. Am I doing something wrong or ...
I am trying to use the array validation feature in Laravel 5.2 but finding an issue. I am not sure if it is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@mikeerickson hey, any news on a new release?
Fixed in 3.13.4.