Skip to content

Types for Joi.build #2490

Open
Open
@scriptcoded

Description

@scriptcoded

Hey!

I'm implementing a way for my front-end to retrieve validation schemes from the back-end automatically. While snooping around I realized that I can use schema.describe() in conjunction with Joi.build(). I wouldn't believe that this is officially supported, but I wanted to mention that the the type definition says the following:

https://github.com/sideway/joi/blob/a2ac147a3ef6c2d96ac2f3ae3407306de1ceb01c/lib/index.d.ts#L2181-L2184

It would appear that Joi.build() takes a description object and parses it into a proper Joi schema. Is that the intended behavior, and should the definitions be updated?

Cheers!

Metadata

Metadata

Assignees

No one assigned

    Labels

    typesTypeScript type definitions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions