From 7335d02ddc21657f03044a3a8b00f4261f8fa89e Mon Sep 17 00:00:00 2001 From: Janusz Piechota Date: Thu, 20 Jun 2024 10:48:49 +0200 Subject: [PATCH 1/4] PPPSYS-47023 Fix OpenAPI validation errors --- .../authorized_api/definitions/profile_details.yaml | 4 ++-- custom_reports/http_api/definitions/query_request.yaml | 8 ++++++-- .../http_api/definitions/real_time_query_request.yaml | 10 +++++++--- custom_reports/http_api/paths/query.yaml | 1 - custom_reports/http_api/paths/real_time_events.yaml | 2 +- custom_reports/http_api/paths/real_time_query.yaml | 1 - custom_reports/http_api/paths/sessions.yaml | 3 +-- 7 files changed, 17 insertions(+), 12 deletions(-) diff --git a/audience_manager/authorized_api/definitions/profile_details.yaml b/audience_manager/authorized_api/definitions/profile_details.yaml index 9a42bc3e..87dd1f68 100644 --- a/audience_manager/authorized_api/definitions/profile_details.yaml +++ b/audience_manager/authorized_api/definitions/profile_details.yaml @@ -32,11 +32,11 @@ allOf: description: Number of conversions. example: 4 last_revenue: - type: float + type: number description: Amount of last transaction. example: 13.37 total_revenue: - type: float + type: number description: Total amount of transactions tracked by audience manager. example: 13.37 generic: diff --git a/custom_reports/http_api/definitions/query_request.yaml b/custom_reports/http_api/definitions/query_request.yaml index caa35310..9075a89d 100644 --- a/custom_reports/http_api/definitions/query_request.yaml +++ b/custom_reports/http_api/definitions/query_request.yaml @@ -178,7 +178,7 @@ properties: - lte value: description: Value that should be matched by filter. - type: float + type: number example: 42.5 required: - operator @@ -206,6 +206,10 @@ properties: By default sorts descending by the first metric in query. items: type: array + items: + oneOf: + - type: integer + - type: string example: [[1, "desc"], [2, "asc"]] format: type: string @@ -233,7 +237,7 @@ properties: Additional options for query. properties: sampling: - type: float + type: number description: | Apply sampling for query with given data percent. Sampling 0.1 means only 10% of data are used to calculate query results. Sampling 1 diff --git a/custom_reports/http_api/definitions/real_time_query_request.yaml b/custom_reports/http_api/definitions/real_time_query_request.yaml index 8d500172..03122ab0 100644 --- a/custom_reports/http_api/definitions/real_time_query_request.yaml +++ b/custom_reports/http_api/definitions/real_time_query_request.yaml @@ -27,7 +27,7 @@ properties: - column_id example: [{"column_id":"device_type"},{"column_id":"revenue","transformation_id":"sum"}] lookback_window: - type: int + type: integer description: | Period of time (in minutes) to query. Example: lookback_window=10 means "last 10 minutes of data". filters: @@ -150,7 +150,7 @@ properties: - lte value: description: Value that should be matched by filter. - type: float + type: number example: 42.5 required: - operator @@ -178,6 +178,10 @@ properties: By default sorts descending by the first metric in query. items: type: array + items: + oneOf: + - type: integer + - type: string example: [[1, "desc"], [2, "asc"]] format: type: string @@ -205,7 +209,7 @@ properties: Additional options for query. properties: sampling: - type: float + type: number description: | Apply sampling for query with given data percent. Sampling 0.1 means only 10% of data are used to calculate query results. Sampling 1 diff --git a/custom_reports/http_api/paths/query.yaml b/custom_reports/http_api/paths/query.yaml index 41d1820d..9ef44be4 100644 --- a/custom_reports/http_api/paths/query.yaml +++ b/custom_reports/http_api/paths/query.yaml @@ -46,7 +46,6 @@ post: description: Rows with results for the query. items: type: object - description: meta: type: object description: Additional results metadata for the query. diff --git a/custom_reports/http_api/paths/real_time_events.yaml b/custom_reports/http_api/paths/real_time_events.yaml index 98a2bd24..1f0e45c0 100644 --- a/custom_reports/http_api/paths/real_time_events.yaml +++ b/custom_reports/http_api/paths/real_time_events.yaml @@ -39,7 +39,7 @@ post: type: array description: List of column IDs returned. items: - type: str + type: string count: type: integer description: Total number of results available for this query. diff --git a/custom_reports/http_api/paths/real_time_query.yaml b/custom_reports/http_api/paths/real_time_query.yaml index 1dfe2cd7..c55c5059 100644 --- a/custom_reports/http_api/paths/real_time_query.yaml +++ b/custom_reports/http_api/paths/real_time_query.yaml @@ -25,7 +25,6 @@ post: description: Rows with results for the query. items: type: object - description: meta: type: object description: Additional results metadata for the query. diff --git a/custom_reports/http_api/paths/sessions.yaml b/custom_reports/http_api/paths/sessions.yaml index f8d190db..7d47a127 100644 --- a/custom_reports/http_api/paths/sessions.yaml +++ b/custom_reports/http_api/paths/sessions.yaml @@ -32,7 +32,6 @@ post: description: Rows with results for the query. items: type: object - description: meta: type: object description: Additional results metadata for the query. @@ -41,7 +40,7 @@ post: type: array description: List of column IDs returned. items: - type: str + type: string count: type: integer description: Total number of results available for this query. From 9b5e353edb96781f5615a6430b0549599263cba3 Mon Sep 17 00:00:00 2001 From: Janusz Piechota Date: Thu, 20 Jun 2024 11:54:48 +0200 Subject: [PATCH 2/4] PPPSYS-47023 Fix OpenAPI validation errors - CR corrections --- .../authorized_api/definitions/profile_details.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/audience_manager/authorized_api/definitions/profile_details.yaml b/audience_manager/authorized_api/definitions/profile_details.yaml index 87dd1f68..a837a52d 100644 --- a/audience_manager/authorized_api/definitions/profile_details.yaml +++ b/audience_manager/authorized_api/definitions/profile_details.yaml @@ -33,10 +33,12 @@ allOf: example: 4 last_revenue: type: number + format: float description: Amount of last transaction. example: 13.37 total_revenue: type: number + format: float description: Total amount of transactions tracked by audience manager. example: 13.37 generic: From 515206c451b396f30f570479583404add93c9ec9 Mon Sep 17 00:00:00 2001 From: Janusz Piechota Date: Thu, 20 Jun 2024 11:59:26 +0200 Subject: [PATCH 3/4] PPPSYS-47023 Fix OpenAPI validation errors - CR corrections --- custom_reports/http_api/paths/events.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_reports/http_api/paths/events.yaml b/custom_reports/http_api/paths/events.yaml index 9d1f014a..b84f0aa5 100644 --- a/custom_reports/http_api/paths/events.yaml +++ b/custom_reports/http_api/paths/events.yaml @@ -40,7 +40,7 @@ post: type: array description: List of column IDs returned. items: - type: str + type: string count: type: integer description: Total number of results available for this query. From abb6bf8a0ddd13b990a9c52807c4386340439f97 Mon Sep 17 00:00:00 2001 From: Janusz Piechota Date: Fri, 21 Jun 2024 13:09:05 +0200 Subject: [PATCH 4/4] PPPSYS-47023 Fix OpenAPI validation errors - CR corrections --- custom_reports/http_api/definitions/query_request.yaml | 2 ++ .../http_api/definitions/real_time_query_request.yaml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/custom_reports/http_api/definitions/query_request.yaml b/custom_reports/http_api/definitions/query_request.yaml index 9075a89d..b63a1ac5 100644 --- a/custom_reports/http_api/definitions/query_request.yaml +++ b/custom_reports/http_api/definitions/query_request.yaml @@ -179,6 +179,7 @@ properties: value: description: Value that should be matched by filter. type: number + format: float example: 42.5 required: - operator @@ -238,6 +239,7 @@ properties: properties: sampling: type: number + format: float description: | Apply sampling for query with given data percent. Sampling 0.1 means only 10% of data are used to calculate query results. Sampling 1 diff --git a/custom_reports/http_api/definitions/real_time_query_request.yaml b/custom_reports/http_api/definitions/real_time_query_request.yaml index 03122ab0..f6af7301 100644 --- a/custom_reports/http_api/definitions/real_time_query_request.yaml +++ b/custom_reports/http_api/definitions/real_time_query_request.yaml @@ -151,6 +151,7 @@ properties: value: description: Value that should be matched by filter. type: number + format: float example: 42.5 required: - operator @@ -210,6 +211,7 @@ properties: properties: sampling: type: number + format: float description: | Apply sampling for query with given data percent. Sampling 0.1 means only 10% of data are used to calculate query results. Sampling 1