Evaluating the root object with conform alters other result keys
- Dominant language
- JavaScript
- Stars
- 9
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
```js
const Corro = require('corro');
const corro = new Corro();
const schema = {
conform: [{
func: body => !body.thing1 !== !body.thing2,
message: 'either thing1 or thing2 must be specified'
}],
status: {required: true, notEmpty: true}
};
const result = corro.validate(schema, {status: ''});
```
'*' appears erroneously in what should be simply 'status' in the `result.errors` object. Omitting `conform` from the validation schema shows the correct 'status' key.
```json
{
"valid": false,
"errors": {
"*": [{
"rule": "conform",
"result": "either thing1 or thing2 must be specified"
}],
"*.status": [{
"rule": "notEmpty",
"result": "cannot be blank"
}]
}
}
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.