Skip to content

Commit 5ed4855

Browse files
committed
feat(specs): add CSV source
1 parent 595ca4a commit 5ed4855

File tree

1 file changed

+37
-7
lines changed

1 file changed

+37
-7
lines changed

specs/ingestion/common/schemas/source.yml

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ MethodType:
134134
type: string
135135
enum: ['GET', 'POST']
136136

137-
SourceJson:
137+
SourceJSON:
138138
type: object
139139
additionalProperties: false
140140
properties:
@@ -146,18 +146,26 @@ SourceJson:
146146
required:
147147
- url
148148

149-
SourceCsv:
149+
MappingTypeCSV:
150+
type: string
151+
enum: ['string','integer','float','boolean','json']
152+
153+
SourceCSV:
150154
type: object
151155
additionalProperties: false
152156
properties:
153157
url:
154158
type: string
159+
description: The URL of the file.
155160
uniqueIDColumn:
156161
type: string
162+
description: The name of the column that contains the unique ID.
157163
mapping:
158164
type: object
165+
description: >
166+
Mapping of type for every column. For example {"myColumn": "boolean, "myOtherColumn": "json"}.
159167
additionalProperties:
160-
type: string
168+
$ref: '#/MappingTypeCSV'
161169
method:
162170
$ref: '#/MethodType'
163171
required:
@@ -167,8 +175,8 @@ SourceInput:
167175
oneOf:
168176
- $ref: '#/SourceCommercetools'
169177
- $ref: '#/SourceBigCommerce'
170-
- $ref: '#/SourceJson'
171-
- $ref: '#/SourceCsv'
178+
- $ref: '#/SourceJSON'
179+
- $ref: '#/SourceCSV'
172180

173181
SourceUpdateCommercetools:
174182
type: object
@@ -186,13 +194,34 @@ SourceUpdateCommercetools:
186194
items:
187195
type: string
188196

189-
SourceUpdateJson:
197+
SourceUpdateJSON:
198+
type: object
199+
additionalProperties: false
200+
properties:
201+
url:
202+
type: string
203+
description: The URL of the file.
204+
method:
205+
$ref: '#/MethodType'
206+
required:
207+
- url
208+
209+
SourceUpdateCSV:
190210
type: object
191211
additionalProperties: false
192212
properties:
193213
url:
194214
type: string
195215
description: The URL of the file.
216+
uniqueIDColumn:
217+
type: string
218+
description: The name of the column that contains the unique ID.
219+
mapping:
220+
type: object
221+
description: >
222+
Mapping of type for every column. For example {"myColumn": "boolean, "myOtherColumn": "json"}.
223+
additionalProperties:
224+
$ref: '#/MappingTypeCSV'
196225
method:
197226
$ref: '#/MethodType'
198227
required:
@@ -201,4 +230,5 @@ SourceUpdateJson:
201230
SourceUpdateInput:
202231
oneOf:
203232
- $ref: '#/SourceUpdateCommercetools'
204-
- $ref: '#/SourceUpdateJson'
233+
- $ref: '#/SourceUpdateJSON'
234+
- $ref: '#/SourceUpdateCSV'

0 commit comments

Comments
 (0)