-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
Context
- node version: 8.4.0
- joi version: 10.6.0
- environment (node, browser): node
- used with (hapi, standalone, ...): standalone
What are you trying to achieve or the steps to reproduce ?
I want to define a schema for an object with properties a and b, and I want a and b to be numbers that are not equal to one another.
const Joi = require("joi");
Joi
.object({
a: Joi.number(),
b: Joi.number().invalid(Joi.ref("a"))
})
.validate({
a: 123,
b: 321
});Which result you had ?
An error is thrown:
Item cannot come after itself: a
What did you expect ?
No errors.
This example at RunKit: https://runkit.com/57d675ee7580c314003cf648/59a52dfce0c6b2001608a2f1
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugBug or defectBug or defect