Skip to content
This repository has been 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

Open
RichardJECooke opened this issue Jun 24, 2016 · 0 comments

Comments

@RichardJECooke
Copy link

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

@RichardJECooke RichardJECooke changed the title error TS2339: Property 'required' does not exist on type 'typeof 'joi'' Joi - error TS2339: Property 'required' does not exist on type 'typeof 'joi'' Jun 24, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant