-
Notifications
You must be signed in to change notification settings - Fork 1
/
openapi.yaml
127 lines (119 loc) · 3.61 KB
/
openapi.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
119
120
121
122
123
124
125
126
127
openapi: 3.0.2
info:
title: Idempotent Request Service
description: "Idempotent Request Service."
contact:
email: [email protected]
version: 2.0.0
externalDocs:
description: Repository
url: https://gitlab.checkrhq.net/platform/tools/idempotent-request
servers:
- url: http://localhost:8080/api/v2
tags:
- name: Captures
description: HTTP requests captures
paths:
/captures:
put:
tags:
- Captures
summary: Allocate a new request capture
description: Allocate a new request capture
operationId: allocateCapture
requestBody:
$ref: '#/components/requestBodies/AllocateCaptureRequest'
responses:
200:
description: A previous request has been completed and its response was captured
content:
application/json:
schema:
$ref: '#/components/schemas/CaptureRecord'
202:
description: A new request has been captured and will be processed. It should be updated with corresponding upstream response
400:
description: A malformed payload
409:
description: Another request with the same idempotency key is being processed
422:
description: Unprocessable entity. Idempotency key encoding is not compliant
post:
tags:
- Captures
summary: Record a capture for a processed request and its response
description: Record a capture for a processed request and its response
operationId: recordCapture
requestBody:
$ref: '#/components/requestBodies/RecordCaptureRequest'
responses:
200:
description: Successful operation
400:
description: Invalid input
403:
description: Capture has been completed or has not been allocated
components:
requestBodies:
AllocateCaptureRequest:
description: Information, which is required to allocate a capture
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/CaptureAllocation"
RecordCaptureRequest:
description: Response obtained after processing a request, capture of which we need to record.
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/CaptureRecord"
schemas:
RequestIdempotencyKey:
type: string
description: Base64 URL safe encoded without padding (RFC 4648) Idempotency Key to distinguish requests
format: byte
example: "QkE2OTlCQjctNTg2QS00Qzk4LTk2OEYtRUY4NjVFRTBDODVG"
ResponseHeader:
type: object
properties:
key:
type: string
example: "Set-Cookie"
value:
type: string
example: "secret"
Capture:
required:
- response_status
- response_body
- response_headers
type: object
properties:
response_status:
type: integer
example: 200
response_body:
type: string
example: '{"resource_id": "123"}'
response_headers:
type: array
items:
$ref: "#/components/schemas/ResponseHeader"
CaptureAllocation:
required:
- idempotency_key
properties:
idempotency_key:
$ref: '#/components/schemas/RequestIdempotencyKey'
CaptureRecord:
required:
- idempotency_key
- response
type: object
properties:
idempotency_key:
$ref: '#/components/schemas/RequestIdempotencyKey'
response:
$ref: '#/components/schemas/Capture'