-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
featureNew functionality or improvementNew functionality or improvementnon issueIssue is not a problem or requires changesIssue is not a problem or requires changes
Milestone
Description
Context
- node version: 8.12.0
- joi version: 13.7.0
- environment (node, browser): Node
- used with (hapi, standalone, ...): Express-joi 0.3.1
What are you trying to achieve or the steps to reproduce ?
tax: joi.object({
fee: joi
.number()
.integer()
.positive()
.required()
.error(
() =>
`property fee is required and it must be a positive integer number.`,
),
mdr: joi
.number()
.integer()
.positive()
.required()
.error(
() =>
`property mdr is required and it must be a positive integer number.`,
),
})
.required()
.error(() => `property tax is required`),
Request
"tax": {
"fee": -1,
"mdr": 0
}
Which result you had ?
"child "tax" fails because [property tax is required]"
What did you expect ?
child "tax" fails because [child "fee" fails because [property fee is required and it must be a positive integer number.]]
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
featureNew functionality or improvementNew functionality or improvementnon issueIssue is not a problem or requires changesIssue is not a problem or requires changes