mirror of
https://github.com/OpenMaxIO/openmaxio-object-browser
synced 2026-07-01 07:41:18 -07:00
upgrade swagger version to v0.27.0 (#798)
This commit is contained in:
@@ -23,9 +23,12 @@ package models
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/validate"
|
||||
)
|
||||
|
||||
// ProfilingStartRequest profiling start request
|
||||
@@ -35,7 +38,7 @@ type ProfilingStartRequest struct {
|
||||
|
||||
// type
|
||||
// Required: true
|
||||
Type ProfilerType `json:"type"`
|
||||
Type *ProfilerType `json:"type"`
|
||||
}
|
||||
|
||||
// Validate validates this profiling start request
|
||||
@@ -54,13 +57,51 @@ func (m *ProfilingStartRequest) Validate(formats strfmt.Registry) error {
|
||||
|
||||
func (m *ProfilingStartRequest) validateType(formats strfmt.Registry) error {
|
||||
|
||||
if err := m.Type.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("type")
|
||||
}
|
||||
if err := validate.Required("type", "body", m.Type); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := validate.Required("type", "body", m.Type); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if m.Type != nil {
|
||||
if err := m.Type.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("type")
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validate this profiling start request based on the context it is used
|
||||
func (m *ProfilingStartRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.contextValidateType(ctx, formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ProfilingStartRequest) contextValidateType(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.Type != nil {
|
||||
if err := m.Type.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("type")
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user