Joi: Add check if variable is a valid UUID

Created on 19 Nov 2014  路  5Comments  路  Source: sideway/joi

This would be useful for validating id params and other places UUIDs are used.

feature

Most helpful comment

Oh, and tested Joi.string().guid() against my UUIDs generated by node-uuid and it validates perfectly.

All 5 comments

I'll take a PR adding up on string(). No existing library seems to cover that.

Oh wait, there's already a validation for GUIDs. UUID could just be an alias correct then? Or perhaps the other way around since GUIDs are just Microsoft-speak apparently for UUIDs.

I could create a quick pull request for this.

An alias ? Not worth it. After looking at it I'm not sure GUID/UUIDv2/UUIDv4 are differentiable so I'm gonna say we're good.

Oh, and tested Joi.string().guid() against my UUIDs generated by node-uuid and it validates perfectly.

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

leore picture leore  路  4Comments

chrisegner picture chrisegner  路  4Comments

mohamadresaaa picture mohamadresaaa  路  3Comments

kevbook picture kevbook  路  4Comments

jamesdixon picture jamesdixon  路  4Comments