From e5e8bb4dea9cbf852b45852fd783e8c92f9cac89 Mon Sep 17 00:00:00 2001 From: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com> Date: Tue, 24 Jan 2023 10:20:28 +0200 Subject: [PATCH] Chore: Use same JSON tag casing everywhere for parent UID (#61935) Chore: Use same JSON tag casing everywhere for parent UID --- pkg/api/dtos/folder.go | 2 +- pkg/api/folder.go | 4 +-- public/api-merged.json | 72 +++++++++++++++++++----------------------- public/api-spec.json | 9 ++---- public/openapi3.json | 72 +++++++++++++++++++----------------------- 5 files changed, 72 insertions(+), 87 deletions(-) diff --git a/pkg/api/dtos/folder.go b/pkg/api/dtos/folder.go index 54b96b603f8..618a64a0d45 100644 --- a/pkg/api/dtos/folder.go +++ b/pkg/api/dtos/folder.go @@ -31,5 +31,5 @@ type FolderSearchHit struct { Uid string `json:"uid"` Title string `json:"title"` AccessControl accesscontrol.Metadata `json:"accessControl,omitempty"` - ParentUID string `json:"parent_uid,omitempty"` + ParentUID string `json:"parentUid,omitempty"` } diff --git a/pkg/api/folder.go b/pkg/api/folder.go index 1a5f35f11bd..bfc6cad7e90 100644 --- a/pkg/api/folder.go +++ b/pkg/api/folder.go @@ -39,7 +39,7 @@ func (hs *HTTPServer) GetFolders(c *models.ReqContext) response.Response { OrgID: c.OrgID, Limit: c.QueryInt64("limit"), Page: c.QueryInt64("page"), - UID: c.Query("parent_uid"), + UID: c.Query("parentUid"), SignedInUser: c.SignedInUser, }) } else { @@ -340,7 +340,7 @@ type GetFoldersParams struct { // The parent folder UID // in:query // required:false - ParentUID string `json:"parent_uid"` + ParentUID string `json:"parentUid"` } // swagger:parameters getFolderByUID diff --git a/public/api-merged.json b/public/api-merged.json index 10c3730b5c2..56fd778555b 100644 --- a/public/api-merged.json +++ b/public/api-merged.json @@ -3058,7 +3058,7 @@ "tags": [ "provisioning" ], - "summary": "Updates an existing template.", + "summary": "Updates an existing notification template.", "operationId": "RoutePutTemplate", "parameters": [ { @@ -5240,7 +5240,7 @@ }, "/folders": { "get": { - "description": "Returns all folders that the authenticated user has permission to view.\nIf nested folders are enabled, it expects an additional query parameter with the parent folder UID.", + "description": "Returns all folders that the authenticated user has permission to view.\nIf nested folders are enabled, it expects an additional query parameter with the parent folder UID\nand returns the immediate subfolders.", "tags": [ "folders" ], @@ -5266,7 +5266,7 @@ { "type": "string", "description": "The parent folder UID", - "name": "parent_uid", + "name": "parentUid", "in": "query" } ], @@ -12218,9 +12218,6 @@ "hasAcl": { "type": "boolean" }, - "hasPublicDashboard": { - "type": "boolean" - }, "isFolder": { "type": "boolean" }, @@ -13179,7 +13176,7 @@ "type": "integer", "format": "int64" }, - "parent_uid": { + "parentUid": { "type": "string" }, "title": { @@ -14447,34 +14444,6 @@ "$ref": "#/definitions/Matcher" } }, - "NotificationTemplate": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "provenance": { - "$ref": "#/definitions/Provenance" - }, - "template": { - "type": "string" - } - } - }, - "NotificationTemplateContent": { - "type": "object", - "properties": { - "template": { - "type": "string" - } - } - }, - "NotificationTemplates": { - "type": "array", - "items": { - "$ref": "#/definitions/NotificationTemplate" - } - }, "Metadata": { "description": "Metadata contains user accesses for a given resource\nEx: map[string]bool{\"create\":true, \"delete\": true}", "type": "object", @@ -14647,6 +14616,34 @@ "format": "int64", "title": "NoticeSeverity is a type for the Severity property of a Notice." }, + "NotificationTemplate": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "provenance": { + "$ref": "#/definitions/Provenance" + }, + "template": { + "type": "string" + } + } + }, + "NotificationTemplateContent": { + "type": "object", + "properties": { + "template": { + "type": "string" + } + } + }, + "NotificationTemplates": { + "type": "array", + "items": { + "$ref": "#/definitions/NotificationTemplate" + } + }, "NotificationTestCommand": { "type": "object", "properties": { @@ -18578,7 +18575,6 @@ } }, "alertGroups": { - "description": "AlertGroups alert groups", "type": "array", "items": { "$ref": "#/definitions/alertGroup" @@ -18739,14 +18735,12 @@ } }, "gettableAlerts": { - "description": "GettableAlerts gettable alerts", "type": "array", "items": { "$ref": "#/definitions/gettableAlert" } }, "gettableSilence": { - "description": "GettableSilence gettable silence", "type": "object", "required": [ "comment", @@ -18795,7 +18789,6 @@ } }, "gettableSilences": { - "description": "GettableSilences gettable silences", "type": "array", "items": { "$ref": "#/definitions/gettableSilence" @@ -18982,6 +18975,7 @@ } }, "receiver": { + "description": "Receiver receiver", "type": "object", "required": [ "active", diff --git a/public/api-spec.json b/public/api-spec.json index 14bca1499d2..b342294edea 100644 --- a/public/api-spec.json +++ b/public/api-spec.json @@ -4568,7 +4568,7 @@ }, "/folders": { "get": { - "description": "Returns all folders that the authenticated user has permission to view.\nIf nested folders are enabled, it expects an additional query parameter with the parent folder UID.", + "description": "Returns all folders that the authenticated user has permission to view.\nIf nested folders are enabled, it expects an additional query parameter with the parent folder UID\nand returns the immediate subfolders.", "tags": [ "folders" ], @@ -4594,7 +4594,7 @@ { "type": "string", "description": "The parent folder UID", - "name": "parent_uid", + "name": "parentUid", "in": "query" } ], @@ -11159,9 +11159,6 @@ "hasAcl": { "type": "boolean" }, - "hasPublicDashboard": { - "type": "boolean" - }, "isFolder": { "type": "boolean" }, @@ -11919,7 +11916,7 @@ "type": "integer", "format": "int64" }, - "parent_uid": { + "parentUid": { "type": "string" }, "title": { diff --git a/public/openapi3.json b/public/openapi3.json index f499bc9b891..866480c6390 100644 --- a/public/openapi3.json +++ b/public/openapi3.json @@ -3534,9 +3534,6 @@ "hasAcl": { "type": "boolean" }, - "hasPublicDashboard": { - "type": "boolean" - }, "isFolder": { "type": "boolean" }, @@ -4495,7 +4492,7 @@ "format": "int64", "type": "integer" }, - "parent_uid": { + "parentUid": { "type": "string" }, "title": { @@ -5764,34 +5761,6 @@ }, "type": "array" }, - "NotificationTemplate": { - "properties": { - "name": { - "type": "string" - }, - "provenance": { - "$ref": "#/components/schemas/Provenance" - }, - "template": { - "type": "string" - } - }, - "type": "object" - }, - "NotificationTemplateContent": { - "properties": { - "template": { - "type": "string" - } - }, - "type": "object" - }, - "NotificationTemplates": { - "items": { - "$ref": "#/components/schemas/NotificationTemplate" - }, - "type": "array" - }, "Metadata": { "additionalProperties": { "type": "boolean" @@ -5964,6 +5933,34 @@ "title": "NoticeSeverity is a type for the Severity property of a Notice.", "type": "integer" }, + "NotificationTemplate": { + "properties": { + "name": { + "type": "string" + }, + "provenance": { + "$ref": "#/components/schemas/Provenance" + }, + "template": { + "type": "string" + } + }, + "type": "object" + }, + "NotificationTemplateContent": { + "properties": { + "template": { + "type": "string" + } + }, + "type": "object" + }, + "NotificationTemplates": { + "items": { + "$ref": "#/components/schemas/NotificationTemplate" + }, + "type": "array" + }, "NotificationTestCommand": { "properties": { "disableResolveMessage": { @@ -9893,7 +9890,6 @@ "type": "object" }, "alertGroups": { - "description": "AlertGroups alert groups", "items": { "$ref": "#/components/schemas/alertGroup" }, @@ -10054,14 +10050,12 @@ "type": "object" }, "gettableAlerts": { - "description": "GettableAlerts gettable alerts", "items": { "$ref": "#/components/schemas/gettableAlert" }, "type": "array" }, "gettableSilence": { - "description": "GettableSilence gettable silence", "properties": { "comment": { "description": "comment", @@ -10110,7 +10104,6 @@ "type": "object" }, "gettableSilences": { - "description": "GettableSilences gettable silences", "items": { "$ref": "#/components/schemas/gettableSilence" }, @@ -10297,6 +10290,7 @@ "type": "object" }, "receiver": { + "description": "Receiver receiver", "properties": { "active": { "description": "active", @@ -13835,7 +13829,7 @@ "description": "ValidationError" } }, - "summary": "Updates an existing template.", + "summary": "Updates an existing notification template.", "tags": [ "provisioning" ] @@ -16131,7 +16125,7 @@ }, "/folders": { "get": { - "description": "Returns all folders that the authenticated user has permission to view.\nIf nested folders are enabled, it expects an additional query parameter with the parent folder UID.", + "description": "Returns all folders that the authenticated user has permission to view.\nIf nested folders are enabled, it expects an additional query parameter with the parent folder UID\nand returns the immediate subfolders.", "operationId": "getFolders", "parameters": [ { @@ -16157,7 +16151,7 @@ { "description": "The parent folder UID", "in": "query", - "name": "parent_uid", + "name": "parentUid", "schema": { "type": "string" }