From 395a06ab86a67200733cb5718fc8d9a29239c04a Mon Sep 17 00:00:00 2001 From: Mihai Doarna Date: Wed, 31 Jan 2024 18:06:22 +0200 Subject: [PATCH] Auth: fix swagger responses for the SSO settings API (#81639) fix swagger responses for the sso settings API --- pkg/services/ssosettings/api/api.go | 20 ++++++++++-- public/api-merged.json | 48 +++++++++++++++++++++++++++-- public/openapi3.json | 48 +++++++++++++++++++++++++++-- 3 files changed, 107 insertions(+), 9 deletions(-) diff --git a/pkg/services/ssosettings/api/api.go b/pkg/services/ssosettings/api/api.go index 66357222650..4ebc206a137 100644 --- a/pkg/services/ssosettings/api/api.go +++ b/pkg/services/ssosettings/api/api.go @@ -233,7 +233,11 @@ type UpdateProviderSettingsParams struct { Provider string `json:"key"` // in:body // required:true - Body models.SSOSettings `json:"body"` + Body struct { + ID string `json:"id"` + Provider string `json:"provider"` + Settings map[string]any `json:"settings"` + } `json:"body"` } // swagger:parameters removeProviderSettings @@ -246,11 +250,21 @@ type RemoveProviderSettingsParams struct { // swagger:response listSSOSettingsResponse type ListSSOSettingsResponse struct { // in: body - Body []models.SSOSettings `json:"body"` + Body []struct { + ID string `json:"id"` + Provider string `json:"provider"` + Settings map[string]any `json:"settings"` + Source string `json:"source"` + } `json:"body"` } // swagger:response getSSOSettingsResponse type GetSSOSettingsResponse struct { // in: body - Body models.SSOSettings `json:"body"` + Body struct { + ID string `json:"id"` + Provider string `json:"provider"` + Settings map[string]any `json:"settings"` + Source string `json:"source"` + } `json:"body"` } diff --git a/public/api-merged.json b/public/api-merged.json index e30d02d361b..ee6218c9f04 100644 --- a/public/api-merged.json +++ b/public/api-merged.json @@ -11475,7 +11475,19 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/SSOSettings" + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "provider": { + "type": "string" + }, + "settings": { + "type": "object", + "additionalProperties": false + } + } } } ], @@ -22991,7 +23003,22 @@ "getSSOSettingsResponse": { "description": "(empty)", "schema": { - "$ref": "#/definitions/SSOSettings" + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "provider": { + "type": "string" + }, + "settings": { + "type": "object", + "additionalProperties": false + }, + "source": { + "type": "string" + } + } } }, "getSharingOptionsResponse": { @@ -23177,7 +23204,22 @@ "schema": { "type": "array", "items": { - "$ref": "#/definitions/SSOSettings" + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "provider": { + "type": "string" + }, + "settings": { + "type": "object", + "additionalProperties": false + }, + "source": { + "type": "string" + } + } } } }, diff --git a/public/openapi3.json b/public/openapi3.json index 2d6c2d08411..3410723e17e 100644 --- a/public/openapi3.json +++ b/public/openapi3.json @@ -1173,7 +1173,22 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SSOSettings" + "properties": { + "id": { + "type": "string" + }, + "provider": { + "type": "string" + }, + "settings": { + "additionalProperties": false, + "type": "object" + }, + "source": { + "type": "string" + } + }, + "type": "object" } } }, @@ -1438,7 +1453,22 @@ "application/json": { "schema": { "items": { - "$ref": "#/components/schemas/SSOSettings" + "properties": { + "id": { + "type": "string" + }, + "provider": { + "type": "string" + }, + "settings": { + "additionalProperties": false, + "type": "object" + }, + "source": { + "type": "string" + } + }, + "type": "object" }, "type": "array" } @@ -25205,7 +25235,19 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SSOSettings" + "properties": { + "id": { + "type": "string" + }, + "provider": { + "type": "string" + }, + "settings": { + "additionalProperties": false, + "type": "object" + } + }, + "type": "object" } } },