Hapi/Joi Validation: How to process text to a specific format
You can try the following: And while validating with schema, you can use the convert:true option as: Alternatively, you can directly provide additional preferences to convert the Joi validated object in the schema: Here is a link to working example: https://repl.it/repls/HarmfulEvenPhases