-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathenable-banking-rules.yml
More file actions
98 lines (89 loc) · 2.78 KB
/
Copy pathenable-banking-rules.yml
File metadata and controls
98 lines (89 loc) · 2.78 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
documentationUrl: https://github.com/api-evangelist/enable-banking
rules:
enable-banking-info-title-required:
description: Info object must have a title.
given: $.info
severity: error
then:
field: title
function: truthy
enable-banking-info-version-required:
description: Info object must have a version.
given: $.info
severity: error
then:
field: version
function: truthy
enable-banking-servers-must-include-production:
description: Enable Banking specs should advertise https://api.enablebanking.com as the primary server.
given: $.servers
severity: warn
then:
function: schema
functionOptions:
schema:
type: array
contains:
type: object
properties:
url:
const: https://api.enablebanking.com
enable-banking-bearer-security-required:
description: Enable Banking uses bearer JWT security; all operations should inherit bearerAuth.
given: $
severity: error
then:
field: security
function: truthy
enable-banking-operation-id-snake-case:
description: Operation IDs in Enable Banking specs follow snake_case_with_path suffix.
given: $.paths[*][get,post,put,patch,delete].operationId
severity: warn
then:
function: pattern
functionOptions:
match: ^[a-z][a-z0-9_]*$
enable-banking-operation-summary-required:
description: Every operation must have a summary.
given: $.paths[*][get,post,put,patch,delete]
severity: warn
then:
field: summary
function: truthy
enable-banking-operation-summary-title-case:
description: Operation summaries should be in Title Case.
given: $.paths[*][get,post,put,patch,delete].summary
severity: hint
then:
function: pattern
functionOptions:
match: ^([A-Z][a-z0-9]*)(\s+([A-Z][a-z0-9]*|of|for|in|to|by|the|a|an|with|and|or))*$
enable-banking-tag-allowed:
description: Operations should be tagged with one of the four canonical Enable Banking tags.
given: $.paths[*][get,post,put,patch,delete].tags[*]
severity: warn
then:
function: enumeration
functionOptions:
values:
- User sessions
- Accounts data
- Payments
- Misc
enable-banking-no-trailing-slash:
description: Enable Banking paths do not use trailing slashes.
given: $.paths
severity: warn
then:
function: pattern
functionOptions:
notMatch: /$
enable-banking-no-internal-fields:
description: Component schemas must not expose internal fields prefixed with underscore.
given: $.components.schemas[*].properties.*~
severity: warn
then:
function: pattern
functionOptions:
notMatch: ^_