Skip to content

CLOUDP-307054-2: Extend linting to report invalid placement of x-xgen… #561

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions tools/spectral/.spectral.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,28 @@ rules:
functionOptions:
match: "^(dev|qa|stage|prod)(,(dev|qa|stage|prod))*$"

no-hidden-env-extension-in-invalid-places:
description: "The x-xgen-hidden-env extension should not be placed in invalid locations."
message: "The x-xgen-hidden-env extension is not allowed in this location."
severity: error
given: "$..x-xgen-hidden-env"
then:
field: "$ref"
function: falsy
functionOptions:
paths:
- "$.components.parameters[*].x-xgen-hidden-env"
- "$.components.headers[*].x-xgen-hidden-env"
- "$.components.links[*].x-xgen-hidden-env"
- "$.components.callbacks[*].x-xgen-hidden-env"
- "$.components.examples[*].x-xgen-hidden-env"
- "$.components.securitySchemes[*].x-xgen-hidden-env"
- "$.components.x-xgen-hidden-env"
- "$.paths[*][*].parameters[*].x-xgen-hidden-env"
- "$.paths[*][*].parameters[*].schema.x-xgen-hidden-env"
- "$.paths[*][*].parameters[*].content[*].schema.x-xgen-hidden-env"


soa-migration-extension:
description: "Ensure the x-xgen-soa-migration extension is valid."
message: "The x-xgen-soa-migration extension must include 'additionalServices', 'targetService', 'allowDocsDiff', and 'docsSource'."
Expand Down
Loading