-
Notifications
You must be signed in to change notification settings - Fork 1
/
.spectral.yaml
71 lines (71 loc) · 1.92 KB
/
.spectral.yaml
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
rules:
oas3-unused-component: off
operation-operationId: error
operation-tags: error
operation-tag-defined: error
components-parameters-case:
description: components.parameters must use Pascal case
type: style
severity: error
given: "$.components.parameters[*]~"
then:
function: casing
functionOptions:
type: pascal
components-schemas-case:
description: components.schemas must use Pascal case
type: style
severity: error
given: "$.components.schemas[*]~"
then:
function: casing
functionOptions:
type: pascal
components-responses-case:
description: components.responses must use Pascal case
type: style
severity: error
given: "$.components.responses[*]~"
then:
function: casing
functionOptions:
type: pascal
paths-case:
description: paths must use kebab-case
type: style
severity: error
given: "$.paths[*]~"
then:
function: pattern
functionOptions:
match: '^(\/([a-z0-9-:]+|\{[a-zA-Z_]+\}|(\{[a-zA-Z_]+\}:[a-z0-9-]+)))+$'
fields-case-request:
description: fields must use snake_case
type: style
severity: error
given: "$.paths[*][*][requestBody][content][*][schema]..[properties]"
then:
field: "@key"
function: pattern
functionOptions:
match: "^(_?)[a-z0-9]+((_|\\.)?[a-z0-9])*$"
fields-case-response:
description: fields must use snake_case
type: style
severity: error
given: "$.paths[*][*][responses][*][content][*][schema]..[properties]"
then:
field: "@key"
function: pattern
functionOptions:
match: "^(_?)[a-z0-9]+((_|\\.)?[a-z0-9])*$"
operation-id-case:
description: operationIds must use lowerCamelCase
type: style
severity: error
given: "$.paths[*][*][operationId]"
then:
function: casing
functionOptions:
type: camel