|
| 1 | +openapi: 3.0.2 |
| 2 | +servers: |
| 3 | + - url: /api |
| 4 | +info: |
| 5 | + version: 2.4.0 |
| 6 | + title: GripMock API Schema |
| 7 | +tags: |
| 8 | + - name: stubs |
| 9 | + description: Stubs storage management |
| 10 | + - name: healthcheck |
| 11 | + description: Healthcheck |
| 12 | +paths: |
| 13 | + # healthcheck |
| 14 | + /health/liveness: |
| 15 | + get: |
| 16 | + tags: |
| 17 | + - healthcheck |
| 18 | + summary: Liveness check |
| 19 | + description: The test says that the service is alive and yet |
| 20 | + operationId: liveness |
| 21 | + responses: |
| 22 | + '200': |
| 23 | + description: Successful operation |
| 24 | + content: |
| 25 | + application/json: |
| 26 | + schema: |
| 27 | + $ref: '#/components/schemas/MessageOK' |
| 28 | + /health/readiness: |
| 29 | + get: |
| 30 | + tags: |
| 31 | + - healthcheck |
| 32 | + summary: Readiness check |
| 33 | + description: The test indicates readiness to receive traffic |
| 34 | + operationId: readiness |
| 35 | + responses: |
| 36 | + '200': |
| 37 | + description: Successful operation |
| 38 | + content: |
| 39 | + application/json: |
| 40 | + schema: |
| 41 | + $ref: '#/components/schemas/MessageOK' |
| 42 | + |
| 43 | + # stubs |
| 44 | + /stubs/used: |
| 45 | + get: |
| 46 | + tags: |
| 47 | + - stubs |
| 48 | + summary: Getting a list of used stubs |
| 49 | + description: The list is needed to quickly find used stubs |
| 50 | + operationId: listUsedStubs |
| 51 | + responses: |
| 52 | + '200': |
| 53 | + description: Successful operation |
| 54 | + content: |
| 55 | + application/json: |
| 56 | + schema: |
| 57 | + $ref: '#/components/schemas/StubList' |
| 58 | + /stubs/unused: |
| 59 | + get: |
| 60 | + tags: |
| 61 | + - stubs |
| 62 | + summary: Getting a list of unused stubs |
| 63 | + description: The list is needed to quickly find unused stubs |
| 64 | + operationId: listUnusedStubs |
| 65 | + responses: |
| 66 | + '200': |
| 67 | + description: Successful operation |
| 68 | + content: |
| 69 | + application/json: |
| 70 | + schema: |
| 71 | + $ref: '#/components/schemas/StubList' |
| 72 | + /stubs: |
| 73 | + get: |
| 74 | + tags: |
| 75 | + - stubs |
| 76 | + summary: Getting a list of stubs |
| 77 | + description: The list of stubs is required to view all added stubs |
| 78 | + operationId: listStubs |
| 79 | + responses: |
| 80 | + '200': |
| 81 | + description: Successful operation |
| 82 | + content: |
| 83 | + application/json: |
| 84 | + schema: |
| 85 | + $ref: '#/components/schemas/StubList' |
| 86 | + post: |
| 87 | + tags: |
| 88 | + - stubs |
| 89 | + summary: Add a new stub to the store |
| 90 | + description: Add a new stub to the store |
| 91 | + operationId: addStub |
| 92 | + responses: |
| 93 | + '200': |
| 94 | + description: Successful operation |
| 95 | + content: |
| 96 | + application/json: |
| 97 | + schema: |
| 98 | + oneOf: |
| 99 | + - $ref: '#/components/schemas/ListID' |
| 100 | + requestBody: |
| 101 | + description: Create a new pet in the store |
| 102 | + required: true |
| 103 | + content: |
| 104 | + application/json: |
| 105 | + schema: |
| 106 | + oneOf: |
| 107 | + - $ref: '#/components/schemas/StubList' |
| 108 | + - $ref: '#/components/schemas/Stub' |
| 109 | + delete: |
| 110 | + tags: |
| 111 | + - stubs |
| 112 | + summary: Remove all stubs |
| 113 | + description: Completely clears the stub storage |
| 114 | + operationId: purgeStubs |
| 115 | + responses: |
| 116 | + '204': |
| 117 | + description: Successful operation |
| 118 | + /stubs/batchDelete: |
| 119 | + post: |
| 120 | + tags: |
| 121 | + - stubs |
| 122 | + summary: Deletes a pack by IDs |
| 123 | + description: Takes IDs as input and deletes them |
| 124 | + operationId: batchStubsDelete |
| 125 | + responses: |
| 126 | + '204': |
| 127 | + description: Successful operation |
| 128 | + requestBody: |
| 129 | + description: Create a new pet in the store |
| 130 | + required: true |
| 131 | + content: |
| 132 | + application/json: |
| 133 | + schema: |
| 134 | + $ref: '#/components/schemas/ListID' |
| 135 | + '/stubs/{uuid}': |
| 136 | + delete: |
| 137 | + tags: |
| 138 | + - stubs |
| 139 | + summary: Deletes stub by ID |
| 140 | + description: The method removes the stub by ID |
| 141 | + operationId: deleteStubByID |
| 142 | + parameters: |
| 143 | + - name: uuid |
| 144 | + in: path |
| 145 | + description: ID of stub |
| 146 | + required: true |
| 147 | + schema: |
| 148 | + $ref: '#/components/schemas/ID' |
| 149 | + responses: |
| 150 | + '204': |
| 151 | + description: successful operation |
| 152 | + '/stubs/search': |
| 153 | + post: |
| 154 | + tags: |
| 155 | + - stubs |
| 156 | + summary: Stub storage search |
| 157 | + description: Performs a search for a stub by the given conditions |
| 158 | + operationId: searchStubs |
| 159 | + responses: |
| 160 | + '200': |
| 161 | + description: Successful operation |
| 162 | + content: |
| 163 | + application/json: |
| 164 | + schema: |
| 165 | + $ref: '#/components/schemas/SearchResponse' |
| 166 | + requestBody: |
| 167 | + description: Description of filtering |
| 168 | + required: true |
| 169 | + content: |
| 170 | + application/json: |
| 171 | + schema: |
| 172 | + $ref: '#/components/schemas/SearchRequest' |
| 173 | +components: |
| 174 | + schemas: |
| 175 | + # health |
| 176 | + MessageOK: |
| 177 | + type: object |
| 178 | + required: |
| 179 | + - message |
| 180 | + - time |
| 181 | + properties: |
| 182 | + message: |
| 183 | + type: string |
| 184 | + time: |
| 185 | + type: string |
| 186 | + format: date-time |
| 187 | + # stubs |
| 188 | + ID: |
| 189 | + type: string |
| 190 | + format: uuid |
| 191 | + example: 51c50050-ec27-4dae-a583-a32ca71a1dd5 |
| 192 | + ListID: |
| 193 | + type: array |
| 194 | + items: |
| 195 | + $ref: '#/components/schemas/ID' |
| 196 | + StubList: |
| 197 | + type: array |
| 198 | + items: |
| 199 | + $ref: '#/components/schemas/Stub' |
| 200 | + SearchRequest: |
| 201 | + type: object |
| 202 | + required: |
| 203 | + - service |
| 204 | + - method |
| 205 | + - data |
| 206 | + properties: |
| 207 | + id: |
| 208 | + $ref: '#/components/schemas/ID' |
| 209 | + service: |
| 210 | + type: string |
| 211 | + example: Gripmock |
| 212 | + method: |
| 213 | + type: string |
| 214 | + example: SayHello |
| 215 | + headers: |
| 216 | + type: object |
| 217 | + additionalProperties: |
| 218 | + type: string |
| 219 | + x-go-type-skip-optional-pointer: true |
| 220 | + data: |
| 221 | + type: object |
| 222 | + x-go-type: interface{} |
| 223 | + additionalProperties: true |
| 224 | + SearchResponse: |
| 225 | + type: object |
| 226 | + required: |
| 227 | + - data |
| 228 | + - error |
| 229 | + properties: |
| 230 | + headers: |
| 231 | + type: object |
| 232 | + additionalProperties: |
| 233 | + type: string |
| 234 | + x-go-type-skip-optional-pointer: true |
| 235 | + data: |
| 236 | + type: object |
| 237 | + x-go-type: interface{} |
| 238 | + additionalProperties: true |
| 239 | + error: |
| 240 | + type: string |
| 241 | + example: Message not found |
| 242 | + code: |
| 243 | + type: integer |
| 244 | + format: uint32 |
| 245 | + x-go-type: codes.Code |
| 246 | + x-go-type-import: |
| 247 | + name: codes |
| 248 | + path: google.golang.org/grpc/codes |
| 249 | + example: 3 |
| 250 | + Stub: |
| 251 | + type: object |
| 252 | + required: |
| 253 | + - service |
| 254 | + - method |
| 255 | + - input |
| 256 | + - output |
| 257 | + properties: |
| 258 | + id: |
| 259 | + $ref: '#/components/schemas/ID' |
| 260 | + service: |
| 261 | + type: string |
| 262 | + example: Gripmock |
| 263 | + method: |
| 264 | + type: string |
| 265 | + example: SayHello |
| 266 | + headers: |
| 267 | + $ref: '#/components/schemas/StubHeaders' |
| 268 | + input: |
| 269 | + $ref: '#/components/schemas/StubInput' |
| 270 | + output: |
| 271 | + $ref: '#/components/schemas/StubOutput' |
| 272 | + StubInput: |
| 273 | + type: object |
| 274 | + properties: |
| 275 | + ignoreArrayOrder: |
| 276 | + type: boolean |
| 277 | + default: false |
| 278 | + equals: |
| 279 | + type: object |
| 280 | + additionalProperties: true |
| 281 | + x-go-type-skip-optional-pointer: true |
| 282 | + contains: |
| 283 | + type: object |
| 284 | + additionalProperties: true |
| 285 | + x-go-type-skip-optional-pointer: true |
| 286 | + matches: |
| 287 | + type: object |
| 288 | + additionalProperties: true |
| 289 | + x-go-type-skip-optional-pointer: true |
| 290 | + StubHeaders: |
| 291 | + type: object |
| 292 | + x-go-type-skip-optional-pointer: true |
| 293 | + properties: |
| 294 | + equals: |
| 295 | + type: object |
| 296 | + additionalProperties: |
| 297 | + type: string |
| 298 | + x-go-type-skip-optional-pointer: true |
| 299 | + contains: |
| 300 | + type: object |
| 301 | + additionalProperties: |
| 302 | + type: string |
| 303 | + x-go-type-skip-optional-pointer: true |
| 304 | + matches: |
| 305 | + type: object |
| 306 | + additionalProperties: |
| 307 | + type: string |
| 308 | + x-go-type-skip-optional-pointer: true |
| 309 | + StubOutput: |
| 310 | + type: object |
| 311 | + required: |
| 312 | + - data |
| 313 | + - error |
| 314 | + properties: |
| 315 | + data: |
| 316 | + type: object |
| 317 | + additionalProperties: true |
| 318 | + headers: |
| 319 | + type: object |
| 320 | + additionalProperties: |
| 321 | + type: string |
| 322 | + x-go-type-skip-optional-pointer: true |
| 323 | + error: |
| 324 | + type: string |
| 325 | + example: Message not found |
| 326 | + code: |
| 327 | + type: integer |
| 328 | + format: uint32 |
| 329 | + x-go-type: codes.Code |
| 330 | + x-go-type-import: |
| 331 | + name: codes |
| 332 | + path: google.golang.org/grpc/codes |
| 333 | + example: 3 |
0 commit comments