-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
breaking changesChange that can breaking existing codeChange that can breaking existing codebugBug or defectBug or defect
Milestone
Description
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 ?
{
key: "some label"
}What did you expect ?
{
key: "someKey"
}This example on RunKit: https://runkit.com/57d675ee7580c314003cf648/58fe1d4fad401b00120f475a/branches/master
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
breaking changesChange that can breaking existing codeChange that can breaking existing codebugBug or defectBug or defect