From 99c28f7782ba7522ce1b4e23993786a07bd56cf1 Mon Sep 17 00:00:00 2001 From: Gareth Jones Date: Wed, 9 Oct 2024 15:00:06 +1300 Subject: [PATCH] feat: create dedicated ecosystem name enum with all ecosystems Signed-off-by: Gareth Jones --- validation/schema.json | 50 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 47 insertions(+), 3 deletions(-) diff --git a/validation/schema.json b/validation/schema.json index b9db4a8..236b5e3 100644 --- a/validation/schema.json +++ b/validation/schema.json @@ -56,7 +56,7 @@ "type": "object", "properties": { "ecosystem": { - "$ref": "#/$defs/ecosystem" + "$ref": "#/$defs/ecosystemWithSuffix" }, "name": { "type": "string" @@ -296,11 +296,55 @@ "modified" ], "$defs": { - "ecosystem": { + "ecosystemName": { "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|Chainguard|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|Wolfi)(:[0-9]+)?" + "enum": [ + "AlmaLinux", + "Alpine", + "Android", + "Bioconductor", + "Bitnami", + "Chainguard", + "ConanCenter", + "CRAN", + "crates.io", + "Debian", + "GHC", + "GitHub Actions", + "Go", + "Hackage", + "Hex", + "Linux", + "Mageia", + "Maven", + "npm", + "NuGet", + "OSS-Fuzz", + "openSUSE", + "Packagist", + "Photon OS", + "Pub", + "PyPI", + "Red Hat", + "Rocky Linux", + "RubyGems", + "SUSE", + "SwiftURL", + "Ubuntu", + "Wolfi" + ] + }, + "ecosystemSuffix": { + "type": "string", + "pattern": ":.+" + }, + "ecosystemWithSuffix": { + "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|Chainguard|ConanCenter|CRAN|crates\\.io|Debian|GHC|GitHub Actions|Go|Hackage|Hex|Linux|Mageia|Maven|npm|NuGet|OSS-Fuzz|openSUSE|Packagist|Photon OS|Pub|PyPI|Red Hat|Rocky Linux|RubyGems|SUSE|SwiftURL|Ubuntu|Wolfi|GIT)(:.+)?$" }, "prefix": { "type": "string",