upgrade swagger version to v0.27.0 (#798)
This commit is contained in:
@@ -23,6 +23,7 @@ package models
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"strconv"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
@@ -54,7 +55,6 @@ func (m *TierListResponse) Validate(formats strfmt.Registry) error {
|
||||
}
|
||||
|
||||
func (m *TierListResponse) validateItems(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Items) { // not required
|
||||
return nil
|
||||
}
|
||||
@@ -78,6 +78,38 @@ func (m *TierListResponse) validateItems(formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validate this tier list response based on the context it is used
|
||||
func (m *TierListResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.contextValidateItems(ctx, formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *TierListResponse) contextValidateItems(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
for i := 0; i < len(m.Items); i++ {
|
||||
|
||||
if m.Items[i] != nil {
|
||||
if err := m.Items[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("items" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *TierListResponse) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
|
||||
Reference in New Issue
Block a user