typesafe-joi icon indicating copy to clipboard operation
typesafe-joi copied to clipboard

required() seems to be getting ignored

Open KieranHarper opened this issue 5 years ago • 0 comments

Noticed when trying to use the sample code example to define a type from a schema:

const schema = Joi.array()
  .items({
    id: Joi.number().integer().required(),
    email: Joi.string().email()
  })
  .required()

type T = Joi.Literal<typeof schema>

It seems to be ignoring required(), producing my results below instead:

Screen Shot 2019-10-07 at 3 26 01 pm

My versions:

"typesafe-joi": "^2.0.6",
"@hapi/joi": "^15.1.1",
"typescript": "^3.5.1"

KieranHarper avatar Oct 07 '19 05:10 KieranHarper