Skip to content

Commit d805a5b

Browse files
committed
CLOUDP-307054-2: Extend linting to report invalid placement of x-xgen-hidden-env
1 parent 52b526b commit d805a5b

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

tools/spectral/.spectral.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,28 @@ rules:
158158
functionOptions:
159159
match: "^(dev|qa|stage|prod)(,(dev|qa|stage|prod))*$"
160160

161+
no-hidden-env-extension-in-invalid-places:
162+
description: "The x-xgen-hidden-env extension should not be placed in invalid locations."
163+
message: "The x-xgen-hidden-env extension is not allowed in this location."
164+
severity: error
165+
given: "$..x-xgen-hidden-env"
166+
then:
167+
field: "$ref"
168+
function: falsy
169+
functionOptions:
170+
paths:
171+
- "$.components.parameters[*].x-xgen-hidden-env"
172+
- "$.components.headers[*].x-xgen-hidden-env"
173+
- "$.components.links[*].x-xgen-hidden-env"
174+
- "$.components.callbacks[*].x-xgen-hidden-env"
175+
- "$.components.examples[*].x-xgen-hidden-env"
176+
- "$.components.securitySchemes[*].x-xgen-hidden-env"
177+
- "$.components.x-xgen-hidden-env"
178+
- "$.paths[*][*].parameters[*].x-xgen-hidden-env"
179+
- "$.paths[*][*].parameters[*].schema.x-xgen-hidden-env"
180+
- "$.paths[*][*].parameters[*].content[*].schema.x-xgen-hidden-env"
181+
182+
161183
soa-migration-extension:
162184
description: "Ensure the x-xgen-soa-migration extension is valid."
163185
message: "The x-xgen-soa-migration extension must include 'additionalServices', 'targetService', 'allowDocsDiff', and 'docsSource'."

0 commit comments

Comments
 (0)