Skip to content

Commit b9b4ba3

Browse files
morganleroimillotp
andauthored
feat(specs): add CSV source (#1301)
Co-authored-by: Pierre Millot <[email protected]>
1 parent 2be188f commit b9b4ba3

File tree

1 file changed

+31
-15
lines changed

1 file changed

+31
-15
lines changed

specs/ingestion/common/schemas/source.yml

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ SourceSearch:
9595

9696
SourceType:
9797
type: string
98-
enum: ['bigcommerce', 'commercetools', 'json']
98+
enum: ['bigcommerce', 'commercetools', 'json', 'csv']
9999

100100
SourceCommercetools:
101101
type: object
@@ -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,11 +146,37 @@ SourceJson:
146146
required:
147147
- url
148148

149+
MappingTypeCSV:
150+
type: string
151+
enum: ['string','integer','float','boolean','json']
152+
153+
SourceCSV:
154+
type: object
155+
additionalProperties: false
156+
properties:
157+
url:
158+
type: string
159+
description: The URL of the file.
160+
uniqueIDColumn:
161+
type: string
162+
description: The name of the column that contains the unique ID, used as `objectID` in Algolia.
163+
mapping:
164+
type: object
165+
description: >
166+
Mapping of type for every column. For example {"myColumn": "boolean", "myOtherColumn": "json"}.
167+
additionalProperties:
168+
$ref: '#/MappingTypeCSV'
169+
method:
170+
$ref: '#/MethodType'
171+
required:
172+
- url
173+
149174
SourceInput:
150175
oneOf:
151176
- $ref: '#/SourceCommercetools'
152177
- $ref: '#/SourceBigCommerce'
153-
- $ref: '#/SourceJson'
178+
- $ref: '#/SourceJSON'
179+
- $ref: '#/SourceCSV'
154180

155181
SourceUpdateCommercetools:
156182
type: object
@@ -168,19 +194,9 @@ SourceUpdateCommercetools:
168194
items:
169195
type: string
170196

171-
SourceUpdateJson:
172-
type: object
173-
additionalProperties: false
174-
properties:
175-
url:
176-
type: string
177-
description: The URL of the file.
178-
method:
179-
$ref: '#/MethodType'
180-
required:
181-
- url
182197

183198
SourceUpdateInput:
184199
oneOf:
185200
- $ref: '#/SourceUpdateCommercetools'
186-
- $ref: '#/SourceUpdateJson'
201+
- $ref: '#/SourceJSON'
202+
- $ref: '#/SourceCSV'

0 commit comments

Comments
 (0)