-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
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
Describe references as such #345
Comments
Example? |
{
type: 'ref',
isContext: false,
key: 'a.b'
path: ['a', 'b'],
depth: 2,
root: 'a'
} Not sure about valids/invalids, can they ever have other values ? |
Valid and invalid cannot be an object or function other than: |
Considering the specific api of refs, I don't see how valids could ever be anything else than [undefined, function] and invalids [null], am I wrong ? |
Valid and invalid is easy to do. What do you want to do about flags.default? |
Does it exist at all ? > Joi.ref('a.b').default(0)
TypeError: Object ref:a.b has no method 'default' |
No. |
I think it's out of topic. My current problem is to describe references alone, not objects of any type that have a default to a reference. Unless I missed something I don't see how it's related. |
Yeah, but it's the same problem for me. |
I've decided to leave the describe() behavior as-is, and add |
As mentioned in outmoded/lout#57, references should have their own descriptions.
I think isContext, key, path, depth, root should be exposed at the root of the description and type should indeed be
ref
.The text was updated successfully, but these errors were encountered: