Forked from svx/gist:096473518d1a6a2e4019071ee7fc1b22
Created
December 15, 2021 16:13
-
-
Save peteraritchie/40f950610612977235acb30bff5f6fc1 to your computer and use it in GitHub Desktop.
spectral-rules.yml
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
extends: [[spectral:oas, all]] | |
rules: | |
# Default spectral OAS rules | |
# https://stoplight.io/p/docs/gh/stoplightio/spectral/docs/reference/openapi-rules.md | |
oas3-unused-components-schema: false | |
operation-default-response: false | |
# Custom rules | |
tag-descriptions: | |
description: Tags must have a description. | |
given: $.tags[*] | |
severity: error | |
recommended: true | |
then: | |
field: description | |
function: truthy | |
operation-summary-formatted: | |
description: Operation `summary` should start with upper case and end with a dot. | |
recommended: false | |
type: style | |
given: "$.paths.*[?( @property === 'get' || @property === 'put' || @property === | |
'post' || @property === 'delete' || @property === 'options' || @property === | |
'head' || @property === 'patch' || @property === 'trace' )]" | |
then: | |
field: summary | |
function: pattern | |
functionOptions: | |
match: "^[A-Z].*\\.$" | |
tags: | |
- operation |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment