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"
|
||||
@@ -60,7 +61,6 @@ func (m *ResultTarget) Validate(formats strfmt.Registry) error {
|
||||
}
|
||||
|
||||
func (m *ResultTarget) validateResult(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Result) { // not required
|
||||
return nil
|
||||
}
|
||||
@@ -84,6 +84,38 @@ func (m *ResultTarget) validateResult(formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validate this result target based on the context it is used
|
||||
func (m *ResultTarget) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.contextValidateResult(ctx, formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ResultTarget) contextValidateResult(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
for i := 0; i < len(m.Result); i++ {
|
||||
|
||||
if m.Result[i] != nil {
|
||||
if err := m.Result[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("result" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *ResultTarget) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
|
||||
Reference in New Issue
Block a user