mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Swagger: Fix getLibraryElementByName
response (#78221)
It returns an array of library elements, not a single one. This has been tested by generating the OpenAPI client and using it in Terraform
This commit is contained in:
parent
3c51190392
commit
cd584e9261
@ -270,7 +270,7 @@ func (l *LibraryElementService) getConnectionsHandler(c *contextmodel.ReqContext
|
|||||||
// Returns a library element with the given name.
|
// Returns a library element with the given name.
|
||||||
//
|
//
|
||||||
// Responses:
|
// Responses:
|
||||||
// 200: getLibraryElementResponse
|
// 200: getLibraryElementArrayResponse
|
||||||
// 401: unauthorisedError
|
// 401: unauthorisedError
|
||||||
// 404: notFoundError
|
// 404: notFoundError
|
||||||
// 500: internalServerError
|
// 500: internalServerError
|
||||||
@ -448,6 +448,12 @@ type GetLibraryElementResponse struct {
|
|||||||
Body model.LibraryElementResponse `json:"body"`
|
Body model.LibraryElementResponse `json:"body"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// swagger:response getLibraryElementArrayResponse
|
||||||
|
type GetLibraryElementArrayResponse struct {
|
||||||
|
// in: body
|
||||||
|
Body model.LibraryElementArrayResponse `json:"body"`
|
||||||
|
}
|
||||||
|
|
||||||
// swagger:response getLibraryElementConnectionsResponse
|
// swagger:response getLibraryElementConnectionsResponse
|
||||||
type GetLibraryElementConnectionsResponse struct {
|
type GetLibraryElementConnectionsResponse struct {
|
||||||
// in: body
|
// in: body
|
||||||
|
@ -4764,6 +4764,18 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"LibraryElementArrayResponse": {
|
||||||
|
"type": "object",
|
||||||
|
"title": "LibraryElementArrayResponse is a response struct for an array of LibraryElementDTO.",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/definitions/LibraryElementDTO"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"LibraryElementConnectionDTO": {
|
"LibraryElementConnectionDTO": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"title": "LibraryElementConnectionDTO is the frontend DTO for element connections.",
|
"title": "LibraryElementConnectionDTO is the frontend DTO for element connections.",
|
||||||
@ -8480,6 +8492,12 @@
|
|||||||
"$ref": "#/definitions/GetHomeDashboardResponse"
|
"$ref": "#/definitions/GetHomeDashboardResponse"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"getLibraryElementArrayResponse": {
|
||||||
|
"description": "",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/LibraryElementArrayResponse"
|
||||||
|
}
|
||||||
|
},
|
||||||
"getLibraryElementConnectionsResponse": {
|
"getLibraryElementConnectionsResponse": {
|
||||||
"description": "",
|
"description": "",
|
||||||
"schema": {
|
"schema": {
|
||||||
|
@ -6017,7 +6017,7 @@
|
|||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"$ref": "#/responses/getLibraryElementResponse"
|
"$ref": "#/responses/getLibraryElementArrayResponse"
|
||||||
},
|
},
|
||||||
"401": {
|
"401": {
|
||||||
"$ref": "#/responses/unauthorisedError"
|
"$ref": "#/responses/unauthorisedError"
|
||||||
@ -15313,6 +15313,18 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"LibraryElementArrayResponse": {
|
||||||
|
"type": "object",
|
||||||
|
"title": "LibraryElementArrayResponse is a response struct for an array of LibraryElementDTO.",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/definitions/LibraryElementDTO"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"LibraryElementConnectionDTO": {
|
"LibraryElementConnectionDTO": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"title": "LibraryElementConnectionDTO is the frontend DTO for element connections.",
|
"title": "LibraryElementConnectionDTO is the frontend DTO for element connections.",
|
||||||
@ -21654,6 +21666,12 @@
|
|||||||
"$ref": "#/definitions/GetHomeDashboardResponse"
|
"$ref": "#/definitions/GetHomeDashboardResponse"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"getLibraryElementArrayResponse": {
|
||||||
|
"description": "(empty)",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/LibraryElementArrayResponse"
|
||||||
|
}
|
||||||
|
},
|
||||||
"getLibraryElementConnectionsResponse": {
|
"getLibraryElementConnectionsResponse": {
|
||||||
"description": "(empty)",
|
"description": "(empty)",
|
||||||
"schema": {
|
"schema": {
|
||||||
|
@ -862,6 +862,16 @@
|
|||||||
},
|
},
|
||||||
"description": "(empty)"
|
"description": "(empty)"
|
||||||
},
|
},
|
||||||
|
"getLibraryElementArrayResponse": {
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/LibraryElementArrayResponse"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"description": "(empty)"
|
||||||
|
},
|
||||||
"getLibraryElementConnectionsResponse": {
|
"getLibraryElementConnectionsResponse": {
|
||||||
"content": {
|
"content": {
|
||||||
"application/json": {
|
"application/json": {
|
||||||
@ -6321,6 +6331,18 @@
|
|||||||
},
|
},
|
||||||
"type": "object"
|
"type": "object"
|
||||||
},
|
},
|
||||||
|
"LibraryElementArrayResponse": {
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/components/schemas/LibraryElementDTO"
|
||||||
|
},
|
||||||
|
"type": "array"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"title": "LibraryElementArrayResponse is a response struct for an array of LibraryElementDTO.",
|
||||||
|
"type": "object"
|
||||||
|
},
|
||||||
"LibraryElementConnectionDTO": {
|
"LibraryElementConnectionDTO": {
|
||||||
"properties": {
|
"properties": {
|
||||||
"connectionId": {
|
"connectionId": {
|
||||||
@ -18659,7 +18681,7 @@
|
|||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"$ref": "#/components/responses/getLibraryElementResponse"
|
"$ref": "#/components/responses/getLibraryElementArrayResponse"
|
||||||
},
|
},
|
||||||
"401": {
|
"401": {
|
||||||
"$ref": "#/components/responses/unauthorisedError"
|
"$ref": "#/components/responses/unauthorisedError"
|
||||||
|
Loading…
Reference in New Issue
Block a user