Here is an example value that is not working as expected:
{{base_url}}/api/users/?filters[type]=1
The issue I am having with celebrate is:
"message": "\"filters\" must be [[object Object]]; ",
I create the error handler like this:
app.use((err: any, _req: Request, res: Response, _next: NextFunction) => { if (isCelebrateError(err)) { let message = ''; for (const value of err.details.values()) { message += value.message + '; '; } logger.error('🔥 error %o', message); res.status(httpStatus.BAD_REQUEST).json(resultError(message)); } })
but i have error for the nested joi schema. I think i do it in the wrong way.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
node
version - 18celebrate
version - 15.0.3joi
version (vianpm ls --depth=0 | grep joi
) -17My
joi
schema looks like this:`export const fetchUsersValidation = {
}) };`
Here is an example value that is not working as expected:
{{base_url}}/api/users/?filters[type]=1
The issue I am having with
celebrate
is: "message": "\"filters\" must be [[object Object]]; ", I create the error handler like this:app.use((err: any, _req: Request, res: Response, _next: NextFunction) => { if (isCelebrateError(err)) { let message = ''; for (const value of err.details.values()) { message += value.message + '; '; } logger.error('🔥 error %o', message); res.status(httpStatus.BAD_REQUEST).json(resultError(message)); } })
but i have error for the nested joi schema. I think i do it in the wrong way.