Skip to content
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

feat(specs): add CSV source #1301

Merged
merged 6 commits into from
Feb 8, 2023
Merged
Changes from 2 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
58 changes: 53 additions & 5 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
morganleroi marked this conversation as resolved.
Show resolved Hide resolved
description: The URL of the file.
uniqueIDColumn:
type: string
description: The name of the column that contains the unique ID.
morganleroi marked this conversation as resolved.
Show resolved Hide resolved
mapping:
type: object
description: >
Mapping of type for every column. For example {"myColumn": "boolean, "myOtherColumn": "json"}.
morganleroi marked this conversation as resolved.
Show resolved Hide resolved
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,13 +194,34 @@ SourceUpdateCommercetools:
items:
type: string

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

SourceUpdateCSV:
type: object
additionalProperties: false
properties:
url:
type: string
description: The URL of the file.
uniqueIDColumn:
type: string
morganleroi marked this conversation as resolved.
Show resolved Hide resolved
description: The name of the column that contains the unique ID.
mapping:
type: object
description: >
Mapping of type for every column. For example {"myColumn": "boolean, "myOtherColumn": "json"}.
additionalProperties:
$ref: '#/MappingTypeCSV'
method:
$ref: '#/MethodType'
required:
Expand All @@ -183,4 +230,5 @@ SourceUpdateJson:
SourceUpdateInput:
oneOf:
- $ref: '#/SourceUpdateCommercetools'
- $ref: '#/SourceUpdateJson'
- $ref: '#/SourceUpdateJSON'
- $ref: '#/SourceUpdateCSV'