Context
- node version: 7.9.0
- joi version: 10.4.1
- environment (node, browser): node
- used with (hapi, standalone, ...): standalone
What are you trying to achieve or the steps to reproduce?
I need to get the key from the context, I expected context.key to be the key, but it turns out it's the label.
const Joi = require("joi");
const context = Joi
.object({
someKey: Joi.required().label("some label")
})
.validate({})
.error.details[0].context;
console.log(context);
Which result you had ?
What did you expect ?
This example on RunKit: https://runkit.com/57d675ee7580c314003cf648/58fe1d4fad401b00120f475a/branches/master
Context
What are you trying to achieve or the steps to reproduce?
I need to get the key from the context, I expected
context.keyto be the key, but it turns out it's the label.Which result you had ?
What did you expect ?
This example on RunKit: https://runkit.com/57d675ee7580c314003cf648/58fe1d4fad401b00120f475a/branches/master