forked from flashbots/relay-specs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.spectral.yml
29 lines (29 loc) · 930 Bytes
/
.spectral.yml
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
extends: [["spectral:oas", "all"]]
formats: ["oas3"]
rules:
operation-singular-tag: off
oas3-parameter-description: off
contact-properties: off
operation-tags: error
openapi-tags-alphabetical: error
operation-tag-defined: error
paths-snake-case:
description: All YAML paths MUST follow snake-case
severity: error
recommended: true
message: "path is not snake-case: {{error}}"
given: $.paths[*]~
then:
function: pattern
functionOptions:
match: "^\/([a-z0-9]+(_[a-z0-9]+)*)?(\/[a-z0-9]+(_[a-z0-9]+)*|\/{.+})*$"
parameters-snake-case-alphanumeric:
description: Path parameters MUST follow snake case
severity: error
recommended: true
message: "{{property}} parameter is not snake case: {{error}}"
given: $..parameters[?(@.in == 'path' || @.in == 'query')].name
then:
function: pattern
functionOptions:
match: "^[a-z][_a-z0-9]+$"