-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstatsd-admin-interface-rules.yml
More file actions
67 lines (61 loc) · 1.92 KB
/
Copy pathstatsd-admin-interface-rules.yml
File metadata and controls
67 lines (61 loc) · 1.92 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
extends:
- - spectral:oas
- all
rules:
statsd-summary-title-case:
description: Every operation summary MUST be in Title Case.
severity: warn
given: $.paths[*][*].summary
then:
function: pattern
functionOptions:
match: '^(?:[A-Z][A-Za-z0-9]*)(?: [A-Z][A-Za-z0-9]*)*$'
statsd-operation-description-required:
description: Every operation MUST have a description.
severity: error
given: $.paths[*][get,post,put,delete,patch]
then:
field: description
function: truthy
statsd-operation-id-camel-case:
description: operationId MUST be lowerCamelCase.
severity: warn
given: $.paths[*][*].operationId
then:
function: pattern
functionOptions:
match: '^[a-z][a-zA-Z0-9]*$'
statsd-tag-defined-titlecase:
description: All tags MUST be defined in the top-level `tags` array and use Title Case.
severity: warn
given: $.tags[*].name
then:
function: pattern
functionOptions:
match: '^(?:[A-Z][A-Za-z0-9]*)(?: [A-Z][A-Za-z0-9]*)*$'
statsd-admin-text-plain-responses:
description: >-
The StatsD admin interface returns plain-text payloads natively. Every
2xx response in the admin OpenAPI MUST advertise a `text/plain` media
type (even when also exposing JSON-shaped schemas for parsed consumers).
severity: info
given: $.paths[*][get,post].responses['200'].content
then:
field: text/plain
function: truthy
statsd-admin-default-port-documented:
description: The admin TCP port SHOULD be exposed as a server variable with default 8126.
severity: info
given: $.servers[*].variables.port
then:
field: default
function: truthy
statsd-no-trailing-slash:
description: Paths MUST NOT end with a trailing slash.
severity: warn
given: $.paths
then:
function: pattern
functionOptions:
notMatch: '.+/$'
field: '@key'