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 source samples specs #2759

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions specs/ingestion/common/schemas/source.yml
Original file line number Diff line number Diff line change
Expand Up @@ -387,3 +387,7 @@ SourceUpdateInput:
DockerSourceStream:
type: object
description: A stream definition (see the Singer specification for details).

SourceSample:
type: object
description: A source sample is a sample of the data that can be fetched from a source.
18 changes: 18 additions & 0 deletions specs/ingestion/common/sourceSamplesParameters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
limit:
name: limit
description: The maximum number of samples to return.
in: query
required: false
schema:
type: integer
minimum: 1
example: 2

filter:
name: filter
description: The filter expression to apply to the list of samples. Should be in the format `key = value`.
in: query
required: false
schema:
type: string
example: event_name = "add_to_cart"
32 changes: 32 additions & 0 deletions specs/ingestion/paths/sources/samples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
get:
tags:
- sources
summary: Get a list of source samples.
description: Get a list of source samples for the given sourceID and query parameters.
operationId: getSourceSamples
x-acl:
- addObject
- deleteIndex
- editSettings
parameters:
- $ref: '../../common/parameters.yml#/pathSourceID'
- $ref: '../../common/sourceSamplesParameters.yml#/filter'
- $ref: '../../common/sourceSamplesParameters.yml#/limit'
responses:
'200':
description: OK
content:
application/json:
schema:
title: listSourceSamplesResponse
type: object
additionalProperties: false
properties:
samples:
type: array
items:
$ref: '../../common/schemas/source.yml#/SourceSample'
required:
- samples
'400':
$ref: '../../../common/responses/BadRequest.yml'
2 changes: 2 additions & 0 deletions specs/ingestion/spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ paths:
$ref: 'paths/sources/sourceID.yml'
/1/sources/{sourceID}/discover:
$ref: 'paths/sources/discover.yml'
/1/sources/{sourceID}/samples:
$ref: 'paths/sources/samples.yml'

# tasks API.
/1/tasks:
Expand Down
Loading