From a4756ba8e434912ac5be4a3b15f93f182abf485e Mon Sep 17 00:00:00 2001 From: Daniel Gaspar Date: Tue, 3 May 2022 15:36:17 +0100 Subject: [PATCH] fix: OpenAPI docs small fixes --- superset/charts/api.py | 6 +----- superset/dashboards/api.py | 2 ++ superset/databases/api.py | 3 --- superset/embedded/api.py | 2 ++ superset/importexport/api.py | 2 -- superset/reports/api.py | 4 ++++ superset/security/api.py | 2 ++ 7 files changed, 11 insertions(+), 10 deletions(-) diff --git a/superset/charts/api.py b/superset/charts/api.py index 260ae4442c75c..a7c2da5473e59 100644 --- a/superset/charts/api.py +++ b/superset/charts/api.py @@ -516,14 +516,12 @@ def cache_screenshot(self, pk: int, **kwargs: Any) -> WerkzeugResponse: schema: $ref: '#/components/schemas/screenshot_query_schema' responses: - 200: + 202: description: Chart async result content: application/json: schema: $ref: "#/components/schemas/ChartCacheScreenshotResponseSchema" - 302: - description: Redirects to the current digest 400: $ref: '#/components/responses/400' 401: @@ -596,8 +594,6 @@ def screenshot(self, pk: int, digest: str) -> WerkzeugResponse: schema: type: string format: binary - 302: - description: Redirects to the current digest 400: $ref: '#/components/responses/400' 401: diff --git a/superset/dashboards/api.py b/superset/dashboards/api.py index 5e3f78a9536ae..576fdee10fea4 100644 --- a/superset/dashboards/api.py +++ b/superset/dashboards/api.py @@ -853,6 +853,8 @@ def thumbnail(self, pk: int, digest: str, **kwargs: Any) -> WerkzeugResponse: properties: message: type: string + 302: + description: Redirects to the current digest 401: $ref: '#/components/responses/401' 404: diff --git a/superset/databases/api.py b/superset/databases/api.py index ac497bf67dbde..6ec470119ce4e 100644 --- a/superset/databases/api.py +++ b/superset/databases/api.py @@ -236,8 +236,6 @@ def post(self) -> Response: type: number result: $ref: '#/components/schemas/{{self.__class__.__name__}}.post' - 302: - description: Redirects to the current digest 400: $ref: '#/components/responses/400' 401: @@ -659,7 +657,6 @@ def related_objects(self, pk: int) -> Response: schema: type: integer responses: - 200: 200: description: Query result content: diff --git a/superset/embedded/api.py b/superset/embedded/api.py index f7278d910a079..086fb16114f2e 100644 --- a/superset/embedded/api.py +++ b/superset/embedded/api.py @@ -91,6 +91,8 @@ def get(self, uuid: str) -> Response: result: $ref: '#/components/schemas/EmbeddedDashboardResponseSchema' 401: + $ref: '#/components/responses/401' + 404: $ref: '#/components/responses/404' 500: $ref: '#/components/responses/500' diff --git a/superset/importexport/api.py b/superset/importexport/api.py index c0021a8f88cd7..1f4543cd58901 100644 --- a/superset/importexport/api.py +++ b/superset/importexport/api.py @@ -64,8 +64,6 @@ def export(self) -> Response: schema: type: string format: binary - 400: - $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 404: diff --git a/superset/reports/api.py b/superset/reports/api.py index 2871125c9a322..645cd24894634 100644 --- a/superset/reports/api.py +++ b/superset/reports/api.py @@ -310,6 +310,8 @@ def post(self) -> Response: $ref: '#/components/responses/401' 404: $ref: '#/components/responses/404' + 422: + $ref: '#/components/responses/422' 500: $ref: '#/components/responses/500' """ @@ -379,6 +381,8 @@ def put(self, pk: int) -> Response: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' + 422: + $ref: '#/components/responses/422' 500: $ref: '#/components/responses/500' """ diff --git a/superset/security/api.py b/superset/security/api.py index 6411ccf7be56b..4eb7ebe660323 100644 --- a/superset/security/api.py +++ b/superset/security/api.py @@ -140,6 +140,8 @@ def guest_token(self) -> Response: type: string 401: $ref: '#/components/responses/401' + 400: + $ref: '#/components/responses/400' 500: $ref: '#/components/responses/500' """