a: {
b: 'c'
}
I'm trying to validate it using Joi, inside my module:
ConfigModule.forRoot({
envFilePath: ['config.env'],
load: [generalConfig],
validationSchema: Joi.object({
a: Joi.object({
b: Joi.number().min(0).max(2).required(),
}),
}),
validationOptions: {
allowUnknown: true,
abortEarly: true,
},
cache: false,
}),
I get no error/warning at all. If I change the validationSchema to:
validationSchema: Joi.object({
b: Joi.number().min(0).max(2).required(),
}),
And this is the .env content:
a: {
"b": 1,
}
I get the error as always. Any idea?