OpenAPI: Fix alerting DeleteMuteTiming errors (#91109)

The `GenericPublicError` is not what is actually returned by the API. Using `PublicError` describes the API correctly
This commit is contained in:
Julien Duchesne 2024-08-26 10:04:36 -04:00 committed by GitHub
parent 0075abe383
commit 087df1d8e5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 66 additions and 116 deletions

View File

@ -1315,14 +1315,6 @@
"title": "Frames is a slice of Frame pointers.", "title": "Frames is a slice of Frame pointers.",
"type": "array" "type": "array"
}, },
"GenericPublicError": {
"properties": {
"body": {
"$ref": "#/definitions/PublicError"
}
},
"type": "object"
},
"GettableAlertmanagers": { "GettableAlertmanagers": {
"properties": { "properties": {
"data": { "data": {
@ -4583,7 +4575,6 @@
"type": "object" "type": "object"
}, },
"alertGroups": { "alertGroups": {
"description": "AlertGroups alert groups",
"items": { "items": {
"$ref": "#/definitions/alertGroup", "$ref": "#/definitions/alertGroup",
"type": "object" "type": "object"
@ -5919,9 +5910,9 @@
"description": " The mute timing was deleted successfully." "description": " The mute timing was deleted successfully."
}, },
"409": { "409": {
"description": "GenericPublicError", "description": "PublicError",
"schema": { "schema": {
"$ref": "#/definitions/GenericPublicError" "$ref": "#/definitions/PublicError"
} }
} }
}, },
@ -5997,9 +5988,9 @@
} }
}, },
"409": { "409": {
"description": "GenericPublicError", "description": "PublicError",
"schema": { "schema": {
"$ref": "#/definitions/GenericPublicError" "$ref": "#/definitions/PublicError"
} }
} }
}, },
@ -6211,9 +6202,9 @@
"description": " The template was deleted successfully." "description": " The template was deleted successfully."
}, },
"409": { "409": {
"description": "GenericPublicError", "description": "PublicError",
"schema": { "schema": {
"$ref": "#/definitions/GenericPublicError" "$ref": "#/definitions/PublicError"
} }
} }
}, },
@ -6241,9 +6232,9 @@
} }
}, },
"404": { "404": {
"description": "GenericPublicError", "description": "PublicError",
"schema": { "schema": {
"$ref": "#/definitions/GenericPublicError" "$ref": "#/definitions/PublicError"
} }
} }
}, },
@ -6286,15 +6277,15 @@
} }
}, },
"400": { "400": {
"description": "GenericPublicError", "description": "PublicError",
"schema": { "schema": {
"$ref": "#/definitions/GenericPublicError" "$ref": "#/definitions/PublicError"
} }
}, },
"409": { "409": {
"description": "GenericPublicError", "description": "PublicError",
"schema": { "schema": {
"$ref": "#/definitions/GenericPublicError" "$ref": "#/definitions/PublicError"
} }
} }
}, },

View File

@ -70,7 +70,7 @@ import (
// Responses: // Responses:
// 202: MuteTimeInterval // 202: MuteTimeInterval
// 400: ValidationError // 400: ValidationError
// 409: GenericPublicError // 409: PublicError
// swagger:route DELETE /v1/provisioning/mute-timings/{name} provisioning stable RouteDeleteMuteTiming // swagger:route DELETE /v1/provisioning/mute-timings/{name} provisioning stable RouteDeleteMuteTiming
// //
@ -78,7 +78,7 @@ import (
// //
// Responses: // Responses:
// 204: description: The mute timing was deleted successfully. // 204: description: The mute timing was deleted successfully.
// 409: GenericPublicError // 409: PublicError
// swagger:route // swagger:route

View File

@ -13,7 +13,7 @@ package definitions
// //
// Responses: // Responses:
// 200: NotificationTemplate // 200: NotificationTemplate
// 404: GenericPublicError // 404: PublicError
// swagger:route PUT /v1/provisioning/templates/{name} provisioning stable RoutePutTemplate // swagger:route PUT /v1/provisioning/templates/{name} provisioning stable RoutePutTemplate
// //
@ -24,8 +24,8 @@ package definitions
// //
// Responses: // Responses:
// 202: NotificationTemplate // 202: NotificationTemplate
// 400: GenericPublicError // 400: PublicError
// 409: GenericPublicError // 409: PublicError
// swagger:route DELETE /v1/provisioning/templates/{name} provisioning stable RouteDeleteTemplate // swagger:route DELETE /v1/provisioning/templates/{name} provisioning stable RouteDeleteTemplate
// //
@ -33,7 +33,7 @@ package definitions
// //
// Responses: // Responses:
// 204: description: The template was deleted successfully. // 204: description: The template was deleted successfully.
// 409: GenericPublicError // 409: PublicError
// swagger:parameters RouteGetTemplate RoutePutTemplate RouteDeleteTemplate // swagger:parameters RouteGetTemplate RoutePutTemplate RouteDeleteTemplate
type RouteGetTemplateParam struct { type RouteGetTemplateParam struct {

View File

@ -20,10 +20,3 @@ type ForbiddenError struct {
// in: body // in: body
Body errutil.PublicError `json:"body"` Body errutil.PublicError `json:"body"`
} }
// swagger:model
type GenericPublicError struct {
// The response message
// in: body
Body errutil.PublicError `json:"body"`
}

View File

@ -1315,14 +1315,6 @@
"title": "Frames is a slice of Frame pointers.", "title": "Frames is a slice of Frame pointers.",
"type": "array" "type": "array"
}, },
"GenericPublicError": {
"properties": {
"body": {
"$ref": "#/definitions/PublicError"
}
},
"type": "object"
},
"GettableAlertmanagers": { "GettableAlertmanagers": {
"properties": { "properties": {
"data": { "data": {
@ -8130,9 +8122,9 @@
"description": " The mute timing was deleted successfully." "description": " The mute timing was deleted successfully."
}, },
"409": { "409": {
"description": "GenericPublicError", "description": "PublicError",
"schema": { "schema": {
"$ref": "#/definitions/GenericPublicError" "$ref": "#/definitions/PublicError"
} }
} }
}, },
@ -8208,9 +8200,9 @@
} }
}, },
"409": { "409": {
"description": "GenericPublicError", "description": "PublicError",
"schema": { "schema": {
"$ref": "#/definitions/GenericPublicError" "$ref": "#/definitions/PublicError"
} }
} }
}, },
@ -8422,9 +8414,9 @@
"description": " The template was deleted successfully." "description": " The template was deleted successfully."
}, },
"409": { "409": {
"description": "GenericPublicError", "description": "PublicError",
"schema": { "schema": {
"$ref": "#/definitions/GenericPublicError" "$ref": "#/definitions/PublicError"
} }
} }
}, },
@ -8452,9 +8444,9 @@
} }
}, },
"404": { "404": {
"description": "GenericPublicError", "description": "PublicError",
"schema": { "schema": {
"$ref": "#/definitions/GenericPublicError" "$ref": "#/definitions/PublicError"
} }
} }
}, },
@ -8497,15 +8489,15 @@
} }
}, },
"400": { "400": {
"description": "GenericPublicError", "description": "PublicError",
"schema": { "schema": {
"$ref": "#/definitions/GenericPublicError" "$ref": "#/definitions/PublicError"
} }
}, },
"409": { "409": {
"description": "GenericPublicError", "description": "PublicError",
"schema": { "schema": {
"$ref": "#/definitions/GenericPublicError" "$ref": "#/definitions/PublicError"
} }
} }
}, },

View File

@ -3086,9 +3086,9 @@
} }
}, },
"409": { "409": {
"description": "GenericPublicError", "description": "PublicError",
"schema": { "schema": {
"$ref": "#/definitions/GenericPublicError" "$ref": "#/definitions/PublicError"
} }
} }
} }
@ -3125,9 +3125,9 @@
"description": " The mute timing was deleted successfully." "description": " The mute timing was deleted successfully."
}, },
"409": { "409": {
"description": "GenericPublicError", "description": "PublicError",
"schema": { "schema": {
"$ref": "#/definitions/GenericPublicError" "$ref": "#/definitions/PublicError"
} }
} }
} }
@ -3343,9 +3343,9 @@
} }
}, },
"404": { "404": {
"description": "GenericPublicError", "description": "PublicError",
"schema": { "schema": {
"$ref": "#/definitions/GenericPublicError" "$ref": "#/definitions/PublicError"
} }
} }
} }
@ -3389,15 +3389,15 @@
} }
}, },
"400": { "400": {
"description": "GenericPublicError", "description": "PublicError",
"schema": { "schema": {
"$ref": "#/definitions/GenericPublicError" "$ref": "#/definitions/PublicError"
} }
}, },
"409": { "409": {
"description": "GenericPublicError", "description": "PublicError",
"schema": { "schema": {
"$ref": "#/definitions/GenericPublicError" "$ref": "#/definitions/PublicError"
} }
} }
} }
@ -3429,9 +3429,9 @@
"description": " The template was deleted successfully." "description": " The template was deleted successfully."
}, },
"409": { "409": {
"description": "GenericPublicError", "description": "PublicError",
"schema": { "schema": {
"$ref": "#/definitions/GenericPublicError" "$ref": "#/definitions/PublicError"
} }
} }
} }
@ -4947,14 +4947,6 @@
"$ref": "#/definitions/Frame" "$ref": "#/definitions/Frame"
} }
}, },
"GenericPublicError": {
"type": "object",
"properties": {
"body": {
"$ref": "#/definitions/PublicError"
}
}
},
"GettableAlertmanagers": { "GettableAlertmanagers": {
"type": "object", "type": "object",
"properties": { "properties": {

View File

@ -11498,9 +11498,9 @@
} }
}, },
"409": { "409": {
"description": "GenericPublicError", "description": "PublicError",
"schema": { "schema": {
"$ref": "#/definitions/GenericPublicError" "$ref": "#/definitions/PublicError"
} }
} }
} }
@ -11536,9 +11536,9 @@
"description": " The mute timing was deleted successfully." "description": " The mute timing was deleted successfully."
}, },
"409": { "409": {
"description": "GenericPublicError", "description": "PublicError",
"schema": { "schema": {
"$ref": "#/definitions/GenericPublicError" "$ref": "#/definitions/PublicError"
} }
} }
} }
@ -11747,9 +11747,9 @@
} }
}, },
"404": { "404": {
"description": "GenericPublicError", "description": "PublicError",
"schema": { "schema": {
"$ref": "#/definitions/GenericPublicError" "$ref": "#/definitions/PublicError"
} }
} }
} }
@ -11792,15 +11792,15 @@
} }
}, },
"400": { "400": {
"description": "GenericPublicError", "description": "PublicError",
"schema": { "schema": {
"$ref": "#/definitions/GenericPublicError" "$ref": "#/definitions/PublicError"
} }
}, },
"409": { "409": {
"description": "GenericPublicError", "description": "PublicError",
"schema": { "schema": {
"$ref": "#/definitions/GenericPublicError" "$ref": "#/definitions/PublicError"
} }
} }
} }
@ -11831,9 +11831,9 @@
"description": " The template was deleted successfully." "description": " The template was deleted successfully."
}, },
"409": { "409": {
"description": "GenericPublicError", "description": "PublicError",
"schema": { "schema": {
"$ref": "#/definitions/GenericPublicError" "$ref": "#/definitions/PublicError"
} }
} }
} }
@ -15556,14 +15556,6 @@
"$ref": "#/definitions/Frame" "$ref": "#/definitions/Frame"
} }
}, },
"GenericPublicError": {
"type": "object",
"properties": {
"body": {
"$ref": "#/definitions/PublicError"
}
}
},
"GetAccessTokenResponseDTO": { "GetAccessTokenResponseDTO": {
"type": "object", "type": "object",
"properties": { "properties": {
@ -22171,7 +22163,6 @@
} }
}, },
"alertGroups": { "alertGroups": {
"description": "AlertGroups alert groups",
"type": "array", "type": "array",
"items": { "items": {
"type": "object", "type": "object",

View File

@ -5616,14 +5616,6 @@
"title": "Frames is a slice of Frame pointers.", "title": "Frames is a slice of Frame pointers.",
"type": "array" "type": "array"
}, },
"GenericPublicError": {
"properties": {
"body": {
"$ref": "#/components/schemas/PublicError"
}
},
"type": "object"
},
"GetAccessTokenResponseDTO": { "GetAccessTokenResponseDTO": {
"properties": { "properties": {
"createdAt": { "createdAt": {
@ -12230,7 +12222,6 @@
"type": "object" "type": "object"
}, },
"alertGroups": { "alertGroups": {
"description": "AlertGroups alert groups",
"items": { "items": {
"$ref": "#/components/schemas/alertGroup" "$ref": "#/components/schemas/alertGroup"
}, },
@ -25449,11 +25440,11 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/GenericPublicError" "$ref": "#/components/schemas/PublicError"
} }
} }
}, },
"description": "GenericPublicError" "description": "PublicError"
} }
}, },
"summary": "Delete a mute timing.", "summary": "Delete a mute timing.",
@ -25549,11 +25540,11 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/GenericPublicError" "$ref": "#/components/schemas/PublicError"
} }
} }
}, },
"description": "GenericPublicError" "description": "PublicError"
} }
}, },
"summary": "Replace an existing mute timing.", "summary": "Replace an existing mute timing.",
@ -25878,11 +25869,11 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/GenericPublicError" "$ref": "#/components/schemas/PublicError"
} }
} }
}, },
"description": "GenericPublicError" "description": "PublicError"
} }
}, },
"summary": "Delete a template.", "summary": "Delete a template.",
@ -25918,11 +25909,11 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/GenericPublicError" "$ref": "#/components/schemas/PublicError"
} }
} }
}, },
"description": "GenericPublicError" "description": "PublicError"
} }
}, },
"summary": "Get a notification template.", "summary": "Get a notification template.",
@ -25975,21 +25966,21 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/GenericPublicError" "$ref": "#/components/schemas/PublicError"
} }
} }
}, },
"description": "GenericPublicError" "description": "PublicError"
}, },
"409": { "409": {
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/GenericPublicError" "$ref": "#/components/schemas/PublicError"
} }
} }
}, },
"description": "GenericPublicError" "description": "PublicError"
} }
}, },
"summary": "Updates an existing notification template.", "summary": "Updates an existing notification template.",