默认情况下,当验证失败时,响应会像
{
statusCode: 400,
message: [ 'Provide a url.', 'test must be a string' ],
error: 'Bad Request'
}
我怎样才能得到消息的价值:
{
statusCode: 400,
message: {
"url": 'Provide a url.',
"test": 'test must be a string'
},
error: 'Bad Request'
}