Skip to content

Validation fails with valid UUID 3 #1687

Closed
@YegorMedvedev

Description

@YegorMedvedev

Context

  • node version: v8.9.2
  • joi version: 13.4.0
  • environment (node, browser): node
  • used with (hapi, standalone, ...): standalone

What are you trying to achieve or the steps to reproduce ?

Joi validate function fails on UUID v3, when UUID version passed to function.

For reproduction, please, follow the next script:

const joi = require("joi")

const uuid = "bfbf15ac-7388-3cf3-6720-19fde31a1711";
joi.validate(uuid, joi.string().guid()) // passes
joi.validate(uuid, joi.string().guid({version: ["uuidv1", "uuidv2", "uuidv3", "uuidv4", "uuidv5"]})) // fails

What did you expect ?

Expected behaviour, that validate function with version will not fail.

Metadata

Metadata

Assignees

Labels

non issueIssue is not a problem or requires changes

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions