hapijs / hapijs/joi

Allow in newer versions doesn't seem to be backwards compatible?

Open
#2,657 1 comment 1 reaction 0 assignees View on GitHub
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*: v14.17.5
* *module version*: 17.4.2 (tried other versions also)
* *environment* (e.g. node, browser, native): node
* *used with* (e.g. hapi application, another framework, standalone, ...): N/A
* *any other relevant information*: N/A

#### How can we help?

`joi.string().allow('HEAD').hex().min(6).max(40).lowercase().required()` does not allow for the string `HEAD`, which is explicitly allowed. Can someone explain what I am doing wrong?

Contributor guide

Open the contributing guide

Research direction

Reproduce the reported schema with Joi 17.4.2 on Node 14.17.5, then inspect how allow('HEAD') interacts with hex(), min(), max(), lowercase(), and required(). No files or tests are named in the issue; done means determining whether this is intended behavior or a regression and, if it is a bug, identifying a focused test case.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.