We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Properties with defaults should be applied, even if they're part of an alternative subschema with a match mode.
const joi = require('joi') const s = joi.alternatives().try( joi.object({ lol: joi.string().default('rofl') }).unknown(), joi.object({ foo: joi.string().default('bar'), baz: joi.string() }) ).match('all') const { value, error } = s.validate({ baz: 'bing' })
error === undefined value === { baz: 'bing' }
error === undefined value === { lol: 'rofl', foo: 'bar', baz: 'bing' }
The text was updated successfully, but these errors were encountered:
Could you take a look at this when you have a chance @hueniverse ?
Have some work that depends on this and would appreciate any help getting this into a release so I can get off my fork.
Sorry, something went wrong.
hueniverse
Successfully merging a pull request may close this issue.
Support plan
Context
What are you trying to achieve or the steps to reproduce?
Properties with defaults should be applied, even if they're part of an alternative subschema with a match mode.
What was the result you got?
What result did you expect?
The text was updated successfully, but these errors were encountered: