Node.js + Joi how to display a custom error messages?

后端 未结 12 1574
故里飘歌
故里飘歌 2020-12-01 00:56

It seems pretty straight forward to validate user\'s input in Node.js RESTapi with Joi.

But the problem is that my app is not written in English. That m

12条回答
  •  甜味超标
    2020-12-01 01:24

    let schema = Joi.object().keys({
       Joi.string().required().options({language: {any: {required: "First name is required"}}})
    });
    

提交回复
热议问题