-
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 codefeatureNew functionality or improvementNew functionality or improvement
Milestone
Description
Support plan
- which support plan is this issue covered by? Community
- is this issue currently blocking your project? (yes/no): yes
- is this issue affecting a production system? (yes/no): no
Context
- node version: 10.13.0
- module version: 16.1.7
- environment (e.g. node, browser, native): node
- used with (e.g. hapi application, another framework, standalone, ...): standalone
- any other relevant information: -
How can we help?
Is it possible to pass the current state to the default value provider. It should be a help when using the pattern method (set default value based on the path for example)
const schema = Joi.object({})
.pattern(
/^.+$/,
Joi.object({
type: Joi.string().default((ctx, options, state) => {
// default value can be calculated based on state, for example env values
})
})
);Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
breaking changesChange that can breaking existing codeChange that can breaking existing codefeatureNew functionality or improvementNew functionality or improvement