Top "Joi" questions

Object schema description language and validator for JavaScript objects.

Joi validation of array

trying to validate that an array has zero or more strings in one case and that it has zero or …

hapijs joi
Node.js + Joi how to display a custom error messages?

It seems pretty straight forward to validate user's input in Node.js RESTapi with Joi. But the problem is that …

node.js joi
How to validate array of objects using Joi?

I am getting an array of objects to backend, where each object contains a service name. The structure looks like …

node.js validation express joi
Allow only specific values for key in Joi schema

Is there any other way to set specific values in Joi validation schema for key except regex pattern? My example …

javascript joi
Joi validation multiple conditions

I have the following schema: var testSchema = Joi.object().keys({ a: Joi.string(), b: Joi.string(), c: Joi.string().when(…

javascript hapijs joi
How to use enum values with Joi String validation

I am using Joi validator for my HTTP requests. There I have a parameter called type. I need to make …

node.js validation express joi
joi_1.default.validate is not a function

I want to validate my Express routes before calling the controller logic. I use joi and created a validator which …

javascript node.js typescript express joi
How to allow any other key in Joi

I have a simple requirement. I tried to search on the internet as well as documentation but failed. So here …

javascript hapijs joi
Allow string to be null or empty in joi and express-validation

I am using "joi": "10.0.6" and "express-validation": "1.0.1" in my project to validate a JSON object which I will save in the …

node.js validation joi
Joi Nested schema

I am trying to create nested schema in joi and it is throwing error [Error: Object schema cannot be a …

javascript node.js joi