Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EntityValidator ¶
type EntityValidator interface {
Validate(interface{}) *Result
}
An EntityValidator is an interface for things that can validate entities
type HeaderValidator ¶
type HeaderValidator struct { KnownFormats strfmt.Registry // contains filtered or unexported fields }
A HeaderValidator has very limited subset of validations to apply
func NewHeaderValidator ¶
NewHeaderValidator creates a new header validator object
func (*HeaderValidator) Validate ¶
func (p *HeaderValidator) Validate(data interface{}) *Result
Validate the value of the header against its schema
type ParamValidator ¶
type ParamValidator struct { KnownFormats strfmt.Registry // contains filtered or unexported fields }
A ParamValidator has very limited subset of validations to apply
func NewParamValidator ¶
func NewParamValidator(param *spec.Parameter, formats strfmt.Registry) *ParamValidator
NewParamValidator creates a new param validator object
func (*ParamValidator) Validate ¶
func (p *ParamValidator) Validate(data interface{}) *Result
Validate the data against the description of the parameter
type Result ¶
Result represents a validation result
type SchemaValidator ¶
type SchemaValidator struct { Path string Schema *spec.Schema Root interface{} KnownFormats strfmt.Registry // contains filtered or unexported fields }
SchemaValidator like param validator but for a full json schema
func NewSchemaValidator ¶
func NewSchemaValidator(schema *spec.Schema, rootSchema interface{}, root string, formats strfmt.Registry) *SchemaValidator
NewSchemaValidator creates a new schema validator
func (*SchemaValidator) Applies ¶
func (s *SchemaValidator) Applies(source interface{}, kind reflect.Kind) bool
Applies returns true when this schema validator applies
func (*SchemaValidator) SetPath ¶
func (s *SchemaValidator) SetPath(path string)
SetPath sets the path for this schema valdiator
func (*SchemaValidator) Validate ¶
func (s *SchemaValidator) Validate(data interface{}) *Result
Validate validates the data against the schema
type SpecValidator ¶
type SpecValidator struct { KnownFormats strfmt.Registry // contains filtered or unexported fields }
SpecValidator validates a swagger spec
func NewSpecValidator ¶
func NewSpecValidator(schema *spec.Schema, formats strfmt.Registry) *SpecValidator
NewSpecValidator creates a new swagger spec validator instance
func (*SpecValidator) Validate ¶
func (s *SpecValidator) Validate(data interface{}) (errs *Result, warnings *Result)
Validate validates the swagger spec