-
Notifications
You must be signed in to change notification settings - Fork 276
/
openapi.yaml
338 lines (333 loc) · 11.1 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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
openapi: 3.0.0
info:
description: |
Connector Builder Server API
version: "1.0.0"
title: Connector Builder Server API
contact:
email: contact@airbyte.io
license:
name: MIT
url: "https://opensource.org/licenses/MIT"
externalDocs:
description: Find out more about Connector Builder
url: "https://docs.airbyte.com/connector-development/config-based/overview/"
paths:
/v1/stream/read:
post:
summary: Reads a specific stream in the source. TODO in a later phase - only read a single slice of data.
operationId: readStream
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/StreamReadRequestBody"
required: true
responses:
"200":
description: Successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/StreamRead"
"400":
$ref: "#/components/responses/ExceptionResponse"
"422":
$ref: "#/components/responses/InvalidInputResponse"
/v1/streams/list:
post:
summary: List all streams present in the connector manifest, along with their specific request URLs
operationId: listStreams
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/StreamsListRequestBody"
required: true
responses:
"200":
description: Successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/StreamsListRead"
"400":
$ref: "#/components/responses/ExceptionResponse"
"422":
$ref: "#/components/responses/InvalidInputResponse"
/v1/manifest_template:
get:
summary: Return a connector manifest template to use as the default value for the yaml editor
operationId: getManifestTemplate
responses:
"200":
description: Successful operation
content:
application/json:
schema:
type: string
description: Connector manifest template string
/v1/manifest/resolve:
post:
summary: Given a JSON manifest, returns a JSON manifest with all of the $refs and $options resolved and flattened
operationId: resolveManifest
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/ResolveManifestRequestBody"
required: true
responses:
"200":
description: Successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/ResolveManifest"
"400":
$ref: "#/components/responses/ExceptionResponse"
"422":
$ref: "#/components/responses/InvalidInputResponse"
components:
schemas:
StreamRead:
type: object
required:
- logs
- slices
- test_read_limit_reached
properties:
logs:
type: array
description: The LOG AirbyteMessages that were emitted during the read of this slice
items:
type: object
# $ref: "#/components/schemas/AirbyteProtocol/definitions/AirbyteLogMessage"
slices:
type: array
description: The stream slices returned from the read command. If no stream slicer is configured, this should contain a single item containing all of the results.
items:
type: object
required:
- pages
properties:
pages:
type: array
description: The pages returned from the read command. If no pagination is configured, this should contain a single item containing all of the results.
items:
type: object
required:
- records
properties:
records:
type: array
description: The RECORD AirbyteMessages coming from the read operation for this page
items:
type: object
# $ref: "#/components/schemas/AirbyteProtocol/definitions/AirbyteRecordMessage"
request:
$ref: "#/components/schemas/HttpRequest"
response:
$ref: "#/components/schemas/HttpResponse"
sliceDescriptor:
type: object
description: "An object describing the current slice. This can be omitted if a stream slicer is not configured."
properties:
startDatetime:
type: string
format: date-time
listItem:
type: string
state:
type: object
description: The STATE AirbyteMessage emitted at the end of this slice. This can be omitted if a stream slicer is not configured.
# $ref: "#/components/schemas/AirbyteProtocol/definitions/AirbyteStateMessage"
test_read_limit_reached:
type: boolean
description: Whether the maximum number of request per slice or the maximum number of slices queried has been reached
inferred_schema:
type: object
description: The narrowest JSON Schema against which every AirbyteRecord in the slices can validate successfully. This is inferred from reading every record in the output slices.
StreamReadRequestBody:
type: object
required:
- manifest
- stream
- config
properties:
manifest:
type: object
description: The config-based connector manifest contents
# $ref: "#/components/schemas/ConnectorManifest"
stream:
type: string
description: Name of the stream to read
config:
type: object
description: The config blob containing the user inputs for testing
state:
type: object
description: The AirbyteStateMessage object to use as the starting state for this read
# $ref: "#/components/schemas/AirbyteProtocol/definitions/AirbyteStateMessage"
record_limit:
type: integer
minimum: 1
maximum: 1000
description: Number of records that will be returned to the client from the connector builder (max of 1000)
# --- Potential addition for a later phase ---
# numPages:
# type: integer
# description: Number of pages to read from the source for each slice
# default: 1
HttpRequest:
type: object
required:
- url
- http_method
properties:
url:
type: string
description: URL that the request was sent to
parameters:
type: object
description: The request parameters that were set on the HTTP request, if any
body:
type: object
description: The body of the HTTP request, if present
headers:
type: object
description: The headers of the HTTP request, if any
http_method:
type: string
enum: ["GET", "POST", "PUT", "PATCH"]
description: The http method of the request ("GET", "POST", "PUT", or "PATCH")
HttpResponse:
type: object
required:
- status
properties:
status:
type: integer
description: The status of the response
body:
type: object
description: The body of the HTTP response, if present
headers:
type: object
description: The headers of the HTTP response, if any
# --- Commenting out for now since they do not work with our orval openapi client generator ---
# ConnectorManifest:
# $ref: ../../../../airbyte-cdk/python/airbyte_cdk/sources/declarative/config_component_schema.json
# AirbyteProtocol:
# $ref: ../../../../airbyte-protocol/protocol-models/src/main/resources/airbyte_protocol/airbyte_protocol.yaml
StreamsListRequestBody:
type: object
required:
- manifest
- config
properties:
manifest:
type: object
description: The config-based connector manifest contents
# $ref: "#/components/schemas/ConnectorManifest"
config:
type: object
description: The config blob containing the user inputs for testing
StreamsListRead:
type: object
required:
- streams
properties:
streams:
type: array
items:
type: object
description: The stream names present in the connector manifest
required:
- name
- url
properties:
name:
type: string
description: The name of the stream
url:
type: string
description: The URL to which read requests will be made for this stream
# --- Potential addition for a later phase ---
# slices:
# type: array
# description: list of slices that will be retrieved for this stream
# items:
# type: object
ResolveManifestRequestBody:
type: object
required:
- manifest
properties:
manifest:
type: object
description: The config-based connector manifest contents
ResolveManifest:
type: object
required:
- manifest
properties:
manifest:
type: object
description: The config-based connector manifest contents with $refs and $options resolved
# The following exception structs were copied from airbyte-api/src/main/openapi/config.yaml
InvalidInputProperty:
type: object
required:
- propertyPath
properties:
propertyPath:
type: string
invalidValue:
type: string
message:
type: string
KnownExceptionInfo:
type: object
required:
- message
properties:
message:
type: string
exceptionClassName:
type: string
exceptionStack:
type: array
items:
type: string
InvalidInputExceptionInfo:
type: object
required:
- message
- validationErrors
properties:
message:
type: string
exceptionClassName:
type: string
exceptionStack:
type: array
items:
type: string
validationErrors:
type: array
items:
$ref: "#/components/schemas/InvalidInputProperty"
responses:
InvalidInputResponse:
description: Input failed validation
content:
application/json:
schema:
$ref: "#/components/schemas/InvalidInputExceptionInfo"
ExceptionResponse:
description: Exception occurred; see message for details.
content:
application/json:
schema:
$ref: "#/components/schemas/KnownExceptionInfo"