diff --git a/mgmt/rest/v2/api.go b/mgmt/rest/v2/api.go index 23746a6ad..996afbba0 100644 --- a/mgmt/rest/v2/api.go +++ b/mgmt/rest/v2/api.go @@ -110,6 +110,7 @@ func (s *apiV2) GetRoutes() []api.Route { // 415: ErrorResponse // 500: ErrorResponse // 401: UnauthResponse + // default: ErrorStringResponse api.Route{Method: "POST", Path: prefix + "/plugins", Handle: s.loadPlugin}, // swagger:route DELETE /plugins/{ptype}/{pname}/{pversion} plugins unloadPlugin // diff --git a/mgmt/rest/v2/error.go b/mgmt/rest/v2/error.go index ea2a3f5a5..56330214a 100644 --- a/mgmt/rest/v2/error.go +++ b/mgmt/rest/v2/error.go @@ -63,6 +63,15 @@ type UnauthError struct { Message string `json:"message"` } +// ErrorStringResponse represents an error in the string format. +// +// It includes an error message only. +// +// swagger:response ErrorStringResponse +type ErrorStringResponse struct { + Message string `json:"message"` +} + // Unsuccessful generic response to a failed API call type Error struct { ErrorMessage string `json:"message"` diff --git a/swagger.json b/swagger.json index 96e0ee2ea..f1a6c42fb 100644 --- a/swagger.json +++ b/swagger.json @@ -188,6 +188,9 @@ }, "500": { "$ref": "#/responses/ErrorResponse" + }, + "default": { + "$ref": "#/responses/ErrorStringResponse" } } } @@ -1292,6 +1295,14 @@ "$ref": "#/definitions/Error" } }, + "ErrorStringResponse": { + "description": "ErrorStringResponse represents an error in the string format.\n\nIt includes an error message only.", + "headers": { + "message": { + "type": "string" + } + } + }, "MetricsResponse": { "description": "MetricsResponse is the representation of metric operation response.", "schema": {