From 0a47f2bfc032600ab37bac45c6d2d605f92c5ba7 Mon Sep 17 00:00:00 2001 From: Srinivas Chippagiri Date: Mon, 30 Nov 2026 14:43:04 -0800 Subject: [PATCH] fix(schema): accept SchemaVersion majors of 0 and 10+ The major part was [1-9]+, so 0.1.0 and 10.0.1 failed validation. Use (0|[1-9][0-9]*) like the minor and patch parts allow any number, without a leading zero in the major. Fixes #239 Signed-off-by: Srinivas Chippagiri --- docs/editor/js/schema-fallback.js | 2 +- docs/schema.md | 2 +- spec/schema.cue | 2 +- spec/schema.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/editor/js/schema-fallback.js b/docs/editor/js/schema-fallback.js index 15d4da9..7604bb8 100644 --- a/docs/editor/js/schema-fallback.js +++ b/docs/editor/js/schema-fallback.js @@ -34,7 +34,7 @@ const SchemaFallback = SchemaFallbackParser.createSchema( "description": "SchemaVersion is a version string in the format X.Y.Z", "kind": "primitive", "type": "string", - "pattern": "^[1-9]+\\.[0-9]+\\.[0-9]+$" + "pattern": "^(0|[1-9][0-9]*)\\.[0-9]+\\.[0-9]+$" }, "#Assessment": { "name": "#Assessment", diff --git a/docs/schema.md b/docs/schema.md index 1067a0f..68952d9 100644 --- a/docs/schema.md +++ b/docs/schema.md @@ -491,7 +491,7 @@ Email is a valid email address SchemaVersion is a version string in the format X.Y.Z - **Type**: `string` -- **Value**: `^[1-9]+\\.[0-9]+\\.[0-9]+$` +- **Value**: `^(0|[1-9][0-9]*)\\.[0-9]+\\.[0-9]+$` --- diff --git a/spec/schema.cue b/spec/schema.cue index 0903403..3b70bf2 100644 --- a/spec/schema.cue +++ b/spec/schema.cue @@ -16,7 +16,7 @@ import ( #Date: time.Format("2006-01-02") // SchemaVersion is a version string in the format X.Y.Z -#SchemaVersion: =~"^[1-9]+\\.[0-9]+\\.[0-9]+$" +#SchemaVersion: =~"^(0|[1-9][0-9]*)\\.[0-9]+\\.[0-9]+$" // Assessment represents the results of a security assessment, including comments, evidence, and date. #Assessment: { diff --git a/spec/schema.md b/spec/schema.md index 619d1c2..556d537 100644 --- a/spec/schema.md +++ b/spec/schema.md @@ -484,7 +484,7 @@ Email is a valid email address SchemaVersion is a version string in the format X.Y.Z - **Type**: `string` -- **Value**: `^[1-9]+\\.[0-9]+\\.[0-9]+$` +- **Value**: `^(0|[1-9][0-9]*)\\.[0-9]+\\.[0-9]+$` ---