-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
featureNew functionality or improvementNew functionality or improvement
Milestone
Description
Context
- node version: 6
- joi version: 10.3.x
- environment (node, browser):
- used with (hapi, standalone, ...):
- any other relevant information:
What are you trying to achieve or the steps to reproduce ?
const caseInsensitiveOverrides = ['marketcode', 'MarketCode', 'MARKETCODE'];
const schema = Joi.object({
marketCode : Joi.string(),
}).rename(caseInsensitiveOverrides, 'marketCode')I have a need for my params to be case insensitive and would like to implement that by using the rename api. It would be nice if I could pass rename a list of keys that whenever present would rename to a default key.
Example:
=> /route?marketCode=191
=> /route?marketcode=191
=> /route?MARKETCODE=191
I would expect each permutation to be validated and that in my handler the return value would be...
request.query.marketCode // => 191Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
featureNew functionality or improvementNew functionality or improvement