-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
Context
- node version: 8
- joi version: (pre) 11.0
- environment (node, browser):
- used with (hapi, standalone, ...):
- any other relevant information:
What are you trying to achieve or the steps to reproduce ?
Describe your issue here, include schemas and inputs you are validating if needed.
const defaultJoi = Joi.defaults((schema) => {
switch(schema.type) {
case 'object': // it cannot be reached, since object schema's type is function.
...
}
})
// this is not defaulted.
defaultJoi.object()What did you expect ?
#1256 introduces Joi.defaults() feature, however,
there is a conflict in joi's API: type getter & Joi.object().type()
Type getter or mapping function of Joi.defaults() should be redesigned.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugBug or defectBug or defect