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 // => 191
Context
What are you trying to achieve or the steps to reproduce ?
I have a need for my params to be case insensitive and would like to implement that by using the
renameapi. It would be nice if I could passrenamea list of keys that whenever present would rename to a default key.Example:
=>
/route?marketCode=191=>
/route?marketcode=191=>
/route?MARKETCODE=191I would expect each permutation to be validated and that in my handler the return value would be...