Skip to content

Added wrapper option to uuid function #3082

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ben-walters
Copy link

Adds wrapper options to .uuid() function to enable stricter validation rules when validating uuid's.

joi.uuid()                  // retains current functionality

joi.uuid({wrapper: true})   // uuid MUST be wrapped by any of the allowed brackets
joi.uuid({wrapper: false})  // uuid MUST NOT be wrapped in any of the allowed brackets
joi.uuid({wrapper: '{'})    // uuid MUST be wrapped by { }
joi.uuid({wrapper: '['})    // uuid MUST be wrapped by [ ]
joi.uuid({wrapper: '('})    // uuid MUST be wrapped by ( )

closes #3081

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Toggle brackets when validating UUID's
1 participant