Skip to content
This repository was archived by the owner on Apr 30, 2019. It is now read-only.
This repository was archived by the owner on Apr 30, 2019. It is now read-only.

Joi - error TS2339: Property 'required' does not exist on type 'typeof 'joi'' #287

@RichardJECooke

Description

@RichardJECooke

This code fails:

export const PostUsersRolesDataValidator : Joi.ObjectSchema = Joi.object().keys({
    roles: Joi.object().required(),
  franchiseeId: Joi.string().min(36).max(36).when('franchisorId', { is: false, then: Joi.required() }),
  franchisorId: Joi.string().min(36).max(36).when('franchiseeId', { is: false, then: Joi.required() })
});

with the error ../shared/joiValidators/PostUsersRolesDataValidator.ts(5,90): error TS2339: Property 'required' does not exist on type 'typeof 'joi''.

Idea from here: hapijs/joi#194

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions