Skip to content

Commit 75c27fb

Browse files
committed
Fix the UUID format.
The specification requires the verbose (with-dashes) format of specifying UUIDs.
1 parent b0f2877 commit 75c27fb

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

jsonschema/_format.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,5 @@ def is_duration(instance):
487487
def is_uuid(instance):
488488
if not isinstance(instance, str):
489489
return True
490-
if "-" not in instance:
491-
raise ValueError("Invalid UUID format")
492-
return UUID(instance)
490+
UUID(instance)
491+
return all(instance[position] == "-" for position in (8, 13, 18, 23))

0 commit comments

Comments
 (0)