Skip to content

Allow _ in alias, arg, flag, modifier, override, rule, and term names#2243

Merged
hueniverse merged 1 commit intohapijs:masterfrom
necojackarc:#2242-allow-_-in-rule-names
Dec 26, 2019
Merged

Allow _ in alias, arg, flag, modifier, override, rule, and term names#2243
hueniverse merged 1 commit intohapijs:masterfrom
necojackarc:#2242-allow-_-in-rule-names

Conversation

@necojackarc
Copy link
Contributor

@necojackarc necojackarc commented Dec 10, 2019

Closes #2242

I am not sure if this is intended or not but Joi v15 or lower allows _ in rule names, however, Joi v16 doesn't allow it.

This PR may be a sort of bug fix for backward compatibility.

@necojackarc necojackarc marked this pull request as ready for review December 10, 2019 19:35
@Alexsey
Copy link

Alexsey commented Dec 11, 2019

/^[_a-zA-Z0-9]+$/ is exactly /^\w+$/

@necojackarc necojackarc force-pushed the #2242-allow-_-in-rule-names branch from 2898c61 to 20b7114 Compare December 11, 2019 11:45
@hueniverse hueniverse self-assigned this Dec 26, 2019
@hueniverse hueniverse added the bug Bug or defect label Dec 26, 2019
@hueniverse hueniverse added this to the 17.0.0 milestone Dec 26, 2019
@hueniverse hueniverse merged commit f238460 into hapijs:master Dec 26, 2019
hueniverse added a commit that referenced this pull request Dec 26, 2019
@necojackarc necojackarc deleted the #2242-allow-_-in-rule-names branch February 24, 2020 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Bug or defect

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can you allow _ in rule names?

3 participants