Joi validation of array

后端 未结 6 1006
梦如初夏
梦如初夏 2021-02-02 05:29

trying to validate that an array has zero or more strings in one case and that it has zero or more objects in another , struggling with Joi docs :(

validate: {
          


        
6条回答
  •  萌比男神i
    2021-02-02 05:56

    Joi.array().items(Joi.string().required(), Joi.number().required()); found it here

提交回复
热议问题