From c83ad4131d87c150410e9952c60cce1904de7a1f Mon Sep 17 00:00:00 2001 From: Travis Gosselin Date: Wed, 27 Jul 2022 12:58:27 -0400 Subject: [PATCH 1/2] Update url-structure.ruleset.yml --- rulesets/src/url-structure.ruleset.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/rulesets/src/url-structure.ruleset.yml b/rulesets/src/url-structure.ruleset.yml index cb97b13..abb83a5 100644 --- a/rulesets/src/url-structure.ruleset.yml +++ b/rulesets/src/url-structure.ruleset.yml @@ -85,14 +85,15 @@ rules: functionOptions: match: "^(\\/|[a-z0-9-.]+|{[a-zA-Z0-9_]+})+$" - sps-paths-no-special-characters: - message: "A resource MUST only contain lowercase ISO basic Latin alphabet characters, the numeric characters `0-9`, and a hyphen or dash character. Parameters must be camel cased." - severity: error - given: $.paths.*~ - then: - function: pattern - functionOptions: - match: ^([0-9a-z-\/]*({[a-z][0-9a-zA-Z-]+})?)*$ + # Performance issue with spectral-cli and the regex provided - https://github.com/SPSCommerce/sps-api-standards/issues/26 + # sps-paths-no-special-characters: + # message: "A resource MUST only contain lowercase ISO basic Latin alphabet characters, the numeric characters `0-9`, and a hyphen or dash character. Parameters must be camel cased." + # severity: error + # given: $.paths.*~ + # then: + # function: pattern + # functionOptions: + # match: ^([0-9a-z-\/]*({[a-z][0-9a-zA-Z-]+})?)*$ sps-paths-trailing-slash: message: "A resource MUST be addressable without a trailing slash on the path." @@ -193,4 +194,4 @@ rules: functionOptions: notMatch: \? - \ No newline at end of file + From 7d4987dd0c043222eda614e90d39d21cc3af3257 Mon Sep 17 00:00:00 2001 From: travisgosselin Date: Wed, 27 Jul 2022 13:00:08 -0400 Subject: [PATCH 2/2] Remove Tests for now --- .../url-structure/sps-paths-no-special-characters.test.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rulesets/test/url-structure/sps-paths-no-special-characters.test.js b/rulesets/test/url-structure/sps-paths-no-special-characters.test.js index 73798f3..cd102df 100644 --- a/rulesets/test/url-structure/sps-paths-no-special-characters.test.js +++ b/rulesets/test/url-structure/sps-paths-no-special-characters.test.js @@ -9,7 +9,7 @@ describe("sps-paths-no-special-characters", () => { spectral = new SpectralTestHarness(ruleset); }); - test("succeeds with standard characters", async () => { + xtest("succeeds with standard characters", async () => { const spec = ` openapi: 3.1.0 paths: @@ -21,7 +21,7 @@ describe("sps-paths-no-special-characters", () => { await spectral.validateSuccess(spec, ruleName); }); - test("succeeds with interpolation", async () => { + xtest("succeeds with interpolation", async () => { const spec = ` openapi: 3.1.0 paths: @@ -33,7 +33,7 @@ describe("sps-paths-no-special-characters", () => { await spectral.validateSuccess(spec, ruleName); }); - test("fails special characters", async () => { + xtest("fails special characters", async () => { const spec = ` openapi: 3.1.0 paths: