Validate the validation: Disallow certain feature/combinations
- Dominant language
- JavaScript
- Stars
- 21.2k
- Forks
- 1.5k
- Avg merge
- 4h 57m
- Merged PRs (30d)
- 14
Description
#### Support plan
* *is this issue currently blocking your project?* (yes/no): no
* *is this issue affecting a production system?* (yes/no): no
#### Context
* *node version*: 14.21.1
* *module version*: 17.6.1
* *environment* (e.g. node, browser, native): node
* *used with* (e.g. hapi application, another framework, standalone, ...): express
* *any other relevant information*:
#### How can we help?
I'm setting up a new project which is expected to get quite large. Having very strict validation from the very beginning is crucial. However, in large projects with many people working on them, things tend to get out of hand and eventually less strict validation sneaks in. Once that's the case, it's hard to make the validation strict again (I've been there). So, I was just wondering: Is there a way to automatically enforce strict validation by reducing the options/possibilities of Joi?
I was thinking of **disallowing**:
- The usage of `Joi.any()`
- The usage of `Joi.object` without further narrowing down (by `.keys`, `.pattern` etc.)
- The usage of `Joi.array` withouth `items` etc.
- The usage of `Joi.string()` without narrowing down (`.email()` , regex etc)
Is that possible somehow?
Contributor guide
Assessment
This issue has not been assessed yet.