From 800f207ca2bf38acafd88186f653ecc9e39c9f61 Mon Sep 17 00:00:00 2001 From: Andrew Pollock Date: Thu, 12 Sep 2024 05:28:48 +0000 Subject: [PATCH] refactor(schema): simplify prefix validation regex Annoying yak shave: - I have an ecosystem cross-reference unit test for osv.dev in the works, which relies on using the regex in the schema definition, verbatim. - [Python 3.7 has a FutureWarning on set constructs](https://docs.python.org/dev/whatsnew/3.7.html#re), where as far as I can tell, `(:[[:digit:]]+)?` would need to be written as `(:\[[:digit:]]+)?`, which isn't valid in the JSON Schema (more in https://github.com/python/cpython/issues/74534) Signed-off-by: Andrew Pollock --- validation/schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/validation/schema.json b/validation/schema.json index f2781a0..01bdd27 100644 --- a/validation/schema.json +++ b/validation/schema.json @@ -300,7 +300,7 @@ "type": "string", "title": "Currently supported ecosystems", "description": "These ecosystems are also documented at https://ossf.github.io/osv-schema/#affectedpackage-field", - "pattern": "^(AlmaLinux|Alpine|Android|Bioconductor|Bitnami|ConanCenter|CRAN|crates.io|Debian|GHC|GitHub Actions|GIT|Go|Hackage|Hex|Linux|Maven|npm|NuGet|openSUSE|OSS-Fuzz|Packagist|Photon OS|Pub|PyPI|Red Hat|Rocky Linux|RubyGems|SUSE|SwiftURL|Ubuntu)(:[[:digit:]]+)?" + "pattern": "^(AlmaLinux|Alpine|Android|Bioconductor|Bitnami|ConanCenter|CRAN|crates.io|Debian|GHC|GitHub Actions|GIT|Go|Hackage|Hex|Linux|Maven|npm|NuGet|openSUSE|OSS-Fuzz|Packagist|Photon OS|Pub|PyPI|Red Hat|Rocky Linux|RubyGems|SUSE|SwiftURL|Ubuntu)([0-9]+)?" }, "prefix": { "type": "string",