Skip to content

Commit aed20fe

Browse files
shortcutsmillotp
andauthored
feat(specs): add more descriptions to the Ingestion API (#1273)
Co-authored-by: Pierre Millot <[email protected]>
1 parent 6747f5c commit aed20fe

29 files changed

+265
-150
lines changed

specs/ingestion/common/authenticationParameters.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
type:
22
name: type
33
in: query
4-
description: Which type the returned authentication should have. Can be a list of string separated with commas.
4+
description: The type of the authentications to retrieve.
55
required: false
66
style: form
77
explode: false
@@ -14,7 +14,7 @@ type:
1414
platform:
1515
name: platform
1616
in: query
17-
description: Which platform the returned authentication should have. Can be a list of string separated with commas.
17+
description: The platform of the authentications to retrieve.
1818
required: false
1919
style: form
2020
explode: false
@@ -24,7 +24,12 @@ platform:
2424
$ref: '#/platformWithNone'
2525
example: commercetools,none
2626

27+
platformNone:
28+
type: string
29+
description: Used to filter Authentication without platform property.
30+
enum: ['none']
31+
2732
platformWithNone:
2833
oneOf:
2934
- $ref: './schemas/authentication.yml#/Platform'
30-
- $ref: './schemas/authentication.yml#/PlatformNone'
35+
- $ref: '#/platformNone'

specs/ingestion/common/destinationParameters.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
type:
22
name: type
33
in: query
4-
description: Which type the returned destination should have. Can be a list of string separated with commas.
4+
description: The type of the destinations to retrive.
55
required: false
66
style: form
77
explode: false
@@ -14,11 +14,11 @@ type:
1414
authenticationID:
1515
name: authenticationID
1616
in: query
17-
description: Which authenticationID the returned destination should have. Can be a list of string separated with commas.
17+
description: The authenticationIDs of the destinations to retrive.
1818
required: false
1919
style: form
2020
explode: false
2121
schema:
2222
type: array
2323
items:
24-
type: string
24+
$ref: './schemas/common.yml#/authenticationID'

specs/ingestion/common/observabilityParameters.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ taskID:
3030
in: query
3131
description: Filter by taskID.
3232
schema:
33-
type: string
33+
$ref: './schemas/common.yml#/taskID'

specs/ingestion/common/parameters.yml

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,50 @@
1-
authenticationID:
1+
pathAuthenticationID:
22
name: authenticationID
33
in: path
4-
description: The authentication uuid.
54
required: true
5+
description: The authentication UUID.
66
schema:
7-
type: string
8-
example: 6c02aeb1-775e-418e-870b-1faccd4b2c0f
7+
$ref: './schemas/common.yml#/authenticationID'
98

10-
destinationID:
9+
pathDestinationID:
1110
name: destinationID
1211
in: path
13-
description: The destination uuid.
1412
required: true
13+
description: The destination UUID.
1514
schema:
16-
type: string
17-
example: 6c02aeb1-775e-418e-870b-1faccd4b2c0f
15+
$ref: './schemas/common.yml#/destinationID'
1816

19-
sourceID:
17+
pathSourceID:
2018
name: sourceID
2119
in: path
22-
description: The source uuid.
2320
required: true
21+
description: The source UUID.
2422
schema:
25-
type: string
26-
example: 6c02aeb1-775e-418e-870b-1faccd4b2c0f
23+
$ref: './schemas/common.yml#/sourceID'
2724

28-
taskID:
25+
pathTaskID:
2926
name: taskID
3027
in: path
31-
description: The task uuid.
3228
required: true
29+
description: The task UUID.
3330
schema:
34-
type: string
35-
example: 6c02aeb1-775e-418e-870b-1faccd4b2c0f
31+
$ref: './schemas/common.yml#/taskID'
3632

37-
runID:
33+
pathRunID:
3834
name: runID
3935
in: path
40-
description: The run uuid.
4136
required: true
37+
description: The run UUID.
4238
schema:
43-
type: string
44-
example: 6c02aeb1-775e-418e-870b-1faccd4b2c0f
39+
$ref: './schemas/common.yml#/runID'
4540

46-
eventID:
41+
pathEventID:
4742
name: eventID
4843
in: path
49-
description: The event uuid.
5044
required: true
45+
description: The event UUID.
5146
schema:
52-
type: string
53-
example: 6c02aeb1-775e-418e-870b-1faccd4b2c0f
47+
$ref: './schemas/common.yml#/eventID'
5448

5549
itemsPerPage:
5650
name: itemsPerPage

specs/ingestion/common/schemas/authentication.yml

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
Authentication:
22
type: object
3+
description: An authentication is used to login into a Source or a Destination.
34
additionalProperties: false
45
properties:
56
authenticationID:
6-
type: string
7+
$ref: './common.yml#/authenticationID'
78
type:
89
$ref: '#/AuthenticationType'
910
name:
10-
type: string
11+
$ref: './common.yml#/name'
1112
platform:
1213
$ref: '#/Platform'
1314
createdAt:
@@ -26,6 +27,7 @@ AuthenticationWithInput:
2627
- $ref: '#/Authentication'
2728
- type: object
2829
title: authenticationInput
30+
description: The authentication input property stores the (encrypted) credentials.
2931
additionalProperties: false
3032
properties:
3133
input:
@@ -35,12 +37,13 @@ AuthenticationWithInput:
3537

3638
AuthenticationCreate:
3739
type: object
40+
description: The payload when creating an authentication.
3841
additionalProperties: false
3942
properties:
4043
type:
4144
$ref: '#/AuthenticationType'
4245
name:
43-
type: string
46+
$ref: './common.yml#/name'
4447
platform:
4548
$ref: '#/Platform'
4649
input:
@@ -52,12 +55,13 @@ AuthenticationCreate:
5255

5356
AuthenticationCreateResponse:
5457
type: object
58+
description: Response from the API when the Authentication is successfully created.
5559
additionalProperties: false
5660
properties:
5761
authenticationID:
58-
type: string
62+
$ref: './common.yml#/authenticationID'
5963
name:
60-
type: string
64+
$ref: './common.yml#/name'
6165
createdAt:
6266
$ref: './common.yml#/createdAt'
6367
required:
@@ -67,12 +71,13 @@ AuthenticationCreateResponse:
6771

6872
AuthenticationUpdate:
6973
type: object
74+
description: Payload to partialy update an Authentication.
7075
additionalProperties: false
7176
properties:
7277
type:
7378
$ref: '#/AuthenticationType'
7479
name:
75-
type: string
80+
$ref: './common.yml#/name'
7681
platform:
7782
$ref: '#/Platform'
7883
input:
@@ -81,11 +86,12 @@ AuthenticationUpdate:
8186
AuthenticationUpdateResponse:
8287
type: object
8388
additionalProperties: false
89+
description: Response from the API when the Authentication is successfully updated.
8490
properties:
8591
authenticationID:
86-
type: string
92+
$ref: './common.yml#/authenticationID'
8793
name:
88-
type: string
94+
$ref: './common.yml#/name'
8995
updatedAt:
9096
$ref: './common.yml#/updatedAt'
9197
required:
@@ -96,40 +102,44 @@ AuthenticationUpdateResponse:
96102
AuthenticationSearch:
97103
type: object
98104
additionalProperties: false
105+
description: Payload to search for multiple authentications, based on the given `authenticationIDs`.
99106
properties:
100107
authenticationIDs:
101108
type: array
102109
items:
103-
type: string
110+
$ref: './common.yml#/authenticationID'
104111
required:
105112
- authenticationIDs
106113

107114
AuthenticationType:
108115
type: string
116+
description: Type of the Authentication, defines what kind of object is stored in the input.
109117
enum: ['googleServiceAccount', 'basic', 'apiKey', 'oauth', 'algolia']
110118

111119
Platform:
112120
type: string
121+
description: Describe which platform the Authentication is used for.
113122
enum: ['bigcommerce', 'commercetools']
114123

115-
PlatformNone:
116-
type: string
117-
enum: ['none']
118-
119124
AuthGoogleServiceAccount:
120125
type: object
126+
description: Authentication input to connect to a Google service (e.g. BigQuery).
121127
additionalProperties: false
122128
properties:
123129
clientEmail:
124130
type: string
131+
description: Email address of the Service Account.
132+
125133
privateKey:
126134
type: string
135+
description: Private key of the Service Account.
127136
required:
128137
- clientEmail
129138
- privateKey
130139

131140
AuthBasic:
132141
type: object
142+
description: Authentication input for Basic login with username and password.
133143
additionalProperties: false
134144
properties:
135145
username:
@@ -142,6 +152,7 @@ AuthBasic:
142152

143153
AuthAPIKey:
144154
type: object
155+
description: Authentication input used for token credentials.
145156
additionalProperties: false
146157
properties:
147158
key:
@@ -151,16 +162,18 @@ AuthAPIKey:
151162

152163
AuthOAuth:
153164
type: object
165+
description: Authentication input for OAuth login.
154166
additionalProperties: false
155167
properties:
156168
url:
157169
type: string
170+
description: The OAuth endpoint URL.
158171
client_id:
159172
type: string
173+
description: The clientID.
160174
client_secret:
161175
type: string
162-
scope:
163-
type: string
176+
description: The secret.
164177
required:
165178
- url
166179
- client_id
@@ -172,8 +185,10 @@ AuthAlgolia:
172185
properties:
173186
appID:
174187
type: string
188+
description: Algolia Application ID.
175189
apiKey:
176190
type: string
191+
description: Algolia API Key, with the correct rights to push to an index and change settings.
177192
required:
178193
- appID
179194
- apiKey

specs/ingestion/common/schemas/common.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,37 @@ DeleteResponse:
2626
description: Date of deletion (RFC3339 format).
2727
required:
2828
- deletedAt
29+
30+
authenticationID:
31+
type: string
32+
description: The authentication UUID.
33+
example: 6c02aeb1-775e-418e-870b-1faccd4b2c0f
34+
35+
destinationID:
36+
type: string
37+
description: The destination UUID.
38+
example: 6c02aeb1-775e-418e-870b-1faccd4b2c0f
39+
40+
sourceID:
41+
type: string
42+
description: The source UUID.
43+
example: 6c02aeb1-775e-418e-870b-1faccd4b2c0f
44+
45+
taskID:
46+
type: string
47+
description: The task UUID.
48+
example: 6c02aeb1-775e-418e-870b-1faccd4b2c0f
49+
50+
runID:
51+
type: string
52+
description: The run UUID.
53+
example: 6c02aeb1-775e-418e-870b-1faccd4b2c0f
54+
55+
eventID:
56+
type: string
57+
description: The event UUID.
58+
example: 6c02aeb1-775e-418e-870b-1faccd4b2c0f
59+
60+
name:
61+
type: string
62+
description: An human readable name describing the object.

0 commit comments

Comments
 (0)