-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
31 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# References to the rules | ||
# OpenAPI: https://docs.stoplight.io/docs/spectral/4dec24461f3af-open-api-rules#openapi-rules | ||
# OWASP Top 10: https://apistylebook.stoplight.io/docs/owasp-top-10 | ||
# Documentations: https://github.com/stoplightio/spectral-documentation/blob/main/src/ruleset.ts | ||
# OWASP Top 10: https://github.com/stoplightio/spectral-owasp-ruleset/blob/v1.4.3/src/ruleset.ts | ||
# Documentations: https://github.com/stoplightio/spectral-documentation/blob/v1.3.1/src/ruleset.ts | ||
|
||
# cspell: words OWASP owasp | ||
|
||
|
@@ -10,3 +10,32 @@ extends: | |
- 'spectral:oas' | ||
- 'https://unpkg.com/@stoplight/[email protected]/dist/ruleset.mjs' | ||
- 'https://unpkg.com/@stoplight/[email protected]/dist/ruleset.mjs' | ||
|
||
aliases: | ||
PathItem: | ||
- $.paths[*] | ||
OperationObject: | ||
- $.paths[*][get,put,post,delete,options,head,patch,trace] | ||
DescribableObjects: | ||
- $.info | ||
- $.tags[*] | ||
- '#OperationObject' | ||
- '#OperationObject.responses[*]' | ||
- '#PathItem.parameters[?(@ && @.in)]' | ||
- '#OperationObject.parameters[?(@ && @.in)]' | ||
|
||
overrides: | ||
- files: ['*'] | ||
rules: | ||
# Override documnent description rule | ||
# - No limitations on the characters that can start or end a sentence. | ||
# - Length should be >= 20 characters | ||
docs-description: | ||
given: '#DescribableObjects' | ||
then: | ||
- field: 'description' | ||
function: 'truthy' | ||
- field: 'description' | ||
function: 'length' | ||
functionOptions: | ||
min: 20 |