Skip to content

feat(specs): add CSV source #1301

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Feb 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 31 additions & 15 deletions specs/ingestion/common/schemas/source.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ SourceSearch:

SourceType:
type: string
enum: ['bigcommerce', 'commercetools', 'json']
enum: ['bigcommerce', 'commercetools', 'json', 'csv']

SourceCommercetools:
type: object
Expand Down Expand Up @@ -134,7 +134,7 @@ MethodType:
type: string
enum: ['GET', 'POST']

SourceJson:
SourceJSON:
type: object
additionalProperties: false
properties:
Expand All @@ -146,11 +146,37 @@ SourceJson:
required:
- url

MappingTypeCSV:
type: string
enum: ['string','integer','float','boolean','json']

SourceCSV:
type: object
additionalProperties: false
properties:
url:
type: string
description: The URL of the file.
uniqueIDColumn:
type: string
description: The name of the column that contains the unique ID, used as `objectID` in Algolia.
mapping:
type: object
description: >
Mapping of type for every column. For example {"myColumn": "boolean", "myOtherColumn": "json"}.
additionalProperties:
$ref: '#/MappingTypeCSV'
method:
$ref: '#/MethodType'
required:
- url

SourceInput:
oneOf:
- $ref: '#/SourceCommercetools'
- $ref: '#/SourceBigCommerce'
- $ref: '#/SourceJson'
- $ref: '#/SourceJSON'
- $ref: '#/SourceCSV'

SourceUpdateCommercetools:
type: object
Expand All @@ -168,19 +194,9 @@ SourceUpdateCommercetools:
items:
type: string

SourceUpdateJson:
type: object
additionalProperties: false
properties:
url:
type: string
description: The URL of the file.
method:
$ref: '#/MethodType'
required:
- url

SourceUpdateInput:
oneOf:
- $ref: '#/SourceUpdateCommercetools'
- $ref: '#/SourceUpdateJson'
- $ref: '#/SourceJSON'
- $ref: '#/SourceCSV'