-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparcellab-rules.yml
More file actions
71 lines (71 loc) · 2.02 KB
/
Copy pathparcellab-rules.yml
File metadata and controls
71 lines (71 loc) · 2.02 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
extends: [[spectral:oas, recommended]]
documentationUrl: https://docs.parcellab.com/docs/developers/getting-started/api-reference
rules:
parcellab-info-contact:
description: parcelLab specs must point at parcelLab developer support.
given: $.info.contact
severity: warn
then:
- field: name
function: truthy
- field: url
function: pattern
functionOptions:
match: "^https://docs\\.parcellab\\.com/.*"
parcellab-versioned-paths:
description: Operations live under /v4/ — the current API version.
given: $.paths.*~
severity: error
then:
function: pattern
functionOptions:
match: "^/v[0-9]+/"
parcellab-operation-id-camel:
description: Operation IDs use camelCase.
given: $.paths[*][*].operationId
severity: warn
then:
function: pattern
functionOptions:
match: "^[a-z][a-zA-Z0-9]+$"
parcellab-summary-title-case:
description: Operation summaries use Title Case.
given: $.paths[*][*].summary
severity: warn
then:
function: pattern
functionOptions:
match: "^([A-Z][a-zA-Z0-9]*)(\\s+[A-Z/][a-zA-Z0-9/]*)*$"
parcellab-auth-token-header:
description: Define the Parcellab-API-Token apiKey security scheme on the Authorization header.
given: $.components.securitySchemes
severity: error
then:
function: schema
functionOptions:
schema:
type: object
minProperties: 1
parcellab-tag-set:
description: Use the canonical parcelLab tag set.
given: $.tags[*].name
severity: warn
then:
function: enumeration
functionOptions:
values:
- Orders
- Events
- Place Info
- Promise
- Returns
- Campaigns
- Surveys
parcellab-trailing-slash:
description: parcelLab paths end with a trailing slash, matching the published API.
given: $.paths.*~
severity: warn
then:
function: pattern
functionOptions:
match: ".*/$"