Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

131
Views
Cómo validar múltiples tipos para un solo campo usando Joi en Node JS

Estoy haciendo un esquema Joi para validar la consulta de solicitud, el esquema se ve así.

 const validateSchema = Joi.object() .keys({ 'size': Joi .string() .regex(/^\d+$/) .optional(),, 'from': Joi .string() .regex(/^\d+$/) .optional(), 'searchparams': Joi .string() .optional() .allow(''), 'active': '' // do this here });

En el esquema anterior, quiero que el campo active pueda ser una cadena o un valor booleano, ¿cómo puedo aplicar allí la validación del esquema Joi?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!