From 7df02fa8ed5a0c5068c7e72cf5705b489c34a309 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 6e392a1387..184757439a 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\.1\.\d+(-.+)?$' + pattern: '^3\.1\.[0-9]+(-.+)?$' info: $ref: '#/$defs/info' jsonSchemaDialect: diff --git a/tests/schema/fail/openapi-version.yaml b/tests/schema/fail/openapi-version.yaml new file mode 100644 index 0000000000..a70838cb0d --- /dev/null +++ b/tests/schema/fail/openapi-version.yaml @@ -0,0 +1,5 @@ +openapi: 3.1.৪ +info: + title: BENGALI DIGIT FOUR is a valid digit, but not an ascii digit + version: 1.0.0 +paths: {}