-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflutterwave-rules.yml
More file actions
94 lines (94 loc) · 3.19 KB
/
Copy pathflutterwave-rules.yml
File metadata and controls
94 lines (94 loc) · 3.19 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
extends:
- spectral:oas
rules:
flutterwave-info-contact:
description: All Flutterwave OpenAPI specs must declare an info.contact block pointing to the developer portal.
given: $.info
severity: warn
then:
field: contact
function: truthy
flutterwave-info-license:
description: All Flutterwave OpenAPI specs must include an info.license block.
given: $.info
severity: warn
then:
field: license
function: truthy
flutterwave-server-url-cloud:
description: Flutterwave production server URL must be on api.flutterwave.cloud.
given: $.servers[?(@.description == 'Production')].url
severity: error
then:
function: pattern
functionOptions:
match: '^https://api\\.flutterwave\\.cloud/f4b/production'
flutterwave-server-url-sandbox:
description: Flutterwave sandbox server URL must be on api.flutterwave.cloud/f4b/sandbox.
given: $.servers[?(@.description == 'Sandbox')].url
severity: warn
then:
function: pattern
functionOptions:
match: '^https://api\\.flutterwave\\.cloud/f4b/sandbox'
flutterwave-operation-summary-title-case:
description: Operation summaries must be Title Case.
given: $.paths[*][get,post,put,delete,patch].summary
severity: warn
then:
function: pattern
functionOptions:
match: '^([A-Z][a-zA-Z0-9]*\\s?)+$'
flutterwave-operation-id-camel-case:
description: operationId must be camelCase.
given: $.paths[*][get,post,put,delete,patch].operationId
severity: warn
then:
function: pattern
functionOptions:
match: '^[a-z][a-zA-Z0-9]*$'
flutterwave-mutating-ops-idempotency-key:
description: POST and PUT operations should accept an X-Idempotency-Key header.
given: $.paths[*][post,put]
severity: info
then:
field: parameters
function: truthy
flutterwave-security-oauth2:
description: Flutterwave APIs must declare OAuth2 client credentials security.
given: $.components.securitySchemes
severity: error
then:
field: OAuth2
function: truthy
flutterwave-snake-case-properties:
description: Schema property names must be snake_case (matches Flutterwave's JSON conventions).
given: $.components.schemas[*].properties[*]~
severity: warn
then:
function: pattern
functionOptions:
match: '^[a-z][a-z0-9_]*$'
flutterwave-monetary-fields-have-currency:
description: When an `amount` property is present, a sibling `currency` property must also be defined.
given: $.components.schemas[?(@.properties.amount)].properties
severity: warn
then:
field: currency
function: truthy
flutterwave-id-fields-are-strings:
description: All `id` properties must be strings (Flutterwave IDs are opaque strings, not integers).
given: $.components.schemas[*].properties.id
severity: error
then:
field: type
function: enumeration
functionOptions:
values: [string]
flutterwave-status-uses-enum:
description: Lifecycle `status` properties should be enumerated.
given: $.components.schemas[?(@.properties.status)].properties.status
severity: info
then:
field: enum
function: truthy