From d3144069632b88125a60878b3af555e7b45856ae Mon Sep 17 00:00:00 2001 From: Sam Mesterton-Gibbons Date: Thu, 12 Feb 2026 13:56:26 +0000 Subject: [PATCH 1/2] test(harness): Add test with relative ref Adds a test using an example object with an `externalValue` containing a relative reference. --- test-harness/scenarios/oas3.1/petstore.scenario | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test-harness/scenarios/oas3.1/petstore.scenario b/test-harness/scenarios/oas3.1/petstore.scenario index a7bb6f96b..9711cd2ff 100644 --- a/test-harness/scenarios/oas3.1/petstore.scenario +++ b/test-harness/scenarios/oas3.1/petstore.scenario @@ -92,6 +92,8 @@ paths: value: lastName: Baker dateOfBirth: '1985-10-02' + Example With External Value: + externalValue: ./{asset:externalExample.json} /users: post: summary: Create New User @@ -194,6 +196,10 @@ components: extends: [[spectral:oas, off]] rules: oas3-schema: error +====asset:externalExample.json==== +{ + "lastName": "Watson" +} ====command==== {bin} lint {document} --ruleset {asset:ruleset.yaml} ====stdout==== From 71a7ead95dcaf3f585463c8b78be862f9d3e4b8e Mon Sep 17 00:00:00 2001 From: Sam Mesterton-Gibbons Date: Thu, 12 Feb 2026 13:56:34 +0000 Subject: [PATCH 2/2] fix(rulesets): Allow relative externalValue OpenAPI 3.1.0 allowed `externalValue` in an examples object to be a relative reference. This makes that permitted by the ruleset. Fixes #2819 --- packages/rulesets/src/oas/schemas/oas/v3.1/index.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/rulesets/src/oas/schemas/oas/v3.1/index.json b/packages/rulesets/src/oas/schemas/oas/v3.1/index.json index 95a33ef24..3961aa28c 100644 --- a/packages/rulesets/src/oas/schemas/oas/v3.1/index.json +++ b/packages/rulesets/src/oas/schemas/oas/v3.1/index.json @@ -803,7 +803,7 @@ "value": true, "externalValue": { "type": "string", - "format": "uri" + "format": "uri-reference" } }, "not": {