forked from twilio/twilio-oai
-
Notifications
You must be signed in to change notification settings - Fork 0
/
spectral.yaml
54 lines (48 loc) · 1.25 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
46
47
48
49
50
51
52
53
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
pascal-case-param-name-rule:
severity: error
recommended: true
message: Path parameter names should be capitalized.
type: style
given: "$.paths.[*].parameters.[*].name"
then:
function: pattern
functionOptions:
match: "^[A-Z].*"
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