After implemnting joi-objectid, the responce in post man it looks good but the terminal giving me an error:"Cannot set headers after they are sent to the client"

const joi = require(‘joi’);

joi.objectId = require(‘joi-objectid’)(joi);

function validateRental(any){
const schema = joi.object({
customerId:joi.objectId().required(),
movieId:joi.objectId().required()
});
return schema.validate(any)
};