-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathamtrust-financial-services-spectral-rules.yml
More file actions
88 lines (79 loc) · 2.16 KB
/
Copy pathamtrust-financial-services-spectral-rules.yml
File metadata and controls
88 lines (79 loc) · 2.16 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
extends: "spectral:oas"
rules:
info-title-amtrust:
description: API title must include AmTrust Financial Services
severity: warn
given: "$.info.title"
then:
function: pattern
functionOptions:
match: "^AmTrust"
info-description-required:
description: Info must have a description
severity: error
given: "$.info"
then:
field: description
function: truthy
servers-https-only:
description: All servers must use HTTPS
severity: error
given: "$.servers[*].url"
then:
function: pattern
functionOptions:
match: "^https://"
operation-summary-required:
description: All operations must have summaries
severity: error
given: "$.paths[*][get,post,put,patch,delete]"
then:
field: summary
function: truthy
operation-operationid-required:
description: All operations must have operationIds
severity: error
given: "$.paths[*][get,post,put,patch,delete]"
then:
field: operationId
function: truthy
operation-tags-required:
description: All operations must have tags
severity: error
given: "$.paths[*][get,post,put,patch,delete]"
then:
field: tags
function: truthy
parameter-description-required:
description: All parameters must have descriptions
severity: warn
given: "$.paths[*][*].parameters[*]"
then:
field: description
function: truthy
response-success-required:
description: All operations must have success responses
severity: error
given: "$.paths[*][get,post,put,patch,delete].responses"
then:
function: schema
functionOptions:
schema:
anyOf:
- required: ['200']
- required: ['201']
- required: ['204']
security-schemes-defined:
description: Security schemes must be defined
severity: error
given: "$.components"
then:
field: securitySchemes
function: truthy
schema-properties-typed:
description: Schema properties should have explicit types
severity: warn
given: "$.components.schemas[*].properties[*]"
then:
field: type
function: truthy