-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmicrocks-vacuum-rules.yaml
118 lines (110 loc) · 2.99 KB
/
microcks-vacuum-rules.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
functions:
- oas-verify-mocks-vacuum
extends: [[spectral:oas, off]]
rules:
microcks-info-extension-valid:
description: x-microcks extension must be valid
message: "x-microcks extension must be valid"
formats:
- oas3
severity: warn
given: "$.info"
then:
field: x-microcks
function: schema
functionOptions:
schema:
type: object
properties:
labels:
type: object
additionalProperties:
type: string
required:
- labels
additionalProperties: false
microcks-operation-extension-valid:
description: x-microcks-operation extension must be valid
message: "x-microcks-operation extension must be valid"
formats:
- oas3
severity: warn
given: "$.paths.*.*"
then:
field: x-microcks-operation
function: schema
functionOptions:
schema:
type: object
properties:
delay:
type: number
format: int32
frequency:
type: number
format: int32
dispatcher:
type: string
dispatcherRules:
type: string
parameterConstraints:
type: array
items:
type: object
properties:
name:
type: string
in:
type: string
enum: [path, query, header]
required:
type: boolean
recopy:
type: boolean
mustMatchRegexp:
type: string
required:
- name
- in
additionalProperties: false
oas3-valid-media-example: true
oas3-valid-schema-example: true
microcks-examples-in-parameter:
description: Parameters should have examples
message: "Parameters should have examples"
formats:
- oas3
severity: info
given: "$..parameters"
then:
field: examples
function: truthy
microcks-examples-in-request-content:
description: Request with content must have examples
message: "Request with content must have examples"
formats:
- oas3
severity: warn
given: "$.paths..requestBody..content.*"
then:
field: examples
function: truthy
microcks-examples-in-response-content:
description: Response with content must have examples
message: "Response with content must have examples"
formats:
- oas3
severity: warn
given: "$.paths..responses..content.*"
then:
field: examples
function: truthy
microcks-examples-fragments-to-complete-mocks:
description: Response example must match required params examples to form full mocks
message: "{{error}}"
formats:
- oas3
severity: warn
given: "$.paths.*.*"
then:
function: oas-verify-mocks-vacuum