-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsplit-rules.yml
More file actions
98 lines (87 loc) · 2.72 KB
/
Copy pathsplit-rules.yml
File metadata and controls
98 lines (87 loc) · 2.72 KB
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
extends: [[spectral:oas, recommended]]
rules:
split-operation-id-required:
description: All operations must have an operationId.
severity: error
given: "$.paths[*][get,post,put,patch,delete,head,options]"
then:
field: operationId
function: truthy
split-operation-id-verb-prefix:
description: operationId must start with a standard REST verb.
severity: warn
given: "$.paths[*][get,post,put,patch,delete].operationId"
then:
function: pattern
functionOptions:
match: "^(get|list|create|update|delete|enable|restore|kill|add|remove|upload|approve|deactivate|invite|track)[A-Z][a-zA-Z0-9]+$"
split-summary-title-case:
description: Operation summaries must use Title Case.
severity: warn
given: "$.paths[*][get,post,put,patch,delete].summary"
then:
function: pattern
functionOptions:
match: "^[A-Z][a-zA-Z0-9 /()-]+$"
split-tags-required:
description: Every operation must have at least one tag.
severity: warn
given: "$.paths[*][get,post,put,patch,delete]"
then:
field: tags
function: truthy
split-bearer-auth-required:
description: Operations must use bearerAuth security scheme.
severity: error
given: "$.components.securitySchemes"
then:
field: bearerAuth
function: truthy
split-response-200-required:
description: Every operation must define a 200 or 201 success response.
severity: error
given: "$.paths[*][get,post,put,patch,delete].responses"
then:
function: schema
functionOptions:
schema:
anyOf:
- required: ["200"]
- required: ["201"]
split-401-response-required:
description: Every operation must define a 401 Unauthorized response.
severity: warn
given: "$.paths[*][get,post,put,patch,delete].responses"
then:
function: schema
functionOptions:
schema:
required: ["401"]
split-pagination-params:
description: List operations should support limit and offset query parameters.
severity: info
given: "$.paths[*].get.operationId"
then:
function: pattern
functionOptions:
match: "^list"
split-workspace-id-path-param:
description: Workspace-scoped paths must use workspaceId path parameter.
severity: info
given: "$.paths[~/ws/{workspaceId}]"
then:
function: truthy
split-servers-required:
description: The API must define at least one server.
severity: error
given: "$"
then:
field: servers
function: truthy
split-info-contact-required:
description: The info object must include a contact entry.
severity: warn
given: "$.info"
then:
field: contact
function: truthy