From 25e6398238de9441534fda2aa33705d5006f0b10 Mon Sep 17 00:00:00 2001 From: Karen Etheridge Date: Sun, 30 Aug 2026 15:11:57 -0700 Subject: [PATCH] fix regex for openapi version The "pattern" keyword is defined as following unicode semantics, where \d will match digits outside of the ascii range. But this is not likely to be treated as a valid version, so we must restrict to ascii digits. --- src/schemas/validation/schema.yaml | 2 +- tests/schema/fail/openapi-version.yaml | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 tests/schema/fail/openapi-version.yaml diff --git a/src/schemas/validation/schema.yaml b/src/schemas/validation/schema.yaml index 135e14ff52..e8896b505d 100644 --- a/src/schemas/validation/schema.yaml +++ b/src/schemas/validation/schema.yaml @@ -7,7 +7,7 @@ type: object properties: openapi: type: string - pattern: '^3\.2\.\d+(-.+)?$' + pattern: '^3\.2\.[0-9]+(-.+)?$' $self: type: string format: uri-reference diff --git a/tests/schema/fail/openapi-version.yaml b/tests/schema/fail/openapi-version.yaml new file mode 100644 index 0000000000..afed313cd7 --- /dev/null +++ b/tests/schema/fail/openapi-version.yaml @@ -0,0 +1,5 @@ +openapi: 3.2.৪ +info: + title: BENGALI DIGIT FOUR is a valid digit, but not an ascii digit + version: 1.0.0 +paths: {}