Skip to content

Commit 2e5bceb

Browse files
CLOUDP-260965: Check that the extention x-xgen-hidden has the correct format (#119)
1 parent c15e8d0 commit 2e5bceb

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

.spectral.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,18 @@ rules:
144144
- required: ["examples"]
145145
- required: ["schema"]
146146

147+
x-xgen-hidden-env-format:
148+
description: "Ensure x-xgen-hidden-env extension has the correct format. https://go/openapi-hidden-extension"
149+
severity: error
150+
given: "$..x-xgen-hidden-env" # Match anywhere in the document
151+
then:
152+
- field: envs
153+
function: truthy
154+
- field: envs
155+
function: pattern
156+
functionOptions:
157+
match: "^(dev|qa|stage|prod)(,(dev|qa|stage|prod))*$"
158+
147159
overrides:
148160
- files: # load sample data has an issue with different path param names for different VERBS
149161
- "*.yaml#/paths/~1api~1atlas~1v1.0~1groups~1%7BgroupId%7D~1sampleDatasetLoad~1%7BsampleDatasetId%7D"

0 commit comments

Comments
 (0)