Skip to content

Some refs not converted in .describe() #592

@myndzi

Description

@myndzi
> Joi.compile(Joi.ref('foo')).describe()
{ type: 'any',
  flags: { allowOnly: true },
  valids:
   [ { [Function]
       isContext: false,
       key: 'foo',
       path: [Object],
       depth: 1,
       root: 'foo',
       isJoi: true,
       toString: [Function] } ] }

But:

> Joi.compile(Joi.string().when('a', { is: 'foo', then: Joi.forbidden() })).describe()
{ type: 'alternatives',
  flags: { presence: 'ignore' },
  alternatives:
   [ { ref: 'ref:a',
       is: [Object],
       then: [Object],
       otherwise: [Object] } ] }

Metadata

Metadata

Assignees

Labels

breaking changesChange that can breaking existing codebugBug or defect

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions