Is there a way to incorporate JOI validator into Firebase functions as middleware? When calling a Firebase function, it looks something like this:
exports.createUserAccount = region("europe-east1").https.onCall(createAccount); // createAccount is a function
In normal Express endpoints or routes, I typically do something like the following:
app.post("/app/some/endpoint", auth(), validator(), createAccount());
My validator
is a JOI middleware where I verify that req.body
follows a specified schema.
PS. My createAccount
function does not include (req, res)
, as Firebase returns a simple DTO within this function.
Thank you for any assistance.