Skip to content

fix: isUUID validation fails for UUID like strings #2648

@EdgarHarutyunyan02

Description

@EdgarHarutyunyan02

Description

Recently a breaking change was introduced in validator v13.15.0 which made UUID validation strict by also validating the variant field. The recent update of class-validator brought this breaking change of validator library in 0.14.3 causing failures for UUID like ID validations.

validatorjs/validator.js#2421

isUUID('240d8c21-a21e-4282-0674-176658866702') // false since 0.14.3

Expected behavior

UUID Validation for UUID like strings should pass when in loose mode, introduced in [email protected]. loose mode should be properly exposed for consumption.

isUUID('240d8c21-a21e-4282-0674-176658866702', 'loose') // true

Actual behavior

There is no loose mode to opt-into resulting in failed validations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: needs triageIssues which needs to be reproduced to be verified report.type: fixIssues describing a broken feature.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions