Evaluating the root object with conform alters other result keys
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript, node.js
- Domain
- backend
Research direction
Reproduce the issue using the JavaScript example in the report and inspect how validate builds result.errors for root-level conform rules and the status field. Trace the validation result formatting, then confirm that the conform error remains separate while the notEmpty error uses the status key rather than *.status.
Written by the indexing model from the issue text.
Description
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.
{
"valid": false,
"errors": {
"*": [{
"rule": "conform",
"result": "either thing1 or thing2 must be specified"
}],
"*.status": [{
"rule": "notEmpty",
"result": "cannot be blank"
}]
}
}
- Dominant language
- JavaScript
- Stars
- 9
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dequelabs/corro
-
update `growl`Open
Difficulty 1/5 Under an hour Newbie friendliness 55/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
fb55/htmlparser2#2579 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
needs verification
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 13 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
swc-project/swc-next-issues#532 ·
-
domain/checkout Platform(Default) priority/low testing/acceptance
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day