Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 26, 2019

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