-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
featureNew functionality or improvementNew functionality or improvement
Milestone
Description
Hi,
here's what I'm trying to do :
I've got this Joi schema
var validateQuery = core.Joi.object().keys({
clientId: core.Joi.string().required(),
redirectUri: core.Joi.string().required().regex(/^[a-z0-9]*:\/\/[^*]*/i),
responseType: core.Joi.string().required().valid(['code', 'token']),
}).rename('client_id', 'clientId', {override: true})
.rename('redirect_uri', 'redirectUri', {override: true})
.rename('response_type', 'responseType', {override: true});and I'm validating this object
redirectUri: 'http://whatever.com',
responseType: 'token',
clientId: '240f17d59129425093d9ec805009e75e' }This give me [ValidationError: child "clientId" fails because ["clientId" is required]]. Changing clientId to client_id in my object works fine, but rename() shouldn't delete my keys if the rename isn't necessary, right? I think this behavior is comming from this commit but maybe it's on purpose and I missed something.
Is that a bug or a feature ?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
featureNew functionality or improvementNew functionality or improvement