Skip to content

Commit

Permalink
canonical-schema: Fix UUID regex pattern
Browse files Browse the repository at this point in the history
Commit cea02af (#1676) added a UUID to each test case. However, the
regex pattern that it added to the canonical schema was too permissive,
meaning that CI would pass on a PR that added, for example, a version 1
UUID (see #1735).

Changes:
- Use `a-f` instead of `a-z`
- The third group must start with `4`.
- The fourth group must start with `8`, `9`, `a` or `b`.
  • Loading branch information
ee7 committed Dec 27, 2020
1 parent bb38e15 commit 4be1cdd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions canonical-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@
},

"uuid":
{ "description": "A universally unique identifier in the v4 format"
{ "description": "A version 4 UUID (compliant with RFC 4122) in the canonical textual representation"
, "type" : "string"
, "pattern" : "^[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}$"
, "pattern" : "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
},

"scenario":
Expand Down

0 comments on commit 4be1cdd

Please sign in to comment.