Skip to content

Commit

Permalink
fix: WatchResponse
Browse files Browse the repository at this point in the history
  • Loading branch information
shortcuts committed Dec 11, 2024
1 parent 566bddb commit 80cc695
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 30 deletions.
22 changes: 22 additions & 0 deletions specs/ingestion/common/schemas/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,25 @@ Window:
required:
- startDate
- endDate

WatchResponse:
type: object
additionalProperties: false
properties:
runID:
$ref: './common.yml#/runID'
data:
type: array
description: when used with discovering or validating sources, the sampled data of your source is returned.
items:
type: object
events:
description: in case of error, observability events will be added to the response, if any.
type: array
items:
$ref: '../../common/schemas/event.yml#/Event'
message:
description: a message describing the outcome of a validate run.
type: string
required:
- message
22 changes: 0 additions & 22 deletions specs/ingestion/common/schemas/source.yml
Original file line number Diff line number Diff line change
Expand Up @@ -476,28 +476,6 @@ sourceShopifyBase:
x-discriminator-fields:
- shopURL

SourceWatchResponse:
type: object
additionalProperties: false
properties:
runID:
$ref: './common.yml#/runID'
data:
type: array
description: depending on the source type, the validation returns sampling data of your source (JSON, CSV, BigQuery).
items:
type: object
events:
description: in case of error, observability events will be added to the response, if any.
type: array
items:
$ref: '../../common/schemas/event.yml#/Event'
message:
description: a message describing the outcome of a validate run.
type: string
required:
- message

RunSourcePayload:
type: object
additionalProperties: false
Expand Down
3 changes: 0 additions & 3 deletions specs/ingestion/common/schemas/task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,3 @@ ShopifyMarket:
- countries
- currencies
- locales

PushTaskResponse:
$ref: './source.yml#/SourceWatchResponse'
2 changes: 1 addition & 1 deletion specs/ingestion/paths/sources/discover.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ post:
content:
application/json:
schema:
$ref: '../../common/schemas/source.yml#/SourceWatchResponse'
$ref: '../../common/schemas/common.yml#/WatchResponse'
'400':
$ref: '../../../common/responses/BadRequest.yml'
2 changes: 1 addition & 1 deletion specs/ingestion/paths/sources/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ post:
content:
application/json:
schema:
$ref: '../../common/schemas/source.yml#/SourceWatchResponse'
$ref: '../../common/schemas/common.yml#/WatchResponse'
'400':
$ref: '../../../common/responses/BadRequest.yml'
2 changes: 1 addition & 1 deletion specs/ingestion/paths/sources/validateID.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ post:
content:
application/json:
schema:
$ref: '../../common/schemas/source.yml#/SourceWatchResponse'
$ref: '../../common/schemas/common.yml#/WatchResponse'
'400':
$ref: '../../../common/responses/BadRequest.yml'
2 changes: 1 addition & 1 deletion specs/ingestion/paths/tasks/v2/pushTask.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ post:
content:
application/json:
schema:
$ref: '../../../common/schemas/task.yml#/PushTaskResponse'
$ref: '../../../common/schemas/common.yml#/WatchResponse'
'400':
$ref: '../../../../common/responses/BadRequest.yml'
2 changes: 1 addition & 1 deletion templates/java/guides/ingestion/pushSetup.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class pushSetup {
{{> snippets/init}}

// setting `watch` to `true` will make the call synchronous
PushTaskResponse resp = {{#dynamicSnippet}}pushSetup{{/dynamicSnippet}};
WatchResponse resp = {{#dynamicSnippet}}pushSetup{{/dynamicSnippet}};

System.out.println(resp);

Expand Down

0 comments on commit 80cc695

Please sign in to comment.