-
Notifications
You must be signed in to change notification settings - Fork 81
/
spectral.yaml
45 lines (40 loc) · 1.04 KB
/
spectral.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
extends: spectral:oas
rules:
no-$ref-siblings: false
component-name-rule:
severity: error
recommended: true
message: Semantic error - Component names can only contain the characters A-Z a-z 0-9 - . _
given: $..components.schemas[*]~
then:
function: pattern
functionOptions:
match: "^[a-zA-Z0-9\\.\\-_]+$"
pascal-case-name-rule:
severity: error
recommended: true
message: OperationId should be PascalCased.
type: style
given: "$.paths.[*].operationId"
then:
function: casing
functionOptions:
type: pascal
require-openapi-rule:
severity: error
message: openapi field must be present with a non empty value
given: $
then:
field: openapi
function: truthy
operation-id-length-rule:
severity: warn
message: OperationID length should be between 4 and 50
given: "$.paths.[*].operationId"
then:
function: length
functionOptions:
max: 50
min: 4
# Disable example checks
oas3-valid-media-example: off