diff --git a/.spectral.yaml b/.spectral.yaml index a64686716..53849f2e8 100644 --- a/.spectral.yaml +++ b/.spectral.yaml @@ -156,6 +156,17 @@ rules: functionOptions: match: "^(dev|qa|stage|prod)(,(dev|qa|stage|prod))*$" + no-slash-before-custom-method: + description: "Custom methods (e.g., ':applyItem') should not be preceded by a '/'." + message: "The path '{{path}}' contains a '/' before a custom method. Custom methods should not start with a '/'." + severity: error + given: "$.paths" + then: + field: "@key" + function: pattern + functionOptions: + notMatch: "/[^/]+/:[a-zA-Z]+$" + overrides: - files: # load sample data has an issue with different path param names for different VERBS - "*.yaml#/paths/~1api~1atlas~1v1.0~1groups~1%7BgroupId%7D~1sampleDatasetLoad~1%7BsampleDatasetId%7D"