Skip to content

Clarify Joi.ref documentation to work with arrays. #2899

Open
@redwert

Description

@redwert

What are you trying to achieve or the steps to reproduce ?

Please update the documentation for joi.ref. The example part to:

{
    x: {
        a: Joi.any(),
        b: {
            c: Joi.any(),
            d: Joi.ref('c'),
            e: Joi.ref('...a'),
            f: Joi.ref('....y')
        },
        c: Joi.array().items({
          g: Joi.ref('....a'),
        }),
    },
    y: Joi.any()
}

It is not clear that the array needs one more level and dot to get to the grandparent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions