-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.yaml
More file actions
141 lines (141 loc) · 3.29 KB
/
Copy pathopenapi.yaml
File metadata and controls
141 lines (141 loc) · 3.29 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
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
openapi: 3.0.0
info:
title: Mock Server API
version: 1.0.0
description: API for managing mock expectations
paths:
/api/expectation:
post:
summary: Add a new expectation
operationId: addExpectation
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ExpectationCreate'
responses:
'201':
description: Expectation created
content:
application/json:
schema:
$ref: '#/components/schemas/ExpectationId'
'400':
description: Invalid request
'500':
description: Internal server error
/api/expectation/{id}:
get:
summary: Check if an expectation was matched
operationId: checkExpectation
parameters:
- name: id
in: path
required: true
schema:
type: string
format: uuid
responses:
'200':
description: Match status
content:
application/json:
schema:
$ref: '#/components/schemas/MatchStatus'
'400':
description: Missing ID
'404':
description: Expectation not found
delete:
summary: Remove an expectation
operationId: removeExpectation
parameters:
- name: id
in: path
required: true
schema:
type: string
format: uuid
responses:
'204':
description: Expectation removed
'400':
description: Missing ID
'404':
description: Expectation not found
/api/expectations:
get:
summary: Get all expectations
operationId: getExpectations
responses:
'200':
description: List of expectations
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Expectation'
components:
schemas:
Expectation:
type: object
properties:
id:
type: string
format: uuid
matched_count:
type: integer
method:
type: string
path:
type: string
request:
type: string
status:
type: integer
headers:
type: object
additionalProperties:
type: string
mock:
type: string
ExpectationCreate:
type: object
required:
- method
- path
properties:
method:
type: string
example: GET
path:
type: string
example: /api/test
request:
type: string
description: Regex for request body matching
status:
type: integer
default: 200
headers:
type: object
additionalProperties:
type: string
mock:
type: string
description: Response body or @filename
ExpectationId:
type: object
properties:
id:
type: string
format: uuid
MatchStatus:
type: object
properties:
matched:
type: boolean
matched_count:
type: integer