Skip to content
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

[Feature request] Support Joi.link() #105

Open
DanielNoveo opened this issue Mar 21, 2024 · 1 comment
Open

[Feature request] Support Joi.link() #105

DanielNoveo opened this issue Mar 21, 2024 · 1 comment

Comments

@DanielNoveo
Copy link

DanielNoveo commented Mar 21, 2024

Please add functionality of Joi.link()
This would allow schemas to be recursive

Usage example: i have schema like this

const nestedThingValidator = Joi.object({
    type: Joi.string().required().valid(FIELD_TYPE.NESTED),
    format: Joi.string()
      .valid(FIELD_TYPE.BOOL, FIELD_TYPE.RADIOBUTTON, FIELD_TYPE.DROPDOWN)
      .required(),
    options: Joi.array()
      .items(
        Joi.object({
          value: Joi.string().required(),
          code: propertyCodeValidator,
          fieldset: Joi.array()
            .items(Joi.ref("#nestedOne"))
            .min(1),
        })
      )
      .required()
      .min(1),
  })
  .id("nestedOne");

Which allows object to be recursively nested

P.S. Here are a message i have with my schema when i try to convert it with this library
image

@DanielNoveo DanielNoveo changed the title [Feature request] [Feature request] Support Joi.link() Mar 21, 2024
@Mairu
Copy link
Collaborator

Mairu commented Mar 22, 2024

Hi, the library is in maintenance mode. I do not actively develop new features, but any PRs are welcome and will be merged after being reviewed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants