-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathspectral.yaml
120 lines (108 loc) · 3 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
extends: spectral:oas
formats: ["oas3_1"]
rules:
require-openapi-rule:
severity: error
message: openapi field must be present with a non empty value
given: $
then:
field: openapi
function: truthy
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\\.\\-_]+$"
operation-id-length-rule:
severity: warn
message: operationID length should be between 4 and 50
given: "$.paths.[*].operationId"
then:
function: length
functionOptions:
max: 85
min: 4
operationId-should-be-pascal-case:
description: operationIds should be PascalCase.
type: style
given: "$.paths.[*].operationId"
severity: error
message: "{{property}} should be PascalCase"
then:
function: casing
functionOptions:
type: pascal
schemas-should-be-pascal-case:
description: Schemas should be PascalCase.
type: style
given: "$.components['schemas'].*~"
severity: error
message: "{{property}} should be PascalCase"
then:
function: casing
functionOptions:
type: pascal
responses-should-be-pascal-case:
description: Responses should be PascalCase.
type: style
given: "$.components['responses'].*~"
severity: error
message: "{{property}} should be PascalCase"
then:
function: casing
functionOptions:
type: pascal
parameters-should-be-pascal-case:
description: Parameters should be PascalCase.
type: style
given: "$.components['parameters'].*~"
severity: error
message: "{{property}} should be PascalCase"
then:
function: casing
functionOptions:
type: pascal
examples-should-be-pascal-case:
description: Examples should be PascalCase.
type: style
given: "$.components['examples'].*~"
severity: error
message: "{{property}} should be PascalCase"
then:
function: casing
functionOptions:
type: pascal
requestBodies-should-be-pascal-case:
description: requestBodies should be PascalCase.
type: style
given: "$.components['requestBodies'].*~"
severity: error
message: "{{property}} should be PascalCase"
then:
function: casing
functionOptions:
type: pascal
headers-should-be-pascal-case:
description: Headers should be PascalCase.
type: style
given: "$.components['headers'].*~"
severity: error
message: "{{property}} should be PascalCase"
then:
function: casing
functionOptions:
type: pascal
securitySchemes-should-be-pascal-case:
description: Headers should be PascalCase.
type: style
given: "$.components['securitySchemes'].*~"
severity: error
message: "{{property}} should be PascalCase"
then:
function: casing
functionOptions:
type: pascal