From 80cc695ccddd25d68121bb8a9b4c5c49cbd9e6fd Mon Sep 17 00:00:00 2001 From: shortcuts Date: Wed, 11 Dec 2024 14:53:22 +0100 Subject: [PATCH] fix: WatchResponse --- specs/ingestion/common/schemas/common.yml | 22 +++++++++++++++++++ specs/ingestion/common/schemas/source.yml | 22 ------------------- specs/ingestion/common/schemas/task.yml | 3 --- specs/ingestion/paths/sources/discover.yml | 2 +- specs/ingestion/paths/sources/validate.yml | 2 +- specs/ingestion/paths/sources/validateID.yml | 2 +- specs/ingestion/paths/tasks/v2/pushTask.yml | 2 +- .../java/guides/ingestion/pushSetup.mustache | 2 +- 8 files changed, 27 insertions(+), 30 deletions(-) diff --git a/specs/ingestion/common/schemas/common.yml b/specs/ingestion/common/schemas/common.yml index ddf2dd9d3a..f06c607fa8 100644 --- a/specs/ingestion/common/schemas/common.yml +++ b/specs/ingestion/common/schemas/common.yml @@ -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 diff --git a/specs/ingestion/common/schemas/source.yml b/specs/ingestion/common/schemas/source.yml index f15974efed..b85f6abdd5 100644 --- a/specs/ingestion/common/schemas/source.yml +++ b/specs/ingestion/common/schemas/source.yml @@ -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 diff --git a/specs/ingestion/common/schemas/task.yml b/specs/ingestion/common/schemas/task.yml index 0bcd7d42b3..fdaf54114b 100644 --- a/specs/ingestion/common/schemas/task.yml +++ b/specs/ingestion/common/schemas/task.yml @@ -553,6 +553,3 @@ ShopifyMarket: - countries - currencies - locales - -PushTaskResponse: - $ref: './source.yml#/SourceWatchResponse' diff --git a/specs/ingestion/paths/sources/discover.yml b/specs/ingestion/paths/sources/discover.yml index 4a66698601..4e1cc387ed 100644 --- a/specs/ingestion/paths/sources/discover.yml +++ b/specs/ingestion/paths/sources/discover.yml @@ -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' diff --git a/specs/ingestion/paths/sources/validate.yml b/specs/ingestion/paths/sources/validate.yml index dd3ede67ea..447f65b1a0 100644 --- a/specs/ingestion/paths/sources/validate.yml +++ b/specs/ingestion/paths/sources/validate.yml @@ -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' diff --git a/specs/ingestion/paths/sources/validateID.yml b/specs/ingestion/paths/sources/validateID.yml index c00f89502f..f40028bc4f 100644 --- a/specs/ingestion/paths/sources/validateID.yml +++ b/specs/ingestion/paths/sources/validateID.yml @@ -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' diff --git a/specs/ingestion/paths/tasks/v2/pushTask.yml b/specs/ingestion/paths/tasks/v2/pushTask.yml index 112e855835..b43c64d5d6 100644 --- a/specs/ingestion/paths/tasks/v2/pushTask.yml +++ b/specs/ingestion/paths/tasks/v2/pushTask.yml @@ -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' diff --git a/templates/java/guides/ingestion/pushSetup.mustache b/templates/java/guides/ingestion/pushSetup.mustache index e5f0b10aa9..e133154c56 100644 --- a/templates/java/guides/ingestion/pushSetup.mustache +++ b/templates/java/guides/ingestion/pushSetup.mustache @@ -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);