Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save peteraritchie/40f950610612977235acb30bff5f6fc1 to your computer and use it in GitHub Desktop.
Save peteraritchie/40f950610612977235acb30bff5f6fc1 to your computer and use it in GitHub Desktop.
spectral-rules.yml
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