refactor: dashboards OpenAPI spec (#10301)

* refactor: dashboards OpenAPI spec

* small fix
This commit is contained in:
Daniel Vaz Gaspar 2020-07-14 08:56:23 +01:00 committed by GitHub
parent 96e0da9fea
commit 3922348351
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 12 deletions

View File

@ -139,7 +139,6 @@ class DashboardRestApi(BaseSupersetModelRestApi):
base_filters = [["slice", DashboardFilter, lambda: []]]
openapi_spec_tag = "Dashboards"
order_rel_fields = {
"slices": ("slice_name", "asc"),
"owners": ("first_name", "asc"),
@ -149,6 +148,12 @@ class DashboardRestApi(BaseSupersetModelRestApi):
}
allowed_rel_fields = {"owners"}
openapi_spec_tag = "Dashboards"
apispec_parameter_schemas = {
"get_delete_ids_schema": get_delete_ids_schema,
"get_export_ids_schema": get_export_ids_schema,
"thumbnail_query_schema": thumbnail_query_schema,
}
openapi_spec_methods = openapi_spec_methods_override
""" Overrides GET methods OpenApi descriptions """
@ -354,9 +359,7 @@ class DashboardRestApi(BaseSupersetModelRestApi):
content:
application/json:
schema:
type: array
items:
type: integer
$ref: '#/components/schemas/get_delete_ids_schema'
responses:
200:
description: Dashboard bulk delete
@ -413,9 +416,7 @@ class DashboardRestApi(BaseSupersetModelRestApi):
content:
application/json:
schema:
type: array
items:
type: integer
$ref: '#/components/schemas/get_export_ids_schema'
responses:
200:
description: Dashboard export
@ -475,11 +476,7 @@ class DashboardRestApi(BaseSupersetModelRestApi):
content:
application/json:
schema:
type: object
properties:
force:
type: boolean
default: false
$ref: '#/components/schemas/thumbnail_query_schema'
responses:
200:
description: Dashboard thumbnail image