Bump: go-swagger to latest stable
Bumps the API spec/client generation util of `go-swagger` from 0.30.2 to 0.30.5 which is the latest stable. Signed-off-by: gotjosh <josue.abreu@gmail.com>
This commit is contained in:
parent
16aa996c4f
commit
2ec6b89aa7
2
Makefile
2
Makefile
|
@ -65,7 +65,7 @@ SWAGGER = docker run \
|
|||
--user=$(shell id -u $(USER)):$(shell id -g $(USER)) \
|
||||
--rm \
|
||||
-v $(shell pwd):/go/src/github.com/prometheus/alertmanager \
|
||||
-w /go/src/github.com/prometheus/alertmanager quay.io/goswagger/swagger:v0.30.3
|
||||
-w /go/src/github.com/prometheus/alertmanager quay.io/goswagger/swagger:v0.30.5
|
||||
|
||||
api/v2/models api/v2/restapi api/v2/client: api/v2/openapi.yaml
|
||||
-rm -r api/v2/{client,models,restapi}
|
||||
|
|
|
@ -56,7 +56,7 @@ func (o *GetAlertsReader) ReadResponse(response runtime.ClientResponse, consumer
|
|||
}
|
||||
return nil, result
|
||||
default:
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
return nil, runtime.NewAPIError("[GET /alerts] getAlerts", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -99,6 +99,11 @@ func (o *GetAlertsOK) IsCode(code int) bool {
|
|||
return code == 200
|
||||
}
|
||||
|
||||
// Code gets the status code for the get alerts o k response
|
||||
func (o *GetAlertsOK) Code() int {
|
||||
return 200
|
||||
}
|
||||
|
||||
func (o *GetAlertsOK) Error() string {
|
||||
return fmt.Sprintf("[GET /alerts][%d] getAlertsOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
@ -160,6 +165,11 @@ func (o *GetAlertsBadRequest) IsCode(code int) bool {
|
|||
return code == 400
|
||||
}
|
||||
|
||||
// Code gets the status code for the get alerts bad request response
|
||||
func (o *GetAlertsBadRequest) Code() int {
|
||||
return 400
|
||||
}
|
||||
|
||||
func (o *GetAlertsBadRequest) Error() string {
|
||||
return fmt.Sprintf("[GET /alerts][%d] getAlertsBadRequest %+v", 400, o.Payload)
|
||||
}
|
||||
|
@ -221,6 +231,11 @@ func (o *GetAlertsInternalServerError) IsCode(code int) bool {
|
|||
return code == 500
|
||||
}
|
||||
|
||||
// Code gets the status code for the get alerts internal server error response
|
||||
func (o *GetAlertsInternalServerError) Code() int {
|
||||
return 500
|
||||
}
|
||||
|
||||
func (o *GetAlertsInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /alerts][%d] getAlertsInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ func (o *PostAlertsReader) ReadResponse(response runtime.ClientResponse, consume
|
|||
}
|
||||
return nil, result
|
||||
default:
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
return nil, runtime.NewAPIError("[POST /alerts] postAlerts", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -96,6 +96,11 @@ func (o *PostAlertsOK) IsCode(code int) bool {
|
|||
return code == 200
|
||||
}
|
||||
|
||||
// Code gets the status code for the post alerts o k response
|
||||
func (o *PostAlertsOK) Code() int {
|
||||
return 200
|
||||
}
|
||||
|
||||
func (o *PostAlertsOK) Error() string {
|
||||
return fmt.Sprintf("[POST /alerts][%d] postAlertsOK ", 200)
|
||||
}
|
||||
|
@ -148,6 +153,11 @@ func (o *PostAlertsBadRequest) IsCode(code int) bool {
|
|||
return code == 400
|
||||
}
|
||||
|
||||
// Code gets the status code for the post alerts bad request response
|
||||
func (o *PostAlertsBadRequest) Code() int {
|
||||
return 400
|
||||
}
|
||||
|
||||
func (o *PostAlertsBadRequest) Error() string {
|
||||
return fmt.Sprintf("[POST /alerts][%d] postAlertsBadRequest %+v", 400, o.Payload)
|
||||
}
|
||||
|
@ -209,6 +219,11 @@ func (o *PostAlertsInternalServerError) IsCode(code int) bool {
|
|||
return code == 500
|
||||
}
|
||||
|
||||
// Code gets the status code for the post alerts internal server error response
|
||||
func (o *PostAlertsInternalServerError) Code() int {
|
||||
return 500
|
||||
}
|
||||
|
||||
func (o *PostAlertsInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[POST /alerts][%d] postAlertsInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ func (o *GetAlertGroupsReader) ReadResponse(response runtime.ClientResponse, con
|
|||
}
|
||||
return nil, result
|
||||
default:
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
return nil, runtime.NewAPIError("[GET /alerts/groups] getAlertGroups", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -99,6 +99,11 @@ func (o *GetAlertGroupsOK) IsCode(code int) bool {
|
|||
return code == 200
|
||||
}
|
||||
|
||||
// Code gets the status code for the get alert groups o k response
|
||||
func (o *GetAlertGroupsOK) Code() int {
|
||||
return 200
|
||||
}
|
||||
|
||||
func (o *GetAlertGroupsOK) Error() string {
|
||||
return fmt.Sprintf("[GET /alerts/groups][%d] getAlertGroupsOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
@ -160,6 +165,11 @@ func (o *GetAlertGroupsBadRequest) IsCode(code int) bool {
|
|||
return code == 400
|
||||
}
|
||||
|
||||
// Code gets the status code for the get alert groups bad request response
|
||||
func (o *GetAlertGroupsBadRequest) Code() int {
|
||||
return 400
|
||||
}
|
||||
|
||||
func (o *GetAlertGroupsBadRequest) Error() string {
|
||||
return fmt.Sprintf("[GET /alerts/groups][%d] getAlertGroupsBadRequest %+v", 400, o.Payload)
|
||||
}
|
||||
|
@ -221,6 +231,11 @@ func (o *GetAlertGroupsInternalServerError) IsCode(code int) bool {
|
|||
return code == 500
|
||||
}
|
||||
|
||||
// Code gets the status code for the get alert groups internal server error response
|
||||
func (o *GetAlertGroupsInternalServerError) Code() int {
|
||||
return 500
|
||||
}
|
||||
|
||||
func (o *GetAlertGroupsInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /alerts/groups][%d] getAlertGroupsInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ func (o *GetStatusReader) ReadResponse(response runtime.ClientResponse, consumer
|
|||
}
|
||||
return result, nil
|
||||
default:
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
return nil, runtime.NewAPIError("[GET /status] getStatus", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -87,6 +87,11 @@ func (o *GetStatusOK) IsCode(code int) bool {
|
|||
return code == 200
|
||||
}
|
||||
|
||||
// Code gets the status code for the get status o k response
|
||||
func (o *GetStatusOK) Code() int {
|
||||
return 200
|
||||
}
|
||||
|
||||
func (o *GetStatusOK) Error() string {
|
||||
return fmt.Sprintf("[GET /status][%d] getStatusOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ func (o *GetReceiversReader) ReadResponse(response runtime.ClientResponse, consu
|
|||
}
|
||||
return result, nil
|
||||
default:
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
return nil, runtime.NewAPIError("[GET /receivers] getReceivers", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -87,6 +87,11 @@ func (o *GetReceiversOK) IsCode(code int) bool {
|
|||
return code == 200
|
||||
}
|
||||
|
||||
// Code gets the status code for the get receivers o k response
|
||||
func (o *GetReceiversOK) Code() int {
|
||||
return 200
|
||||
}
|
||||
|
||||
func (o *GetReceiversOK) Error() string {
|
||||
return fmt.Sprintf("[GET /receivers][%d] getReceiversOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ func (o *DeleteSilenceReader) ReadResponse(response runtime.ClientResponse, cons
|
|||
}
|
||||
return nil, result
|
||||
default:
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
return nil, runtime.NewAPIError("[DELETE /silence/{silenceID}] deleteSilence", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -96,6 +96,11 @@ func (o *DeleteSilenceOK) IsCode(code int) bool {
|
|||
return code == 200
|
||||
}
|
||||
|
||||
// Code gets the status code for the delete silence o k response
|
||||
func (o *DeleteSilenceOK) Code() int {
|
||||
return 200
|
||||
}
|
||||
|
||||
func (o *DeleteSilenceOK) Error() string {
|
||||
return fmt.Sprintf("[DELETE /silence/{silenceID}][%d] deleteSilenceOK ", 200)
|
||||
}
|
||||
|
@ -147,6 +152,11 @@ func (o *DeleteSilenceNotFound) IsCode(code int) bool {
|
|||
return code == 404
|
||||
}
|
||||
|
||||
// Code gets the status code for the delete silence not found response
|
||||
func (o *DeleteSilenceNotFound) Code() int {
|
||||
return 404
|
||||
}
|
||||
|
||||
func (o *DeleteSilenceNotFound) Error() string {
|
||||
return fmt.Sprintf("[DELETE /silence/{silenceID}][%d] deleteSilenceNotFound ", 404)
|
||||
}
|
||||
|
@ -199,6 +209,11 @@ func (o *DeleteSilenceInternalServerError) IsCode(code int) bool {
|
|||
return code == 500
|
||||
}
|
||||
|
||||
// Code gets the status code for the delete silence internal server error response
|
||||
func (o *DeleteSilenceInternalServerError) Code() int {
|
||||
return 500
|
||||
}
|
||||
|
||||
func (o *DeleteSilenceInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[DELETE /silence/{silenceID}][%d] deleteSilenceInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ func (o *GetSilenceReader) ReadResponse(response runtime.ClientResponse, consume
|
|||
}
|
||||
return nil, result
|
||||
default:
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
return nil, runtime.NewAPIError("[GET /silence/{silenceID}] getSilence", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -99,6 +99,11 @@ func (o *GetSilenceOK) IsCode(code int) bool {
|
|||
return code == 200
|
||||
}
|
||||
|
||||
// Code gets the status code for the get silence o k response
|
||||
func (o *GetSilenceOK) Code() int {
|
||||
return 200
|
||||
}
|
||||
|
||||
func (o *GetSilenceOK) Error() string {
|
||||
return fmt.Sprintf("[GET /silence/{silenceID}][%d] getSilenceOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
@ -161,6 +166,11 @@ func (o *GetSilenceNotFound) IsCode(code int) bool {
|
|||
return code == 404
|
||||
}
|
||||
|
||||
// Code gets the status code for the get silence not found response
|
||||
func (o *GetSilenceNotFound) Code() int {
|
||||
return 404
|
||||
}
|
||||
|
||||
func (o *GetSilenceNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /silence/{silenceID}][%d] getSilenceNotFound ", 404)
|
||||
}
|
||||
|
@ -213,6 +223,11 @@ func (o *GetSilenceInternalServerError) IsCode(code int) bool {
|
|||
return code == 500
|
||||
}
|
||||
|
||||
// Code gets the status code for the get silence internal server error response
|
||||
func (o *GetSilenceInternalServerError) Code() int {
|
||||
return 500
|
||||
}
|
||||
|
||||
func (o *GetSilenceInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /silence/{silenceID}][%d] getSilenceInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ func (o *GetSilencesReader) ReadResponse(response runtime.ClientResponse, consum
|
|||
}
|
||||
return nil, result
|
||||
default:
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
return nil, runtime.NewAPIError("[GET /silences] getSilences", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -93,6 +93,11 @@ func (o *GetSilencesOK) IsCode(code int) bool {
|
|||
return code == 200
|
||||
}
|
||||
|
||||
// Code gets the status code for the get silences o k response
|
||||
func (o *GetSilencesOK) Code() int {
|
||||
return 200
|
||||
}
|
||||
|
||||
func (o *GetSilencesOK) Error() string {
|
||||
return fmt.Sprintf("[GET /silences][%d] getSilencesOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
@ -154,6 +159,11 @@ func (o *GetSilencesInternalServerError) IsCode(code int) bool {
|
|||
return code == 500
|
||||
}
|
||||
|
||||
// Code gets the status code for the get silences internal server error response
|
||||
func (o *GetSilencesInternalServerError) Code() int {
|
||||
return 500
|
||||
}
|
||||
|
||||
func (o *GetSilencesInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /silences][%d] getSilencesInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ func (o *PostSilencesReader) ReadResponse(response runtime.ClientResponse, consu
|
|||
}
|
||||
return nil, result
|
||||
default:
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
return nil, runtime.NewAPIError("[POST /silences] postSilences", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -99,6 +99,11 @@ func (o *PostSilencesOK) IsCode(code int) bool {
|
|||
return code == 200
|
||||
}
|
||||
|
||||
// Code gets the status code for the post silences o k response
|
||||
func (o *PostSilencesOK) Code() int {
|
||||
return 200
|
||||
}
|
||||
|
||||
func (o *PostSilencesOK) Error() string {
|
||||
return fmt.Sprintf("[POST /silences][%d] postSilencesOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
@ -162,6 +167,11 @@ func (o *PostSilencesBadRequest) IsCode(code int) bool {
|
|||
return code == 400
|
||||
}
|
||||
|
||||
// Code gets the status code for the post silences bad request response
|
||||
func (o *PostSilencesBadRequest) Code() int {
|
||||
return 400
|
||||
}
|
||||
|
||||
func (o *PostSilencesBadRequest) Error() string {
|
||||
return fmt.Sprintf("[POST /silences][%d] postSilencesBadRequest %+v", 400, o.Payload)
|
||||
}
|
||||
|
@ -223,6 +233,11 @@ func (o *PostSilencesNotFound) IsCode(code int) bool {
|
|||
return code == 404
|
||||
}
|
||||
|
||||
// Code gets the status code for the post silences not found response
|
||||
func (o *PostSilencesNotFound) Code() int {
|
||||
return 404
|
||||
}
|
||||
|
||||
func (o *PostSilencesNotFound) Error() string {
|
||||
return fmt.Sprintf("[POST /silences][%d] postSilencesNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
|
|
@ -163,6 +163,11 @@ func (m *AlertGroup) contextValidateAlerts(ctx context.Context, formats strfmt.R
|
|||
for i := 0; i < len(m.Alerts); i++ {
|
||||
|
||||
if m.Alerts[i] != nil {
|
||||
|
||||
if swag.IsZero(m.Alerts[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Alerts[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("alerts" + "." + strconv.Itoa(i))
|
||||
|
@ -195,6 +200,7 @@ func (m *AlertGroup) contextValidateLabels(ctx context.Context, formats strfmt.R
|
|||
func (m *AlertGroup) contextValidateReceiver(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.Receiver != nil {
|
||||
|
||||
if err := m.Receiver.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("receiver")
|
||||
|
|
|
@ -68,6 +68,11 @@ func (m AlertGroups) ContextValidate(ctx context.Context, formats strfmt.Registr
|
|||
for i := 0; i < len(m); i++ {
|
||||
|
||||
if m[i] != nil {
|
||||
|
||||
if swag.IsZero(m[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName(strconv.Itoa(i))
|
||||
|
|
|
@ -175,6 +175,7 @@ func (m *AlertmanagerStatus) ContextValidate(ctx context.Context, formats strfmt
|
|||
func (m *AlertmanagerStatus) contextValidateCluster(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.Cluster != nil {
|
||||
|
||||
if err := m.Cluster.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("cluster")
|
||||
|
@ -191,6 +192,7 @@ func (m *AlertmanagerStatus) contextValidateCluster(ctx context.Context, formats
|
|||
func (m *AlertmanagerStatus) contextValidateConfig(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.Config != nil {
|
||||
|
||||
if err := m.Config.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("config")
|
||||
|
@ -207,6 +209,7 @@ func (m *AlertmanagerStatus) contextValidateConfig(ctx context.Context, formats
|
|||
func (m *AlertmanagerStatus) contextValidateVersionInfo(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.VersionInfo != nil {
|
||||
|
||||
if err := m.VersionInfo.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("versionInfo")
|
||||
|
|
|
@ -156,6 +156,11 @@ func (m *ClusterStatus) contextValidatePeers(ctx context.Context, formats strfmt
|
|||
for i := 0; i < len(m.Peers); i++ {
|
||||
|
||||
if m.Peers[i] != nil {
|
||||
|
||||
if swag.IsZero(m.Peers[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Peers[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("peers" + "." + strconv.Itoa(i))
|
||||
|
|
|
@ -366,6 +366,11 @@ func (m *GettableAlert) contextValidateReceivers(ctx context.Context, formats st
|
|||
for i := 0; i < len(m.Receivers); i++ {
|
||||
|
||||
if m.Receivers[i] != nil {
|
||||
|
||||
if swag.IsZero(m.Receivers[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Receivers[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("receivers" + "." + strconv.Itoa(i))
|
||||
|
@ -384,6 +389,7 @@ func (m *GettableAlert) contextValidateReceivers(ctx context.Context, formats st
|
|||
func (m *GettableAlert) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.Status != nil {
|
||||
|
||||
if err := m.Status.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("status")
|
||||
|
|
|
@ -68,6 +68,11 @@ func (m GettableAlerts) ContextValidate(ctx context.Context, formats strfmt.Regi
|
|||
for i := 0; i < len(m); i++ {
|
||||
|
||||
if m[i] != nil {
|
||||
|
||||
if swag.IsZero(m[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName(strconv.Itoa(i))
|
||||
|
|
|
@ -202,6 +202,7 @@ func (m *GettableSilence) ContextValidate(ctx context.Context, formats strfmt.Re
|
|||
func (m *GettableSilence) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.Status != nil {
|
||||
|
||||
if err := m.Status.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("status")
|
||||
|
|
|
@ -68,6 +68,11 @@ func (m GettableSilences) ContextValidate(ctx context.Context, formats strfmt.Re
|
|||
for i := 0; i < len(m); i++ {
|
||||
|
||||
if m[i] != nil {
|
||||
|
||||
if swag.IsZero(m[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName(strconv.Itoa(i))
|
||||
|
|
|
@ -75,6 +75,11 @@ func (m Matchers) ContextValidate(ctx context.Context, formats strfmt.Registry)
|
|||
for i := 0; i < len(m); i++ {
|
||||
|
||||
if m[i] != nil {
|
||||
|
||||
if swag.IsZero(m[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName(strconv.Itoa(i))
|
||||
|
|
|
@ -203,6 +203,10 @@ func (m *PostableAlert) ContextValidate(ctx context.Context, formats strfmt.Regi
|
|||
|
||||
func (m *PostableAlert) contextValidateAnnotations(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Annotations) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Annotations.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("annotations")
|
||||
|
|
|
@ -68,6 +68,11 @@ func (m PostableAlerts) ContextValidate(ctx context.Context, formats strfmt.Regi
|
|||
for i := 0; i < len(m); i++ {
|
||||
|
||||
if m[i] != nil {
|
||||
|
||||
if swag.IsZero(m[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName(strconv.Itoa(i))
|
||||
|
|
|
@ -412,6 +412,6 @@ func (o *AlertmanagerAPI) AddMiddlewareFor(method, path string, builder middlewa
|
|||
}
|
||||
o.Init()
|
||||
if h, ok := o.handlers[um][path]; ok {
|
||||
o.handlers[method][path] = builder(h)
|
||||
o.handlers[um][path] = builder(h)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue