Skip to content

Commit

Permalink
fix: update rules and ref to doc
Browse files Browse the repository at this point in the history
  • Loading branch information
bkioshn committed Jan 25, 2024
1 parent ae10091 commit 05c7241
Showing 1 changed file with 31 additions and 2 deletions.
33 changes: 31 additions & 2 deletions catalyst-gateway/.spectral.yml
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

Expand All @@ -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

0 comments on commit 05c7241

Please sign in to comment.