Versions in this module Expand all Collapse all v0 v0.1.2 Nov 3, 2019 Changes in this version + var DefaultSchemaPool = Definitions + var DefaultValidators = map[string]ValMaker + var MaxValueErrStringLen = 20 + func AddError(errs *[]ValError, propPath string, data interface{}, msg string) + func DataType(data interface{}) string + func InvalidValueString(data interface{}) string + func RegisterValidator(propName string, maker ValMaker) + type AdditionalItems struct + Schema *Schema + func (a *AdditionalItems) JSONChildren() (res map[string]JSONPather) + func (a *AdditionalItems) JSONProp(name string) interface{} + func (a *AdditionalItems) UnmarshalJSON(data []byte) error + func (a *AdditionalItems) Validate(propPath string, data interface{}, errs *[]ValError) + type AdditionalProperties struct + Properties *Properties + Schema *Schema + func (ap *AdditionalProperties) JSONChildren() (res map[string]JSONPather) + func (ap *AdditionalProperties) JSONProp(name string) interface{} + func (ap *AdditionalProperties) UnmarshalJSON(data []byte) error + func (ap AdditionalProperties) MarshalJSON() ([]byte, error) + func (ap AdditionalProperties) Validate(propPath string, data interface{}, errs *[]ValError) + type AllOf []*Schema + func (a AllOf) JSONChildren() (res map[string]JSONPather) + func (a AllOf) JSONProp(name string) interface{} + func (a AllOf) Validate(propPath string, data interface{}, errs *[]ValError) + type AnyOf []*Schema + func (a AnyOf) JSONChildren() (res map[string]JSONPather) + func (a AnyOf) JSONProp(name string) interface{} + func (a AnyOf) Validate(propPath string, data interface{}, errs *[]ValError) + type BaseValidator struct + func (b *BaseValidator) SetPath(path string) + func (b BaseValidator) AddError(errs *[]ValError, propPath string, data interface{}, msg string) + func (b BaseValidator) Path() string + type Const jsoniter.RawMessage + func (c *Const) UnmarshalJSON(data []byte) error + func (c Const) JSONProp(name string) interface{} + func (c Const) MarshalJSON() ([]byte, error) + func (c Const) Path() string + func (c Const) String() string + func (c Const) Validate(propPath string, data interface{}, errs *[]ValError) + type Contains Schema + func (c *Contains) UnmarshalJSON(data []byte) error + func (c *Contains) Validate(propPath string, data interface{}, errs *[]ValError) + func (c Contains) JSONChildren() (res map[string]JSONPather) + func (c Contains) JSONProp(name string) interface{} + type Definitions map[string]*Schema + func (d Definitions) JSONChildren() (r map[string]JSONPather) + func (d Definitions) JSONProp(name string) interface{} + type Dependencies map[string]Dependency + func (d Dependencies) JSONProp(name string) interface{} + func (d Dependencies) Validate(propPath string, data interface{}, errs *[]ValError) + type Dependency struct + func (d *Dependency) UnmarshalJSON(data []byte) error + func (d Dependency) MarshalJSON() ([]byte, error) + func (d Dependency) Validate(propPath string, data interface{}, errs *[]ValError) + type Else Schema + func (e *Else) UnmarshalJSON(data []byte) error + func (e *Else) Validate(propPath string, data interface{}, err *[]ValError) + func (e Else) JSONChildren() (res map[string]JSONPather) + func (e Else) JSONProp(name string) interface{} + func (e Else) MarshalJSON() ([]byte, error) + type Enum []Const + func (e Enum) JSONChildren() (res map[string]JSONPather) + func (e Enum) JSONProp(name string) interface{} + func (e Enum) Path() string + func (e Enum) String() string + func (e Enum) Validate(propPath string, data interface{}, errs *[]ValError) + type ExclusiveMaximum float64 + func (m ExclusiveMaximum) Validate(propPath string, data interface{}, errs *[]ValError) + type ExclusiveMinimum float64 + func (m ExclusiveMinimum) Validate(propPath string, data interface{}, errs *[]ValError) + type Format string + func (f Format) Validate(propPath string, data interface{}, errs *[]ValError) + type If struct + Else *Else + Schema Schema + Then *Then + func (i *If) UnmarshalJSON(data []byte) error + func (i *If) Validate(propPath string, data interface{}, errs *[]ValError) + func (i If) JSONChildren() (res map[string]JSONPather) + func (i If) JSONProp(name string) interface{} + func (i If) MarshalJSON() ([]byte, error) + type Items struct + Schemas []*Schema + func (it *Items) UnmarshalJSON(data []byte) error + func (it Items) JSONChildren() (res map[string]JSONPather) + func (it Items) JSONProp(name string) interface{} + func (it Items) MarshalJSON() ([]byte, error) + func (it Items) Validate(propPath string, data interface{}, errs *[]ValError) + type JSONContainer interface + JSONChildren func() map[string]JSONPather + type JSONPather interface + JSONProp func(name string) interface{} + type MaxItems int + func (m MaxItems) Validate(propPath string, data interface{}, errs *[]ValError) + type MaxLength int + func (m MaxLength) Validate(propPath string, data interface{}, errs *[]ValError) + type MaxProperties int + func (m MaxProperties) Validate(propPath string, data interface{}, errs *[]ValError) + type Maximum float64 + func (m Maximum) Validate(propPath string, data interface{}, errs *[]ValError) + type MinItems int + func (m MinItems) Validate(propPath string, data interface{}, errs *[]ValError) + type MinLength int + func (m MinLength) Validate(propPath string, data interface{}, errs *[]ValError) + type Minimum float64 + func (m Minimum) Validate(propPath string, data interface{}, errs *[]ValError) + type MultipleOf float64 + func (m MultipleOf) Validate(propPath string, data interface{}, errs *[]ValError) + type Not Schema + func (n *Not) UnmarshalJSON(data []byte) error + func (n *Not) Validate(propPath string, data interface{}, errs *[]ValError) + func (n Not) JSONChildren() (res map[string]JSONPather) + func (n Not) JSONProp(name string) interface{} + func (n Not) MarshalJSON() ([]byte, error) + type OneOf []*Schema + func (o OneOf) JSONChildren() (res map[string]JSONPather) + func (o OneOf) JSONProp(name string) interface{} + func (o OneOf) Validate(propPath string, data interface{}, errs *[]ValError) + type Pattern regexp.Regexp + func (p *Pattern) UnmarshalJSON(data []byte) error + func (p Pattern) MarshalJSON() ([]byte, error) + func (p Pattern) Validate(propPath string, data interface{}, errs *[]ValError) + type PatternProperties []patternSchema + func (p *PatternProperties) UnmarshalJSON(data []byte) error + func (p PatternProperties) JSONChildren() (res map[string]JSONPather) + func (p PatternProperties) JSONProp(name string) interface{} + func (p PatternProperties) MarshalJSON() ([]byte, error) + func (p PatternProperties) Validate(propPath string, data interface{}, errs *[]ValError) + type Properties map[string]*Schema + func (p Properties) JSONChildren() (res map[string]JSONPather) + func (p Properties) JSONProp(name string) interface{} + func (p Properties) Validate(propPath string, data interface{}, errs *[]ValError) + type PropertyNames Schema + func (p *PropertyNames) UnmarshalJSON(data []byte) error + func (p PropertyNames) JSONChildren() (res map[string]JSONPather) + func (p PropertyNames) JSONProp(name string) interface{} + func (p PropertyNames) MarshalJSON() ([]byte, error) + func (p PropertyNames) Validate(propPath string, data interface{}, errs *[]ValError) + type Required []string + func (r Required) JSONProp(name string) interface{} + func (r Required) Validate(propPath string, data interface{}, errs *[]ValError) + type RootSchema struct + SchemaURI string + func Must(jsonString string) *RootSchema + func (rs *RootSchema) FetchRemoteReferences() error + func (rs *RootSchema) TopLevelType() string + func (rs *RootSchema) UnmarshalJSON(data []byte) error + func (rs *RootSchema) ValidateBytes(data []byte) ([]ValError, error) + type Schema struct + Comment string + Default interface{} + Definitions Definitions + Description string + Examples []interface{} + Format string + ID string + ReadOnly *bool + Ref string + Title string + Validators map[string]Validator + WriteOnly *bool + func (s *Schema) Path() string + func (s *Schema) UnmarshalJSON(data []byte) error + func (s *Schema) Validate(propPath string, data interface{}, errs *[]ValError) + func (s Schema) JSONChildren() (ch map[string]JSONPather) + func (s Schema) JSONProp(name string) interface{} + func (s Schema) MarshalJSON() ([]byte, error) + type Then Schema + func (t *Then) UnmarshalJSON(data []byte) error + func (t *Then) Validate(propPath string, data interface{}, errs *[]ValError) + func (t Then) JSONChildren() (res map[string]JSONPather) + func (t Then) JSONProp(name string) interface{} + func (t Then) MarshalJSON() ([]byte, error) + type Type struct + func (t *Type) UnmarshalJSON(data []byte) error + func (t Type) JSONProp(name string) interface{} + func (t Type) MarshalJSON() ([]byte, error) + func (t Type) String() string + func (t Type) Validate(propPath string, data interface{}, errs *[]ValError) + type UniqueItems bool + func (u *UniqueItems) Validate(propPath string, data interface{}, errs *[]ValError) + type ValError struct + InvalidValue interface{} + Message string + PropertyPath string + RulePath string + func (v ValError) Error() string + type ValMaker func() Validator + type Validator interface + Validate func(propPath string, data interface{}, errs *[]ValError) + func NewAdditionalItems() Validator + func NewAdditionalProperties() Validator + func NewAllOf() Validator + func NewAnyOf() Validator + func NewConst() Validator + func NewContains() Validator + func NewDependencies() Validator + func NewElse() Validator + func NewEnum() Validator + func NewExclusiveMaximum() Validator + func NewExclusiveMinimum() Validator + func NewFormat() Validator + func NewIf() Validator + func NewItems() Validator + func NewMaxItems() Validator + func NewMaxLength() Validator + func NewMaxProperties() Validator + func NewMaximum() Validator + func NewMinItems() Validator + func NewMinLength() Validator + func NewMinProperties() Validator + func NewMinimum() Validator + func NewMultipleOf() Validator + func NewNot() Validator + func NewOneOf() Validator + func NewPattern() Validator + func NewPatternProperties() Validator + func NewProperties() Validator + func NewPropertyNames() Validator + func NewRequired() Validator + func NewThen() Validator + func NewType() Validator + func NewUniqueItems() Validator